Example #1
0
 private void AttributeSection(out ICSharpCode.NRefactory.Parser.AST.AttributeSection section)
 {
     ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
     string attributeTarget = "";
     List<ICSharpCode.NRefactory.Parser.AST.Attribute> attributes = new List<ICSharpCode.NRefactory.Parser.AST.Attribute>();
     base.Expect(0x12);
     Point location = this.t.Location;
     if (this.IsLocalAttrTarget())
     {
         if (this.la.kind == 0x44)
         {
             base.lexer.NextToken();
             attributeTarget = "event";
         }
         else if (this.la.kind == 100)
         {
             base.lexer.NextToken();
             attributeTarget = "return";
         }
         else
         {
             base.lexer.NextToken();
             if ((((this.t.val != "field") || (this.t.val != "method")) || ((this.t.val != "module") || (this.t.val != "param"))) || ((this.t.val != "property") || (this.t.val != "type")))
             {
                 this.Error("attribute target specifier (event, return, field,method, module, param, property, or type) expected");
             }
             attributeTarget = this.t.val;
         }
         base.Expect(9);
     }
     this.Attribute(out attribute);
     attributes.Add(attribute);
     while (this.NotFinalComma())
     {
         base.Expect(14);
         this.Attribute(out attribute);
         attributes.Add(attribute);
     }
     if (this.la.kind == 14)
     {
         base.lexer.NextToken();
     }
     base.Expect(0x13);
     section = new ICSharpCode.NRefactory.Parser.AST.AttributeSection(attributeTarget, attributes);
     section.StartLocation = location;
     section.EndLocation = this.t.EndLocation;
 }
Example #2
0
 private void GlobalAttributeSection()
 {
     ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
     base.Expect(0x12);
     Point location = this.t.Location;
     base.Expect(1);
     if (this.t.val != "assembly")
     {
         this.Error("global attribute target specifier (\"assembly\") expected");
     }
     string val = this.t.val;
     List<ICSharpCode.NRefactory.Parser.AST.Attribute> attributes = new List<ICSharpCode.NRefactory.Parser.AST.Attribute>();
     base.Expect(9);
     this.Attribute(out attribute);
     attributes.Add(attribute);
     while (this.NotFinalComma())
     {
         base.Expect(14);
         this.Attribute(out attribute);
         attributes.Add(attribute);
     }
     if (this.la.kind == 14)
     {
         base.lexer.NextToken();
     }
     base.Expect(0x13);
     ICSharpCode.NRefactory.Parser.AST.AttributeSection childNode = new ICSharpCode.NRefactory.Parser.AST.AttributeSection(val, attributes);
     childNode.StartLocation = location;
     childNode.EndLocation = this.t.EndLocation;
     base.compilationUnit.AddChild(childNode);
 }