[x3d-public] C++ SAI: setters and addChildren return void
John Carlson
yottzumm at gmail.com
Sun Dec 15 08:57:46 PST 2024
Pushing CPPON (C++ Object Notation) as an X3D encoding and a X3D binding
will provide pushback against the Python/C++ wave of OpenUSD-PEGTL (the new
grammar language for .usda, apparently, but where is the grammar ?). Since
my C++ grammar is written in ANTLR4, it can use the same grammar for many
languages, not just a C++ target. Plus ANTLR4 already works with
NetBeans. ANTLR4 can produce parsers frameworks in JavaScript, which is
suitable for web; Swift, which is suitable for Apple development, Java,
which works well with X3DJSAIL and Android, C#, which is suitable for
Microsoft development, Go for Google development, PHP for web development,
and Python 2 and 3 if we want to add a C++ X3D encoding Blender importer.
Sorry, no Kotlin or Clojure parsers yet.
My grammar is available now, and parses function bodies in a limited form
of C++, which I call CPPON. There aren’t control structures, so it’s not
Turing complete, is as free from viruses as XML and JSON. Since CPPON can
be read into XML DOM, CPPON can be thought of as a document language, just
like JSON, HTML and XML. Perhaps one can even stream it! In addition, one
can just #include it in a C++ function or method!
I can also do a Java Object Notation. I’ve already demonstrated XML to
Java Object array and back. Easy peasy! I just don’t have a grammar for
it yet!
John
On Sun, Dec 15, 2024 at 9:56 AM John Carlson <yottzumm at gmail.com> wrote:
> If people want to experiment with C++ generation from DOM and JSON, my
> personal examples are here:
>
> https://github.com/coderextreme/CPPON/tree/main
>
>
> This will give you some idea about the current C++ SAI (I haven’t tried it
> for 9 months though).
>
> Note that these do not include a renderer yet, as I parse C++ to produce
> DOM, which can be used in X3DJSAIL.
>
> The JSON to C++ is written in Node.js and may be suitable inclusion in
> other JavaScript tools.
>
> If there’s enough demand, I should be able to create a C++ to DOM parser
> in JavaScript, if ANTLR4 produces JavaScript parser generators.
>
> That would mean that C++ could be used as an X3D encoding in X3DOM, X_ITE
> and Sunrize.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20241215/e83af50d/attachment.html>
More information about the x3d-public
mailing list