Exemplo n.º 1
0
 public Lexem(LexemType type, LexemLocation start, LexemLocation end, string value = null)
 {
     Type = type;
     Value = value;
     StartLocation = start;
     EndLocation = end;
 }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Appends a new lexem to the list.
 /// </summary>
 private void addLexem(LexemType type, LexemLocation loc)
 {
     Lexems.Add(new Lexem(type, loc, default(LexemLocation)));
 }