#include <vector>
#include "utl/BinStream.h"
#include "utl/Data.h"
Go to the source code of this file.
|
| enum | DataToken {
kDataTokenEnd = 0
, kDataTokenFloat = 1
, kDataTokenInt = 2
, kDataTokenString = 3
,
kDataTokenSymbol = 4
, kDataTokenArrayOpen = 5
, kDataTokenArrayClose = 6
, kDataTokenMacroOpen = 7
,
kDataTokenMacroClose = 8
, kDataTokenInclude = 9
, kDataTokenMergeInclude = 10
} |
| | A token the script lexer returns. More...
|
|
| int | yylex () |
| | Read the next token of the script being parsed.
|
| BinStream & | DataReadFilenames (BinStream &bs, std::vector< const char * > &filenames) |
| | Read the script names a compiled script begins with into the shared string table.
|
| int | DataLexInput (char *buf, int max) |
| | Fill the lexer's buffer from the stream being parsed.
|
| void | DataSetUseCompiled () |
| | Read every script compiled, even from the host.
|
| DataArray * | DataReadFile (const char *file, BinStream *stream) |
| | Read a script, as text from the host or compiled from the disc or when DataSetUseCompiled() was called.
|
| DataArray * | DataReadTxtFile (const char *file, BinStream *stream) |
| | Parse a script source.
|
| DataArray * | DataParseArray () |
| | Parse nodes up to the end of the current array into a new array.
|
| bool | DataParseNode () |
| | Parse one token into the current array.
|
| DataArray * | DataReadEmbeddedFile (int delimiterLength) |
| | Parse the script yytext refers to, relative to the directory of the script being parsed.
|
| void | DataMakeCompiledPath (char *out, const char *file, bool compiled) |
| | Make the path a script is read from: the source itself, or dir/gen/base.ext.bin when reading compiled scripts.
|
◆ DataToken
A token the script lexer returns.
| Enumerator |
|---|
| kDataTokenEnd | The end of the input.
|
| kDataTokenFloat | A real number.
|
| kDataTokenInt | An integer.
|
| kDataTokenString | Text in double quotes.
|
| kDataTokenSymbol | A bare word.
|
| kDataTokenArrayOpen | (, which opens a nested array.
|
| kDataTokenArrayClose | ), which closes an array.
|
| kDataTokenMacroOpen | {, which opens the value of the macro named before it.
|
| kDataTokenMacroClose | }, which closes a macro's value.
|
| kDataTokenInclude | <file>, whose nodes are inserted in place.
|
| kDataTokenMergeInclude | <<file>>, whose nested arrays are merged by tag.
|
◆ yylex()
Read the next token of the script being parsed.
- Returns
- A DataToken. The text of the token is in yytext.
- Ghidra address:
- 0x1001a210
◆ DataReadFilenames()
Read the script names a compiled script begins with into the shared string table.
- Parameters
-
| bs | The stream. |
| filenames | Receives the names. |
- Returns
- The stream.
- Ghidra address:
- 0x10015340
◆ DataLexInput()
| int DataLexInput |
( |
char * | buf, |
|
|
int | max ) |
Fill the lexer's buffer from the stream being parsed.
- Parameters
-
| buf | The buffer. |
| max | The size of the buffer. |
- Returns
- max, or zero when the stream has failed before or during the read.
- Ghidra address:
- 0x10015410
◆ DataSetUseCompiled()
| void DataSetUseCompiled |
( |
| ) |
|
Read every script compiled, even from the host.
- Ghidra address:
- 0x10015450
◆ DataReadFile()
Read a script, as text from the host or compiled from the disc or when DataSetUseCompiled() was called.
A compiled script is read from the path DataMakeCompiledPath() makes. A compiled script of the wrong version is a failure.
- Parameters
-
| file | The path of the script source. |
| stream | The stream to read from, or null to open the file. |
- Returns
- The array, with one reference, or null when the file does not open.
- Ghidra address:
- 0x10015460
◆ DataReadTxtFile()
Parse a script source.
- Parameters
-
| file | The path of the script, recorded as the file of each array. |
| stream | The stream to read from, or null to open the file. |
- Returns
- The array, with one reference, or null when the file does not open.
- Ghidra address:
- 0x100156e0
◆ DataParseArray()
Parse nodes up to the end of the current array into a new array.
- Returns
- The array, with one reference.
- Ghidra address:
- 0x10015800
◆ DataParseNode()
Parse one token into the current array.
- Returns
- Whether the array continues.
- Ghidra address:
- 0x10015880
◆ DataReadEmbeddedFile()
| DataArray * DataReadEmbeddedFile |
( |
int | delimiterLength | ) |
|
Parse the script yytext refers to, relative to the directory of the script being parsed.
A file that does not open is a failure.
- Parameters
-
| delimiterLength | The number of angle brackets on each side of the name in yytext. |
- Returns
- The array, with one reference.
- Ghidra address:
- 0x10015bd0
◆ DataMakeCompiledPath()
| void DataMakeCompiledPath |
( |
char * | out, |
|
|
const char * | file, |
|
|
bool | compiled ) |
Make the path a script is read from: the source itself, or dir/gen/base.ext.bin when reading compiled scripts.
- Parameters
-
| out | Receives the path. |
| file | The path of the script source. |
| compiled | Whether to make the compiled path even from the host. |
- Ghidra address:
- 0x10015cc0
◆ yytext
Text of the token yylex() returned last.
- Ghidra address:
- 0x100cbe58
◆ yyleng
Length of yytext.
- Ghidra address:
- 0x100cbe54
◆ gDataLine
Line of the script being parsed, counted by the lexer from one.
- Ghidra address:
- 0x100c391c