thanks in advance
Haroldo
I'm trying to work out some ideas,
- I'd like to capture a string of characters , and the use the capture later in the grammar to match the same string of characters. I'm aware (although I'm no expert) of Text::Delimited and Text::Balanced, and I wonder how those two tools manage to match a dynamic token in the input, that is, if there is a grammar trick that captures like one would capture and backreference in a perl regular expression, or if that is computed in the semantic layer.
- I also want to know how to express in the grammar that a part of the input text (many lines of arbitrary text) has to be taken 'as is' to the semantic layer, in order to parse it separately. I've read poeple are chaining parsers. Any pointers as how to do it are welcome.
- The previous point, relates to my desire to find some patterns in the parsed input, for instance, two nested loops, or two consecutive nested loops, or even 'while true ...' loops which are controlled by a variable, which name could be anything, that is initialized immediately before the loop, and incremated or accumulated inside the loop. I wonder what approaches are good or known to 'parse' (meaning confronting to a specialized grammar over a bigger grammar) the AST that results from a parse stage. Is ordinary ad-hoc programming the way to deal with ASTs that have had some inner portions separated or eliminated in order to match outer or bigger structures to predefined patterns, or even to sort them out of a big codebase as to see which programming patterns are most common in the codebase? Or is it better to bring the 'reduced' AST back to a DSL , and then process it against 'pattern grammars' until one fits the specialized pattern ? (I hope this can be understood, sorry for any mistakes, and thanks for the reading)
--
You received this message because you are subscribed to the Google Groups "marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.