[antlr-interest] CodeSections - a very simple version of noweb for treewalkers (and other uses)

Terence Parr parrt at jguru.com
Sat Oct 26 09:49:10 PDT 2002

Hi Matthew,

Very cool stuff!

Monty is here in San Francisco for a few days but should be back to the 
wilds of Oregon and his computer soon. :)

On Friday, October 25, 2002, at 09:58  PM, Matthew Ford wrote:

> Hi list,
> Mony has mentioned a few times in the past the benifit of using noweb 
> for treewalkers.
> The idea is that for multi-pass tree walkers the structure is usually 
> almost the same, just the actions vary.
> Please find attached CodeSections, simple command line and ant jars 
> that will selectively output code sections as required.
> The source code for both versions is in CodeSection.cs   Naturally 
> CodeSections is used to generate the two versions from the one master 
> file.
> regards
> matthew
> The complete docs are at the top of CodeSection.cs  part of which 
> are reproduced below
> --------------------------  
> Input File Format
> --------------------------
> alternative code sections start with
> <<id>>=
> starting in col1 and followed by whitespace and newline
> where id is  $ alpha or underscore followed by $ alpha,underscore or 
> digits (a Java identifier)
> spaces are NOT allowed within id or between << id and >>=
> sections continue until next section or EOF
>  <<*>>=
> is the default section that is always output (note: here it is not in 
> col1 so is not processed, see real examples below)
> To output other code sections list the id's of the sections to be 
> output in the arguments
> java -jar CodeSections inputFile outFile [ids]*
> If there are no ids listed just the <<*>>= sections will be output.
> If you ask for an id that does not exist in the input file a warning 
> is printed on
> System.out
> See this file and the testin.cs for examples
> this is a real example of using the default code section tag
> <<*>>=
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> Service.<CodeSections.zip>
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list