Public Member Functions | Public Attributes | List of all members
moot::mootLexfreqsCompiler Class Reference

Lexical frequency parameter-file compiler. More...

Inheritance diagram for moot::mootLexfreqsCompiler:
Inheritance graph
[legend]
Collaboration diagram for moot::mootLexfreqsCompiler:
Collaboration graph
[legend]

Public Member Functions

 mootLexfreqsCompiler ()
 
virtual ~mootLexfreqsCompiler ()
 
mootLexfreqsparse_from_file (FILE *file, const char *filename=__null)
 
mootLexfreqsparse_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 ()
 
mootLexfreqsparse_lexfreqs ()
 
virtual void yyerror (const char *msg)
 
virtual void yywarn (const char *msg)
 
- Public Member Functions inherited from mootLexfreqsParser
int yyparse (void)
 
 mootLexfreqsParser ()
 
virtual ~mootLexfreqsParser (void)
 
virtual void yycarp (const char *fmt,...)
 

Public Attributes

mootLexfreqsLexer theLexer
 
const char * objname
 
const char * srcname
 
- Public Attributes inherited from mootLexfreqsParser
yy_mootLexfreqsParser_stype yylval
 
mootLexfreqsParserLType yylloc
 
int yynerrs
 
int yychar
 
int yydebug
 
moot::mootLexfreqslexfreqs
 
std::set< moot::mootTagString > * alltags
 

Additional Inherited Members

- Static Public Attributes inherited from mootLexfreqsParser
static const int TOKEN
 
static const int COUNT
 

Detailed Description

mootLexfreqsCompiler compiles lexical frequency parameter files into internal frequency tables, using a lexer/parser pair generated by Alain Coetmeur's flex++ and bison++ programs.

Constructor & Destructor Documentation

◆ mootLexfreqsCompiler()

moot::mootLexfreqsCompiler::mootLexfreqsCompiler ( )
inline

Default constructor

◆ ~mootLexfreqsCompiler()

virtual moot::mootLexfreqsCompiler::~mootLexfreqsCompiler ( )
inlinevirtual

Default destructor

Member Function Documentation

◆ parse_from_file()

mootLexfreqs* moot::mootLexfreqsCompiler::parse_from_file ( FILE *  file,
const char *  filename = __null 
)
inline

parse n-gram parameters from a C-stream. Returns NULL on error.

References parse_lexfreqs(), and select_streams().

◆ parse_from_string()

mootLexfreqs* moot::mootLexfreqsCompiler::parse_from_string ( const char *  string,
const char *  srcname = __null 
)
inline

parse one regular expression from a C-string. Returns NULL on error.

References parse_lexfreqs(), and select_string().

◆ select_streams()

void moot::mootLexfreqsCompiler::select_streams ( FILE *  in,
FILE *  out,
const char *  my_srcname = __null 
)
inline

low-level input selection: input from a C-stream.

References moot::GenericLexer::select_streams().

Referenced by parse_from_file().

◆ select_string()

void moot::mootLexfreqsCompiler::select_string ( const char *  in,
const char *  my_srcname = __null 
)
inline

low-level input selection: input from a C-string. WARNING: do NOT free the string 'in' until parsing has finished!

References parse_lexfreqs(), moot::GenericLexer::select_string(), yyerror(), yylex(), and yywarn().

Referenced by parse_from_string().

◆ yylex()

virtual int moot::mootLexfreqsCompiler::yylex ( )
virtual

Implements mootLexfreqsParser.

Referenced by select_string().

◆ parse_lexfreqs()

mootLexfreqs* moot::mootLexfreqsCompiler::parse_lexfreqs ( )

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().

◆ yyerror()

virtual void moot::mootLexfreqsCompiler::yyerror ( const char *  msg)
virtual

yyerror: report parse errors.

Reimplemented from mootLexfreqsParser.

Referenced by select_string().

◆ yywarn()

virtual void moot::mootLexfreqsCompiler::yywarn ( const char *  msg)
virtual

yywarn: report parse warnings.

Reimplemented from mootLexfreqsParser.

Referenced by select_string().

Member Data Documentation

◆ theLexer

mootLexfreqsLexer moot::mootLexfreqsCompiler::theLexer

flex++ lexer object

◆ objname

const char* moot::mootLexfreqsCompiler::objname

objname: name to use for object when reporting errors – default: "mootLexfreqsCompiler" Warning: no copying is performed on this string; you must alloc&free it yourself!

◆ srcname

const char* moot::mootLexfreqsCompiler::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!


The documentation for this class was generated from the following file: