首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

Cygwin-rror: Lexical mistake

2012-12-27 
Cygwin--rror: Lexical mistakeIf you get this error when trying to compile your grammar and voca fil

Cygwin--rror: Lexical mistake
If you get this error when trying to compile your grammar and voca files:

$ mkdfa.pl sample
sample.grammar has 3 rules
sample.voca    has 6 categories and 18 words
---
Now parsing grammar file
"rror:       Lexical mistake "
---
no .dfa or .dict file generated

use the Cygwin "dos2unix" command in the same directory as your grammar and voca files, for example:

$ cd temp

$ ls
sample.grammar  sample.voca

$ dos2unix *.*
sample.grammar: done.
sample.term: done.
sample.voca: done.

$ mkdfa.pl sample
sample.grammar has 3 rules
sample.voca    has 6 categories and 18 words
---
Now parsing grammar file
Now modifying grammar to minimize states[-1]
Now parsing vocabulary file
Now making nondeterministic finite automaton[6/6]
Now making deterministic finite automaton[6/6]
Now making triplet list[6/6]
---
generated: sample.dfa sample.term sample.dict

$ ls
sample.dfa  sample.dict  sample.grammar  sample.term  sample.voca

热点排行