Simple language design decisions - SE 4.0

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Russell Mason

Couple of quick questions about the Simple language.

1) Why is the Simple language derived from MergableSyntaxLanguage rather than SyntaxLanguage as it doesn't seem to have any merging stuff?

2) Why is MergableToken called MergableToken? Does it have anything that is specific to mergable languages? It looks easier to derive from MergableToken than implement IToken but would this cause any issues for SyntaxLanguage derived languages?

Russell Mason

Comments (1)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
1) Theoretically you could "merge" it with another language like swapping it in for one of the languages in DynamicallyCreateForm. The lexer will work with language transitions however right now as things are, the code for determining what to show in IntelliPrompt might get a little goofy if it starts looking across language boundaries. Same thing applies to the .NET Languages Add-on's C# language right now. We need to work on that.

2) MergableToken is the base class you must use for a MergableSyntaxLanguage because it has some core properties that are needed like a LexicalParseFlags, ParentToken, and LexicalParseData. For mergable languages, those are used to coordinate behind the scenes transitions between languages.

If you don't need language merging, then don't inherit MergableSyntaxLanguage and make your token classes inherit TokenBase instead. TokenBase is what sits in between IToken and MergableToken in terms of implementation provided.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.