Exemple #1
0
 public CodeBodyParser(TokenStream<String> tokens, CodeBody body, SymbolTable symbols, ASTNode containingNode, MessageLog log = null)
 {
     Log = log ?? new MessageLog();
     Symbols = symbols;
     Tokens = tokens;
     _loopCount = 0;
     _switchCount = 0;
     Node = containingNode;
     Body = body;
     OuterClassScope = NodeUtils.GetOuterClassScope(containingNode);
     // TODO: refactor a better solution to this mess
     if (IsState)
         NodeVariables = (containingNode as State);
     else if (IsFunction)
         NodeVariables = (containingNode as Function);
     else if (IsOperator)
         NodeVariables = (containingNode as OperatorDeclaration);
 }
Exemple #2
0
 public CodeBodyParser(TokenStream <String> tokens, CodeBody body, SymbolTable symbols, ASTNode containingNode, MessageLog log = null)
 {
     Log             = log ?? new MessageLog();
     Symbols         = symbols;
     Tokens          = tokens;
     _loopCount      = 0;
     _switchCount    = 0;
     Node            = containingNode;
     Body            = body;
     OuterClassScope = NodeUtils.GetOuterClassScope(containingNode);
     // TODO: refactor a better solution to this mess
     if (IsState)
     {
         NodeVariables = (containingNode as State);
     }
     else if (IsFunction)
     {
         NodeVariables = (containingNode as Function);
     }
     else if (IsOperator)
     {
         NodeVariables = (containingNode as OperatorDeclaration);
     }
 }