Removing comments I forgot to remove before committing r23558.

[not reviewed]



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23697 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Squash certain scope-less BlockStmt when parser constructs AST



The goal of this work was to flatten certain uses of BlockStmt with tag SCOPELESS 
that are introduced during parsing.  This is an element of a sub-task of the
current Interpreter task.

This checkin includes some minor clean up of adjacent code and minor bug fixes.



1) parser/chapel.ypp

The primary change is to replace three uses of BlockStmt::insertAtTail() with
calls to the new function BlockStmt::appendChapelStmt().

There are also a few minor formatting changes.  This is part of long term goal
to incrementally align the BISON-based implementation of the parser with the
productions documented in the spec.  The intent is to improve the quality of
the spec and, perhaps, to identify any issues/opportunities in the parser.



Rationale:

Many of the Bison productions return a BlockStmt to represent what a reader of
the Chapel Spec might think of as a "statement".  Most of these BlockStmts are
tagged scopeless.  The Bison productions then use the function 

    void BlockStmt::insertAtTail(Expr* ast);

to add this statement to the end of the body of some other BlockStmt.  It is
common to see a sequence of scopeless BlockStmts in the generated AST.  The
new function will collapse these.

The new function verifies that the BlockStmt is actually scopeless before it
collapses the contents.



2) main/config.cpp

The function parseCmdLineConfig is used to convert name/value configuration
C strings into Chapel AST using the parser to build AST from a simple assignment
statement.

This code expected to see a scopeless BlockStmt inside a normal BlockStmt and
then extracted the rhs of the assignment.  Added code to determine if there is
still a scopeless BlockStmt.

[Longer term: Not clear why it parses a C-string rather than using the AST
constructors directly].



3) AST/stmt.{h,cpp}

Added appendChapelStmt() and isScopeless() to BlockStmt.

Also added const qualifier to two methods on BlockStmt and some minor
format changes.



4) AST/build.{h,cpp}

The function

BlockStmt* buildChapelStmt(BaseAST* ast = NULL)

is called consistently with either NULL or an Expr*.  Altered
the signature from BaseAST* to Expr*.  This is partly for
clarity but it also results in a much simpler implementation.




5) AST/AstDumpToNode.cpp

Trying to inspect primordial AST in the middle of the construction
of the parse tree caused this new logger to trip over some unexpected
NULLs.





Compiled: STD on clang and STD/LLVM on gcc

Tested:   Visual inspection of some simple Chapel code
          paratest
          test/multilocale with --no-local per Tom

Reviewd:  Tom





git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23698 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
First cut at a filerator (iterator that yields file[name]s)

I've been splashing around today with writing a (serial) iterator that
yields files.  The current interface takes a starting directory, a
boolean saying whether or not to traverse the hierarchy recursively,
and a boolean saying whether or not to consider dotfiles.  So far, it
seems to be working nicely for me.  This commit adds .execopts to try
the 2 x 2 set of boolean values and a little directory structure with
dotfiles and non- to test behavior.

I'm checking this in as a NOTEST for now because the order of the
files being yielded is nondeterministic, based on the internals of
one's filesystem (I think).  You'd need to sort to avoid this, which
would require manifesting the filenames in memory (for better or
worse).  The technique I'm relying on to determine if a filename is a
directory in the recursive case is also non-portable.

Arguably, I also shouldn't be yielding the directory names... that
only occurred to me just now.

Now that I'm comfortable with the C interface, the next steps are to
study the Python interface for reference, propose something that seems
like a good fit for Chapel, and circulate that proposal for comment.



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23699 3a8e244f-b0f2-452b-bcba-4c88e055c3ca