Loading ...
Sorry, an error occurred while loading the content.

Lexers hoist simple preds now

Expand Messages
  • Terence Parr
    Folks, Haven t heard from anybody on my proposal, but I think it s a good idea so I ve implemented it. Works great for the beginning of line issue.
    Message 1 of 3 , Aug 31, 2002
    • 0 Attachment
      Folks,

      Haven't heard from anybody on my proposal, but I think it's a good idea
      so I've implemented it. Works great for the "beginning of line issue."
      Python-parsing lovers rejoice!

      You can gate rules in/out depending on semantic context now:

      A : {pred1}? 'a' ;

      Will only be tested upon pred1 by the lexer. In prior versions, it
      would enter the rule and then fail (as a validating pred not
      disambiguating pred).

      NOTE the really cool thing is that the C++ and C# output generators
      will not have to be modified because the code generator is called after
      I build the internal representation of nextToken rule. :) Woohoo!

      Oh...I do not allow multiple alternative preds from same rule to be
      hoisted as that requires real hoisting (i.e., pulling syntactic context
      along with semantic).

      L8R,
      Ter
      --
      Co-founder, http://www.jguru.com
      Creator, ANTLR Parser Generator: http://www.antlr.org
    • Ric Klaren
      Hi, Good to see you at work on antlr again :) (now hope that I get some time in the near future to do some of the last debugging sessions on the C++ part :( )
      Message 2 of 3 , Sep 2, 2002
      • 0 Attachment
        Hi,

        Good to see you at work on antlr again :) (now hope that I get some time in
        the near future to do some of the last debugging sessions on the C++ part :( )

        On Sat, Aug 31, 2002 at 04:27:54PM -0700, Terence Parr wrote:
        > Haven't heard from anybody on my proposal, but I think it's a good idea
        > so I've implemented it. Works great for the "beginning of line issue."
        > Python-parsing lovers rejoice!
        >
        > You can gate rules in/out depending on semantic context now:
        >
        > A : {pred1}? 'a' ;
        >
        > Will only be tested upon pred1 by the lexer. In prior versions, it
        > would enter the rule and then fail (as a validating pred not
        > disambiguating pred).

        <cheers at Ter>

        > NOTE the really cool thing is that the C++ and C# output generators
        > will not have to be modified because the code generator is called after
        > I build the internal representation of nextToken rule. :) Woohoo!

        <another cheer at Ter>

        Some small questions:

        Does this do anything for parsers as well ? (too lazy to read the code ;) )
        I saw no patches in the documentation I trust these are still pending ;) ;) ;)

        Cheers,

        Ric
        --
        -----+++++*****************************************************+++++++++-------
        ---- Ric Klaren ----- klaren@... ----- +31 53 4893722 ----
        -----+++++*****************************************************+++++++++-------
        Wo das Chaos auf die Ordnung trifft, gewinnt meist das Chaos, weil es
        besser organisiert ist. --- Friedrich Nietzsche
      • Terence Parr
        ... Hooray! ... Thanks... I must say that the code is really disgusting viewing it again after quite an absence and with the perspective of having written a
        Message 3 of 3 , Sep 2, 2002
        • 0 Attachment
          On Monday, September 2, 2002, at 02:00 AM, Ric Klaren wrote:
          > Good to see you at work on antlr again :) (now hope that I get some
          > time in
          > the near future to do some of the last debugging sessions on the C++
          > part :( )

          Hooray!
          >> NOTE the really cool thing is that the C++ and C# output generators
          >> will not have to be modified because the code generator is called
          >> after
          >> I build the internal representation of nextToken rule. :) Woohoo!
          >
          > <another cheer at Ter>

          Thanks... I must say that the code is really disgusting viewing it
          again after quite an absence and with the perspective of having written
          a commercial program (jGuru server). Ick Ick Ick! Oh well, I was a
          prototype guy. With luck, future work will benefit from my newfound
          respect for real coding! ;)

          > Some small questions:
          >
          > Does this do anything for parsers as well ? (too lazy to read the code
          > ;) )
          > I saw no patches in the documentation I trust these are still pending
          > ;) ;) ;)

          Sure is...i'll update the doc. It doesn't affect parsers, only a
          lexer's nextToken--not even lexer rules that call other lexer rules.
          This is a prelude to the future ;)

          Ter
        Your message has been successfully submitted and would be delivered to recipients shortly.