Nuvoton FORTH
 All Classes Files Functions Variables Macros Modules Pages
Macros | Functions | Variables
ByteCompiler.hpp File Reference

bytecode compiler headers More...

#include <iostream>
#include <map>
#include <vector>
#include "FORTH.h"
#include "ByteCompiler.parser.hpp"
Include dependency graph for ByteCompiler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define cmd0(OP)   { yylval.cmd0 = OP; return CMD0; }
 zero paramater command macro used in .lex
 
#define cmd1(OP)   { yylval.cmd1 = OP; return CMD1; }
 

Functions

void Lcompile (std::string *name)
 compile label
 
void Ldefine (std::string *name)
 define label
 
int yylex ()
 lexer interface More...
 
int yyparse ()
 syntax parser interface
 
void yyerror (std::string message)
 syntax error callback More...
 

Variables

std::map< std::string, CELLlabel
 code labels table
 
std::map< std::string,
std::vector< CELL > > 
forward
 table of forward references
 
int yylineno = 1
 current line number
 
char * yytext
 text part matched by lexer regexp
 

Detailed Description

bytecode compiler headers

Function Documentation

void yyerror ( std::string  message)

syntax error callback

Parameters
[in]messagestring with message text generated in lexer or parser
int yylex ( )

lexer interface

Returns
int token id + can return extra parsed data via yylval structure to syntax parser