[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question About Mimicking Syntax
- From: Brent Fulgham <bfulgham@...>
- Date: Thu, 18 Oct 2007 11:45:53 -0700
On Thursday, October 18, 2007, at 02:57AM, "Luiz Henrique de Figueiredo" <lhf@tecgraf.puc-rio.br> wrote:
>> x=1.0;WHILE x<4.0 DO
>> StartTest;
>> SetDuration[20000.0];
>> x=x+1.0
>> OD;
>> Stop
>
>If this is the whole syntax, you can do it easily with a short token
>filter in C. Email me if you want to go this way. --lhf
>
Thank you. I applied the change from your other note, and it seems to work fine with the following exception.
There was an additional piece of syntax I had forgotten -- PromptUser. This function call presents a message (string) to the user. However, the original language did not use quotes, since they were inferred from the function call:
PromptUser(To begin run, press OK);
The PromptUser call is not a problem, but the lack of quotes around the string causes Lua to try to find an enclosing parenthesis to finish off the prior token.
This might be most easily handled by something equivalent to "s/PromptUser\((.*)\)/PromptUser\("\1"\)/"
Can more magic be used to handle this in the lexer?
Thanks,
-Brent