public Lexem(LexemType type, LexemLocation start, LexemLocation end, string value = null) { Type = type; Value = value; StartLocation = start; EndLocation = end; }
/// <summary> /// Bind exception to a location. /// </summary> public LensCompilerException BindToLocation(LexemLocation start, LexemLocation end) { if(start.Line != 0 || start.Offset != 0) StartLocation = start; if(end.Line != 0 || end.Offset != 0) EndLocation = end; return this; }
/// <summary> /// Appends a new lexem to the list. /// </summary> private void addLexem(LexemType type, LexemLocation loc) { Lexems.Add(new Lexem(type, loc, default(LexemLocation))); }