public override object Visit(PropertyGetRegion propertyGetRegion, object data)
 {
     return null;
 }
 public override object Visit(PropertyGetRegion propertyGetRegion, object data)
 {
     Console.WriteLine(propertyGetRegion.ToString());
     return propertyGetRegion.AcceptChildren(this, data);
 }
        public override object Visit(PropertyGetRegion propertyGetRegion, object data)
        {
            DebugOutput(propertyGetRegion);
            AppendAttributes(propertyGetRegion.Attributes);
            AppendIndentation();sourceText.Append("Get");
            AppendNewLine();

            if (propertyGetRegion.Block != null) {
                ++indentLevel;
                propertyGetRegion.Block.AcceptVisitor(this, data);
                --indentLevel;
            }
            AppendIndentation();sourceText.Append("End Get");
            AppendNewLine();
            return null;
        }
 public virtual object Visit(PropertyGetRegion propertyGetRegion, object data)
 {
     foreach (AttributeSection section in propertyGetRegion.Attributes) {
         section.AcceptVisitor(this, data);
     }
     blockStack.Push(propertyGetRegion.Block);
     object ret = data;
     if (propertyGetRegion.Block != null) {
         ret = propertyGetRegion.Block.AcceptChildren(this, data);
     }
     blockStack.Pop();
     return ret;
 }
Exemplo n.º 5
0
	void GetAccessorDecl(
#line  1330 "cs.ATG" 
out PropertyGetRegion getBlock, ArrayList attributes, Modifier m) {

#line  1331 "cs.ATG" 
		Statement stmt = null; 
		Expect(1);

#line  1334 "cs.ATG" 
		Point startLocation = t.Location; 

#line  1335 "cs.ATG" 
		if (t.val != "get") Error("get expected"); 
		if (la.kind == 14) {
			Block(
#line  1336 "cs.ATG" 
out stmt);
		} else if (la.kind == 10) {
			lexer.NextToken();
		} else SynErr(163);

#line  1337 "cs.ATG" 
		getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes, m); 

#line  1338 "cs.ATG" 
		getBlock.StartLocation = startLocation; 

#line  1339 "cs.ATG" 
		getBlock.EndLocation = t.Location; 
	}
Exemplo n.º 6
0
	void InterfaceAccessors(
#line  1376 "cs.ATG" 
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {

#line  1378 "cs.ATG" 
		AttributeSection section;
		ArrayList attributes = new ArrayList();
		getBlock = null; setBlock = null;
		
		while (la.kind == 16) {
			AttributeSection(
#line  1383 "cs.ATG" 
out section);

#line  1383 "cs.ATG" 
			attributes.Add(section); 
		}
		if (
#line  1385 "cs.ATG" 
IdentIsGet()) {
			Expect(1);

#line  1385 "cs.ATG" 
			getBlock = new PropertyGetRegion(null, attributes); 
		} else if (
#line  1386 "cs.ATG" 
IdentIsSet()) {
			Expect(1);

#line  1386 "cs.ATG" 
			setBlock = new PropertySetRegion(null, attributes); 
		} else if (la.kind == 1) {
			lexer.NextToken();

#line  1387 "cs.ATG" 
			Error("set or get expected"); 
		} else SynErr(161);
		Expect(10);

#line  1389 "cs.ATG" 
		attributes = new ArrayList(); 
		if (la.kind == 1 || la.kind == 16) {
			while (la.kind == 16) {
				AttributeSection(
#line  1391 "cs.ATG" 
out section);

#line  1391 "cs.ATG" 
				attributes.Add(section); 
			}
			if (
#line  1393 "cs.ATG" 
IdentIsGet()) {
				Expect(1);

#line  1393 "cs.ATG" 
				if (getBlock != null) Error("get already declared");
				else getBlock = new PropertyGetRegion(null, attributes);
				
			} else if (
#line  1396 "cs.ATG" 
IdentIsSet()) {
				Expect(1);

#line  1396 "cs.ATG" 
				if (setBlock != null) Error("set already declared");
				else setBlock = new PropertySetRegion(null, attributes);
				
			} else if (la.kind == 1) {
				lexer.NextToken();

#line  1399 "cs.ATG" 
				Error("set or get expected"); 
			} else SynErr(162);
			Expect(10);
		}
	}
Exemplo n.º 7
0
	void AccessorDecls(
#line  1300 "cs.ATG" 
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {

#line  1302 "cs.ATG" 
		ArrayList attributes = new ArrayList(); 
		Modifiers m = new Modifiers (this);
		AttributeSection section;
		getBlock = null;
		setBlock = null; 
		
		while (la.kind == 16) {
			AttributeSection(
#line  1309 "cs.ATG" 
out section);

#line  1309 "cs.ATG" 
			attributes.Add(section); 
		}
		while (StartOf(22)) {
			AccessorModifier(
#line  1310 "cs.ATG" 
m);
		}
		if (
#line  1312 "cs.ATG" 
IdentIsGet()) {
			GetAccessorDecl(
#line  1313 "cs.ATG" 
out getBlock, attributes, m.Modifier);
			if (StartOf(23)) {

#line  1314 "cs.ATG" 
				attributes = new ArrayList(); m = new Modifiers (this); 
				while (la.kind == 16) {
					AttributeSection(
#line  1315 "cs.ATG" 
out section);

#line  1315 "cs.ATG" 
					attributes.Add(section); 
				}
				while (StartOf(22)) {
					AccessorModifier(
#line  1316 "cs.ATG" 
m);
				}
				SetAccessorDecl(
#line  1317 "cs.ATG" 
out setBlock, attributes, m.Modifier);
			}
		} else if (
#line  1319 "cs.ATG" 
IdentIsSet()) {
			SetAccessorDecl(
#line  1320 "cs.ATG" 
out setBlock, attributes, m.Modifier);
			if (StartOf(23)) {

#line  1321 "cs.ATG" 
				attributes = new ArrayList(); m = new Modifiers (this); 
				while (la.kind == 16) {
					AttributeSection(
#line  1322 "cs.ATG" 
out section);

#line  1322 "cs.ATG" 
					attributes.Add(section); 
				}
				while (StartOf(22)) {
					AccessorModifier(
#line  1323 "cs.ATG" 
m);
				}
				GetAccessorDecl(
#line  1324 "cs.ATG" 
out getBlock, attributes, m.Modifier);
			}
		} else if (la.kind == 1) {
			lexer.NextToken();

#line  1326 "cs.ATG" 
			Error("get or set accessor declaration expected"); 
		} else SynErr(160);
	}
 public override object Visit(PropertyGetRegion getRegion, object data)
 {
     this.VisitAttributes(getRegion.Attributes, data);
     outputFormatter.Indent();
     VisitModifier(getRegion.Modifier);
     outputFormatter.PrintIdentifier("get");
     if (getRegion.Block == null) {
         outputFormatter.PrintToken(Tokens.Semicolon);
     } else {
         outputFormatter.Space();
         outputFormatter.PrintToken(Tokens.OpenCurlyBrace);
         outputFormatter.NewLine();
         ++outputFormatter.IndentationLevel;
         getRegion.Block.AcceptChildren(this, false);
         --outputFormatter.IndentationLevel;
         outputFormatter.Indent();
         outputFormatter.PrintToken(Tokens.CloseCurlyBrace);
     }
     outputFormatter.NewLine();
     return null;
 }