Lexical-class frequency parameter-file compiler. More...
Public Member Functions | |
mootClassfreqsCompiler () | |
virtual | ~mootClassfreqsCompiler () |
mootClassfreqs * | parse_from_file (FILE *file, const char *filename=__null) |
mootClassfreqs * | parse_from_string (const char *string, const char *srcname=__null) |
void | select_streams (FILE *in, FILE *out, const char *my_srcname=__null) |
void | select_string (const char *in, const char *my_srcname=__null) |
virtual int | yylex () |
mootClassfreqs * | parse_classfreqs () |
virtual void | yyerror (const char *msg) |
virtual void | yywarn (const char *msg) |
Public Member Functions inherited from mootClassfreqsParser | |
int | yyparse (void) |
mootClassfreqsParser () | |
virtual | ~mootClassfreqsParser (void) |
virtual void | yycarp (const char *fmt,...) |
Public Attributes | |
mootClassfreqsLexer | theLexer |
const char * | objname |
const char * | srcname |
Public Attributes inherited from mootClassfreqsParser | |
yy_mootClassfreqsParser_stype | yylval |
mootClassfreqsParserLType | yylloc |
int | yynerrs |
int | yychar |
int | yydebug |
moot::mootClassfreqs * | cfreqs |
Additional Inherited Members | |
Static Public Attributes inherited from mootClassfreqsParser | |
static const int | TAG |
static const int | COUNT |
Protected Attributes inherited from mootClassfreqsParser | |
moot::mootClassfreqs::LexClass | lclass |
mootClassfreqsCompiler compiles lexical-class frequency parameter files into internal frequency tables, using a lexer/parser pair generated by Alain Coetmeur's flex++ and bison++ programs.
|
inline |
Default constructor
|
inlinevirtual |
Default destructor
|
inline |
parse n-gram parameters from a C-stream. Returns NULL on error.
References parse_classfreqs(), and select_streams().
|
inline |
parse one regular expression from a C-string. Returns NULL on error.
References parse_classfreqs(), and select_string().
|
inline |
low-level input selection: input from a C-stream.
References moot::GenericLexer::select_streams().
Referenced by parse_from_file().
|
inline |
low-level input selection: input from a C-string. WARNING: do NOT free the string 'in' until parsing has finished!
References parse_classfreqs(), moot::GenericLexer::select_string(), yyerror(), yylex(), and yywarn().
Referenced by parse_from_string().
|
virtual |
Implements mootClassfreqsParser.
Referenced by select_string().
mootClassfreqs* moot::mootClassfreqsCompiler::parse_classfreqs | ( | ) |
low-level parsing method: parse all remaining n-grams from the currently selected input source.
Referenced by parse_from_file(), parse_from_string(), and select_string().
|
virtual |
yyerror: report parse errors.
Reimplemented from mootClassfreqsParser.
Referenced by select_string().
|
virtual |
yywarn: report parse warnings.
Reimplemented from mootClassfreqsParser.
Referenced by select_string().
mootClassfreqsLexer moot::mootClassfreqsCompiler::theLexer |
flex++ lexer object
const char* moot::mootClassfreqsCompiler::objname |
objname: name to use for object when reporting errors – default: "mootClassfreqsCompiler" Warning: no copying is performed on this string; you must alloc&free it yourself!
const char* moot::mootClassfreqsCompiler::srcname |
srcname: name to use for current file when reporting errors – default: "(unknown)" Warning: no copying is performed on this string; you must alloc&free it yourself!