internal TryBuilder(Expression tryBlock, ILexicalScope currentScope) : base(currentScope) { this.tryBlock = tryBlock; faultBlock = finallyBlock = null; handlers = new LinkedList <CatchBlock>(); }
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;
public GlobalScope(SymbolTable symtab, ILexicalScope parent) : base(symtab, parent) { }
//----------------------------------------------------------------------------------- // Construction //----------------------------------------------------------------------------------- public BaseScope(SymbolTable symtab, ILexicalScope enclosingScope) { this.symtab = symtab; this.enclosingScope = enclosingScope; }
private protected ExpressionBuilder(ILexicalScope currentScope) { this.currentScope = currentScope; ownerThread = CurrentThread.ManagedThreadId; }
public TemporaryValue(string name, int index, ILexicalScope scope) { Name = name; Index = index; Scope = scope; }
private protected virtual void Cleanup() => currentScope = null;
/// <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); }
public InnerScope(ILexicalScope parent) { Namespace = parent.Namespace; Parent = parent; MaxTemporaryValue = parent.MaxTemporaryValue; }