Exemple #1
0
 public virtual void BeforeVisit(VariableDef node)
 {
     this.BeforeVisitCatchAll(node);
 }
Exemple #2
0
 public virtual void AfterVisit(VariableDef node)
 {
     this.AfterVisitCatchAll(node);
 }
        public override void BeforeVisit(VariableDef def)
        {
            base.BeforeVisit(def);

            DebugAssert.IsFalse(this.IsInImportScope, "Cannot be in import scope while building symbols for a VariableDef");

            if(_scopeStack.Peek().Items.ContainsKey(def.Name.Text))
                _errorCollector.VariableAlreadyDefined(def.Name);

            if(this.IsInGlobalScope)
                def.GetExtension<SymbolExtension>().Symbol = _scopeStack.Peek().Add(new HappyNamedExpressionSymbol(def.Name.Text, _getGlobalGetter, _setGlobalGetter));
            else
                def.GetExtension<SymbolExtension>().Symbol = _scopeStack.Peek().Add(def.Name.Text);
        }
Exemple #4
0
 public DefStatement(HappySourceLocation startsAt, VariableDef[] variableDefs)
     : base(startsAt, variableDefs.Last().Location)
 {
     this.VariableDefs = variableDefs;
 }
 public override void AfterVisit(VariableDef node)
 {
     if (node.InitializerExpression != null)
         _expressionStack.Push(node, node.GetExtension<SymbolExtension>().Symbol.GetSetExpression(_expressionStack.Pop()));
     base.AfterVisit(node);
 }