Hello! What is "proper way" of implementing result value of parser, have i implement new parser or can (and how?) i use grammar construct with user defined result value that can be passed to attached action (for ex. matched GUID returning)? What is performance penalty for using vectors (they need realloc, don't they) in ast trees? And is there anyway to store scanner defined result in tree, besides using user-specified value in node_val_data and type casting it to specific type depending of node id? Thanks. -- With best regards, GIE.
GIE wrote:
What is "proper way" of implementing result value of parser, have i implement new parser or can (and how?) i use grammar construct with user defined result value that can be passed to attached action (for ex. matched GUID returning)?
Grammars may have return values! By convention the first member of a closure associated with the grammar is used as its return value. See the docs for details.
What is performance penalty for using vectors (they need realloc, don't they) in ast trees?
Not known so far. Try it out and report it to the list. I'm sure this would be interesting to know for many of us.
And is there anyway to store scanner defined result in tree, besides using user-specified value in node_val_data and type casting it to specific type depending of node id?
What do you mean with 'scanner defined result'? Regards Hartmut
Hello, Hartmut!
You wrote to "'Boost Users mailing list'"
GIE
Thanks. Found that. But, because of mine little knowledge of FP i got many new problems.
I have struct member declared something like that: 'unsigned char Data4[ 8 ];' and 'bind(&GUID::Data4[0])(self.val) = arg1' in action call produces compile time error :(
And it seams that i can't apply 'bind(&GUID::Data1)(self.val) = arg1' in subrules, got compiler error.
Well, please post some minimal code that exhibits the problem. But please post it to Spirit's mailing list: Spirit-general mailing list Spirit-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spirit-general Thanks and regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (3)
-
GIE
-
hartmutkaiser@t-online.de
-
Joel de Guzman