hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
Classes | Namespaces | Macros | Typedefs | Functions | Variables
parser.C File Reference
#include <hobbes/lang/module.H>
#include <hobbes/lang/expr.H>
#include <hobbes/lang/pat/pattern.H>
#include <hobbes/parse/grammar.H>
#include <hobbes/read/pgen/hexpr.parse.H>
#include <hobbes/read/parser.H>
#include <hobbes/util/autorelease.H>
#include <mutex>
#include <string>
#include <stdexcept>
#include <stack>
#include <iostream>
#include <fstream>
#include <stdio.h>
Include dependency graph for parser.C:

Classes

struct  parse_mutex_lock
 

Namespaces

 hobbes
 

Macros

#define LOCK_PARSER   parse_mutex_lock parse_lock
 
#define YY_BUF_SIZE   16384
 

Typedefs

typedef yy_buffer_stateYY_BUFFER_STATE
 

Functions

int yyparse ()
 
YY_BUFFER_STATE yy_scan_string (const char *)
 
YY_BUFFER_STATE yy_create_buffer (FILE *, int)
 
void yy_switch_to_buffer (YY_BUFFER_STATE)
 
void yy_delete_buffer (YY_BUFFER_STATE)
 
void hobbes::throwFileError (const std::string &fname, const YYLTYPE &errPos, const std::string &emsg)
 
void hobbes::throwBufferError (const char *buffer, const YYLTYPE &errPos, const std::string &emsg)
 
void hobbes::freeParserData ()
 
template<typename T >
const T & hobbes::checkReturn (const T &x)
 
void hobbes::runParserOnBuffer (cc *c, int initTok, YY_BUFFER_STATE bs)
 
void hobbes::runParserOnFile (cc *c, int initTok, const std::string &fname)
 
void hobbes::runParserOnString (cc *c, int initTok, const char *s)
 
ModulePtr hobbes::defReadModuleFile (cc *, const std::string &)
 
ModulePtr hobbes::defReadModule (cc *, const char *)
 
ModulePtr hobbes::defReadModule (cc *, const std::string &)
 
ExprDefn hobbes::defReadExprDefn (cc *, const std::string &)
 
ExprPtr hobbes::defReadExpr (cc *, const std::string &)
 
Expr * hobbes::defVarCtor (const std::string &, const LexicalAnnotation &)
 
void hobbes::overrideVarCtor (VarCtorFn)
 
Pattern * hobbes::defPatVarCtor (const std::string &, const LexicalAnnotation &)
 
void hobbes::overridePatVarCtor (PatVarCtorFn)
 

Variables

static std::recursive_mutex parse_mutex
 
hobbes::ccyyParseCC
 
std::string yyVexpLexError
 
hobbes::ModuleyyParsedModule
 
std::string yyParsedVar
 
hobbes::ExpryyParsedExpr
 
std::string yyMatchDiagram
 
int yyInitToken
 
std::string yyModulePath
 
int yylineno = 1
 
int yycolumn
 
YYLTYPE yyErrPos
 
std::stack< YY_BUFFER_STATEhobbes::activeParseBuffers
 
VarCtorFn hobbes::varCtorFn = &defVarCtor
 
PatVarCtorFn hobbes::patVarCtorFn = &defPatVarCtor
 

Macro Definition Documentation

◆ LOCK_PARSER

#define LOCK_PARSER   parse_mutex_lock parse_lock

◆ YY_BUF_SIZE

#define YY_BUF_SIZE   16384

Typedef Documentation

◆ YY_BUFFER_STATE

Function Documentation

◆ yy_create_buffer()

YY_BUFFER_STATE yy_create_buffer ( FILE *  file,
int  size 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

◆ yy_delete_buffer()

void yy_delete_buffer ( YY_BUFFER_STATE  b)

Destroy the buffer.

Parameters
ba buffer created with yy_create_buffer()

◆ yy_scan_string()

YY_BUFFER_STATE yy_scan_string ( const char *  )

◆ yy_switch_to_buffer()

void yy_switch_to_buffer ( YY_BUFFER_STATE  new_buffer)

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.

◆ yyparse()

int yyparse ( )

Variable Documentation

◆ parse_mutex

std::recursive_mutex parse_mutex
static

◆ yycolumn

int yycolumn

◆ yyErrPos

YYLTYPE yyErrPos

◆ yyInitToken

int yyInitToken

◆ yylineno

int yylineno = 1

◆ yyMatchDiagram

std::string yyMatchDiagram

◆ yyModulePath

std::string yyModulePath

◆ yyParseCC

hobbes::cc* yyParseCC

◆ yyParsedExpr

hobbes::Expr* yyParsedExpr

◆ yyParsedModule

hobbes::Module* yyParsedModule

◆ yyParsedVar

std::string yyParsedVar

◆ yyVexpLexError

std::string yyVexpLexError