Esempio n. 1
0
 //------------------------------------------------------------
 // Ident重複チェック。trueなら重複している。
 private bool checkIdentDuplication(SymbolTree.ErrorInfoHolder aErrorHolder, Identifier aIdent)
 {
     if (FindChildNode(aIdent) != null)
     {
         aErrorHolder.Set(new SymbolTree.ErrorInfo(SymbolTree.ErrorKind.NODE_NAME_IS_ALREADY_EXIST, mModuleContext, aIdent.Token));
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
 //------------------------------------------------------------
 // 展開命令。
 public bool SymbolExpand(SymbolTree.ErrorInfoHolder aHolder, SymbolExpandCmdKind aCmd)
 {
     foreach (ISymbolNode node in mNodeList)
     {
         if (!node.SymbolExpand(aHolder, aCmd))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 3
0
        //------------------------------------------------------------
        // 展開命令。
        public bool SymbolExpand(SymbolTree.ErrorInfoHolder aErrorHolder, SymbolExpandCmdKind aCmd)
        {
            switch (aCmd)
            {
            case SymbolExpandCmdKind.TypeNode:
                return(expandTypeNode(aErrorHolder));

            case SymbolExpandCmdKind.FunctionNodeDecl:
                return(expandFunctionNodeDecl(aErrorHolder));

            default:
                return(true);
            }
        }
 //------------------------------------------------------------
 // コンストラクタ。
 public SemanticAnalyzeComponent(
     SymbolTree.ErrorInfoHolder aErrorInfoHolder
     , ModuleContext aModuleContext
     , TypeSymbolNode aTypeSymbolNode
     , OnSymbolNodeCreate aOnSymbolNodeCreate
     , ISymbolNode aPrevSymbolNode
     )
 {
     ErrorInfoHolder          = aErrorInfoHolder;
     ModuleContext            = aModuleContext;
     TypeSymbolNode           = aTypeSymbolNode;
     OnSymbolNodeCreateMethod = aOnSymbolNodeCreate;
     PrevSymbolNode           = aPrevSymbolNode;
 }
Esempio n. 5
0
 //------------------------------------------------------------
 // FunctionNode宣言展開。
 private bool expandFunctionNodeDecl(SymbolTree.ErrorInfoHolder aErrorHolder)
 {
     foreach (SymbolDef symbol in mStaticTypeDef.SymbolDefList)
     {
         if (symbol.MemberFunctionDecl != null)
         {
             if (checkIdentDuplication(aErrorHolder, symbol.MemberFunctionDecl.Ident))
             {
                 return(false);
             }
             addNode(new FunctionSymbolNode(this, mModuleContext, symbol.MemberFunctionDecl));
         }
     }
     return(true);
 }
Esempio n. 6
0
 //------------------------------------------------------------
 // TypeNode展開。
 private bool expandTypeNode(SymbolTree.ErrorInfoHolder aErrorHolder)
 {
     foreach (SymbolDef symbol in mStaticTypeDef.SymbolDefList)
     {
         if (symbol.StaticTypeDef != null)
         {
             if (checkIdentDuplication(aErrorHolder, symbol.StaticTypeDef.Ident))
             {
                 return(false);
             }
             addNode(new TypeSymbolNode(this, mModuleContext, symbol.StaticTypeDef));
         }
     }
     return(true);
 }
Esempio n. 7
0
 //------------------------------------------------------------
 // シンボルを展開する。
 public bool SymbolExpand(SymbolTree.ErrorInfoHolder aHolder, SymbolExpandCmdKind aCmdKind)
 {
     // todo:impl
     return(true);
 }
Esempio n. 8
0
 //------------------------------------------------------------
 // 展開命令
 public bool SymbolExpand(SymbolTree.ErrorInfoHolder holder, SymbolExpandCmdKind cmd)
 {
     return(mTypeNode.SymbolExpand(holder, cmd));
 }