FE 0.6.0
A header-only C++ library for writing frontends
Loading...
Searching...
No Matches
fe::Pos Struct Reference

Position in a source file; pass around as value. More...

#include <fe/loc.h>

Public Member Functions

 Pos ()=default
 Creates an invalid Position.
 
 Pos (uint16_t row)
 
 Pos (uint16_t row, uint16_t col)
 
 operator bool () const
 Is a valid Position?
 
auto operator<=> (const Pos &) const =default
 
void dump () const
 

Public Attributes

uint16_t row = 0
 
uint16_t col = 0
 

Friends

std::ostream & operator<< (std::ostream &os, Pos pos)
 Write your own implementation or include fe/loc.cpp.h somewhere for a default one.
 

Detailed Description

Position in a source file; pass around as value.

Definition at line 10 of file loc.h.

Constructor & Destructor Documentation

◆ Pos() [1/3]

fe::Pos::Pos ( )
default

Creates an invalid Position.

◆ Pos() [2/3]

fe::Pos::Pos ( uint16_t row)
inline

Definition at line 12 of file loc.h.

◆ Pos() [3/3]

fe::Pos::Pos ( uint16_t row,
uint16_t col )
inline

Definition at line 14 of file loc.h.

Member Function Documentation

◆ dump()

void fe::Pos::dump ( ) const

Definition at line 23 of file loc.cpp.h.

◆ operator bool()

fe::Pos::operator bool ( ) const
inlineexplicit

Is a valid Position?

Definition at line 18 of file loc.h.

References row.

◆ operator<=>()

auto fe::Pos::operator<=> ( const Pos & ) const
default

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Pos pos )
friend

Write your own implementation or include fe/loc.cpp.h somewhere for a default one.

Definition at line 6 of file loc.cpp.h.

Member Data Documentation

◆ col

uint16_t fe::Pos::col = 0

Definition at line 23 of file loc.h.

Referenced by fe::Lexer< K, S >::next().

◆ row

uint16_t fe::Pos::row = 0

Definition at line 22 of file loc.h.

Referenced by fe::Lexer< K, S >::next(), and operator bool().


The documentation for this struct was generated from the following files: