discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

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

N
NateTG
Sun, Sep 2, 2018 9:58 PM

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/

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/
TP
Torsten Paul
Sun, Sep 2, 2018 10:27 PM

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.

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.
DM
doug moen
Sun, Sep 2, 2018 10:29 PM

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 nate-openscadforum@pedantic.org
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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 <nate-openscadforum@pedantic.org> 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
AB
Antonio Bueno
Sun, Sep 2, 2018 10:35 PM

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 (nate-openscadforum@pedantic.org)
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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Saludos,
Antonio

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 (<nate-openscadforum@pedantic.org>) 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- Saludos, Antonio
DM
doug moen
Sun, Sep 2, 2018 10:42 PM

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 doug@moens.org 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 nate-openscadforum@pedantic.org
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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 <doug@moens.org> 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 <nate-openscadforum@pedantic.org> > 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 >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > >
N
NateTG
Mon, Sep 3, 2018 12:50 AM

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/

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/