コード例 #1
0
 public PropertyDeclaration(string name, TypeReference typeReference, Modifier modifier, ArrayList attributes)
 {
     this.name = name;
     this.typeReference = typeReference;
     this.modifier = modifier;
     this.attributes = attributes;
 }
コード例 #2
0
 public CatchClause(TypeReference type, string variableName, Statement statementBlock, Expression condition)
 {
     this.type = type;
     this.variableName = variableName;
     this.statementBlock = statementBlock;
     this.condition = condition;
 }
コード例 #3
0
 public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParamModifiers paramModifiers, Expression defaultValue)
 {
     this.typeReference = typeReference;
     this.parameterName = parameterName;
     this.paramModifiers = paramModifiers;
     this.attributes = attributes;
     this.defaultValue = defaultValue;
 }
コード例 #4
0
 public MethodDeclaration(string name, Modifier modifier, TypeReference typeReference, ArrayList parameters, ArrayList attributes)
 {
     this.name = name;
     this.modifier = modifier;
     this.typeReference = typeReference;
     this.parameters = parameters;
     this.attributes = attributes;
 }
コード例 #5
0
 public EventDeclaration(TypeReference typeReference, Modifier modifier, ArrayList parameters, ArrayList attributes, string name, ImplementsClause implementsClause)
 {
     this.typeReference = typeReference;
     this.modifier = modifier;
     this.parameters = parameters;
     this.attributes = attributes;
     this.name = name;
     this.implementsClause = implementsClause;
 }
コード例 #6
0
 public DeclareDeclaration(string name, Modifier modifier, TypeReference returnType, ArrayList parameters, ArrayList attributes, string library, string alias, CharsetModifier charset)
 {
     this.name = name;
     this.modifier = modifier;
     this.returnType = returnType;
     this.parameters = parameters;
     this.attributes = attributes;
     this.library = library;
     this.alias = alias;
     this.charset = charset;
 }
コード例 #7
0
 public void AddVariable(TypeReference typeRef, string name, Point startPos, Point endPos)
 {
     if (name == null || name.Length == 0) {
         return;
     }
     name = name.ToLower();
     ArrayList list;
     if (variables[name] == null) {
         variables[name] = list = new ArrayList();
     } else {
         list = (ArrayList)variables[name];
     }
     list.Add(new LocalLookupVariable(typeRef, startPos, endPos));
 }
コード例 #8
0
        public string Convert(TypeReference typeRef)
        {
            StringBuilder builder = new StringBuilder();
            builder.Append(ConvType(typeRef.Type));

            if (typeRef.RankSpecifier != null) {
                for (int i = 0; i < typeRef.RankSpecifier.Count; ++i) {
                    builder.Append('[');
                    for (int j = 1; j < (int)typeRef.RankSpecifier[i]; ++j) {
                        builder.Append(',');
                    }
                    builder.Append(']');
                }
            }

            return builder.ToString();
        }
コード例 #9
0
	void NonArrayTypeName(
#line  1782 "VBNET.ATG" 
out TypeReference typeref) {

#line  1784 "VBNET.ATG" 
		string name;
		typeref = null;
		
		if (StartOf(9)) {
			Qualident(
#line  1787 "VBNET.ATG" 
out name);

#line  1787 "VBNET.ATG" 
			typeref = new TypeReference(name); 
		} else if (la.kind == 134) {
			lexer.NextToken();

#line  1788 "VBNET.ATG" 
			typeref = new TypeReference("System.Object"); 
		} else if (StartOf(25)) {
			PrimitiveTypeName(
#line  1789 "VBNET.ATG" 
out name);

#line  1789 "VBNET.ATG" 
			typeref = new TypeReference(name); 
		} else SynErr(224);
	}
