[fpc-devel] Incomplete docs on operator precedence / Question about actual precedence

Martin Frb lazarus at mfriebe.de
Mon Feb 3 15:07:39 CET 2014


On 03/02/2014 13:47, Jonas Maebe wrote:
>
> On 03 Feb 2014, at 14:28, Martin Frb wrote:
>
>> The reason I did get to that,  is because I have to reproduce the 
>> behaviour (for fpdebug).
>> And when scanning/evaluating a pascal expression/statement, it works 
>> well to handle the "." (and also []()^) as operator. So that is haw 
>> the "." ended on the list.
>
> Can't you use fcl-passrc (http://wiki.freepascal.org/fcl-passrc ) 
> instead of scanning/parsing everything yourself? Or does it only 
> support complete source files?
>

The example only shows how to parse a full file.

All I need is to parse any of the following
    SomeValue
    SomeType
    SomeFoo + Bar[1]
    Bar(Abc).xyz^    // Bar may be a class, or a function

At the time of parsing nothing else is known, the types / values can be 
looked up during parsing.

This are only right hand site expressions. This are NOT full pascal 
statements (since the result := part is not there)
They may result in a value, or a type. (or be invalid)


I already have the parser (that part was rather simple).  And it returns 
a structure of objects, that can deal with the rest of the work (getting 
type/value and evaluate).




More information about the fpc-devel mailing list