public override object Visit(VariableDeclaration variableDeclaration, object data)
 {
     return null;
 }
Example #2
0
	void ConstantDeclarator(
#line  1259 "VBNET.ATG" 
ArrayList constantDeclaration) {

#line  1261 "VBNET.ATG" 
		Expression expr = null;
		TypeReference type = null;
		string name = String.Empty;
		
		Identifier();

#line  1265 "VBNET.ATG" 
		name = t.val; 
		if (la.kind == 49) {
			lexer.NextToken();
			TypeName(
#line  1266 "VBNET.ATG" 
out type);
		}
		Expect(11);
		Expr(
#line  1267 "VBNET.ATG" 
out expr);

#line  1269 "VBNET.ATG" 
		VariableDeclaration f = new VariableDeclaration(name, expr);
		f.Type = type;
		constantDeclaration.Add(f);
		
	}
Example #3
0
	void VariableDeclarator(
#line  1276 "VBNET.ATG" 
ArrayList fieldDeclaration) {

#line  1278 "VBNET.ATG" 
		Expression expr = null;
		TypeReference type = null;
		ObjectCreateExpression oce = null;
		ArrayCreateExpression ace = null;
		ArrayList rank = null;
		ArrayList dimension = null;
		
		Identifier();

#line  1287 "VBNET.ATG" 
		VariableDeclaration f = new VariableDeclaration(t.val);
		
		if (
#line  1289 "VBNET.ATG" 
IsRank()) {
			ArrayTypeModifiers(
#line  1289 "VBNET.ATG" 
out rank);
		}
		if (
#line  1290 "VBNET.ATG" 
IsSize()) {
			ArrayInitializationModifier(
#line  1290 "VBNET.ATG" 
out dimension);
		}
		if (
#line  1292 "VBNET.ATG" 
IsObjectCreation()) {
			Expect(49);
			ObjectCreateExpression(
#line  1292 "VBNET.ATG" 
out expr);

#line  1294 "VBNET.ATG" 
			if(expr is ArrayCreateExpression) {
			ace = expr as ArrayCreateExpression;
			f.Initializer = ace.ArrayInitializer;
			
			} else {
				oce = expr as ObjectCreateExpression;
				f.Initializer = oce;
				if(oce.CreateType != null) {
					f.Type = oce.CreateType;
				}
			}
			
		} else if (StartOf(16)) {
			if (la.kind == 49) {
				lexer.NextToken();
				TypeName(
#line  1307 "VBNET.ATG" 
out type);
			}

#line  1309 "VBNET.ATG" 
			if(type != null) {
			type.Dimension = dimension;
			}
			f.Type = type;
			if (type != null && rank != null) {
				if(type.RankSpecifier != null) {
					Error("array rank only allowed one time");
				} else {
					type.RankSpecifier = rank;
				}
			}
			
			if (la.kind == 11) {
				lexer.NextToken();
				VariableInitializer(
#line  1321 "VBNET.ATG" 
out expr);

#line  1321 "VBNET.ATG" 
				f.Initializer = expr; 
			}
		} else SynErr(211);

#line  1323 "VBNET.ATG" 
		fieldDeclaration.Add(f); 
	}
Example #4
0
	void EnumMemberDecl(
#line  849 "VBNET.ATG" 
out FieldDeclaration f) {

#line  851 "VBNET.ATG" 
		Expression expr = null;
		ArrayList attributes = new ArrayList();
		AttributeSection section = null;
		VariableDeclaration varDecl = null;
		
		while (la.kind == 28) {
			AttributeSection(
#line  856 "VBNET.ATG" 
out section);

#line  856 "VBNET.ATG" 
			attributes.Add(section); 
		}
		Identifier();

#line  859 "VBNET.ATG" 
		f = new FieldDeclaration(attributes);
		varDecl = new VariableDeclaration(t.val);
		varDecl.Specials["before"] = lexer.SpecialTracker.RetreiveComments();
		f.Fields.Add(varDecl);
		f.StartLocation = t.Location;
		
		if (la.kind == 11) {
			lexer.NextToken();
			Expr(
#line  865 "VBNET.ATG" 
out expr);

#line  865 "VBNET.ATG" 
			varDecl.Initializer = expr; 
		}
		Expect(1);
	}
 public object Visit(VariableDeclaration variableDeclaration, object data)
 {
     // called inside ENUMS
     //			AppendAttributes(field.Attributes);
     AppendIndentation();
     sourceText.Append(variableDeclaration.Name);
     if (variableDeclaration.Initializer != null) {
         sourceText.Append(" = ");
         sourceText.Append(variableDeclaration.Initializer.AcceptVisitor(this, data));
     }
     AppendNewLine();
     return null;
 }
 public virtual object Visit(VariableDeclaration variableDeclaration, object data)
 {
     if (variableDeclaration.Initializer == null) {
         return data;
     }
     return variableDeclaration.Initializer.AcceptVisitor(this, data);
 }