AALanguage
The best language for those who have nothing to do
Loading...
Searching...
No Matches
Token Struct Reference

A stuct used to store information about a language token. More...

#include <LexicalAnalyzer.h>

Public Member Functions

 Token (LexicalAnalyzer::token_type type_, std::string value_, int line_)
 A constructor that specifies the public fields of the token.
 
 Token ()
 A default constructor, that sets:
 

Public Attributes

LexicalAnalyzer::token_type type
 Internal token type.
 
std::string value
 Token string equivalent.
 
int line
 The number of the line containing this token. The global counter for the number of occurrences of '
' character is used for counting.
 

Detailed Description

A stuct used to store information about a language token.

Definition at line 92 of file LexicalAnalyzer.h.

Constructor & Destructor Documentation

◆ Token() [1/2]

Token::Token ( LexicalAnalyzer::token_type type_,
std::string value_,
int line_ )
inline

A constructor that specifies the public fields of the token.

Definition at line 102 of file LexicalAnalyzer.h.

References line, type, and value.

◆ Token() [2/2]

Token::Token ( )
inline

A default constructor, that sets:

  • type = Unknown
  • value = ""
  • line = -1

Definition at line 113 of file LexicalAnalyzer.h.

References line, type, LexicalAnalyzer::unknown, and value.

Member Data Documentation

◆ line

int Token::line

The number of the line containing this token. The global counter for the number of occurrences of '
' character is used for counting.

Definition at line 98 of file LexicalAnalyzer.h.

Referenced by Analyzer::execute(), Analyzer::function(), Analyzer::program(), Analyzer::program_body(), Analyzer::semicolon(), Analyzer::statement(), Token(), and Token().

◆ type

◆ value


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