[antlr-interest] Type-checking and compiling a language with import constructs

jeroen.v.schagen at gmail.com jeroen.v.schagen at gmail.com
Thu Jul 9 06:16:58 PDT 2009


After some digging I've found a tutorial in v2.7:  
http://www.ibm.com/developerworks/aix/library/au-c_plusplus_antlr/index.html.  
However, while implementing the preprocessor I noticed that the  
antlr.TokenStreamSelector add input stream requires a antlr.TokenStream,  
but the org.antlr.runtime.Lexer inherits from antlr.runtime.TokenStream.  
Now I'ma bit puzzled why there are two different TokenStream classes. Is  
this purely a migration issue that is waiting to be resolved, or should I  
use some other facility for multiple token streams?

On Jul 8, 2009 12:33pm, Jeroen van Schagen <jeroen.v.schagen at gmail.com>  
wrote:
> Hello,

> Currently I'm working on the implementation of a mark-up DSL using ANTLR.  
> This language makes use of module definitions and import constructs. What  
> would be the optimal approach to loading contents of dependent modules in  
> my AST?


> The parser grammar is as follows:
> module: 'module' moduleId ( imprt | site | function )* 'end' EOF ;
> moduleId: IDENTIFIER ( '.' IDENTIFIER )* ;
> imprt: 'import' moduleId ';' ;


> Thanks in advance!
> Jeroen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090709/c77ddf40/attachment.html 


More information about the antlr-interest mailing list