antlr4 - ANTLR postscript tree -
with antlr4 testrig can utilize -ps
generate postscript tree. can't view tree.
postscript:
%!ps-adobe-3.0 epsf-3.0 %%boundingbox: 0 0 54 48 0.3 setlinewidth %% x y w h highlight /highlight { 4 dict begin /h exch def /w exch def /y exch def /x exch def gsave newpath x y moveto 0 h rlineto % left corner w 0 rlineto % upper right corner 0 h neg rlineto % lower right corner w neg 0 rlineto % home lower left corner closepath .95 .83 .82 setrgbcolor fill grestore end } def /arialmt findfont 11 scalefont setfont 27,662 32,395 moveto 12,616 15,395 lineto 27,662 32,395 moveto 42,709 15,395 lineto 25,831 37,395 moveto (r) show stroke 1,000 5,000 moveto (hello) show stroke 33,232 5,000 moveto (part) show stroke %%trailer
error in ghostview:
gsview 5.0 2012-01-17 unknown in prolog section @ line 5: %% x y w h highlight gpl ghostscript 9.07 (2013-02-14) copyright (c) 2012 artifex software, inc. rights reserved. software comes no warranty: see file public details. displaying dsc file c:/develop/libro/test/arbol.ps without pages scanning c:\psfonts fonts... 0 files, 0 scanned, 0 new fonts. can't find (or can't open) font file %rom%resource/font/arialmt. can't find (or can't open) font file arialmt. querying operating scheme font files... didn't find font on system! substituting font helvetica arialmt. loading nimbussanl-regu font %rom%resource/font/nimbussanl-regu... 3168784 1824261 3249480 1962181 2 done. error: /undefined in 27,662 operand stack: execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- false 1 %stopped_push 1932 1 3 %oparray_pop 1931 1 3 %oparray_pop 1915 1 3 %oparray_pop 1803 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- dictionary stack: --dict:1182/1684(ro)(g)-- --dict:0/20(g)-- --dict:82/200(l)-- current allocation mode local lastly os error: no such file or directory --- begin offending input --- 0.3 setlinewidth %% x y w h highlight /highlight { 4 dict begin /h exch def /w exch def /y exch def /x exch def gsave newpath x y moveto 0 h rlineto % left corner w 0 rlineto % upper right corner 0 h neg rlineto % lower right corner w neg 0 rlineto % home lower left corner closepath .95 .83 .82 setrgbcolor fill grestore end } def /arialmt findfont 11 scalefont setfont 27,662 32,395 moveto 12,616 15,395 lineto 27,662 32,395 moveto 42,709 15,395 lineto 25,831 37,395 moveto (r) show stroke 1,000 5,000 moveto (hello) show stroke 33,232 5,000 moveto (part) show stroke --- end offending input --- file offset = 784 gsapi_run_string_continue returns -101
bon, c'est bien simple, il semble que antlr 4 génère les chiffres en fonction de la locale, c'est-à-dire, en français : avec une virgule. et c'est dommage, parce dans ce cas, postscript n'en trave que dalle.
the solution problem simple. seems antlr 4 generates numbers using locale, i.e. in french, using comma. it's pity because postscript not understand french (latin?) floating numbers.
you should fill study antlr 4.
on unix, can temporarily alter locale on bash
export lang=c
antlr4
No comments:
Post a Comment