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

John Carlson yottzumm at gmail.com
Mon Oct 23 08:43:56 PDT 2023


Hmm.  Looks good.  I am riffing off of:

https://github.com/ingowald/antlr-vrml/blob/master/vrml.g4

I don't know if X3DUOM supports ordering, which probably has
combinatorial explosion if employed, so I'll probably go for something
simpler in the long run.

This is interesting, I'm not only targeting Java or Python:
https://github.com/antlr/antlr4/blob/master/doc/targets.md

Hmm!

John

On Mon, Oct 23, 2023 at 9:19 AM GPU Group <gpugroup at gmail.com> wrote:

> 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/6a03ee63/attachment.html>


More information about the x3d-public mailing list