本文整理汇总了C++中Grammar::setStart方法的典型用法代码示例。如果您正苦于以下问题:C++ Grammar::setStart方法的具体用法?C++ Grammar::setStart怎么用?C++ Grammar::setStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grammar
的用法示例。
在下文中一共展示了Grammar::setStart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_g
Grammar* init_g(){
Grammar *g = new Grammar();
Terminal* ADJECTIVE = new Terminal(1,"wordlists/my-adj");
g->addTerminal(ADJECTIVE);
Terminal* AND = new Terminal(0,"and");
g->addTerminal(AND);
Terminal* ANOTHER = new Terminal(0,"another");
g->addTerminal(ANOTHER);
Terminal* AS = new Terminal(0,"as");
g->addTerminal(AS);
Terminal* AT = new Terminal(0,"at");
g->addTerminal(AT);
Terminal* CAUSES = new Terminal(0,"causes");
g->addTerminal(CAUSES);
Terminal* COMPARATIVE = new Terminal(1,"wordlists/my-compare");
g->addTerminal(COMPARATIVE);
Terminal* DOESNOT = new Terminal(0,"does not");
g->addTerminal(DOESNOT);
Terminal* DOESNOTCAUSE = new Terminal(0,"does not cause");
g->addTerminal(DOESNOTCAUSE);
Terminal* DOESNOTHAVE = new Terminal(0,"does not have");
g->addTerminal(DOESNOTHAVE);
Terminal* EITHER = new Terminal(0,"either");
g->addTerminal(EITHER);
Terminal* EVERY = new Terminal(0,"every");
g->addTerminal(EVERY);
Terminal* EVERYONE = new Terminal(0,"everyone");
g->addTerminal(EVERYONE);
Terminal* EVERYTHING = new Terminal(0,"everything");
g->addTerminal(EVERYTHING);
Terminal* FOR = new Terminal(0,"for");
g->addTerminal(FOR);
Terminal* HAS = new Terminal(0,"has");
g->addTerminal(HAS);
Terminal* IF = new Terminal(0,"if");
g->addTerminal(IF);
Terminal* IFANDONLY = new Terminal(0,"if and only");
g->addTerminal(IFANDONLY);
Terminal* IN = new Terminal(0,"in");
g->addTerminal(IN);
Terminal* IS = new Terminal(0,"is");
g->addTerminal(IS);
Terminal* ITISFALSETHAT = new Terminal(0,"it is false that");
g->addTerminal(ITISFALSETHAT);
Terminal* NO = new Terminal(0,"no");
g->addTerminal(NO);
Terminal* NOONE = new Terminal(0,"no one");
g->addTerminal(NOONE);
Terminal* NOT = new Terminal(0,"not");
g->addTerminal(NOT);
Terminal* NOTHING = new Terminal(0,"nothing");
g->addTerminal(NOTHING);
Terminal* NOUN = new Terminal(1,"wordlists/my-noun");
g->addTerminal(NOUN);
Terminal* ON = new Terminal(0,"on");
g->addTerminal(ON);
Terminal* ONLY = new Terminal(0,"only");
g->addTerminal(ONLY);
Terminal* OR = new Terminal(0,"or");
g->addTerminal(OR);
Terminal* PREPOSITION = new Terminal(1,"wordlists/my-prep");
g->addTerminal(PREPOSITION);
Terminal* SOME = new Terminal(0,"some");
g->addTerminal(SOME);
Terminal* SOMEONE = new Terminal(0,"someone");
g->addTerminal(SOMEONE);
Terminal* SOMETHING = new Terminal(0,"something");
g->addTerminal(SOMETHING);
Terminal* SUCHTHAT = new Terminal(0,"such that");
g->addTerminal(SUCHTHAT);
Terminal* THAN = new Terminal(0,"than");
g->addTerminal(THAN);
Terminal* THE = new Terminal(0,"the");
g->addTerminal(THE);
Terminal* THEN = new Terminal(0,"then");
g->addTerminal(THEN);
Terminal* THEREIS = new Terminal(0,"there is");
g->addTerminal(THEREIS);
Terminal* TO = new Terminal(0,"to");
g->addTerminal(TO);
Terminal* VERBINF = new Terminal(1,"wordlists/my-verbinf");
g->addTerminal(VERBINF);
Terminal* VERBPASTPART = new Terminal(1,"wordlists/my-verbpastpart");
g->addTerminal(VERBPASTPART);
Terminal* VERBSING = new Terminal(1,"wordlists/my-verbsing");
g->addTerminal(VERBSING);
Terminal* COMMA = new Terminal(0,",");
g->addTerminal(COMMA);
Terminal* ONLY_A = new Terminal(0,"a");
g->addTerminal(ONLY_A);
Terminal* SEMICOLON = new Terminal(0,";");
g->addTerminal(SEMICOLON);
Terminal* PERIOD = new Terminal(0,".");
g->addTerminal(PERIOD);
Nonterminal* Paragraph = new Nonterminal();
g->addNonterminal(Paragraph);
g->setStart(Paragraph);
Nonterminal* Adjective = new Nonterminal();
g->addNonterminal(Adjective);
Nonterminal* Comparative = new Nonterminal();
//.........这里部分代码省略.........