Posted 14 years ago by Matt Kerchmar
Avatar
Hello,

The getting started samples for Syntax Editor for WPF use a SimpleLanguage example. One of the files pertaining to this sample language is the SimpleTokenID.cs file. This file seems to be auto generated by the Language Designer (according to some comments within the file). But I'm not seeing any functionality within the Language Designer that exports this type of file. It contains a class which has all the token IDs from each token. This is used in the SimpleParser class to determine the type of token it is working with.

Could anyone direct me to where I can generate this code?

Also, I'm a little confused by the current state of setting up parsing. Is there an abstract syntax tree system already implemented, or is that an upcoming feature? Assuming I have fairly simple/standard requirements, what is the ideal parsing setup? Should I be looking into using ANTLR or MGrammar, or are there provisions already included in the product?

Thanks!

-Matt Kerchmar


[Modified at 01/06/2010 02:47 PM]

Comments (5)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

That file was generated back with the oldest version of the Language Designer before we really beefed it up. We haven't yet added in support for programmatic lexers to the Language Designer yet. Once we do, this sort of file will be able to be generated again.

We don't yet have a custom grammar/AST model yet. Right now were working on code outlining (folding) features, then will likely move into grammar/AST because that is the last piece that is preventing us from starting work on add-on languages. In the meantime you can use ANTLR, MGrammar or any other third party parser that you like. The only thing an IParse must do is return a parse result object that gets set to the document's ParseData property when parsing completes. But your parser can do anything you like.


Actipro Software Support

Posted 14 years ago by Mark Cunningham - Software Engineer, CNC Software, Inc.
Avatar
I'm in a similar position, looking at the SimpleTokenID class. Do you have an updated sample application that only shows what's been "beefed" up? Having sample code and version mismatch slows down users. I'm trying to piece together an application using a language I've designed with your designer. Once I have all the basic features (like intellisense) I will move onto putting a Grammar underneath generated with Irony. I was using MGrammar but the CTP license will prevent me from shipping. Also, it would be nice if the MGrammar AddOn was updated to the November CTP.
-Mark Cunningham

Mark Cunningham

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mark,

The TokenID and LexicalStateID classes are really the only things currently missing from the Language Designer that were in there before. We will be adding those back in as soon as programmatic lexer support is added to it. In the meantime, they are really just classes with a bunch of integer constants on them. So they aren't too hard to manually create.

After outlining, updating the MGrammar add-on is one thing we have planned. They made some breaking changes, which affected how the add-on did things. We haven't had a change to get it up to speed with the latest yet since code outlining features have been the priority in the past couple months. Also MGrammar now is .NET 4.0 based instead of .NET 3.5.


Actipro Software Support

Posted 14 years ago by Mark Cunningham - Software Engineer, CNC Software, Inc.
Avatar
Ok, Thanks. Starting from scratch in the last few weeks with this, it's hard to know what's old and what's not. The language designer is pretty good, and I have my DSL working nicely in that. Taking the next step, with the generated code and producing my own test app, and then adding the additional features like intellisense is difficult. The sample's seem to have a lack on consistency.

Yes, I have a .NET4 based MGrammar ready. Though I'd set that priority lower than adding other Parsers like Irony or your own.
-Mark

Mark Cunningham

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mark,

Most of our QuickStarts are designed to focus on a particular feature within a feature area. The Getting Started series is something we're going to continue growing as more feature areas are implemented. For instance, we are adding code outlining in build 514 and have added a new Getting Started series sample that shows how to add code outlining for the Simple language.

When we get to a point where we have our own grammar/AST model, we will add more samples on how to use AST data to help drive features like IntelliPrompt.


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.