[antlr-interest] Two questions about antlr3 syntax
shmuel siegel
antlr at shmuelhome.mine.nu
Thu Oct 27 09:52:46 PDT 2005
1) In antlr2 I used EOT to indicate that the entire input file must
match my syntax. What has replaced this in antlr3.
example
document : contextSection (eventSection)? (handlerList)?
(settingSection)* EOT!;
2) in antlr2 we used labels to create referenceable items. The read me
notes say that we should use an equal sign instead of a colon but
neither syntax works for me in antlr3. what do I need to do?
example:
LINE_DIRECTIVE : a="#line" WS line=NUMBER WS (filename=STRING)?
{
$setType(Token.SKIP);
setLine(Integer.parseInt(line.getText())-1);
if(filename!=null)
{
currentFilename = filename.getText();
setFilename(currentFilename);
}
}
;
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/146 - Release Date: 10/21/2005
More information about the antlr-interest
mailing list