Are All the Language Features in src/lexer.l and src/parsery.y

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Are All the Language Features in src/lexer.l and src/parsery.y

NateTG
I've been wondering about the feasibility of writing an OpenSCAD converter or
interpreter so I've been looking through the source to for the specification
of the grammar and a comprehensive sense of built-in capabilities.  So far
I'm looking at:

/src/lexer.l

/src/parser.y

for the grammar

and

/src/scadlexer.cpp

for a list of "built-in" capabilities.

Is that enough to give me a reasonably comprehensive list of stuff that's in
the language?

Also, I'm wondering what keywordSet[2] is for.  Can anyone tell me?





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Are All the Language Features in src/lexer.l and src/parsery.y

tp3
On 09/02/2018 11:58 PM, NateTG wrote:
> /src/lexer.l
> /src/parser.y
>
Yep, that describes the full parser.

The actual built-ins can be found searching for Builtins::init(),
see:

https://github.com/openscad/openscad/blob/master/src/builtin.cc

> /src/scadlexer.cpp > for a list of "built-in" capabilities.
>
That lexer is GUI only, it has no influence on the actual
language, but it *should* be in sync for most keywords.

ciao,
   Torsten.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Are All the Language Features in src/lexer.l and src/parsery.y

doug.moen
In reply to this post by NateTG
scadlexer.cpp is not authoritative. I don't see "intersection_for", so at least that is missing.

keywordSet[2] appears to be used for keywords used in doxygen comments, in case you happen to process your openscad source code using doxygen. These keywords are not part of openscad.

On 2 September 2018 at 17:58, NateTG <[hidden email]> wrote:
I've been wondering about the feasibility of writing an OpenSCAD converter or
interpreter so I've been looking through the source to for the specification
of the grammar and a comprehensive sense of built-in capabilities.  So far
I'm looking at:

/src/lexer.l

/src/parser.y

for the grammar

and

/src/scadlexer.cpp

for a list of "built-in" capabilities.

Is that enough to give me a reasonably comprehensive list of stuff that's in
the language?

Also, I'm wondering what keywordSet[2] is for.  Can anyone tell me?





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Are All the Language Features in src/lexer.l and src/parsery.y

atnbueno
In reply to this post by NateTG
I looked into this last february: https://github.com/openscad/openscad/issues/2292 and scadlexer.cpp wasn't enough

Maybe the first image in that link and the text below can help you.

El dom., 2 sept. 2018 a las 23:59, NateTG (<[hidden email]>) escribió:
I've been wondering about the feasibility of writing an OpenSCAD converter or
interpreter so I've been looking through the source to for the specification
of the grammar and a comprehensive sense of built-in capabilities.  So far
I'm looking at:

/src/lexer.l

/src/parser.y

for the grammar

and

/src/scadlexer.cpp

for a list of "built-in" capabilities.

Is that enough to give me a reasonably comprehensive list of stuff that's in
the language?

Also, I'm wondering what keywordSet[2] is for.  Can anyone tell me?





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
Saludos,
Antonio



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Are All the Language Features in src/lexer.l and src/parsery.y

doug.moen
In reply to this post by doug.moen
Oops, my local repo was out of date. "intersection_for" is now mentioned in scadlexer.cpp.

On 2 September 2018 at 18:29, doug moen <[hidden email]> wrote:
scadlexer.cpp is not authoritative. I don't see "intersection_for", so at least that is missing.

keywordSet[2] appears to be used for keywords used in doxygen comments, in case you happen to process your openscad source code using doxygen. These keywords are not part of openscad.

On 2 September 2018 at 17:58, NateTG <[hidden email]> wrote:
I've been wondering about the feasibility of writing an OpenSCAD converter or
interpreter so I've been looking through the source to for the specification
of the grammar and a comprehensive sense of built-in capabilities.  So far
I'm looking at:

/src/lexer.l

/src/parser.y

for the grammar

and

/src/scadlexer.cpp

for a list of "built-in" capabilities.

Is that enough to give me a reasonably comprehensive list of stuff that's in
the language?

Also, I'm wondering what keywordSet[2] is for.  Can anyone tell me?





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Are All the Language Features in src/lexer.l and src/parsery.y

NateTG
In reply to this post by tp3
tp3 wrote

> ...
> The actual built-ins can be found searching for Builtins::init(),
> see:
>
> https://github.com/openscad/openscad/blob/master/src/builtin.cc
>
> ...
> ciao,
>    Torsten.
> ...

That's exactly the info I was looking for.  Thanks.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org