Example #1
0
 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 );
 }
Example #2
0
 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;
 }
Example #3
0
        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));
        }