コード例 #10
0
	void CastTarget(
#line  1563 "VBNET.ATG" 
out TypeReference type) {

#line  1565 "VBNET.ATG" 
		type = null;
		
		switch (la.kind) {
		case 60: {
			lexer.NextToken();

#line  1567 "VBNET.ATG" 
			type = new TypeReference("System.Boolean"); 
			break;
		}
		case 61: {
			lexer.NextToken();

#line  1568 "VBNET.ATG" 
			type = new TypeReference("System.Byte"); 
			break;
		}
		case 62: {
			lexer.NextToken();

#line  1569 "VBNET.ATG" 
			type = new TypeReference("System.Char"); 
			break;
		}
		case 63: {
			lexer.NextToken();

#line  1570 "VBNET.ATG" 
			type = new TypeReference("System.DateTime"); 
			break;
		}
		case 65: {
			lexer.NextToken();

#line  1571 "VBNET.ATG" 
			type = new TypeReference("System.Decimal"); 
			break;
		}
		case 64: {
			lexer.NextToken();

#line  1572 "VBNET.ATG" 
			type = new TypeReference("System.Double"); 
			break;
		}
		case 67: {
			lexer.NextToken();

#line  1573 "VBNET.ATG" 
			type = new TypeReference("System.Int32"); 
			break;
		}
		case 69: {
			lexer.NextToken();

#line  1574 "VBNET.ATG" 
			type = new TypeReference("System.Int64"); 
			break;
		}
		case 70: {
			lexer.NextToken();

#line  1575 "VBNET.ATG" 
			type = new TypeReference("System.Object"); 
			break;
		}
		case 73: {
			lexer.NextToken();

#line  1576 "VBNET.ATG" 
			type = new TypeReference("System.Int16"); 
			break;
		}
		case 74: {
			lexer.NextToken();

#line  1577 "VBNET.ATG" 
			type = new TypeReference("System.Single"); 
			break;
		}
		case 75: {
			lexer.NextToken();

#line  1578 "VBNET.ATG" 
			type = new TypeReference("System.String"); 
			break;
		}
		default: SynErr(221); break;
		}
	}
コード例 #11
0
	void ArrayTypeName(
#line  1770 "VBNET.ATG" 
out TypeReference typeref) {

#line  1772 "VBNET.ATG" 
		ArrayList rank = null;
		
		NonArrayTypeName(
#line  1774 "VBNET.ATG" 
out typeref);
		ArrayInitializationModifiers(
#line  1775 "VBNET.ATG" 
out rank);

#line  1777 "VBNET.ATG" 
		typeref = new TypeReference(typeref == null ? "UNKNOWN" : typeref.Type, rank);
		
	}
コード例 #12
0
 public TypeReferenceExpression(string type)
 {
     this.typeReference = new TypeReference(type);
 }
コード例 #13
0
	void InterfaceMemberDecl() {

#line  760 "VBNET.ATG" 
		TypeReference type =null;
		ArrayList p = null;
		AttributeSection section;
		Modifiers mod = new Modifiers(this);
		ArrayList attributes = new ArrayList();
		/*ArrayList parameters = new ArrayList();*/
		string name;
		
		if (StartOf(12)) {
			while (la.kind == 28) {
				AttributeSection(
#line  768 "VBNET.ATG" 
out section);

#line  768 "VBNET.ATG" 
				attributes.Add(section); 
			}
			while (StartOf(6)) {
				MemberModifier(
#line  772 "VBNET.ATG" 
mod);
			}
			if (la.kind == 94) {
				lexer.NextToken();

#line  775 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceEvents); 
				Identifier();

#line  776 "VBNET.ATG" 
				name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  777 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  778 "VBNET.ATG" 
out type);
				}
				Expect(1);

#line  781 "VBNET.ATG" 
				EventDeclaration ed = new EventDeclaration(type, mod.Modifier, p, attributes, name, null);
				ed.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				compilationUnit.AddChild(ed);
				ed.EndLocation = t.EndLocation;
				
			} else if (la.kind == 169) {
				lexer.NextToken();

#line  789 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceMethods);
				ArrayList comments = lexer.SpecialTracker.RetreiveComments();
				
				Identifier();

#line  792 "VBNET.ATG" 
				name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  793 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				Expect(1);

#line  796 "VBNET.ATG" 
				MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, null, p, attributes);
				md.Specials["before"] = comments;
				md.EndLocation = t.EndLocation;
				compilationUnit.AddChild(md);
				
			} else if (la.kind == 101) {
				lexer.NextToken();

#line  804 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceMethods);
				AttributeSection attributeSection = null;
				
				Identifier();

#line  807 "VBNET.ATG" 
				name = t.val; 
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  808 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					if (la.kind == 28) {
						AttributeSection(
#line  809 "VBNET.ATG" 
out attributeSection);
					}
					TypeName(
#line  809 "VBNET.ATG" 
out type);
				}

