New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarative meta fields #20

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@washort

washort commented Mar 11, 2012

No description provided.

Add named elements for meta fields as an alternative to functions, in…
… order to allow development of compiled parsers.
@ZiglioUK

This comment has been minimized.

Show comment
Hide comment
@ZiglioUK

ZiglioUK Mar 25, 2012

Excuse my dumb questions (I'm a Python newbie)
What are Named Elements? What are Compiled Parsers? and why are named elements needed for compiled parsers?

ZiglioUK commented Mar 25, 2012

Excuse my dumb questions (I'm a Python newbie)
What are Named Elements? What are Compiled Parsers? and why are named elements needed for compiled parsers?

@tomerfiliba

This comment has been minimized.

Show comment
Hide comment
@tomerfiliba

tomerfiliba May 15, 2012

@washort could you elaborate on what this patch does? it's totally unclear what problem it comes to solve

tomerfiliba commented May 15, 2012

@washort could you elaborate on what this patch does? it's totally unclear what problem it comes to solve

@washort

This comment has been minimized.

Show comment
Hide comment
@washort

washort May 15, 2012

Right now, construct works as an interpreter. To parse or build some data, a method is called on the structure object which then invokes various methods/functions on its contents, etc. My idea is to support code generation from constructs -- creating Python (or perhaps even C) code that does the building/parsing. This can't work if the construct object has arbitrary functions inside it. So I wanted to replace those functions with objects that can either be used in the current mode (invoke a function to get a value) or in a code generator (where the code generator asks Equal or Boolean etc. to generate code providing their behaviours).

washort commented May 15, 2012

Right now, construct works as an interpreter. To parse or build some data, a method is called on the structure object which then invokes various methods/functions on its contents, etc. My idea is to support code generation from constructs -- creating Python (or perhaps even C) code that does the building/parsing. This can't work if the construct object has arbitrary functions inside it. So I wanted to replace those functions with objects that can either be used in the current mode (invoke a function to get a value) or in a code generator (where the code generator asks Equal or Boolean etc. to generate code providing their behaviours).

@tomerfiliba

This comment has been minimized.

Show comment
Hide comment
@tomerfiliba

tomerfiliba May 16, 2012

yeah, i've had this idea for some time now (see http://sebulbasvn.googlecode.com/svn/trunk/ccon/test.py and the generated files in that directory). the problem is, it's not possible in the general case. so you can solve it for structs and stuff like that, but you can't do it for adapters, as they are just functions.

so this will not work... you have to define a narrowed down version of construct that's not turing complete (most likely context-free), and then it could work. but that's a different project.

tomerfiliba commented May 16, 2012

yeah, i've had this idea for some time now (see http://sebulbasvn.googlecode.com/svn/trunk/ccon/test.py and the generated files in that directory). the problem is, it's not possible in the general case. so you can solve it for structs and stuff like that, but you can't do it for adapters, as they are just functions.

so this will not work... you have to define a narrowed down version of construct that's not turing complete (most likely context-free), and then it could work. but that's a different project.

@washort

This comment has been minimized.

Show comment
Hide comment
@washort

washort May 16, 2012

After writing this patch, I started to believe that as well. :)

washort commented May 16, 2012

After writing this patch, I started to believe that as well. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment