On 10/22/2009 06:08 PM, Юрушкин Михаил wrote:
> Good evening.
> thanks for your support!
> 
> Could u give me one tip.
> I user C target and want to parse such input
> 
> "a = 3.14
> f(x) = 3x^2 - 4x + 2
> 
> print "The value of f for " a " is " f(a)
> print "The derivative of " f() " is " f'()
> 
> 
> list variables
> list functions
> 
> g(y) = 2y^3 + 6y - 5
> h = f + g
> print h()"
> 
> I use this tutorial
> http://jnb.ociweb.com/jnb/jnbJun2008.html
> 
> but parser fails.. when finds empty lines. It's correct, but how can i fix  
> it? It's common problem for all languages. Programmer can input some empty  
> lines between constructions to improve code readability...

Have your "whitespace" be "skipped" by your lexer?  That's what I do in
almost every compiler I've written.  Your lexer tokenizes, and tokens
can be seperated by whitespace, so, so long as you don't have lexer
rules where whitespace is significant, you should be OK.

-- 
Kevin J. Cummings
[email protected]
[email protected]
[email protected]
Registered Linux User #1232 (http://counter.li.org)

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to