explicit token type in dynamic lexer

SyntaxEditor for WPF Forum

Posted 8 years ago by Dave Haas - Powder Software
Version: 11.1.0545
Avatar
Hi.

I'm building a language that has 2 keywords that are fairly close to the same. What I've done is create a token for each keyword (instead of having one token with multiple patterns). I've done that since the tokens have to appear in a specific order.

However, when the lexer runs and produces the tokens it matches improperly.

Token 1: TokenKey -> AddressListKW, pattern -> address_list
Token 2: TokeyKey -> AddressKW, pattern -> address

Now, when the lexer is doing it's thing it matches the 'address_list pattern' when the 'address' text is actually present. It's an explicit pattern type.

I'm not sure what I'm doing wrong.

Cheers,

Dave

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Dave,

Explicit patterns will match the exact text you indicate, taking into account case sensitivity options you have set of course.

It wouldn't match an explicit pattern of "address_list" when the text present is only "address".

It's hard to provide any more information unless we have a sample to debug. You can email us your language and some sample code if you'd like us to look.


Actipro Software Support

Posted 8 years ago by Dave Haas - Powder Software
Avatar
Hi.

I've sent email with a language definition and a c# project that exhibits the problem.

Cheers,

Dave
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.