Hi again,
I have an uncommon question and obviously didn't understand how Semantic and Lexical parsing work in case of Dynamic language.Thanks for post from yesterday I'll try to solve it later :).Lets consider following situation :
1.I have built dynamic VB like syntax language (using XML document)
2.I want to do Lexical parsing similar to this example code :just to have my tokens back from the method call (is this right?Am I getting tokens from calling this method?)
3.Now if get tokens back when I call PerformLexicalParse I can call PerformSemanticParse
like this :4.Now I already implemented interface ISemanticParseDataTarget in my form (this is just for test proposes only I'll migrate it to some Class Library :) ) and I expect to breakpoint in method :
be triggered (and it is) but in body of method there is nothing usefull for me because compilationUnit is always null.
I'm doing this because I want to map this VB like syntax to C# code in order to make some assembly in runtime or whatever but point is I cant get compilation unit != null and furthermore Ast from compilation unit.
Please tell me if I am right for this simple scenario here.Should I change something in my code to make it work?
By the way I want this process of Lexical + Semantic parsing start when I click on some button on form but it is not so important right now.
I already read post located here :
http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=3649 but I don't understand how to actually call some kind of custom Semantic parser (in case of this post it is XmlSemanticParser defined in method).
Otherwise if steps above are not applicable in my case I just wonder how can I get simple output or result when doing Lexical + Semantic parsing in runtime at certain moment?
It would be really nice to nice if you can provide me some short code snippets in steps how can I achieve this.One more time THIS IS IN CASE OF DYNAMIC LANGUAGE!
Thanks for help again in advance.
Best regards,
Civa
I have an uncommon question and obviously didn't understand how Semantic and Lexical parsing work in case of Dynamic language.Thanks for post from yesterday I'll try to solve it later :).Lets consider following situation :
1.I have built dynamic VB like syntax language (using XML document)
2.I want to do Lexical parsing similar to this example code :
base.PerformLexicalParse(doc, new TextRange(0, doc.Length), target);
3.Now if get tokens back when I call PerformLexicalParse I can call PerformSemanticParse
like this :
public override void PerformSemanticParse(Document document, TextRange parseTextRange, SemanticParseFlags flags)
{
rq = new SemanticParserServiceRequest(SemanticParserServiceRequest.HighPriority,
document, parseTextRange, flags, this, document);
SemanticParserService.Parse(rq);
}
public void NotifySemanticParseComplete(SemanticParserServiceRequest request)
{
ICompilationUnit compilationUnit = (ICompilationUnit)request.SemanticParseData;
}
I'm doing this because I want to map this VB like syntax to C# code in order to make some assembly in runtime or whatever but point is I cant get compilation unit != null and furthermore Ast from compilation unit.
Please tell me if I am right for this simple scenario here.Should I change something in my code to make it work?
By the way I want this process of Lexical + Semantic parsing start when I click on some button on form but it is not so important right now.
I already read post located here :
http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=3649 but I don't understand how to actually call some kind of custom Semantic parser (in case of this post it is XmlSemanticParser defined in method
protected override object PerformSemanticParse(MergableLexicalParserManager manager)
Otherwise if steps above are not applicable in my case I just wonder how can I get simple output or result when doing Lexical + Semantic parsing in runtime at certain moment?
It would be really nice to nice if you can provide me some short code snippets in steps how can I achieve this.One more time THIS IS IN CASE OF DYNAMIC LANGUAGE!
Thanks for help again in advance.
Best regards,
Civa