[antlr-interest] some questions about antlr

Bharath Sundararaman bharath at starthis.com
Thu Jun 3 08:01:04 PDT 2004


Hi Yolanda,

Did you check this page: http://www.antlr.org/grammar/list?
 

>> What is antlr tranlation of the following PCCTS rule: (IF YOU ARE ASKING
WHAT THIS MEANS, HERE IS A SIMPLE EXPLANATION).

This is a rule (in the parser) that would recognize a "block of statements"
in your input, which start with an openBracket, contains statements and ends
with a closeBracket.

Assume that openBracket is a left curly "{", closeBracket is a right curly
"}", colon is obviously ":", variableName is an identifier and verticalBar
is "|". If "a:=10;" can be considered as a statement, then your "block" rule
would recognize the code fragment below:

{ // Open bracket
	:myVariable // This is your identifier.
	|  // Vertical bar
	a:=10;
	b:=20; // Statements
}// Close bracket

The # symbol is for the abstract syntax tree, which gets generated if you
set the buildAST option to true. For this code to work, you must have other
rules that take care of whitespace, newlines, tabs and single line comments.


Bharath.
~Give me the tool and I shall move the earth~

-----Original Message-----
From: yjargudo at tiscali.es [mailto:yjargudo at tiscali.es] 
Sent: Thursday, June 03, 2004 4:44 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] some questions about antlr


Hello,

 I have some problems with antlr and I hope you could help me:

1- I need antlr .g extension file for smalltalk-80. Where could I find it?
2- What is antlr tranlation of the following PCCTS rule: 
     block :
	  openBracket #{ ( colon variableName )+ verticalBar } statements
closeBracket
	;

Thank you,

Yolanda

¿Buscas casa? Encuéntrala ya en http://inmobiliaria.tiscali.es/






 
Yahoo! Groups Links



 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list