[antlr-interest] Recognition of dynamic ID-definitions

Christian Mrugalla christian at mrugalla.info
Tue Jan 25 14:21:25 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear all,

is it possible to recognize a language which is (so to say)
'parameterized'  by a finite set of arbitrary named identifiers, using
ANTLR?

Trivial Example:

expr : ID ( '+' ID)* ;

ID is not defined at parser-generation-time, it is only known that at
parser-execution-time there exists a finite set S of arbitrary Strings
which contains the allowed values for ID.

That is in particular: It depends on S, if "a+b" is:
- - build by '+'-connected 'a'- and 'b'-IDs
- - an ID named 'a+b'
- - invalid, because S contains the IDs "a+" and "b"

I did not found any hint concerning such kind of
language-parameterization in the "The Definitive ANTLR Reference".

Thank you in advance for your help!

Kind Regards,
Christian Mrugalla

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAk0/TOUACgkQz2D7mOZ/GFxR0ACbB+GVUODsY1Njr8nGF7M6axJR
h2sAn3Ae3PAxGayB3lMODRQgAIFIvRm/
=ehYs
-----END PGP SIGNATURE-----


More information about the antlr-interest mailing list