internal TryBuilder(Expression tryBlock, ILexicalScope currentScope)
     : base(currentScope)
 {
     this.tryBlock = tryBlock;
     faultBlock    = finallyBlock = null;
     handlers      = new LinkedList <CatchBlock>();
 }
示例#2
0
文件: Definition.cs 项目: zenuas/Roku
        public static AnonymousFunctionBody LambdaExpressionDefinition(ILexicalScope scope, LambdaExpressionNode lambda)
        {
            var root  = Lookup.GetRootNamespace(scope.Namespace);
            var fbody = MakeAnonymousFunction(root);

            fbody.IsImplicit = lambda.IsImplicit;
            if (lambda.Return is { } ret)
            {
                fbody.Return = CreateType(scope, ret);
            }
            lambda.Arguments.Each(x => fbody.Arguments.Add((new VariableValue(x.Name.Name), x is DeclareNode decla ? CreateType(scope, decla.Type) : new TypeImplicit())));
            FunctionBodyDefinition(fbody, lambda.Statements);
            return(fbody);
        }
 internal ConditionalBuilder(Expression test, ILexicalScope currentScope) : base(currentScope) => this.test = test;
示例#4
0
 public GlobalScope(SymbolTable symtab, ILexicalScope parent) : base(symtab, parent)
     {
     }
示例#5
0
 //-----------------------------------------------------------------------------------
 // Construction
 //-----------------------------------------------------------------------------------
 
 public BaseScope(SymbolTable symtab, ILexicalScope enclosingScope)
     {
     this.symtab         = symtab;
     this.enclosingScope = enclosingScope;
     }
示例#6
0
 private protected ExpressionBuilder(ILexicalScope currentScope)
 {
     this.currentScope = currentScope;
     ownerThread       = CurrentThread.ManagedThreadId;
 }
示例#7
0
 public TemporaryValue(string name, int index, ILexicalScope scope)
 {
     Name  = name;
     Index = index;
     Scope = scope;
 }
示例#8
0
 private protected virtual void Cleanup() => currentScope = null;
示例#9
0
 /// <summary>
 /// Represents the method that will handle token matching callbacks.
 /// </summary>
 /// <param name="reader">An <see cref="ITextBufferReader"/> that is reading a text source.</param>
 /// <param name="lexicalScope">The <see cref="ILexicalScope"/> that specifies the lexical scope to check.</param>
 /// <returns>A <see cref="MergableLexerResult"/> indicating the lexer result.</returns>
 private MergableLexerResult IsChildCodeBlockTransitionStateScopeStart(ITextBufferReader reader, ILexicalScope lexicalScope)
 {
     if (reader.Peek() == '<')
     {
         reader.Read();
         if (reader.Peek() == '%')
         {
             reader.Read();
             return(new MergableLexerResult(MatchType.ExactMatch, new LexicalScopeTokenData(lexicalScope, ParentTokenId.ChildCodeBlockStart)));
         }
         reader.ReadReverse();
     }
     return(MergableLexerResult.NoMatch);
 }
示例#10
0
文件: InnerScope.cs 项目: zenuas/Roku
 public InnerScope(ILexicalScope parent)
 {
     Namespace         = parent.Namespace;
     Parent            = parent;
     MaxTemporaryValue = parent.MaxTemporaryValue;
 }