Using DollarSign in LPG 2

  • Edward D. Willink


    I'm trying to upgrade the Eclipse MDT OCL grammars to use LPG 2.0.13 and
    having a lot of trouble with the '$' token.

    Initially the generated keyword lexer had

            tokenKind[''] = Char_DollarSign;

    giving a syntax error. After some tweeking, I think moving the
    DollarSign ::= '$' to the top of, I fixed it to the

            tokenKind['$'] = Char_DollarSign;

    but after more tweeking, I think to fix the failure to honour the
    user specified include path, I lost it again. I can no longer
    get the correct line.

    [I've disabled all IMP builders and am applying LPG to just the
    KWLexer to avoid further confusions.]

    Is there a reliable way to use $ as a token?

    Is there a way to avoid the use of '$' in the above template
    or $Id $ in a CVS keyword substitution provolking a warning?

    Of course changing to escape='#' fixes everything but needs massing editing.


          Ed Willink

    • Adolfo Sanchez-Barbudo Herrera

      Ping ?

      LPG Team, I'm interested in getting some info about this issue.

      Maybe, a way to escape the "escape symbol" in the action-block code would suffice. Is there a way to do this?. I have tried some tipical escaping sequence with no luck.

      Can you provide any solution to this ?



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks