Piaget, 1. You should be tokenizing with code, not rules, if you want it to run fast. 2. If you wish to extract information from what you are analyzing, you need to look for specific complex statements, rather than trying to parse everything as though you can somehow process the trees once you have created them.
My fast parsing technology starts with the above two steps, but is probably too complex for toy applications. Steve ================== On Tue, Jan 1, 2013 at 12:53 PM, Piaget Modeler <[email protected]>wrote: > > > Hello all, > > I'm attempting to create parse trees for user input to the following > simple grammar: > > > *term := number | moment | string | symbol | scheme | collection* > * > * > *number := #nnnn.nnn -- where n is a > digit.* > * > * > *moment := @nnnnnnnnnnnnnnnn -- where n is a digit* > * > * > *string := $[ccccccc] -- where c > is a character* > * > * > *symbol := cccccccc -- where c is > a character* > * > * > *slot := ccccccccc ** -- where > c is a character* > * > * > *scheme := positional | slotted * > * > * > *positional := symbol( term* ) -- where term **is > zero or more & slot** * > * > * > *slotted := symbol(slot:term* ) -- where slot & term > pair is one or more.* > * > * > *collection := sequence | concurrence | choice | cycle* > * > * > *sequence := [ term* ] -- where [ ] > are delimiters* > * > * > *concurrence := ( term* ) -- where ( ) > are delimiters* > * > * > *choice := { term* } -- where { } > are delimiters* > * > * > *cycle := < term* > -- where < > > are delimiters* > > > After an input expression is parsed and a parse tree is generated, I'd > like to be able to: > > (1) query the parse tree against a database > > (2) merge the parse tree into the database. > > > Other requirements: The parse itself should be on the order of > milliseconds. > > Your thoughts on approaches or tools is appreciated? > > > ~PM > > > > > ------------------------------------------------------------------------------------------------------------------------------------------------ > *Confidential *- *This message is meant solely for the intended > recipient. Please do not copy or forward this message without * > *the consent of the sender. If you have received this message in error, > please delete the message and notify the sender.* > *AGI* | Archives <https://www.listbox.com/member/archive/303/=now> > <https://www.listbox.com/member/archive/rss/303/10443978-6f4c28ac> | > Modify<https://www.listbox.com/member/?&>Your Subscription > <http://www.listbox.com> > -- Full employment can be had with the stoke of a pen. Simply institute a six hour workday. That will easily create enough new jobs to bring back full employment. ------------------------------------------- AGI Archives: https://www.listbox.com/member/archive/303/=now RSS Feed: https://www.listbox.com/member/archive/rss/303/21088071-f452e424 Modify Your Subscription: https://www.listbox.com/member/?member_id=21088071&id_secret=21088071-58d57657 Powered by Listbox: http://www.listbox.com
