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

Whish is the best scheme for ignoring all but commands in a text stream ?

Expand Messages
  • Jim Jackl-Mochel
    I am writing a macro processor in Java and I have to admit that I have gotten lost in the possible ways to ignore text in ANTLR. Given .include
    Message 1 of 1 , Dec 1, 1999
      I am writing a macro processor in Java and
      I have to admit that I have gotten lost in the possible
      ways to ignore text in ANTLR.

      Given
      <EXAMPLE>
      .include "sampleInclude.cg"
      .set name = "Reginald"
      Sample text with a single expansion ${name}
      or function call $uppercase(name)
      or even a complex function call
      $max(${name}, "schmoo") as a possibility.
      and some other text
      and some more text
      </EXAMPLE>

      I can see that the "dot commands"

      .include "sampleInclude.cg"
      .set name = "Reginald"

      can be handled with another parser.
      What I can't see is the best way to
      output the normal text unchanged while
      expanding

      ${name}
      $uppercase(name)
      $max(${name}, "schmoo")

      Any suggestions ?

      Jim Jackl-Mochel
      Senior Software Engineer
      Foliage Software Systems, Inc.
      jmochel@...
      PH: (781) 993-5500 x442
      FAX: (781) 993-5501

      "It doesn't harm anyone if the
      tools are abstracted to the point of usability, does it?"

      Steve Champeon
      xml-dev list
      Nov 16th 1999
    Your message has been successfully submitted and would be delivered to recipients shortly.