[antlr-interest] Standard library functions: how to??

Mark Lentczner markl at glyphic.com
Wed Apr 21 15:14:42 PDT 2004


On Apr 21, 2004, at 2:39 PM, Bharath S wrote:

> For example, if the user inputs a
> statement "x := abs(y);", should I write the abs() function as an 
> action in
> the grammar, when the "abs" keyword is encountered?

Unless abs(y) needs to be handled very differently than a call to a 
user function, foo(y), then no, the parser should know nothing about 
it.  Standard library functions (assuming the user doesn't need some 
sort of declaration to import them), should be added to your symbol 
tables before you begin the interpretation or compilation step.

	- Mark

Mark Lentczner
markl at wheatfarm.org
http://www.wheatfarm.org/



 
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