public override bool Accept(SetStatement element, int data) { if (element.expression.Accept(this, 0)) { throw new InvalidOperationException("Assign to not returning expression"); } int index; index = Array.IndexOf(currentFunction.arguments, element.varName); if (index >= 0) { if (index == (byte)index) { il.Emit(OpCodes.Starg_S, (byte)index); } else { il.Emit(OpCodes.Starg, index); } return(true); } index = Array.IndexOf(currentFunction.locals, element.varName); if (index >= 0) { il.Emit(OpCodes.Stloc, index); return(true); } il.Emit(OpCodes.Stsfld, parent.storage.GetField(element.varName, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public)); return(true); }
protected override void VisitSet(SetStatement statement) { State.Write(Symbols.SET); if (statement.Assign != null) { VisitToken(statement.Assign); } }
/// <summary>Activa o desactiva la opcion indicada para todo el batch</summary> public void AddStatement(SetStatement sta, bool val) { BatchStatement bchOpt = new BatchStatement(); bchOpt.Name = sta; bchOpt.Value = val; foreach (BatchStatement bo in lstStatements) { if (bo.Name == sta) { bo.Value = val; return; } } lstStatements.Add(bchOpt); }
private Statement ParseSetStatement() { // parse statement declaration SetStatement stm = new SetStatement(current.Line, current.Column); Consume(TokenType.Set); // parse tag attributes do { if (Current.TokenType != TokenType.Attribute) { throw new ParserException("Expected tag attribute", stm.Line, stm.Column); } string attrName = Current.Data; Consume(TokenType.Attribute); Consume(TokenType.Assign); // look for "test" attribute if (attrName == "name") { stm.Name = Current.Data; Consume(TokenType.String); } else if (attrName == "value") { stm.ValueExpression = ParseExpression(); } }while (Current.TokenType == TokenType.Attribute); // check statement if (stm.Name == null) { throw new ParserException("\"name\" attribute was not specified", stm.Line, stm.Column); } if (stm.ValueExpression == null) { throw new ParserException("\"value\" attribute was not specified", stm.Line, stm.Column); } // it must be an "empty" tag Consume(TokenType.EmptyTag); return(stm); }
public List <SetStatement> ParseSetStatement(SetStatementContext node) { List <SetStatement> statements = new List <SetStatement>(); foreach (var child in node.children) { if (child is VariableClauseContext variable) { SetStatement statement = new SetStatement(); statement.Key = new TokenInfo(variable); statements.Add(statement); } else if (child is PredicateExpressionContext exp) { statements.Last().Value = this.ParseToken(exp); } } return(statements); }
public virtual void OnSetStatement(SetStatement stmt) { Enter(new Set(stmt), stmt); Exit(); }
public override object Visit(SetStatement that, object value) { VisitRoutine(that, value); return null; }
public override object Visit(SetStatement that, object value) { _writer.WriteLine("set:"); that.Block.Visit(this); _writer.WriteLine(); return null; }
public override object Visit(SetStatement that, object value = null) { PrintPrologue(that); PrintRoutine(that); PrintEpilogue(that); that.Profile.Visit(this); that.Block.Visit(this); return null; }
protected abstract void VisitSet(SetStatement statement);
protected override void VisitSet(SetStatement statement) { throw new NotImplementedException(); }
public override object Visit(SetStatement that, object value) { that.Profile.Visit(this); Enter(EncodeRoutine(that.Name.Path, that.Encoded)); that.Block.Visit(this, (object) true); Leave(); return null; }
public virtual R Accept(SetStatement element, A data) { return(Accept((Base)element, data)); }
public override object Visit(SetStatement that, object value = null) { _symbols.EnterBlock(that.Name.Symbol, that); that.Profile.Visit(this); that.Block.Visit(this); _symbols.LeaveBlock(that.Name.Symbol); return null; }
public virtual object Visit(SetStatement that, object value) { throw new System.NotImplementedException(); }