#line  811 "VBNET.ATG" 
				if(type == null) {
				type = new TypeReference("System.Object");
				}
				type.Attributes = attributeSection;
				MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, type, p, attributes);
				md.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				md.EndLocation = t.EndLocation;
				compilationUnit.AddChild(md);
				
				Expect(1);
			} else if (la.kind == 148) {
				lexer.NextToken();

#line  824 "VBNET.ATG" 
				mod.Check(Modifier.InterfaceProperties);
				ArrayList comments = lexer.SpecialTracker.RetreiveComments();
				
				Identifier();

#line  827 "VBNET.ATG" 
				name = t.val;  
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  828 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  829 "VBNET.ATG" 
out type);
				}

#line  831 "VBNET.ATG" 
				if(type == null) {
				type = new TypeReference("System.Object");
				}
				
				Expect(1);

#line  837 "VBNET.ATG" 
				PropertyDeclaration pd = new PropertyDeclaration(name, type, mod.Modifier, attributes);
				pd.Parameters = p;
				pd.Specials["before"] = comments;
				pd.EndLocation = t.EndLocation;
				compilationUnit.AddChild(pd);
				
			} else SynErr(208);
		} else if (StartOf(13)) {
			NonModuleDeclaration(
#line  845 "VBNET.ATG" 
mod, attributes);
		} else SynErr(209);
	}
コード例 #14
0
 public LocalLookupVariable(TypeReference typeRef, Point startPos, Point endPos)
 {
     this.typeRef = typeRef;
     this.startPos = startPos;
     this.endPos = endPos;
 }
コード例 #15
0
 // for all other cases
 public FieldDeclaration(ArrayList attributes, TypeReference typeReference, Modifier modifier)
 {
     this.attributes    = attributes;
     this.typeReference = typeReference;
     this.modifier      = modifier;
 }
コード例 #16
0
 public TypeOfExpression(Expression expression, TypeReference type)
 {
     this.type = type;
     this.expression = expression;
 }
コード例 #17
0
 public ArrayCreateExpression(TypeReference createType, ArrayInitializerExpression arrayInitializer)
 {
     this.createType = createType;
     this.arrayInitializer = arrayInitializer;
 }
コード例 #18
0
 public virtual object Visit(TypeReference typeReference, object data)
 {
     return data;
 }
コード例 #19
0
        string GetTypeString(TypeReference typeRef)
        {
            if (typeRef == null) {
                return "void";
            }

            string typeStr = ConvertTypeString(typeRef.Type);

            StringBuilder arrays = new StringBuilder();

            if (typeRef.RankSpecifier != null) {
                for (int i = 0; i < typeRef.RankSpecifier.Count; ++i) {
                    arrays.Append("[");
                    arrays.Append(new String(',', (int)typeRef.RankSpecifier[i]));
                    arrays.Append("]");
                }
            } else {
                if (typeRef.Dimension != null) {
                    arrays.Append("[");
                    if (typeRef.Dimension.Count > 0) {
                        arrays.Append(new String(',', typeRef.Dimension.Count - 1));
                    }
                    arrays.Append("]");
                }
            }

            return typeStr + arrays.ToString();
        }
