internal static void AddList( ListNode list, Node next, Symbol s ) { list.nodes.Add(next); list.end = s.endpos; }
// {{Methods}} internal static ListNode List( Node first, Symbol s ) { ListNode res = new ListNode(); res.kind = Kind.List; res.start = s.pos; res.end = s.endpos; res.nodes = new ArrayList(); res.nodes.Add(first); return res; }
internal static TypeAndListNode TypeAndList( Kind k, TypeNode type, ListNode list, Symbol s ) { TypeAndListNode res = new TypeAndListNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.type = type; res.list = list; return res; }
private string GenerateSignature( string name, ListNode parms, UmlClass cl, bool is_indexer ) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); if( parms != null ) foreach( ParameterNode pn in parms.nodes ) { if( sb.Length != 0 ) sb.Append( "," ); string type = GetFullTypeName( GetTypeName( pn.type ), cl ); if( pn.modifiers != null ) { if( (pn.modifiers.value & (int)Modifiers.Out) != 0 ) sb.Append( "out " ); if( (pn.modifiers.value & (int)Modifiers.Ref) != 0 ) sb.Append( "ref " ); if( (pn.modifiers.value & (int)Modifiers.Params) != 0 ) sb.Append( "params " ); } sb.Append( type ); } return is_indexer ? name + "[" + sb.ToString() + "]" : name + "(" + sb.ToString() + ")"; }
internal static MethodDecl Operator( ModifiersNode mod, TypeNode type, IdentNode name, ParameterNode op1, ParameterNode op2, Symbol s ) { ListNode ln = new ListNode(); ln.nodes = new ArrayList(); ln.nodes.Add( op1 ); if( op2 != null ) ln.nodes.Add( op2 ); ln.start = op1.start; ln.end = op2 != null ? op2.end : op1.end; ln.kind = Kind.List; return Method( name == null ? Kind.ConversionOperator : op2 == null ? Kind.UnaryOperator : Kind.BinaryOperator, null, mod, name, type, ln, null, null, s ); }
internal static PropertyNode Property( ListNode attributes, ModifiersNode modifiers, TypeNode type, IdentNode name, ListNode accessors, Symbol s ) { PropertyNode res = new PropertyNode(); res.kind = Kind.Property; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.type = type; res.name = name; res.accessors = accessors; return res; }
internal static EnumDecl Enum( ListNode attributes, ModifiersNode modifiers, IdentNode name, TypeNode basetype, ListNode children, Symbol s ) { EnumDecl res = new EnumDecl(); res.kind = Kind.Enum; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.name = name; res.basetype = basetype; res.children = children; return res; }
internal static NamespaceDecl Namespace( IdentNode name, ListNode usings, ListNode members, Symbol s ) { NamespaceDecl res = new NamespaceDecl(); res.kind = Kind.Namespace; res.start = s.pos; res.end = s.endpos; res.name = name; res.usings = usings; res.members = members; return res; }
internal static ConstructorInitializerNode ConstructorInitializer( Kind k, ListNode args, Symbol s ) { ConstructorInitializerNode res = new ConstructorInitializerNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.args = args; return res; }
internal static DelegateNode Delegate( ListNode attributes, ModifiersNode modifiers, IdentNode name, TypeNode return_type, ListNode parameters, Symbol s ) { DelegateNode res = new DelegateNode(); res.kind = Kind.Delegate; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.name = name; res.return_type = return_type; res.parameters = parameters; return res; }
internal static ClassDecl Class( Kind k, ListNode attributes, ModifiersNode modifiers, IdentNode name, ListNode inheritance, ListNode members, Symbol s ) { ClassDecl res = new ClassDecl(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.name = name; res.inheritance = inheritance; res.members = members; return res; }
internal static AttributeSectionNode AttributeSection( IdentNode target, ListNode attrs, Symbol s ) { AttributeSectionNode res = new AttributeSectionNode(); res.kind = Kind.AttributeSection; res.start = s.pos; res.end = s.endpos; res.target = target; res.attrs = attrs; return res; }
internal static AttributeNode Attribute( IdentNode name, ListNode parms, Symbol s ) { AttributeNode res = new AttributeNode(); res.kind = Kind.Attribute; res.start = s.pos; res.end = s.endpos; res.name = name; res.parms = parms; return res; }
internal static ArrayType ListArrayType( TypeNode parent, ListNode dims, Symbol s ) { TypeNode current = parent; foreach( DimSpecNode n in dims.nodes ) current = OneArrayType( current, n, s ); return (ArrayType)current; }
internal static EnumValueNode EnumValue( ListNode attributes, IdentNode name, ExprNode expr, Symbol s ) { EnumValueNode res = new EnumValueNode(); res.kind = Kind.EnumValue; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.name = name; res.expr = expr; return res; }
internal static MethodDecl Method( Kind k, ListNode attributes, ModifiersNode modifiers, IdentNode name, TypeNode return_type, ListNode parameters, StatementNode body, ConstructorInitializerNode base_init, Symbol s ) { MethodDecl res = new MethodDecl(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.name = name; res.return_type = return_type; res.parameters = parameters; res.body = body; res.base_init = base_init; return res; }
internal static EventNode Event( Kind k, ListNode attributes, ModifiersNode modifiers, TypeNode type, IdentNode name, ListNode accessors, ListNode vars, Symbol s ) { EventNode res = new EventNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.type = type; res.name = name; res.accessors = accessors; res.vars = vars; return res; }
internal static NewArrayNode NewArray( TypeNode type, ListNode exprlist, ListNode ranks, Node arrayinit, Symbol s ) { NewArrayNode res = new NewArrayNode(); res.kind = Kind.NewArray; res.start = s.pos; res.end = s.endpos; res.type = type; res.exprlist = exprlist; res.ranks = ranks; res.arrayinit = arrayinit; return res; }
internal static ExprAndListNode ExprAndList( Kind k, ExprNode expr, ListNode list, Symbol s ) { ExprAndListNode res = new ExprAndListNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.expr = expr; res.list = list; return res; }
internal static ParameterNode Parameter( ListNode attributes, ModifiersNode modifiers, TypeNode type, IdentNode name, Symbol s ) { ParameterNode res = new ParameterNode(); res.kind = Kind.Param; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.type = type; res.name = name; return res; }
internal static FieldsDecl Fields( Kind k, ListNode attributes, ModifiersNode modifiers, TypeNode type, ListNode declarators, Symbol s ) { FieldsDecl res = new FieldsDecl(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.type = type; res.declarators = declarators; return res; }
internal static StatementNode Statement( Kind k, ExprNode expr, IdentNode label, StatementNode stmt1, StatementNode stmt2, ListNode stmts, Symbol s ) { StatementNode res = new StatementNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.expr = expr; res.label = label; res.stmt1 = stmt1; res.stmt2 = stmt2; res.stmts = stmts; return res; }
internal static IndexerNode Indexer( ListNode attributes, ModifiersNode modifiers, TypeNode type, IdentNode name, ListNode formal_params, ListNode accessors, Symbol s ) { IndexerNode res = new IndexerNode(); res.kind = Kind.Indexer; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.modifiers = modifiers; res.type = type; res.name = name; res.formal_params = formal_params; res.accessors = accessors; return res; }
internal static TypedStatementNode TypedStatement( Kind k, ExprNode expr, IdentNode label, StatementNode stmt1, StatementNode stmt2, ListNode stmts, TypeNode type, Symbol s ) { TypedStatementNode res = new TypedStatementNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.expr = expr; res.label = label; res.stmt1 = stmt1; res.stmt2 = stmt2; res.stmts = stmts; res.type = type; return res; }
internal static InitializerNode Initializer( Kind k, ExprNode expr, ListNode subinits, Symbol s ) { InitializerNode res = new InitializerNode(); res.kind = k; res.start = s.pos; res.end = s.endpos; res.expr = expr; res.subinits = subinits; return res; }
private ArrayList GetParameters( ListNode ln, UmlClass cl ) { ArrayList l = new ArrayList(); if( ln != null ) foreach( ParameterNode pn in ln.nodes ) { UmlParameter param = new UmlParameter(); param.name = pn.name.identifier; param.Type = GetFullTypeName( GetTypeName( pn.type ), cl ); l.Add( param ); } return l; }
internal static AccessorNode Accessor( ListNode attributes, IdentNode name, StatementNode body, Symbol s ) { AccessorNode res = new AccessorNode(); res.kind = Kind.Accessor; res.start = s.pos; res.end = s.endpos; res.attributes = attributes; res.name = name; res.body = body; return res; }