|
|
|
@ -514,7 +514,8 @@ ImportClause<out Using u> |
|
|
|
NamespaceMemberDecl |
|
|
|
NamespaceMemberDecl |
|
|
|
(. |
|
|
|
(. |
|
|
|
Modifiers m = new Modifiers(); |
|
|
|
Modifiers m = new Modifiers(); |
|
|
|
AttributeSection section;List<AttributeSection> attributes = new List<AttributeSection>(); |
|
|
|
AttributeSection section; |
|
|
|
|
|
|
|
List<AttributeSection> attributes = new List<AttributeSection>(); |
|
|
|
string qualident; |
|
|
|
string qualident; |
|
|
|
.) = |
|
|
|
.) = |
|
|
|
"Namespace" |
|
|
|
"Namespace" |
|
|
|
@ -635,6 +636,7 @@ NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes> |
|
|
|
compilationUnit.AddChild(newType); |
|
|
|
compilationUnit.AddChild(newType); |
|
|
|
compilationUnit.BlockStart(newType); |
|
|
|
compilationUnit.BlockStart(newType); |
|
|
|
newType.StartLocation = t.Location; |
|
|
|
newType.StartLocation = t.Location; |
|
|
|
|
|
|
|
System.Console.WriteLine("XXX " + t.Location.ToString()); |
|
|
|
newType.Type = Types.Struct; |
|
|
|
newType.Type = Types.Struct; |
|
|
|
.) |
|
|
|
.) |
|
|
|
Identifier (. newType.Name = t.val; .) |
|
|
|
Identifier (. newType.Name = t.val; .) |
|
|
|
@ -1194,6 +1196,7 @@ StructureMemberDecl<Modifiers m, List<AttributeSection> attributes> |
|
|
|
| |
|
|
|
| |
|
|
|
"Custom" (. Point startPos = t.Location; .) "Event" |
|
|
|
"Custom" (. Point startPos = t.Location; .) "Event" |
|
|
|
(. |
|
|
|
(. |
|
|
|
|
|
|
|
m.Check(Modifier.VBCustomEvents); |
|
|
|
EventAccessorDeclaration eventAccessorDeclaration; |
|
|
|
EventAccessorDeclaration eventAccessorDeclaration; |
|
|
|
EventAccessorDeclaration addHandlerAccessorDeclaration = null; |
|
|
|
EventAccessorDeclaration addHandlerAccessorDeclaration = null; |
|
|
|
EventAccessorDeclaration removeHandlerAccessorDeclaration = null; |
|
|
|
EventAccessorDeclaration removeHandlerAccessorDeclaration = null; |
|
|
|
@ -1240,9 +1243,113 @@ StructureMemberDecl<Modifiers m, List<AttributeSection> attributes> |
|
|
|
|
|
|
|
|
|
|
|
CustomEventDeclaration decl = new CustomEventDeclaration(m.Modifier, attributes, customEventName, addHandlerAccessorDeclaration, removeHandlerAccessorDeclaration, raiseEventAccessorDeclaration, implementsClause); |
|
|
|
CustomEventDeclaration decl = new CustomEventDeclaration(m.Modifier, attributes, customEventName, addHandlerAccessorDeclaration, removeHandlerAccessorDeclaration, raiseEventAccessorDeclaration, implementsClause); |
|
|
|
decl.StartLocation = startPos; |
|
|
|
decl.StartLocation = startPos; |
|
|
|
decl.StartLocation = t.EndLocation; |
|
|
|
decl.EndLocation = t.EndLocation; |
|
|
|
compilationUnit.AddChild(decl); |
|
|
|
compilationUnit.AddChild(decl); |
|
|
|
.) |
|
|
|
.) |
|
|
|
|
|
|
|
| /* UnaryOperatorDeclaration */ |
|
|
|
|
|
|
|
"Operator" |
|
|
|
|
|
|
|
(. |
|
|
|
|
|
|
|
m.Check(Modifier.VBOperators); |
|
|
|
|
|
|
|
Point startPos = t.Location; |
|
|
|
|
|
|
|
TypeReference returnType = NullTypeReference.Instance; |
|
|
|
|
|
|
|
TypeReference operandType = NullTypeReference.Instance; |
|
|
|
|
|
|
|
string operandName; |
|
|
|
|
|
|
|
OverloadableOperatorType operatorType; |
|
|
|
|
|
|
|
AttributeSection section; |
|
|
|
|
|
|
|
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(); |
|
|
|
|
|
|
|
List<AttributeSection> returnTypeAttributes = new List<AttributeSection>(); |
|
|
|
|
|
|
|
.) |
|
|
|
|
|
|
|
OverloadableOperator<out operatorType> |
|
|
|
|
|
|
|
"(" [ "ByVal" ] Identifier (. operandName = t.val; .) |
|
|
|
|
|
|
|
[ "As" TypeName<out operandType> ] |
|
|
|
|
|
|
|
(. parameters.Add(new ParameterDeclarationExpression(operandType, operandName, ParamModifier.In)); .) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"," |
|
|
|
|
|
|
|
[ "ByVal" ] Identifier (. operandName = t.val; .) |
|
|
|
|
|
|
|
[ "As" TypeName<out operandType> ] |
|
|
|
|
|
|
|
(. parameters.Add(new ParameterDeclarationExpression(operandType, operandName, ParamModifier.In)); .) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
")" |
|
|
|
|
|
|
|
[ "As" { AttributeSection<out section> (. returnTypeAttributes.Add(section); .) } TypeName<out returnType> EOL ] |
|
|
|
|
|
|
|
Block<out stmt> "End" "Operator" EOL |
|
|
|
|
|
|
|
(. |
|
|
|
|
|
|
|
OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier, |
|
|
|
|
|
|
|
attributes, |
|
|
|
|
|
|
|
parameters, |
|
|
|
|
|
|
|
returnType, |
|
|
|
|
|
|
|
operatorType |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
operatorDeclaration.ConvertToType = returnType; |
|
|
|
|
|
|
|
operatorDeclaration.ReturnTypeAttributes = returnTypeAttributes; |
|
|
|
|
|
|
|
operatorDeclaration.Body = (BlockStatement)stmt; |
|
|
|
|
|
|
|
operatorDeclaration.StartLocation = startPos; |
|
|
|
|
|
|
|
operatorDeclaration.EndLocation = t.EndLocation; |
|
|
|
|
|
|
|
compilationUnit.AddChild(operatorDeclaration); |
|
|
|
|
|
|
|
.) |
|
|
|
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OverloadableOperator<out OverloadableOperatorType operatorType> |
|
|
|
|
|
|
|
(. operatorType = OverloadableOperatorType.None; .) |
|
|
|
|
|
|
|
= |
|
|
|
|
|
|
|
"+" (. operatorType = OverloadableOperatorType.Add; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"-" (. operatorType = OverloadableOperatorType.Subtract; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"*" (. operatorType = OverloadableOperatorType.Multiply; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"/" (. operatorType = OverloadableOperatorType.Divide; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"\\" (. operatorType = OverloadableOperatorType.DivideInteger; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"&" (. operatorType = OverloadableOperatorType.Concat; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"Like" (. operatorType = OverloadableOperatorType.Like; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"Mod" (. operatorType = OverloadableOperatorType.Modulus; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"And" (. operatorType = OverloadableOperatorType.BitwiseAnd; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"Or" (. operatorType = OverloadableOperatorType.BitwiseOr; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"Xor" (. operatorType = OverloadableOperatorType.ExclusiveOr; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"^" (. operatorType = OverloadableOperatorType.Power; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"<<" (. operatorType = OverloadableOperatorType.ShiftLeft; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
">>" (. operatorType = OverloadableOperatorType.ShiftRight; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"=" (. operatorType = OverloadableOperatorType.Equality; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"<>" (. operatorType = OverloadableOperatorType.InEquality; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"<" (. operatorType = OverloadableOperatorType.LessThan; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"<=" (. operatorType = OverloadableOperatorType.LessThanOrEqual; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
">" (. operatorType = OverloadableOperatorType.GreaterThan; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
">=" (. operatorType = OverloadableOperatorType.GreaterThanOrEqual; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
"CType" (. operatorType = OverloadableOperatorType.CType; .) |
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
Identifier |
|
|
|
|
|
|
|
(. |
|
|
|
|
|
|
|
string opName = t.val; |
|
|
|
|
|
|
|
switch(opName.ToLower()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case "istrue": |
|
|
|
|
|
|
|
operatorType = OverloadableOperatorType.IsTrue; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "isfalse": |
|
|
|
|
|
|
|
operatorType = OverloadableOperatorType.IsFalse; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
Error("Invalid operator. Possible operators are '+', '-', 'Not', 'IsTrue', 'IsFalse'."); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.) |
|
|
|
. |
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
EventAccessorDeclaration<out EventAccessorDeclaration eventAccessorDeclaration> |
|
|
|
EventAccessorDeclaration<out EventAccessorDeclaration eventAccessorDeclaration> |
|
|
|
@ -2854,6 +2961,8 @@ MemberModifier<Modifiers m> = |
|
|
|
| "WriteOnly" (. /* m.Add(Modifier.WriteOnly); */ .) |
|
|
|
| "WriteOnly" (. /* m.Add(Modifier.WriteOnly); */ .) |
|
|
|
| "WithEvents" (.m.Add(Modifier.WithEvents);.) |
|
|
|
| "WithEvents" (.m.Add(Modifier.WithEvents);.) |
|
|
|
| "Dim" (.m.Add(Modifier.Dim);.) |
|
|
|
| "Dim" (.m.Add(Modifier.Dim);.) |
|
|
|
|
|
|
|
| "Widening" (.m.Add(Modifier.Widening);.) |
|
|
|
|
|
|
|
| "Narrowing" (.m.Add(Modifier.Narrowing);.) |
|
|
|
. |
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
END VBNET. |
|
|
|
END VBNET. |
|
|
|
|