You can use PetitPreprocessor:
Gofer new
    squeaksource3: 'PetitPreprocessor';
    package: 'PetitPreprocessor';
    load

Now it's just transform a matching regex to a substitution String (MyParser preProcess: ('toPreprocess' asRegex) into: 'preProcessed' ) but I plan to improve it by providing a PParser to detect a matching and apply its transformation block (myParser preProcessor: (matchingParser ==> [:m | ..... ])).

2012/9/13 Guillermo Polito <guillermopolito@gmail.com>
Maybe you can use a -completely separate- pre-parser? :)

It takes the input with the pre processor directives, and answers a new processed string which the original parser will handle?.

Guille 

On Thu, Sep 13, 2012 at 3:22 PM, Stephan Eggermont <stephan@stack.nl> wrote:
Hi

What is the best way to handle pre-processor directives with PetitParser without polluting
the parsing too much? Any suggestions?

unit forms;
interface
{$IFDEF WINDOWS}
uses bla;
{$ENDIF}
{$IFDEF LINUX}
uses bla2;
{$ENDIF}

Diego & Stephan


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--
Guillaume Larcheveque