コード例 #20
0
 public CastExpression(TypeReference castTo, Expression expression)
 {
     this.castTo = castTo;
     this.expression = expression;
 }
コード例 #21
0
 public CastExpression(TypeReference castTo, Expression expression, bool isSpecializedCast)
 {
     this.castTo = castTo;
     this.expression = expression;
     this.isSpecializedCast = isSpecializedCast;
 }
コード例 #22
0
 public TypeReferenceExpression(TypeReference  typeReference)
 {
     this.typeReference = typeReference;
 }
コード例 #23
0
	void FormalParameter(
#line  1971 "VBNET.ATG" 
out ParameterDeclarationExpression p) {

#line  1973 "VBNET.ATG" 
		TypeReference type = null;
		ParamModifiers mod = new ParamModifiers(this);
		Expression expr = null;
		p = null;
		ArrayList arrayModifiers = null;
		
		while (StartOf(26)) {
			ParameterModifier(
#line  1979 "VBNET.ATG" 
mod);
		}
		Identifier();

#line  1980 "VBNET.ATG" 
		string parameterName = t.val; 
		if (
#line  1981 "VBNET.ATG" 
IsRank()) {
			ArrayTypeModifiers(
#line  1981 "VBNET.ATG" 
out arrayModifiers);
		}
		if (la.kind == 49) {
			lexer.NextToken();
			TypeName(
#line  1982 "VBNET.ATG" 
out type);
		}

#line  1984 "VBNET.ATG" 
		if(type != null) {
		if (arrayModifiers != null) {
			if (type.RankSpecifier != null) {
				Error("array rank only allowed one time");
			} else {
				type.RankSpecifier = arrayModifiers;
			}
		}
		} else {
			type = new TypeReference("System.Object", arrayModifiers);
		}
		
		if (la.kind == 11) {
			lexer.NextToken();
			Expr(
#line  1996 "VBNET.ATG" 
out expr);
		}

#line  1998 "VBNET.ATG" 
		mod.Check();
		p = new ParameterDeclarationExpression(type, parameterName, mod, expr);
		
	}
コード例 #24
0
 public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParamModifiers paramModifiers)
 {
     this.typeReference  = typeReference;
     this.parameterName  = parameterName;
     this.paramModifiers = paramModifiers;
 }
コード例 #25
0
	void LoopControlVariable(
#line  2320 "VBNET.ATG" 
out LoopControlVariableExpression loopExpr) {

#line  2322 "VBNET.ATG" 
		loopExpr = null;
		//Expression expr = null;
		TypeReference type = null;
		ArrayList arrayModifiers = null;
		string name;
		
		Qualident(
#line  2328 "VBNET.ATG" 
out name);
		if (
#line  2329 "VBNET.ATG" 
IsRank()) {
			ArrayTypeModifiers(
#line  2329 "VBNET.ATG" 
out arrayModifiers);
		}
		if (la.kind == 49) {
			lexer.NextToken();
			TypeName(
#line  2330 "VBNET.ATG" 
out type);

#line  2330 "VBNET.ATG" 
			if (name.IndexOf('.') > 0) { Error("No type def for 'for each' member indexer allowed."); } 
		}

#line  2332 "VBNET.ATG" 
		if(type != null) {
		if(type.RankSpecifier != null && arrayModifiers != null) {
			Error("array rank only allowed one time");
		} else {
			type.RankSpecifier = arrayModifiers;
		}
		} else {
			type = new TypeReference("Integer", arrayModifiers);
		}
		loopExpr = new LoopControlVariableExpression(name, type);
		
	}
コード例 #26
0
	void TypeName(
#line  1758 "VBNET.ATG" 
out TypeReference typeref) {

#line  1760 "VBNET.ATG" 
		ArrayList rank = null;
		
		NonArrayTypeName(
#line  1762 "VBNET.ATG" 
out typeref);
		ArrayTypeModifiers(
#line  1763 "VBNET.ATG" 
out rank);

#line  1765 "VBNET.ATG" 
		typeref = new TypeReference(typeref == null ? "UNKNOWN" : typeref.Type, rank);
		
	}
