Hi
Still working on my VBScript grammar, mostly working fine but I have struck a roadblock to completing the grammar.
VBScript has a rather odd way of expressing invocations :
Call MethodName(param1,param2[,paramX])
or
MethodName param1,param2[,paramX]
I tried to allow for this in the InvocationExpression Non Terminal :
<%
int startOffset = expression.StartOffset;
expression = new InvocationExpression(expression);
expression.StartOffset = startOffset;
AstNodeList argumentList = null;
bool hasParenthesis = false;
%>
['OpenParenthesis<+ hasParenthesis = true; +>' ]
[ "ArgumentList<@ out argumentList @>" ]
[<? hasParenthesis = true ?> 'CloseParenthesis']
<%
if (argumentList != null)
((InvocationExpression)expression).Arguments.AddRange(argumentList.ToArray());
expression.EndOffset = this.Token.EndOffset;
%>
However this seems to cause some sort of error loop. I used the VB.NET grammar as the basis for the grammar and I've slowly been stripping out vb.net specifics and tuning it to work with vbscript specifics. So far so good, I have global methods, variables, constants, classes (all with outlining working well) but this one has me stumped.
Any suggestions welcomed!
Regards
Vincent.
Still working on my VBScript grammar, mostly working fine but I have struck a roadblock to completing the grammar.
VBScript has a rather odd way of expressing invocations :
Call MethodName(param1,param2[,paramX])
or
MethodName param1,param2[,paramX]
I tried to allow for this in the InvocationExpression Non Terminal :
<%
int startOffset = expression.StartOffset;
expression = new InvocationExpression(expression);
expression.StartOffset = startOffset;
AstNodeList argumentList = null;
bool hasParenthesis = false;
%>
['OpenParenthesis<+ hasParenthesis = true; +>' ]
[ "ArgumentList<@ out argumentList @>" ]
[<? hasParenthesis = true ?> 'CloseParenthesis']
<%
if (argumentList != null)
((InvocationExpression)expression).Arguments.AddRange(argumentList.ToArray());
expression.EndOffset = this.Token.EndOffset;
%>
However this seems to cause some sort of error loop. I used the VB.NET grammar as the basis for the grammar and I've slowly been stripping out vb.net specifics and tuning it to work with vbscript specifics. So far so good, I have global methods, variables, constants, classes (all with outlining working well) but this one has me stumped.
Any suggestions welcomed!
Regards
Vincent.