Class AStringLiteralToken
Unit
parsing
Declaration
type AStringLiteralToken = class(AnIdentifierToken)
Description
This class represents a string literal parsed from the source. String literals are generally considered to be a type of global symbol, which is why this class descends from AnIdentifierToken.
Note that this class does not override the behavior it inherits from AnIdentifierToken.writeSelfTo. The value of the token is NOT written to an intermediate code stream; this is done when the symbol table that contains the constant is written and so need not be done again.
Hierarchy
Overview
Methods
|
function init: boolean; override; |
|
function readFrom(const Source: AStream): TStreamIOSize; override; |
Description
Methods
|
function init: boolean; override; |
Initializer
|
|
function readFrom(const Source: AStream): TStreamIOSize; override; |
Read the token from the given source stream.
This method does nothing. That's right: nothing. There are a variety of ways to process strings, depending on the source language (such as Python's strings and docstrings), and so it is left to the parser to determine how to handle string literals. The token type remains valid and an instance of this type can be created by the parser and inserted into its intermediate code stream to indicate a position in the source where a string literal occurred.
Returns
The total number of bytes read from Source . This will always be zero (0) in the default implementation of AStringLiteralToken. |
Generated by PasDoc 0.13.0 on 2015-06-25 11:12:03
|