[x3d-public] Thinking of writing ANTLR4 lexer and parser for ClassicVRML

GPU Group gpugroup at gmail.com
Mon Oct 23 07:19:37 PDT 2023


tangentially related, may relate to importer for x3d.py:

vrml input

https://sourceforge.net/projects/pyvrml97/

which uses:

from simpleparse.parser import Parser

https://pypi.org/project/SimpleParse/

- EBNF single pass for largely deterministic grammars

parser.py snippet:

grammar = r'''

header         :=
headerStatement,profileStatement,componentStatement*,metaStatement*

headerStatement  :=
('#X3D',ts,SFNumber,ts,'utf8',ts,headerComment?,newLine)/('#',headerComment?,newLine)

headerComment  := -newLine+

profileStatement := 'PROFILE', ts, profileName,newLine

profileName    := name

<newLine>      := ('\r\n'/'\r'/'\n')
...



On Mon, Oct 23, 2023 at 7:47 AM John Carlson <yottzumm at gmail.com> wrote:

> Hmm.
>
> I'm thinking about generating a Classic VRML grammar from X3DUOM using
> Python, and then using ANTLR4 to generate Java code for inclusion in
> various experiments with GraalVM's Polyglot, Truffle, etc.
>
> Hmm.
>
> Hmm.
>
> Hmm.
>
> Maybe in another life.
>
> John
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20231023/ca7f0131/attachment-0001.html>


More information about the x3d-public mailing list