[antlr-interest] known number of repetitions..

Sriram Durbha cintyram at yahoo.com
Fri Oct 4 07:47:38 PDT 2002


hi 
 please consider the following and do reply to the
list :

== 1 =========
 this is with reference to writing a rule for numbers

in english : " a number can be any sequence of digits
upto a maximum of 6; so  0 - 999999 is a valid number
"
but 1234567 is not 

what is the best way to write such a rule?

also what to do if the known number is really large
like" a maximum of 1000 records makes a recset "

but anything more than 1000 is invalid ;

== 2 =========

 how to retain comments in rules? and how to find
their associativity with source lines? 

 example :

  in some simple source langugae suppose the code is 
 

 ADD C B D ; add the no. of Boys and Girls and put
           ; the count in regC


 or like 
 /* the utility variables are declared below */
  int a, /* accumulator  */
      b, /* number of boys in the class  */
      c, /* temporary counter   */
      d  /* number of girls  */
      ;
when translated into a target language which should
have comments but not c style ..

 // the utility variables are declared below 
  int a, // accumulator  
      b, // number of boys in the class  
      c, // temporary counter   
      d  // number of girls  
      ;
how do i match comments as they can appear anywhere
they like and also retain them in the target language
file with a good associativity to the meaning ;

== 3 =========
    
how to insert dummy parent nodes in trees?
 like when i want to save all the polynomials from the
test.in file  i want the tree like 
  root
   op-> poly one -> result one
    |
    v 
   op -> poly two -> result two

is there any better structure how to get root and op
into the tree?

============================

thank you very much
warm regards,
ram

 
  







__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

 

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



More information about the antlr-interest mailing list