« Return to Thread: If statement vs short if statement

If statement vs short if statement

by Alex James-2 :: Rate this Message:

Reply to Author | View in Thread

Hi,

I'm quite to new JavaCC and need a little help with the parsing of an  
if statement in the language I'm trying to replicate.

The language has the following definition for if statements:

<if> condition
   statement+
(<else>
   statement+)?
<endif>

It also has a short if statement:

<if> condition statement

Trouble is I can't get my parser to recognise when the short if  
statement has been used as there is nothing to distinguish it from the  
long if statement. The language I'm trying to replicate generally  
ignores end of line characters but seems to take them into account  
when recognising the short if statement. Is there any way I can ignore  
end of line characters except in this one circumstance?

Any help would be greatly appreciated.

Cheers,

Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: If statement vs short if statement