Dear Kaspar,

Thanks for replying! I just solved the problem by fixing the expression rule
last night (maybe I need more tests). The involved rules are:

1. expression_item;
2. sub_expression; (for constructing recursion)
3. expression.

Anyone who is interested can check it on https://gist.github.com/dongli/5791976.
I also fixed "bracketed" method to handle optional parenthesis (You just
emailed me your neat solution, I will use that one!).

Cheers,
Li

在 2013-6-17,下午3:16,Kaspar Schiess <[email protected]> 写道:

> Hi Li,
> 
> I like your test setup! I would like to help. However...
> 
> I don't exactly see what you're asking here. Can you phrase a question 
> that I can try to answer?
> 
> kaspar
> 
> On 16.06.13 15:12, Li Dong wrote:
>> Dear all,
>> 
>> I am writing a tool for processing Fortran codes, and I need to parse
>> the expression in Fortran like:
>> 
>>     ((a+1)+(b-1))/((c*2)+d)
>> 
>> I have written a "expression" rule using Parslet, which can parse the
>> above example, but it also affects the parsing of other statement rules
>> (like "if_condition").
>> 
>> The parser that I am writing has been put on GitHub
>> (https://gist.github.com/dongli/5791976). You can run the tests after
>> cloning or downloading that gist by:
>> 
>>     rspec --fail-fast rspec_fortran_parser.rb
>> 
>> Any suggestion is appreciated!
>> 
>> Best regards,
>> 
>> Li
>> 
>> -----------------------------------------
>> Dr. Li Dong (董理)
>> LASG, Institute of Atmospheric Physics
>> Chinese Academy of Sciences
>> P.O. Box 9804
>> Beijing 100029, China
>> Phone: 8610-8299 5143
>> 
> 
> 


Reply via email to