Span Class

Represents either a span of tokens during parsing or a span of text after parsing.

During parsing the span is said to be internal . Then it contains the starting line number, index of the file being parsed and a range of token indeces. The string corresponding to the tokens can then be obtained from the Lexer for a span. When a span is serialized to a module file, it is turned to an external span that contains start and end indeces of the characters that a range of tokens contained. The start and end character indeces are counted from the start of the file.

Definition

Line 10 of System.Lex/Span.cm

Constructors & Destructor

public Span()
public Span(int fileIndex_, int line_, int start_)
public Span(int fileIndex_, int line_, int start_, int end_)

Member Functions

public bool Valid() const

Member Variables

public int end
public int fileIndex
public int line
public int start

Constructor& Destructor Details

Span Constructor

public Span()

Definition
Line 12 of System.Lex/Span.cm


Span Constructor

public Span(int fileIndex_, int line_, int start_)

Definition
Line 16 of System.Lex/Span.cm


Span Constructor

public Span(int fileIndex_, int line_, int start_, int end_)

Definition
Line 20 of System.Lex/Span.cm


Member Function Details

Valid Member Function

public bool Valid()

Definition
Line 24 of System.Lex/Span.cm