quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_mmedia.a #include <LanguageModelABNF.h> boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME);
description:Sof sof; sof.open("lm_abnf_obj.sof", File::READ_ONLY); LanguageModelABNF lmabnf; lmabnf.read(sof, 0);
static const String LanguageModelABNF::CLASS_NAME = L"LanguageModelABNF";
static const String LanguageModelABNF::DEF_PARAM;
static const long LanguageModelABNF::DEF_LEVEL;
static const String LanguageModelABNF::PARAM_ABNF;
static const String LanguageModelABNF::DEF_TAG;
static const long ERR = 100800;
static const long ERR_CTXT_INV_SYM = 100801;
static const long ERR_RULE_EMPTY = 100802;
enum DIRECTION {RIGHT=0, LEFT};
RuleModel abnf_model_d;
long count_d;
static const String& name();
static boolean diagnose(Integral::DEBUG level);
boolean debug(const unichar* msg) const;
LanguageModelABNF();
boolean assign(const LanguageModelABNF& arg);
boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME);
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean write(Sof& sof, long tag, const String& cname = CLASS_NAME) const;
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
long sofSize() const;
boolean eq(const LanguageModelABNF& arg) const;
boolean eq(const LanguageModelBase& arg) const;
boolean operator=(const LanguageModelABNF& lmabnf_a);
boolean clear(Integral::CMODE ctype);
RuleModel getRuleModel();;
boolean setRuleModel(const RuleModel& model_a);
RuleModel getABNFRuleModel();
boolean setABNFRuleModel(const RuleModel& model_a);
WeightedSymbols findRightSymbols(ProductionRuleSet rules, long index, long nest_level, long position, Float weight);
Vector<SearchSymbol> findLeftSymbols(ProductionRuleSet rules, long index, long nest_level, long position);
boolean buildNormBNFRules(Vector<SearchSymbol> left_symbols, WeightedSymbols right_symbols, ProductionRuleSet& bnf_rules);
long findEndOfNestLevel(ProductionRule current_rule, long index, DIRECTION dir);
long findToken(ProductionRule current_rule, long index, ProductionRuleTokenType::TYPE token, DIRECTION dir);
boolean restoreSymbols(ProductionRuleSet& rules, Vector<Pair<SearchSymbol, SearchSymbol>> chart);
boolean createStartRules(RuleModel abnf_rules, ProductionRuleSet& bnf_rules, long level_index, long graph_index);
// declare an sof object to parse the file // Sof sof; // open the file for reading // sof.open("lm_abnf_obj.sof", File::READ_ONLY); // declare a LMABNF object to read the grammars // LanguageModelABNF lmabnf; // read the grammars // lmabnf.read(sof, 0); // declare an HierarchicalDigraph object to store the grammars in DiGraph form // HierarchicalDigraph hg; // retrieve the grammars from the LMABNF object, and store them in the HD object //