[Kst] Sharing the scanner...

George Staikos staikos at kde.org
Fri Apr 2 22:56:24 CEST 2004


On Friday 02 April 2004 15:51, Andrew Walker wrote:
> Hi George,
>
> The merging of the scanners doesn't work overly well
> due to the presence of yylval. Running an evaluation
> in the exparse ends up settings the value for yylval
> instead of exlval. The exscan.l was built using the
> -P option to avoid this issue.

   We can just #define to get around that.  Having to copies of the scanners 
is really pointless since they are virtually identical.  One was just a 
straight copy of the other with a name change and a few new tokens.

> In short I don't think we can share scanners. Also,
> I would prefer to keep these two expressions parsers
> seperate to some extent as the event monitor is
> necessarily going to become more complex, in ways
> that the existing equation parser does not need to be.

  The parsers are separate.  I didn't plan to change that at this point, 
although I am wondering if there is value in having comparison operators 
inside equations.  The nodes for the parser can easily be shared though.  It 
adds loads of symbols to the app to duplicate those objects verbatim.

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/



More information about the Kst mailing list