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

BNF transformation

Expand Messages
  • birmanstefan
    Hello, I have a BNF as a *.g file. I want to parse the g file and then generate some text/html/code/etc. I looked in the manual and I saw that I can export the
    Message 1 of 3 , Dec 16, 2004
    • 0 Attachment
      Hello,

      I have a BNF as a *.g file. I want to parse the g file and then
      generate some text/html/code/etc. I looked in the manual and I saw
      that I can export the BNF as a html file, with -html option.
      How/Where can I hook and generate my own stuff based on the g
      file? Where should I look for resolving this task? Does anybody tried
      to resolve a similar problem?

      Any info, link, start point, something is welcomed.

      Thank you,
      Stefan.

      PS: My basic ideea is to use, somehow, the StringTemplate.
    • Ric Klaren
      ... There s a grammar for the .g format on antlr.org. Depending on your requirements that should be a good start. The -html/-docbook options are additional
      Message 2 of 3 , Dec 16, 2004
      • 0 Attachment
        On Thu, 16 Dec 2004 19:37:40 -0000, birmanstefan <stefan@...> wrote:
        > I have a BNF as a *.g file. I want to parse the g file and then
        > generate some text/html/code/etc. I looked in the manual and I saw
        > that I can export the BNF as a html file, with -html option.
        > How/Where can I hook and generate my own stuff based on the g
        > file? Where should I look for resolving this task? Does anybody tried
        > to resolve a similar problem?

        There's a grammar for the .g format on antlr.org. Depending on your
        requirements that should be a good start. The -html/-docbook options
        are additional codegenerators that just present the contents of the .g
        file differently. Might be overkill/too much bagage for what you want
        to do.

        Cheers,

        Ric
      • Martin Probst
        Hi, If you look through the archives you ll find a posting by me which contains an attached XSL stylesheet which transforms ANTLR s SGML docbook output to
        Message 3 of 3 , Dec 16, 2004
        • 0 Attachment
          Hi,
          If you look through the archives you'll find a posting by me which
          contains an attached XSL stylesheet which transforms ANTLR's SGML
          docbook output to something more usable in XML format. You should be
          able to generate anything you might need from that XML stuff with some
          XSLT scripts.

          mfg
          Martin

          Am Donnerstag, den 16.12.2004, 21:21 +0100 schrieb Ric Klaren:
          > On Thu, 16 Dec 2004 19:37:40 -0000, birmanstefan <stefan@...> wrote:
          > > I have a BNF as a *.g file. I want to parse the g file and then
          > > generate some text/html/code/etc. I looked in the manual and I saw
          > > that I can export the BNF as a html file, with -html option.
          > > How/Where can I hook and generate my own stuff based on the g
          > > file? Where should I look for resolving this task? Does anybody tried
          > > to resolve a similar problem?
          >
          > There's a grammar for the .g format on antlr.org. Depending on your
          > requirements that should be a good start. The -html/-docbook options
          > are additional codegenerators that just present the contents of the .g
          > file differently. Might be overkill/too much bagage for what you want
          > to do.
          >
          > Cheers,
          >
          > Ric
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.