Posted 12 years ago by tobias weltner
Version: 4.0.0239
Avatar
I am currently switching from v3x to v4 and exploring the new static languages. 3 questions:
1. When I open the sample grammar app. load "simple" language grammar and create the code using the parser generator, I get c# code. when I change the output language to "vb.net", I get a couple of "using" instead of "include" at the top, but all the rest of the code remains c#. What am I doing wrong?
2. The capabilities of static languages seem to be mind blowing cool! However, I am experiencing extreme difficulties finding my way into it using the very limited documentation. Are there any other resources or even samples I could use? Would you recommend licensing the .NET addons in order to get more working examples?
3. I just installed SE4.0 on a Vista machine and licensed it. However, when I launch the sample apps, I still get an "unlicensed" splash. Are there any known issues with Vista, or am I missing something?

Great job, 4.0 seems to be a major major step forward! If there only was more documentation on static language creation...!

It would be very helpful to have a simple example app that does nothing more than loading a static language with the absolute core functionality as well as a step-by-step guide on how to create the parser for it using your excellent grammar/parser generator. This way, it would be much easier to start exploring the grammar and defining test languages in trial-and-error-mode ;-) Currently, I simply struggle finding out which files make up the language and how to create these.

I'll now try and strip down your sample app so I won't get distracted by all the other cool features while trying to understand the mechanics of your AST implementation... again, cool job!

Comments (8)

Posted 12 years ago by tobias weltner
Avatar
Forget question 1, I specified "vb.net" instead of "VB". The grammar tool seems to fall back to c# when it does not understand a language directive. ;-)
Posted 12 years ago by tobias weltner
Avatar
The licensing issue seems to be resolved, too. It applies to the .net addons only. The editor seems to be licensed.

However, while experimenting with the new grammar, when creating vb.net code, it seems to be at least partially be mixed with c# code.

I apologize for any stupid questions I may have asked (or still am asking) ;-) however it is really hard to find my way in the new 4.0 world.
I still have numerous compilation errors and warnings but will shut up for the moment and try.
I just wished there was one simple demo app that did nothing more than read in the output I generate with the parser generator. When I exchange the parser files generated with those delivered with your sample app, I fail.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tobias,

Since some user code is added to the grammar (that is what you see), it needs to be written in C# or VB. In the Simple language grammar file in the C# sample project, the user code is written in C#. In the Simple language grammar file in the VB sample project, the user code is written in VB. So just switch to the other grammar to get VB output.

The Grammar Designer output for the Simple language should be identical to what is packaged. However with the above issue (you using the wrong language variation), that will definitely cause issues since you are mixing two languages together.

A good way to test your own language is to write your language code in a separate assembly. Then in the SDI Editor sample there is a menu item on the Languages menu to load a custom add-on. There you just select your custom assembly and can test out the SyntaxLanguage that it finds in there.


Actipro Software Support

Posted 12 years ago by tobias weltner
Avatar
Thanks, I'll try that! Sorry for my stupid questions ;-) I guess I get overwhelmed by all the new stuff right now and will try a nice and simple starter app just like you suggest.

I did notice that in the lexical parser, you use constants for the base token types. Would it be a huge penalty to use small classes for those base tokens?
You differentiated token types by id ranges which is ok but hard to maintain. I was thinking of using a small class for each base token adding additional id properties that tell which kind of base token it is and use that for assigning highlighting styles etc. I am just wondering if your use of constants was done for speed reasons...
Posted 12 years ago by tobias weltner
Avatar
Ok, I outputted the results from the grammar app into one file and loaded this into a VS Library project in order to compile a DLL which I *thought* I could then feed to the sample app.

However, this resulted in hundreds of errors due to missing references.
I added SyntaxEditor and the base file to the reference list but were still unable to compile.

I start feeling like a real dummy now. I have created sophisticated commercial apps like "SystemScripter" and "PowerShellIDE" using syntaxeditor 3 and always loved it. For now, though, I give up and grab a beer.

A quick suggestion for the grammar app: why couldn't this app simply create a VS project with all the necessary files and references to open it up in VS and compile? Should be no effort and would prevent dummies like me from complaining ;-)

Cheers,
tob
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
In v4.0 you can implement tokens however you want. It's completely generic. So as long as you provide a couple base things like offset ranges and an ID, you can do whatever you'd like.

The ID's do make parsing fastest and are required for use with the semantic parser.

If you would simply copy the sample's "Languages\SimpleAddon" folder (and its child folders) to another folder and would place it in its own project, it should compile just fine as its own assembly. I don't think it needs any other code, other than the Shared/WinUICore/SyntaxEditor assembly references of course. If you are having trouble then please post error messages.


Actipro Software Support

Posted 12 years ago by tobias weltner
Avatar
Thanks for your reply.
When I do that, I get numerous errors such as: type "Actiprosoftware.SyntaxEditor.AstNodeBase" not found
I did include references to SyntaxEditor and the shared code base including WinUICore. I can view AstNodeBase using object explorer.
Your sample app compiles just fine.
What am I missing? Should I send you the project?
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That class is included in the SyntaxEditor assembly. So either your VB project isn't pulling in the necessary namespaces or you are still referencing the v3.1 assembly.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.