I've just found and downloaded SyntaxEditor. The first goal I had for the product was to create a language definition for a non-OO dialect of BASIC. Here is a taste of the syntax:
I have 30 years of coding experience in about 20 different languages and have served as tech editor for some published C# books, so I'm no slouch to coding. But I have to say I'm really lost with SyntaxEditor. I had no idea how complex this sort of work is - or rather, I wouldn't mind the complexity if there were better docs.
I think I just need to understand the process. Where do we start to create a new definition? In the code samples I see editor.Document.LoadLanguageFromXml() imports a <SyntaxLanguage> language definition, which is not the same as a <Grammar> definition.
I'm understanding that the XML files are only one way (dynamic?) of defining a language, where the other way (syntactical) is to define the language in code - and the only example I can find of this is the SimpleSyntaxLanguage, which encapsulates an instance of SimpleLexicalParser. Was that parser generated from the Grammar XML?
So ... we write a Grammar file by hand, generate a Lexical Parser from it, then write a FooSyntaxLanguage class, deriving and implementing some other required classes and including the generated class?
I don't understand what's supposed to happen with the Grammar designer. I see the code in DynamicallyCreateForm.cs and the code in CreateLoggingLanguage, but I don't understand what it's supposed to be doing. The docs say dynamic languages make use of XML but the DynamicLexicalState class is code - is that just a re-use of the word "dynamic"?
Call me an idiot, but as you can see there are some basic assumptions being made, and it's difficult for a newb to filter through all of this to get to those "aha" moments with this package.
Is there a cookbook anywhere that says "if you want to do X, implement Y and here is an example..."? It seems like the documentation has a lot of definitions but doesn't put many of them into context. I'm sure the docs serve as an OK reference if you know what you're doing but getting to that point seems to be pretty painful.
I've seen a suggestion in this forum about video tutorials. Maybe Actipro can invite people to a GoToMeeting or other session where we can see you create a basic parser, then add options for the editor. If it's live we can ask some (moderated) questions. If not then maybe you can just do 10 minute segments every few days and let us ask questions in the forum so that you know how to proceed with each next segment.
Thanks for your time.
! Begin the loop (comments begin with * or ! )
X = 2 ; * Comments at line end preceded by semicolon
FOR N = 1 TO 10 ; * Collapsible block here ends with NEXT
X = X * (N/2) ; * Assignment, expressions vary in complexity
GOSUB SHOW.VALUES ; * Jump to label (note indentation)
NEXT N ; * Handle like close brace
STOP ; * Simple keywords
SHOW.VALUES: * Labels denoted with colon, comment may follow
PRINT N,X ; * varying delimiters and expressions possible
RETURN ; * Handle like close brace to collapse to label
END ; * optional final token
I think I just need to understand the process. Where do we start to create a new definition? In the code samples I see editor.Document.LoadLanguageFromXml() imports a <SyntaxLanguage> language definition, which is not the same as a <Grammar> definition.
I'm understanding that the XML files are only one way (dynamic?) of defining a language, where the other way (syntactical) is to define the language in code - and the only example I can find of this is the SimpleSyntaxLanguage, which encapsulates an instance of SimpleLexicalParser. Was that parser generated from the Grammar XML?
So ... we write a Grammar file by hand, generate a Lexical Parser from it, then write a FooSyntaxLanguage class, deriving and implementing some other required classes and including the generated class?
I don't understand what's supposed to happen with the Grammar designer. I see the code in DynamicallyCreateForm.cs and the code in CreateLoggingLanguage, but I don't understand what it's supposed to be doing. The docs say dynamic languages make use of XML but the DynamicLexicalState class is code - is that just a re-use of the word "dynamic"?
Call me an idiot, but as you can see there are some basic assumptions being made, and it's difficult for a newb to filter through all of this to get to those "aha" moments with this package.
Is there a cookbook anywhere that says "if you want to do X, implement Y and here is an example..."? It seems like the documentation has a lot of definitions but doesn't put many of them into context. I'm sure the docs serve as an OK reference if you know what you're doing but getting to that point seems to be pretty painful.
I've seen a suggestion in this forum about video tutorials. Maybe Actipro can invite people to a GoToMeeting or other session where we can see you create a basic parser, then add options for the editor. If it's live we can ask some (moderated) questions. If not then maybe you can just do 10 minute segments every few days and let us ask questions in the forum so that you know how to proceed with each next segment.
Thanks for your time.