コード例 #27
0
        ArrayList parameters = null; // Expressions

        #endregion Fields

        #region Constructors

        public ArrayCreateExpression(TypeReference createType, ArrayList parameters)
        {
            this.createType = createType;
            this.parameters = parameters;
        }
コード例 #28
0
	void StructureMemberDecl(
#line  884 "VBNET.ATG" 
Modifiers m, ArrayList attributes) {

#line  886 "VBNET.ATG" 
		TypeReference type = null;
		ArrayList p = null;
		Statement stmt = null;
		ArrayList variableDeclarators = new ArrayList();
		
		switch (la.kind) {
		case 68: case 81: case 91: case 113: case 122: case 168: {
			NonModuleDeclaration(
#line  891 "VBNET.ATG" 
m, attributes);
			break;
		}
		case 169: {
			lexer.NextToken();

#line  895 "VBNET.ATG" 
			Point startPos = t.Location;
			ArrayList comments = lexer.SpecialTracker.RetreiveComments();
			
			if (StartOf(9)) {

#line  900 "VBNET.ATG" 
				string name = String.Empty;
				MethodDeclaration methodDeclaration;
				HandlesClause handlesClause = null;
				ImplementsClause implementsClause = null;
				
				Identifier();

#line  907 "VBNET.ATG" 
				name = t.val;
				m.Check(Modifier.Methods);
				
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  910 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 106 || la.kind == 108) {
					if (la.kind == 108) {
						ImplementsClause(
#line  913 "VBNET.ATG" 
out implementsClause);
					} else {
						HandlesClause(
#line  915 "VBNET.ATG" 
out handlesClause);
					}
				}

#line  918 "VBNET.ATG" 
				Point endLocation = t.EndLocation; 
				Expect(1);
				if (
#line  922 "VBNET.ATG" 
IsMustOverride(m)) {

#line  924 "VBNET.ATG" 
					methodDeclaration = new MethodDeclaration(name, m.Modifier,  null, p, attributes);
					methodDeclaration.Specials["before"] = comments;
					methodDeclaration.StartLocation = startPos;
					methodDeclaration.EndLocation   = endLocation;
					
					methodDeclaration.HandlesClause = handlesClause;
					methodDeclaration.ImplementsClause = implementsClause;
					
					compilationUnit.AddChild(methodDeclaration);
					
				} else if (StartOf(10)) {

#line  936 "VBNET.ATG" 
					methodDeclaration = new MethodDeclaration(name, m.Modifier,  null, p, attributes);
					methodDeclaration.Specials["before"] = comments;
					methodDeclaration.StartLocation = startPos;
					methodDeclaration.EndLocation   = endLocation;
					
					methodDeclaration.HandlesClause = handlesClause;
					methodDeclaration.ImplementsClause = implementsClause;
					
					compilationUnit.AddChild(methodDeclaration);
					compilationUnit.BlockStart(methodDeclaration);
					
					Block(
#line  947 "VBNET.ATG" 
out stmt);

#line  949 "VBNET.ATG" 
					compilationUnit.BlockEnd();
					methodDeclaration.Body  = (BlockStatement)stmt;
					
					Expect(89);
					Expect(169);

#line  952 "VBNET.ATG" 
					methodDeclaration.Body.EndLocation = t.EndLocation; 
					Expect(1);
				} else SynErr(201);
			} else if (la.kind == 128) {
				lexer.NextToken();
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  955 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}

#line  956 "VBNET.ATG" 
				m.Check(Modifier.Constructors); 

#line  957 "VBNET.ATG" 
				Point constructorEndLocation = t.EndLocation; 
				Expect(1);
				Block(
#line  959 "VBNET.ATG" 
out stmt);
				Expect(89);
				Expect(169);

#line  960 "VBNET.ATG" 
				Point endLocation = t.EndLocation; 
				Expect(1);

#line  962 "VBNET.ATG" 
				ConstructorDeclaration cd = new ConstructorDeclaration("New", m.Modifier, p, attributes); 
				cd.StartLocation = startPos;
				cd.Specials["before"] = comments;
				cd.EndLocation   = constructorEndLocation;
				cd.Body = (BlockStatement)stmt;
				cd.Body.EndLocation   = endLocation;
				compilationUnit.AddChild(cd);
				
			} else SynErr(202);
			break;
		}
		case 101: {
			lexer.NextToken();

#line  975 "VBNET.ATG" 
			m.Check(Modifier.Methods);
			string name = String.Empty;
			Point startPos = t.Location;
			MethodDeclaration methodDeclaration;
			HandlesClause handlesClause = null;
			ImplementsClause implementsClause = null;
			AttributeSection attributeSection = null;
			
			Identifier();

#line  983 "VBNET.ATG" 
			name = t.val; 
			if (la.kind == 25) {
				lexer.NextToken();
				if (StartOf(4)) {
					FormalParameterList(
#line  984 "VBNET.ATG" 
out p);
				}
				Expect(26);
			}
			if (la.kind == 49) {
				lexer.NextToken();
				if (la.kind == 28) {
					AttributeSection(
#line  985 "VBNET.ATG" 
out attributeSection);
				}
				TypeName(
#line  985 "VBNET.ATG" 
out type);
			}

#line  987 "VBNET.ATG" 
			if(type == null) {
			type = new TypeReference("System.Object");
			}
			type.Attributes = attributeSection;
			
			if (la.kind == 106 || la.kind == 108) {
				if (la.kind == 108) {
					ImplementsClause(
#line  994 "VBNET.ATG" 
out implementsClause);
				} else {
					HandlesClause(
#line  996 "VBNET.ATG" 
out handlesClause);
				}
			}
			Expect(1);
			if (
#line  1002 "VBNET.ATG" 
IsMustOverride(m)) {

#line  1004 "VBNET.ATG" 
				methodDeclaration = new MethodDeclaration(name, m.Modifier,  type, p, attributes);
				methodDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				methodDeclaration.StartLocation = startPos;
				methodDeclaration.EndLocation   = t.EndLocation;
				methodDeclaration.HandlesClause = handlesClause;
				methodDeclaration.ImplementsClause = implementsClause;
				compilationUnit.AddChild(methodDeclaration);
				
			} else if (StartOf(10)) {

#line  1014 "VBNET.ATG" 
				methodDeclaration = new MethodDeclaration(name, m.Modifier,  type, p, attributes);
				methodDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				methodDeclaration.StartLocation = startPos;
				methodDeclaration.EndLocation   = t.EndLocation;
				
				methodDeclaration.HandlesClause = handlesClause;
				methodDeclaration.ImplementsClause = implementsClause;
				
				compilationUnit.AddChild(methodDeclaration);
				compilationUnit.BlockStart(methodDeclaration);
				
				Block(
#line  1025 "VBNET.ATG" 
out stmt);

#line  1027 "VBNET.ATG" 
				compilationUnit.BlockEnd();
				methodDeclaration.Body  = (BlockStatement)stmt;
				
				Expect(89);
				Expect(101);

#line  1032 "VBNET.ATG" 
				methodDeclaration.Body.StartLocation = methodDeclaration.EndLocation;
				methodDeclaration.Body.EndLocation   = t.EndLocation;
				
				Expect(1);
			} else SynErr(203);
			break;
		}
		case 79: {
			lexer.NextToken();

#line  1041 "VBNET.ATG" 
			m.Check(Modifier.ExternalMethods);
			Point startPos = t.Location;
			CharsetModifier charsetModifer = CharsetModifier.None;
			string library = String.Empty;
			string alias = null;
			string name = String.Empty;
			
			if (StartOf(11)) {
				Charset(
#line  1048 "VBNET.ATG" 
out charsetModifer);
			}
			if (la.kind == 169) {
				lexer.NextToken();
				Identifier();

#line  1051 "VBNET.ATG" 
				name = t.val; 
				Expect(116);
				Expect(3);

#line  1052 "VBNET.ATG" 
				library = t.val; 
				if (la.kind == 45) {
					lexer.NextToken();
					Expect(3);

#line  1053 "VBNET.ATG" 
					alias = t.val; 
				}
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  1054 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				Expect(1);

#line  1057 "VBNET.ATG" 
				DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, null, p, attributes, library, alias, charsetModifer);
				declareDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				declareDeclaration.StartLocation = startPos;
				declareDeclaration.EndLocation   = t.EndLocation;
				compilationUnit.AddChild(declareDeclaration);
				
			} else if (la.kind == 101) {
				lexer.NextToken();
				Identifier();

#line  1065 "VBNET.ATG" 
				name = t.val; 
				Expect(116);
				Expect(3);

#line  1066 "VBNET.ATG" 
				library = t.val; 
				if (la.kind == 45) {
					lexer.NextToken();
					Expect(3);

#line  1067 "VBNET.ATG" 
					alias = t.val; 
				}
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  1068 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
				if (la.kind == 49) {
					lexer.NextToken();
					TypeName(
#line  1069 "VBNET.ATG" 
out type);
				}
				Expect(1);

#line  1072 "VBNET.ATG" 
				DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, type, p, attributes, library, alias, charsetModifer);
				declareDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				declareDeclaration.StartLocation = startPos;
				declareDeclaration.EndLocation   = t.EndLocation;
				compilationUnit.AddChild(declareDeclaration);
				
			} else SynErr(204);
			break;
		}
		case 94: {
			lexer.NextToken();

#line  1083 "VBNET.ATG" 
			m.Check(Modifier.Events);
			Point startPos = t.Location;
			EventDeclaration eventDeclaration;
			string name = String.Empty;
			ImplementsClause implementsClause = null;
			
			Identifier();

#line  1089 "VBNET.ATG" 
			name= t.val; 
			if (la.kind == 49) {
				lexer.NextToken();
				TypeName(
#line  1091 "VBNET.ATG" 
out type);
			} else if (la.kind == 1 || la.kind == 25 || la.kind == 108) {
				if (la.kind == 25) {
					lexer.NextToken();
					if (StartOf(4)) {
						FormalParameterList(
#line  1093 "VBNET.ATG" 
out p);
					}
					Expect(26);
				}
			} else SynErr(205);
			if (la.kind == 108) {
				ImplementsClause(
#line  1095 "VBNET.ATG" 
out implementsClause);
			}

#line  1097 "VBNET.ATG" 
			eventDeclaration = new EventDeclaration(type, m.Modifier, p, attributes, name, implementsClause);
			eventDeclaration.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
			eventDeclaration.StartLocation = startPos;
			eventDeclaration.EndLocation = t.EndLocation;
			compilationUnit.AddChild(eventDeclaration);
			
			Expect(1);
			break;
		}
		case 2: case 52: case 71: case 171: {

#line  1105 "VBNET.ATG" 
			Point startPos = t.Location; 

#line  1107 "VBNET.ATG" 
			m.Check(Modifier.Fields);
			FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
			ArrayList comments = lexer.SpecialTracker.RetreiveComments();
			fd.StartLocation = startPos;
			
			VariableDeclarator(
#line  1112 "VBNET.ATG" 
variableDeclarators);

#line  1114 "VBNET.ATG" 
			((INode)variableDeclarators[0]).Specials["before"] = comments;
			
			while (la.kind == 12) {
				lexer.NextToken();
				VariableDeclarator(
#line  1116 "VBNET.ATG" 
variableDeclarators);
			}
			Expect(1);

#line  1119 "VBNET.ATG" 
			fd.EndLocation = t.EndLocation;
			fd.Fields = variableDeclarators;
			compilationUnit.AddChild(fd);
			
			break;
		}
		case 72: {

#line  1124 "VBNET.ATG" 
			m.Check(Modifier.Fields); 
			lexer.NextToken();

#line  1125 "VBNET.ATG" 
			m.Add(Modifier.Constant);  

#line  1127 "VBNET.ATG" 
			FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
			fd.StartLocation = t.Location;
			ArrayList comments = lexer.SpecialTracker.RetreiveComments();
			ArrayList constantDeclarators = new ArrayList();
			
			ConstantDeclarator(
#line  1132 "VBNET.ATG" 
constantDeclarators);

#line  1134 "VBNET.ATG" 
			((INode)constantDeclarators[0]).Specials["before"] = comments;
			
			while (la.kind == 12) {
				lexer.NextToken();
				ConstantDeclarator(
#line  1136 "VBNET.ATG" 
constantDeclarators);
			}

#line  1138 "VBNET.ATG" 
			fd.Fields = constantDeclarators;
			fd.EndLocation = t.Location;
			
			Expect(1);

#line  1143 "VBNET.ATG" 
			fd.EndLocation = t.EndLocation;
			compilationUnit.AddChild(fd);
			
			break;
		}
		case 148: {
			lexer.NextToken();

#line  1149 "VBNET.ATG" 
			m.Check(Modifier.Properties);
			Point startPos = t.Location;
			ImplementsClause implementsClause = null;
			
			Identifier();

#line  1153 "VBNET.ATG" 
			string propertyName = t.val; 
			if (la.kind == 25) {
				lexer.NextToken();
				if (StartOf(4)) {
					FormalParameterList(
#line  1154 "VBNET.ATG" 
out p);
				}
				Expect(26);
			}
			if (la.kind == 49) {
				lexer.NextToken();
				TypeName(
#line  1155 "VBNET.ATG" 
out type);
			}

#line  1157 "VBNET.ATG" 
			if(type == null) {
			type = new TypeReference("System.Object");
			}
			
			if (la.kind == 108) {
				ImplementsClause(
#line  1161 "VBNET.ATG" 
out implementsClause);
			}
			Expect(1);
			if (
#line  1165 "VBNET.ATG" 
IsMustOverride(m)) {

#line  1167 "VBNET.ATG" 
				PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes);
				pDecl.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				pDecl.StartLocation = startPos;
				pDecl.EndLocation   = t.Location;
				pDecl.TypeReference = type;
				pDecl.ImplementsClause = implementsClause;
				pDecl.Parameters = p;
				compilationUnit.AddChild(pDecl);
				
			} else if (la.kind == 28 || la.kind == 102 || la.kind == 158) {

#line  1178 "VBNET.ATG" 
				PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes);
				pDecl.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
				pDecl.StartLocation = startPos;
				pDecl.EndLocation   = t.Location;
				pDecl.BodyStart   = t.Location;
				pDecl.TypeReference = type;
				pDecl.ImplementsClause = implementsClause;
				pDecl.Parameters = p;
				PropertyGetRegion getRegion;
				PropertySetRegion setRegion;
				
				AccessorDecls(
#line  1189 "VBNET.ATG" 
out getRegion, out setRegion);
				Expect(89);
				Expect(148);
				Expect(1);

#line  1193 "VBNET.ATG" 
				pDecl.GetRegion = getRegion;
				pDecl.SetRegion = setRegion;
				pDecl.BodyEnd = t.EndLocation;
				compilationUnit.AddChild(pDecl);
				
			} else SynErr(206);
			break;
		}
		default: SynErr(207); break;
		}
	}
コード例 #29
0
 public object Visit(TypeReference typeReference, object data)
 {
     return ConvertTypeString(typeReference.Type);
 }
コード例 #30
0
 public GetTypeExpression(TypeReference type)
 {
     this.type = type;
 }