Parser is not fed tokens of child states

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by David Chang - Software Engineer, a.i. solutions, Inc.
Version: 4.0.0277
Avatar
Hi,

I am using Dynamic language within which I have a default state and several child states.

Against this dynamic language I have build a parser using the grammar designer.

The problem I have currently is that my parser is not provided the tokens within the child state.

In my case I have a default state that transitions into macro state by MacroStartToken. My parser would read the MacroStartToken and skip all of the MacroStateTokens and continue on to the next token after exiting from macro state.

To illustrate, I have the following...

DefaultStateToken1
DefaultStateToken2
MacroStartToken
MacroStateToken1
MacroStateToken2
MacroEndToken
DefaultStateToken3
DefaultStateToken4

By following the parser in debug mode the code would read in...

DefaultStateToken1
DefaultStateToken2
MacroStartToken
DefaultStateToken3
DefaultStateToken4

My question is, how do I get to the skipped tokens without writer yet another parser to handle the child state?

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi David,

Hmm... my guess is to look in your recursive decent lexical parser implementation. That is the class that feeds tokens from the real lexical parser to the semantic parser. Maybe see if that is somehow filtering things out.

For instance, the class I'm referring to in our Simple language sample is in SimpleRecursiveDescentLexicalParser.cs.


Actipro Software Support

The latest build of this product (v24.1.1) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.