public override void EnterIncr(LatteParser.IncrContext context) { var id = context.ID().GetText(); if (!_environment.NameToVarDef.ContainsKey(id)) { _errorState.AddErrorMessage(new ErrorMessage( context.start.Line, context.start.Column, ErrorMessages.VarNotDefined(id))); } if (!_environment.NameToVarDef[id].Type.Equals(new LatteParser.TIntContext())) { _errorState.AddErrorMessage(new ErrorMessage( context.start.Line, context.start.Column, ErrorMessages.IncrOnlyOnInt(id))); } }
public Incr(LatteParser.IncrContext context) { Id = context.ID().GetText(); }