Exemplo n.º 1
0
Arquivo: AST.cs Projeto: chenzuo/blue
 // For overloaded operators
 // No modifiers needed since op overloading must be public & static.
 // Have a special constructor so that we can set the IsOp flag and
 // get a safe string name. 
 public MethodDecl(
     BinaryExp.BinaryOp op,
     TypeSig tRetType,
     ParamVarDecl[] arParams,
     BlockStatement stmtBody
 )
 {
     m_fIsOpOverload = true;
     string strName  = GetOpOverloadedName(op);
     m_idName        = new Identifier(strName, tRetType.Location);
     m_tRetType      = tRetType;
     m_arParams      = (arParams != null) ? arParams : new ParamVarDecl[0];        
     m_stmtBody      = stmtBody;
     
     //m_mods          = new Modifiers(Modifiers.EFlags.Public | Modifiers.EFlags.Static);
     m_mods = new Modifiers();
     m_mods.SetPublic();
     m_mods.SetStatic();
     
     Debug.Assert(m_idName != null);        
     Debug.Assert(m_stmtBody != null);
     Debug.Assert(m_arParams != null);
 }
Exemplo n.º 2
0
Arquivo: AST.cs Projeto: chenzuo/blue
    MethodDecl(
        Identifier idName,        
        TypeSig tRetType,
        ParamVarDecl[] arParams
    )
    {
        //m_strName       = idName.Text;
        m_idName        = idName;
        m_tRetType      = tRetType;
        
        m_mods          =   new Modifiers();
        m_mods.SetAbstract();
        m_mods.SetVirtual();
        m_mods.SetPublic(); 
        
        m_arParams      = (arParams != null) ? arParams : new ParamVarDecl[0];        
        m_stmtBody      = null;

        Debug.Assert(m_idName != null);
        Debug.Assert(m_arParams != null);        
        
        // @todo - this is wrong
        m_filerange = idName.Location;
    }