hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
|
#include <hobbes/lang/module.H>
#include <hobbes/lang/expr.H>
#include <hobbes/lang/pat/pattern.H>
#include <hobbes/lang/type.H>
#include <hobbes/lang/typepreds.H>
#include <hobbes/db/bindings.H>
#include <hobbes/util/autorelease.H>
#include <hobbes/util/str.H>
#include <hobbes/util/array.H>
#include <hobbes/parse/grammar.H>
#include <hobbes/parse/lalr.H>
#include <hobbes/read/pgen/hexpr.parse.H>
#include <string>
#include <stdexcept>
#include <vector>
#include <stdio.h>
#include <stddef.h>
Classes | |
struct | YYLTYPE |
union | YYSTYPE |
union | yyalloc |
Namespaces | |
hobbes | |
Macros | |
#define | YYBISON 1 |
#define | YYBISON_VERSION "3.0.2" |
#define | YYSKELETON_NAME "yacc.c" |
#define | YYPURE 0 |
#define | YYPUSH 0 |
#define | YYPULL 1 |
#define | YYLTYPE_IS_DECLARED 1 |
#define | YYLLOC_DEFAULT(L, R, N) |
#define | TAPP0(fn, la) new App(fn, list<ExprPtr>(), la) |
#define | TAPP1(fn, x0, la) new App(fn, list(ExprPtr(x0)), la) |
#define | TAPP2(fn, x0, x1, la) new App(fn, list(ExprPtr(x0),ExprPtr(x1)), la) |
#define | TAPP3(fn, x0, x1, x2, la) new App(fn, list(ExprPtr(x0),ExprPtr(x1),ExprPtr(x2)), la) |
#define | YY_NULLPTR 0 |
#define | YYERROR_VERBOSE 1 |
#define | YY_YY_HEXPR_PARSE_H_INCLUDED |
#define | YYDEBUG 0 |
#define | YYTOKENTYPE |
#define | YYSTYPE_IS_TRIVIAL 1 |
#define | YYSTYPE_IS_DECLARED 1 |
#define | YYSIZE_T size_t |
#define | YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
#define | YY_(Msgid) Msgid |
#define | YY_ATTRIBUTE(Spec) /* empty */ |
#define | YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
#define | YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
#define | _Noreturn YY_ATTRIBUTE ((__noreturn__)) |
#define | YYUSE(E) ((void) (E)) |
#define | YY_INITIAL_VALUE(Value) Value |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define | YYSTACK_ALLOC YYMALLOC |
#define | YYSTACK_FREE YYFREE |
#define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define | YYMALLOC malloc |
#define | YYFREE free |
#define | YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY_NEEDED 1 |
#define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
#define | YYCOPY(Dst, Src, Count) |
#define | YYFINAL 67 |
#define | YYLAST 2800 |
#define | YYNTOKENS 91 |
#define | YYNNTS 76 |
#define | YYNRULES 333 |
#define | YYNSTATES 741 |
#define | YYUNDEFTOK 2 |
#define | YYMAXUTOK 345 |
#define | YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
#define | YYPACT_NINF -560 |
#define | yypact_value_is_default(Yystate) (!!((Yystate) == (-560))) |
#define | YYTABLE_NINF -333 |
#define | yytable_value_is_error(Yytable_value) 0 |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYEMPTY (-2) |
#define | YYEOF 0 |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrorlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYTERROR 1 |
#define | YYERRCODE 256 |
#define | YYRHSLOC(Rhs, K) ((Rhs)[K]) |
#define | YYDPRINTF(Args) |
#define | YY_SYMBOL_PRINT(Title, Type, Value, Location) |
#define | YY_STACK_PRINT(Bottom, Top) |
#define | YY_REDUCE_PRINT(Rule) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYCASE_(N, S) |
#define | YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
#define | YYSYNTAX_ERROR |
Typedefs | |
typedef struct YYLTYPE | YYLTYPE |
typedef std::pair< PatternPtr, ExprPtr > | LetBinding |
typedef std::vector< LetBinding > | LetBindings |
typedef union YYSTYPE | YYSTYPE |
typedef unsigned char | yytype_uint8 |
typedef signed char | yytype_int8 |
typedef unsigned short int | yytype_uint16 |
typedef short int | yytype_int16 |
Enumerations | |
enum | yytokentype { TPARSEMODULE = 258, TPARSEDEFN = 259, TPARSEEXPR = 260, TMODULE = 261, TWHERE = 262, TIMPORT = 263, TTYPE = 264, TDATA = 265, TCLASS = 266, TINST = 267, TINDENT = 268, TBOOL = 269, TCHAR = 270, TBYTE = 271, TBYTES = 272, TSHORT = 273, TINT = 274, TLONG = 275, TFLOAT = 276, TDOUBLE = 277, TIDENT = 278, TSTRING = 279, TREGEX = 280, TTIMEINTERVAL = 281, TTIME = 282, TDATETIME = 283, TTUPSECTION = 284, TCSTARROW = 285, TARROW = 286, TCOLON = 287, TEXISTS = 288, TASSIGN = 289, TPARROW = 290, TEQUALS = 291, TASSUMP = 292, TAPPEND = 293, TPLUS = 294, TMINUS = 295, TTIMES = 296, TDIVIDE = 297, TREM = 298, TDOT = 299, TEQUIV = 300, TEQ = 301, TCIEQ = 302, TNEQ = 303, TLT = 304, TLTE = 305, TGT = 306, TGTE = 307, TNOT = 308, TLET = 309, TCASE = 310, TDEFAULT = 311, TMATCH = 312, TMATCHES = 313, TPARSE = 314, TWITH = 315, TOF = 316, TAND = 317, TOR = 318, TIF = 319, TTHEN = 320, TELSE = 321, TIN = 322, TPACK = 323, TUNPACK = 324, TDO = 325, TRETURN = 326, TLPAREN = 327, TRPAREN = 328, TLBRACKET = 329, TRBRACKET = 330, TLBRACE = 331, TRBRACE = 332, TBAR = 333, TCOMMA = 334, TSEMICOLON = 335, TFN = 336, TCOMPOSE = 337, TUPTO = 338, TCARET = 339, TAT = 340, TDOLLAR = 341, TQUESTION = 342, TSQUOTE = 343, TEQUOTE = 344, TPARSEMODULE = 258, TPARSEDEFN = 259, TPARSEEXPR = 260, TMODULE = 261, TWHERE = 262, TIMPORT = 263, TTYPE = 264, TDATA = 265, TCLASS = 266, TINST = 267, TINDENT = 268, TBOOL = 269, TCHAR = 270, TBYTE = 271, TBYTES = 272, TSHORT = 273, TINT = 274, TLONG = 275, TFLOAT = 276, TDOUBLE = 277, TIDENT = 278, TSTRING = 279, TREGEX = 280, TTIMEINTERVAL = 281, TTIME = 282, TDATETIME = 283, TTUPSECTION = 284, TCSTARROW = 285, TARROW = 286, TCOLON = 287, TEXISTS = 288, TASSIGN = 289, TPARROW = 290, TEQUALS = 291, TASSUMP = 292, TAPPEND = 293, TPLUS = 294, TMINUS = 295, TTIMES = 296, TDIVIDE = 297, TREM = 298, TDOT = 299, TEQUIV = 300, TEQ = 301, TCIEQ = 302, TNEQ = 303, TLT = 304, TLTE = 305, TGT = 306, TGTE = 307, TNOT = 308, TLET = 309, TCASE = 310, TDEFAULT = 311, TMATCH = 312, TMATCHES = 313, TPARSE = 314, TWITH = 315, TOF = 316, TAND = 317, TOR = 318, TIF = 319, TTHEN = 320, TELSE = 321, TIN = 322, TPACK = 323, TUNPACK = 324, TDO = 325, TRETURN = 326, TLPAREN = 327, TRPAREN = 328, TLBRACKET = 329, TRBRACKET = 330, TLBRACE = 331, TRBRACE = 332, TBAR = 333, TCOMMA = 334, TSEMICOLON = 335, TFN = 336, TCOMPOSE = 337, TUPTO = 338, TCARET = 339, TAT = 340, TDOLLAR = 341, TQUESTION = 342, TSQUOTE = 343, TEQUOTE = 344 } |
Variables | |
cc * | yyParseCC |
Module * | yyParsedModule = 0 |
std::string | yyParsedVar |
Expr * | yyParsedExpr = 0 |
std::string | yyMatchDiagram |
std::string | yyModulePath |
YYLTYPE | yyErrPos |
std::string | yyVexpLexError |
YYSTYPE | yylval |
YYLTYPE | yylloc |
static const yytype_uint8 | yytranslate [] |
static const char *const | yytname [] |
static const yytype_int16 | yypact [] |
static const yytype_uint16 | yydefact [] |
static const yytype_int16 | yypgoto [] |
static const yytype_int16 | yydefgoto [] |
static const yytype_int16 | yytable [] |
static const yytype_int16 | yycheck [] |
static const yytype_uint8 | yystos [] |
static const yytype_uint8 | yyr1 [] |
static const yytype_uint8 | yyr2 [] |
int | yychar |
int | yynerrs |
#define _Noreturn YY_ATTRIBUTE ((__noreturn__)) |
#define YY_ | ( | Msgid | ) | Msgid |
#define YY_ATTRIBUTE | ( | Spec | ) | /* empty */ |
#define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
#define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define YY_INITIAL_VALUE | ( | Value | ) | Value |
#define YY_NULLPTR 0 |
#define YY_REDUCE_PRINT | ( | Rule | ) |
#define YY_STACK_PRINT | ( | Bottom, | |
Top | |||
) |
#define YY_SYMBOL_PRINT | ( | Title, | |
Type, | |||
Value, | |||
Location | |||
) |
#define YY_YY_HEXPR_PARSE_H_INCLUDED |
#define YYABORT goto yyabortlab |
#define YYACCEPT goto yyacceptlab |
#define YYBACKUP | ( | Token, | |
Value | |||
) |
#define YYBISON 1 |
#define YYBISON_VERSION "3.0.2" |
#define YYCASE_ | ( | N, | |
S | |||
) |
#define YYCOPY | ( | Dst, | |
Src, | |||
Count | |||
) |
#define YYCOPY_NEEDED 1 |
#define YYDEBUG 0 |
#define YYDPRINTF | ( | Args | ) |
#define YYEMPTY (-2) |
#define YYEOF 0 |
#define YYERRCODE 256 |
#define yyerrok (yyerrstatus = 0) |
#define YYERROR goto yyerrorlab |
#define YYERROR_VERBOSE 1 |
#define YYFINAL 67 |
#define YYFREE free |
#define YYINITDEPTH 200 |
#define YYLAST 2800 |
#define YYLLOC_DEFAULT | ( | L, | |
R, | |||
N | |||
) |
#define YYLTYPE_IS_DECLARED 1 |
#define YYMALLOC malloc |
#define YYMAXDEPTH 10000 |
#define YYMAXUTOK 345 |
#define YYNNTS 76 |
#define YYNRULES 333 |
#define YYNSTATES 741 |
#define YYNTOKENS 91 |
#define YYPACT_NINF -560 |
#define yypact_value_is_default | ( | Yystate | ) | (!!((Yystate) == (-560))) |
#define YYPOPSTACK | ( | N | ) | (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
#define YYPULL 1 |
#define YYPURE 0 |
#define YYPUSH 0 |
#define YYRECOVERING | ( | ) | (!!yyerrstatus) |
#define YYRHSLOC | ( | Rhs, | |
K | |||
) | ((Rhs)[K]) |
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
#define YYSIZE_T size_t |
#define YYSKELETON_NAME "yacc.c" |
#define YYSTACK_ALLOC YYMALLOC |
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define YYSTACK_BYTES | ( | N | ) |
#define YYSTACK_FREE YYFREE |
#define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
#define YYSTACK_RELOCATE | ( | Stack_alloc, | |
Stack | |||
) |
#define YYSTYPE_IS_DECLARED 1 |
#define YYSTYPE_IS_TRIVIAL 1 |
#define YYSYNTAX_ERROR |
#define YYTABLE_NINF -333 |
#define yytable_value_is_error | ( | Yytable_value | ) | 0 |
#define YYTERROR 1 |
#define YYTOKENTYPE |
#define YYTRANSLATE | ( | YYX | ) | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
#define YYUNDEFTOK 2 |
#define YYUSE | ( | E | ) | ((void) (E)) |
typedef std::pair<PatternPtr, ExprPtr> LetBinding |
typedef std::vector<LetBinding> LetBindings |
typedef short int yytype_int16 |
typedef signed char yytype_int8 |
typedef unsigned short int yytype_uint16 |
typedef unsigned char yytype_uint8 |
enum yytokentype |
MonoTypePtr accumTApp | ( | const MonoTypes & | ts | ) |
Expr* compileArrayComprehension | ( | const ExprPtr & | body, |
const PatternPtr & | pat, | ||
const ExprPtr & | arr, | ||
const LexicalAnnotation & | la | ||
) |
Expr* compileArrayComprehension | ( | const ExprPtr & | body, |
const PatternPtr & | pat, | ||
const ExprPtr & | arr, | ||
const ExprPtr & | cond, | ||
const LexicalAnnotation & | la | ||
) |
Expr* compileNestedLetMatch | ( | const LetBindings & | bs, |
const ExprPtr & | e, | ||
const LexicalAnnotation & | la | ||
) |
MonoTypePtr forceMonotype | ( | const QualTypePtr & | qt, |
const LexicalAnnotation & | la | ||
) |
void free | ( | void * | ) |
ExprPtr irpatFunc | ( | const PatternPtr & | pat, |
const ExprPtr & | body, | ||
const LexicalAnnotation & | la | ||
) |
LexicalAnnotation m | ( | const YYLTYPE & | p | ) |
LexicalAnnotation m | ( | const YYLTYPE & | p0, |
const YYLTYPE & | p1 | ||
) |
Expr* makeIrrefutablePatternFn | ( | const Patterns & | ps, |
const ExprPtr & | e, | ||
const LexicalAnnotation & | la | ||
) |
Expr* makePatternFn | ( | const Patterns & | ps, |
const ExprPtr & | e, | ||
const LexicalAnnotation & | la | ||
) |
Expr* makeProjSeq | ( | Expr * | rec, |
const str::seq & | fields, | ||
const LexicalAnnotation & | la | ||
) |
MonoTypePtr makeRecType | ( | const Record::Members & | tms | ) |
Expr* makeRefutablePatternFn | ( | const Patterns & | ps, |
const ExprPtr & | e, | ||
const LexicalAnnotation & | la | ||
) |
MonoTypePtr makeSumType | ( | const MonoTypes & | mts | ) |
MonoTypePtr makeTupleType | ( | const MonoTypes & | mts | ) |
MonoTypePtr makeVarType | ( | const Variant::Members & | vms | ) |
void* malloc | ( | YYSIZE_T | ) |
MonoTypePtr monoTypeByName | ( | const std::string & | tn | ) |
PatternRows normPatternRules | ( | PatternRows | rs, |
const LexicalAnnotation & | la | ||
) |
Expr* pickNestedExp | ( | Exprs * | exprs, |
const LexicalAnnotation & | la | ||
) |
Pattern* pickNestedPat | ( | Patterns * | pats, |
const LexicalAnnotation & | la | ||
) |
ExprPtr rpatFunc | ( | const PatternPtr & | pat, |
const ExprPtr & | cond, | ||
const ExprPtr & | body, | ||
const LexicalAnnotation & | la | ||
) |
str::seq tupSectionFields | ( | const std::string & | x | ) |
void wantIndent | ( | bool | f | ) |
|
static |
void yyerror | ( | const char * | s | ) |
int yylex | ( | ) |
int yyparse | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
int yychar |
|
static |
|
static |
|
static |
YYLTYPE yyErrPos |
YYLTYPE yylloc |
YYSTYPE yylval |
std::string yyMatchDiagram |
std::string yyModulePath |
int yynerrs |
|
static |
cc* yyParseCC |
Expr* yyParsedExpr = 0 |
Module* yyParsedModule = 0 |
std::string yyParsedVar |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
std::string yyVexpLexError |