Posted 18 years ago
by Jared Phelps
Hello-
I've been evaluating v4.0, and so far I'm really liking it. This is definitely a must-purchase for me.
I am struggling a little bit with knowing how best to integrate my current code with the actipro object model. I manually wrote both a lexer and a semantic parser for my language, and obviously I'd like to change as little as possible. I already integrated my lexer with the control, but what would be your suggested approach to integrate my semantic parser? I could pattern it after the Simple Language add-on generated by the parser generator, write my own compilationunit & astnode classes, implement all the interfaces and use the visitor pattern, but that seems like a lot of work and I'm not sure what I would gain by doing so. Is there any functionality I get 'for free' (ie intelliprompt features) by using your object model instead of just plugging in calls to my existing code where applicable?
I am having trouble understanding the difference between Direct lexical state transitions and scope lexical state transitions. The example given in the documentation shows that the former would be used for ASP-style <% tags, while the latter would be used for a <script> tag. I think this means that for a direct transition, no matter what lexical state you are in in the 'current' language, the appearance of the transition token means we're going to another language. But for the scope transitions, you have to finish out the lexical state you're in before switching. So you could do this with direct but not scope:
<blah href="<%=geturl()%>">url</blah>
And you could do this with either:
<body>
<%
'code here
%>
</body>
Am I on the right track here?
As a side note, I noticed that in Documentation->Language Definition Guide->Semantic Parsing->Overview, there is this sentance: "Semantic parsing code is placed in the PerformSemanticParsing method of the Document class." This should be PerformSemanticParsing method of the SyntaxLanguageClass, shoudn't it?
In general, I'm very impressed with the documentation. It's main flaw is in the class library...while it sufficiently documents the 'what', it doesn't have any information on where a particular entity is used, why it is used, when you should use it, and how you should use it. Most of my information on individual classes has come from looking at the code in the Simple language add-on.
Thanks and keep up the good work!
Jared
[Modified at 09/07/2006 02:34 PM]
I've been evaluating v4.0, and so far I'm really liking it. This is definitely a must-purchase for me.
I am struggling a little bit with knowing how best to integrate my current code with the actipro object model. I manually wrote both a lexer and a semantic parser for my language, and obviously I'd like to change as little as possible. I already integrated my lexer with the control, but what would be your suggested approach to integrate my semantic parser? I could pattern it after the Simple Language add-on generated by the parser generator, write my own compilationunit & astnode classes, implement all the interfaces and use the visitor pattern, but that seems like a lot of work and I'm not sure what I would gain by doing so. Is there any functionality I get 'for free' (ie intelliprompt features) by using your object model instead of just plugging in calls to my existing code where applicable?
I am having trouble understanding the difference between Direct lexical state transitions and scope lexical state transitions. The example given in the documentation shows that the former would be used for ASP-style <% tags, while the latter would be used for a <script> tag. I think this means that for a direct transition, no matter what lexical state you are in in the 'current' language, the appearance of the transition token means we're going to another language. But for the scope transitions, you have to finish out the lexical state you're in before switching. So you could do this with direct but not scope:
<blah href="<%=geturl()%>">url</blah>
And you could do this with either:
<body>
<%
'code here
%>
</body>
Am I on the right track here?
As a side note, I noticed that in Documentation->Language Definition Guide->Semantic Parsing->Overview, there is this sentance: "Semantic parsing code is placed in the PerformSemanticParsing method of the Document class." This should be PerformSemanticParsing method of the SyntaxLanguageClass, shoudn't it?
In general, I'm very impressed with the documentation. It's main flaw is in the class library...while it sufficiently documents the 'what', it doesn't have any information on where a particular entity is used, why it is used, when you should use it, and how you should use it. Most of my information on individual classes has come from looking at the code in the Simple language add-on.
Thanks and keep up the good work!
Jared
[Modified at 09/07/2006 02:34 PM]