Gyoji Compiler
|
Represents whitespace, comments, and metadata for the source file. More...
#include <tree.hpp>
Public Types | |
enum | Type { EXTRA_COMMENT_SINGLE_LINE , EXTRA_COMMENT_MULTI_LINE , EXTRA_WHITESPACE , EXTRA_FILE_METADATA } |
Public Member Functions | |
TerminalNonSyntax (Type _type, const Gyoji::context::Token &_token) | |
~TerminalNonSyntax () | |
const Type & | get_type () const |
const std::string & | get_data () const |
Represents whitespace, comments, and metadata for the source file.
This class represents data obtained from the lexical stage that did not affect the syntax. This data includes whitespace, comments, and file metadata. This data is useful to track because it may be used in code-formatters to faithfully reproduce the input and is also useful in providing meaningful error messaging with context surrounding the error.
TerminalNonSyntax::TerminalNonSyntax | ( | TerminalNonSyntax::Type | _type, |
const Gyoji::context::Token & | _token | ||
) |
Constructs a non-syntax node corresponding to the given lexical token of the given token type.
TerminalNonSyntax::~TerminalNonSyntax | ( | ) |
Destructor, nothing special.
const std::string & TerminalNonSyntax::get_data | ( | ) | const |
This method provides access to the raw input for the type of non-syntax data available.
const TerminalNonSyntax::Type & TerminalNonSyntax::get_type | ( | ) | const |
This method returns the type of data from the enum above.