[antlr-interest] New user

mzukowski at yci.com mzukowski at yci.com
Thu Aug 29 08:09:02 PDT 2002

2. What is the structure of an AST? I can hardly find literally
specification on the Internet. 

Every node in an AST has a child and a sibling.  So at any node you have two
"dimensions", down and right, instead of a stream which only has "right" or
"next sibling".

5. When do I use syntatic predicate and semantic predicate? Why does this
semantic make sense: ( set_clause ) => set_clause ??!! 

It doesn't make sense like that because you're not using it in context.
What it is saying is choose this alternative if the syntactic predicate
matches.  Sometimes you have things that need "infinite lookahead"--you
can't always decide in "k" tokens what is happening.  When you have that
situation you use a syntactic predicate.  Semantic predicates are for things
like checking symbol tables--the actual semantics of the program.

6. What does match(_token) do? It matches what? Does it match the input
stream? How come the tokens are Integers instead of String? 

Because token types are represented as integers.  But a token is an object
with a type and the text that matched.


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

More information about the antlr-interest mailing list