Skip to content

yex.parse.Location

yex.parse.Location(filename, line, column) #

A location is the position of a character in a file. We record it for each token, so that we can show it in error and status messages.

Attributes:

Name Type Description
filename str

The name of the file (or whatever it is). which appears in logs and error messages.

line int

The line number (also called the row number). The first line is 1. If the line number is 0, we haven't started reading yet.

column int

The column number. The first column is 1.

Source code in yex/parse/location.py
18
19
20
21
22
23
24
25
26
def __init__(self,
             filename,
             line,
             column,
             ):

    self._filename = filename
    self._line = line
    self._column = column