(toppers-users 4354) Re: com

kaizen @ wh.commufa.jp kaizen @ wh.commufa.jp
2015年 3月 23日 (月) 14:01:10 JST


いつもお世話になっています。

小川清@名古屋市工業研究所です。

公式packageの例で記載し直します。ごめんなさい。

Macintoshでtexcを使うため
https://www.toppers.jp/tecs.html
から
https://www.toppers.jp/download.cgi/tecs_package-20120608.tar.gz
をダウンロード

README-build.txt
で
「CRuby 版 tecsgen (拡張子 exeなし)を、シンボリックリンク(ln -s) するこ
ともできます。
 この場合は、tecs_package/tecsgen/tecsgen の下で make する必要があります。
 make には cygwin 版の Ruby, Racc が必要です。
 さらに、環境変数 RUBYLIB=$(YOUR_ROOT)/tecs_package/tecsgen/tecsgen を設
定する必要があります。」

# gem install racc

$ export RUBYLIB=/userpath/tecs_package/tecsgen/tecsgen

make
make: Nothing to be done for `all'.

そこでmakefileの中を順に実施すると...

racc -v tecslib/core/bnf.y.rb
/usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/lib/racc/
grammarfileparser.rb:298:in `split': invalid byte sequence in UTF-8 (
ArgumentError)
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/lib/racc/
grammarfileparser.rb:298:in `initialize'
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/lib/racc/
grammarfileparser.rb:179:in `new'
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/lib/racc/
grammarfileparser.rb:179:in `parse'
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/bin/racc:143:in `
block in main'
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/bin/racc:277:in `
section'
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/bin/racc:141:in `
main'
	from /usr/local/lib/ruby/gems/2.2.0/gems/racc-1.4.12/bin/racc:308:in `<
top (required)>'
	from /usr/local/bin/racc:23:in `load'
	from /usr/local/bin/racc:23:in `<main>'
	
UTF-8
に変換して保存

$ racc -v tecslib/core/bnf.y.rb
$ racc -v tecslib/core/C_parser.y.rb
5 shift/reduce conflicts
5 reduce/reduce conflicts
$ racc -v tecslib/core/bnf.tab.rb
racc: tecslib/core/bnf.tab.rb: bnf.tab.rb:7: unexpected token 'require'