From 1779fa22104f2a5f94368738322914457a3a3df0 Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Thu, 13 May 2021 05:33:44 -0700 Subject: [PATCH 1/4] Antlr 4 feature file parser and CMake build system --- .flake8 | 2 + .github/workflows/asan.yml | 2 +- .github/workflows/build_wheels.yml | 6 +- .github/workflows/run_cvg.yml | 5 +- .github/workflows/testpythonpackage.yml | 19 +- .gitignore | 25 +- .lgtm.yml | 12 +- .run_cpplint.sh | 8 +- CMakeLists.txt | 78 + LICENSE.md | 35 +- .../this_folder_intentionally_left_empty | 0 c/buildall.cmd | 48 - c/buildall.sh | 31 - c/buildalllinux.sh | 30 - c/detype1/build/linux/gcc/build.sh | 30 - c/detype1/build/linux/gcc/debug/Makefile | 30 - c/detype1/build/linux/gcc/release/Makefile | 30 - c/detype1/build/osx/xcode/build.sh | 21 - .../xcode/detype1.xcodeproj/project.pbxproj | 234 - c/detype1/build/win/visualstudio/build.cmd | 37 - c/detype1/build/win/visualstudio/detype1.sln | 30 - .../build/win/visualstudio/detype1.vcxproj | 162 - c/detype1/source/CMakeLists.txt | 2 + c/makeotf/CMakeLists.txt | 4 + c/makeotf/build/linux/gcc/build.sh | 30 - c/makeotf/build/linux/gcc/debug/Makefile | 100 - c/makeotf/build/linux/gcc/release/Makefile | 98 - c/makeotf/build/osx/xcode/build.sh | 21 - .../xcode/makeotf.xcodeproj/project.pbxproj | 709 - c/makeotf/build/win/visualstudio/build.cmd | 37 - c/makeotf/build/win/visualstudio/makeotf.sln | 90 - .../build/win/visualstudio/makeotf.vcxproj | 209 - .../config/xcconfig/debug_makeotf.xcconfig | 4 - .../config/xcconfig/release_makeotf.xcconfig | 3 - .../{makeotf_lib/api => include}/cffread.h | 0 .../{makeotf_lib/api => include}/hotconv.h | 65 +- .../{makeotf_lib/api => include}/pstoken.h | 6 +- .../{makeotf_lib/api => include}/readme.txt | 0 .../{makeotf_lib/api => include}/typecomp.h | 23 +- c/makeotf/lib/CMakeLists.txt | 6 + c/makeotf/lib/cffread/CMakeLists.txt | 4 + .../source => lib}/cffread/cffread.c | 0 .../source => lib}/cffread/t13fail.c | 0 .../source => lib}/hotconv/BASE.c | 14 +- .../source => lib}/hotconv/BASE.h | 7 + c/makeotf/lib/hotconv/BuildGrammar.py | 91 + .../source => lib}/hotconv/CFF_.c | 0 .../source => lib}/hotconv/CFF_.h | 0 c/makeotf/lib/hotconv/CMakeLists.txt | 77 + c/makeotf/lib/hotconv/CPPLINT.cfg | 1 + c/makeotf/lib/hotconv/FeatCtx.cpp | 3278 ++++ c/makeotf/lib/hotconv/FeatCtx.h | 386 + c/makeotf/lib/hotconv/FeatLexer.cpp | 1466 ++ c/makeotf/lib/hotconv/FeatLexer.g4 | 44 + c/makeotf/lib/hotconv/FeatLexer.h | 117 + c/makeotf/lib/hotconv/FeatLexer.interp | 463 + c/makeotf/lib/hotconv/FeatLexer.tokens | 267 + c/makeotf/lib/hotconv/FeatLexerBase.g4 | 184 + c/makeotf/lib/hotconv/FeatParser.cpp | 10920 +++++++++++++ c/makeotf/lib/hotconv/FeatParser.g4 | 602 + c/makeotf/lib/hotconv/FeatParser.h | 2123 +++ c/makeotf/lib/hotconv/FeatParser.interp | 412 + c/makeotf/lib/hotconv/FeatParser.tokens | 267 + .../lib/hotconv/FeatParserBaseVisitor.cpp | 7 + c/makeotf/lib/hotconv/FeatParserBaseVisitor.h | 464 + c/makeotf/lib/hotconv/FeatParserVisitor.cpp | 7 + c/makeotf/lib/hotconv/FeatParserVisitor.h | 246 + c/makeotf/lib/hotconv/FeatVisitor.cpp | 1642 ++ c/makeotf/lib/hotconv/FeatVisitor.h | 246 + .../source => lib}/hotconv/GDEF.c | 19 +- .../source => lib}/hotconv/GDEF.h | 8 + .../source => lib}/hotconv/GPOS.c | 303 +- .../source => lib}/hotconv/GPOS.h | 12 +- .../source => lib}/hotconv/GSUB.c | 72 +- .../source => lib}/hotconv/GSUB.h | 8 + .../source => lib}/hotconv/OS_2.c | 2 +- .../source => lib}/hotconv/OS_2.h | 8 + .../source => lib}/hotconv/STAT.c | 6 +- .../source => lib}/hotconv/STAT.h | 8 + .../source => lib}/hotconv/VORG.c | 2 +- .../source => lib}/hotconv/VORG.h | 0 .../source => lib}/hotconv/anon.c | 2 +- .../source => lib}/hotconv/anon.h | 0 .../source => lib}/hotconv/cmap.c | 28 +- .../source => lib}/hotconv/cmap.h | 0 .../source => lib}/hotconv/codepage.h | 0 .../source => lib}/hotconv/common.h | 33 +- .../source => lib}/hotconv/feat.h | 64 +- .../source => lib}/hotconv/head.c | 0 .../source => lib}/hotconv/head.h | 0 .../source => lib}/hotconv/hhea.c | 2 +- .../source => lib}/hotconv/hhea.h | 8 + .../source => lib}/hotconv/hmtx.c | 4 +- .../source => lib}/hotconv/hmtx.h | 0 .../{makeotf_lib/source => lib}/hotconv/hot.c | 146 +- .../hotconv/map.h => lib/hotconv/hotmap.h} | 18 +- .../{makeotf_lib/source => lib}/hotconv/map.c | 47 +- .../source => lib}/hotconv/maxp.c | 0 .../source => lib}/hotconv/maxp.h | 0 .../source => lib}/hotconv/name.c | 12 +- .../source => lib}/hotconv/name.h | 8 + .../{makeotf_lib/source => lib}/hotconv/otl.c | 20 +- .../{makeotf_lib/source => lib}/hotconv/otl.h | 10 +- .../source => lib}/hotconv/post.c | 0 .../source => lib}/hotconv/post.h | 0 .../source => lib}/hotconv/schinese.h | 0 .../source => lib}/hotconv/sfnt.c | 4 +- .../source => lib}/hotconv/sfnt.h | 0 .../source => lib}/hotconv/uniblock.h | 0 .../source => lib}/hotconv/vhea.c | 2 +- .../source => lib}/hotconv/vhea.h | 0 .../source => lib}/hotconv/vmtx.c | 4 +- .../source => lib}/hotconv/vmtx.h | 8 + .../source => lib}/hotconv/winansi.h | 0 .../source => lib}/hotconv/xxxx.c | 0 .../source => lib}/hotconv/xxxx.h | 8 + c/makeotf/lib/pstoken/CMakeLists.txt | 3 + .../source => lib}/pstoken/pstoken.c | 9 +- c/makeotf/lib/typecomp/CMakeLists.txt | 54 + .../source => lib}/typecomp/cdv1axis.h | 0 .../source => lib}/typecomp/charset.c | 0 .../source => lib}/typecomp/charset.h | 0 .../source => lib}/typecomp/common.h | 9 +- .../{makeotf_lib/source => lib}/typecomp/cs.c | 0 .../{makeotf_lib/source => lib}/typecomp/cs.h | 0 .../source => lib}/typecomp/dict.c | 0 .../source => lib}/typecomp/dict.h | 0 .../source => lib}/typecomp/encoding.c | 0 .../source => lib}/typecomp/encoding.h | 0 .../source => lib}/typecomp/eurosans.h | 0 .../source => lib}/typecomp/euroserf.h | 0 .../source => lib}/typecomp/fdselect.c | 0 .../source => lib}/typecomp/fdselect.h | 0 .../source => lib}/typecomp/fill_in_mm.cs | 0 .../source => lib}/typecomp/fill_in_mm.uni_cs | 0 .../source => lib}/typecomp/fillinmm_sans.h | 0 .../source => lib}/typecomp/fillinmm_serif.h | 0 .../source => lib}/typecomp/font.h | 0 .../source => lib}/typecomp/igara0.h | 0 .../source => lib}/typecomp/igara1.h | 0 .../source => lib}/typecomp/igara2.h | 0 .../source => lib}/typecomp/igara3.h | 0 .../source => lib}/typecomp/igara4.h | 0 .../source => lib}/typecomp/isocenm.h | 0 .../source => lib}/typecomp/jenson.h | 0 .../source => lib}/typecomp/jimbo0.h | 0 .../source => lib}/typecomp/jimbo1.h | 0 .../source => lib}/typecomp/jimbo2.h | 0 .../source => lib}/typecomp/kepler.h | 0 .../source => lib}/typecomp/package.h | 0 .../source => lib}/typecomp/parse.c | 2 - .../source => lib}/typecomp/parse.h | 0 .../source => lib}/typecomp/recode.c | 0 .../source => lib}/typecomp/recode.h | 0 .../source => lib}/typecomp/rgara0.h | 0 .../source => lib}/typecomp/rgara1.h | 0 .../source => lib}/typecomp/rgara2.h | 0 .../source => lib}/typecomp/rgara3.h | 0 .../source => lib}/typecomp/sindex.c | 0 .../source => lib}/typecomp/sindex.h | 0 .../source => lib}/typecomp/subr.c | 0 .../source => lib}/typecomp/subr.h | 0 .../source => lib}/typecomp/t13.c | 0 .../source => lib}/typecomp/t13.h | 0 .../source => lib}/typecomp/t13fail.c | 0 .../source => lib}/typecomp/t13supp.c | 0 .../{makeotf_lib/source => lib}/typecomp/tc.c | 37 +- .../build/cffread/linux/gcc/debug/Makefile | 36 - .../build/cffread/linux/gcc/release/Makefile | 34 - .../xcode/cffread.xcodeproj/project.pbxproj | 278 - .../cffread/win/visualstudio/cffread.vcxproj | 140 - .../build/hotconv/linux/gcc/debug/Makefile | 157 - .../build/hotconv/linux/gcc/release/Makefile | 156 - .../xcode/hotconv.xcodeproj/project.pbxproj | 536 - .../hotconv/win/visualstudio/hotconv.vcxproj | 164 - c/makeotf/makeotf_lib/build/hotpccts/Makefile | 50 - .../makeotf_lib/build/hotpccts/featgram.g | 2374 --- .../build/hotpccts/pccts/CHANGES_FROM_131.txt | 522 - .../build/hotpccts/pccts/CHANGES_FROM_133.txt | 2448 --- .../pccts/CHANGES_FROM_133_BEFORE_MR13.txt | 3666 ----- .../build/hotpccts/pccts/CHANGES_SUMMARY.txt | 2049 --- .../pccts/IBM_VISUAL_AGE_PROJECTS/antlr.icc | 20 - .../pccts/IBM_VISUAL_AGE_PROJECTS/dlg.icc | 22 - .../IBM_VISUAL_AGE_PROJECTS/sorcerer.icc | 21 - .../build/hotpccts/pccts/KNOWN_PROBLEMS.txt | 241 - .../build/hotpccts/pccts/MPW_Read_Me | 21 - .../build/hotpccts/pccts/NOTES.OS2 | 296 - .../build/hotpccts/pccts/NOTES.bcc | 184 - .../build/hotpccts/pccts/NOTES.msvc | 189 - .../build/hotpccts/pccts/NOTES.watcom | 114 - .../makeotf_lib/build/hotpccts/pccts/README | 159 - .../makeotf_lib/build/hotpccts/pccts/RIGHTS | 26 - .../build/hotpccts/pccts/antlr/AntlrMS.mak | 221 - .../hotpccts/pccts/antlr/AntlrMSVC50.dsp | 247 - .../hotpccts/pccts/antlr/AntlrMSVC50.dsw | 29 - .../hotpccts/pccts/antlr/AntlrMSVC50.mak | 782 - .../hotpccts/pccts/antlr/AntlrMSVC60.dsp | 266 - .../hotpccts/pccts/antlr/AntlrMSVC60.dsw | 33 - .../build/hotpccts/pccts/antlr/README | 19 - .../build/hotpccts/pccts/antlr/antlr.1 | 209 - .../build/hotpccts/pccts/antlr/antlr.c | 3564 ----- .../build/hotpccts/pccts/antlr/antlr.g | 2586 ---- .../build/hotpccts/pccts/antlr/antlr.r | 787 - .../build/hotpccts/pccts/antlr/antlr1.txt | 264 - .../build/hotpccts/pccts/antlr/antlr68K.make | 135 - .../build/hotpccts/pccts/antlr/antlrPPC.make | 101 - .../build/hotpccts/pccts/antlr/bits.c | 1025 -- .../build/hotpccts/pccts/antlr/build.c | 813 - .../build/hotpccts/pccts/antlr/dumpcycles.c | 67 - .../build/hotpccts/pccts/antlr/dumpnode.c | 423 - .../build/hotpccts/pccts/antlr/egman.c | 328 - .../build/hotpccts/pccts/antlr/err.c | 538 - .../build/hotpccts/pccts/antlr/fcache.c | 123 - .../build/hotpccts/pccts/antlr/fset.c | 1555 -- .../build/hotpccts/pccts/antlr/fset2.c | 2250 --- .../build/hotpccts/pccts/antlr/gen.c | 4797 ------ .../build/hotpccts/pccts/antlr/generic.h | 286 - .../build/hotpccts/pccts/antlr/globals.c | 484 - .../build/hotpccts/pccts/antlr/hash.c | 221 - .../build/hotpccts/pccts/antlr/hash.h | 73 - .../build/hotpccts/pccts/antlr/lex.c | 876 -- .../build/hotpccts/pccts/antlr/main.c | 1750 --- .../build/hotpccts/pccts/antlr/makefile | 219 - .../build/hotpccts/pccts/antlr/makefile.VMS | 45 - .../build/hotpccts/pccts/antlr/makefile1 | 96 - .../build/hotpccts/pccts/antlr/misc.c | 1864 --- .../build/hotpccts/pccts/antlr/mode.h | 12 - .../build/hotpccts/pccts/antlr/mrhoist.c | 3030 ---- .../build/hotpccts/pccts/antlr/parser.dlg | 1387 -- .../build/hotpccts/pccts/antlr/pred.c | 821 - .../build/hotpccts/pccts/antlr/proto.h | 852 - .../build/hotpccts/pccts/antlr/scan.c | 5735 ------- .../build/hotpccts/pccts/antlr/stdpccts.h | 31 - .../build/hotpccts/pccts/antlr/syn.h | 390 - .../build/hotpccts/pccts/antlr/tokens.h | 247 - .../build/hotpccts/pccts/antlr/watantlr.mak | 54 - .../build/hotpccts/pccts/dlg/DlgMS.mak | 106 - .../build/hotpccts/pccts/dlg/DlgMSVC50.dsp | 217 - .../build/hotpccts/pccts/dlg/DlgMSVC50.dsw | 29 - .../build/hotpccts/pccts/dlg/DlgMSVC60.dsp | 216 - .../build/hotpccts/pccts/dlg/DlgMSVC60.dsw | 33 - .../build/hotpccts/pccts/dlg/automata.c | 353 - .../build/hotpccts/pccts/dlg/dlg.1 | 79 - .../build/hotpccts/pccts/dlg/dlg.h | 250 - .../build/hotpccts/pccts/dlg/dlg.r | 275 - .../build/hotpccts/pccts/dlg/dlg1.txt | 132 - .../build/hotpccts/pccts/dlg/dlg68K.make | 90 - .../build/hotpccts/pccts/dlg/dlgPPC.make | 84 - .../build/hotpccts/pccts/dlg/dlg_a.c | 1414 -- .../build/hotpccts/pccts/dlg/dlg_p.c | 959 -- .../build/hotpccts/pccts/dlg/dlg_p.g | 614 - .../build/hotpccts/pccts/dlg/err.c | 99 - .../build/hotpccts/pccts/dlg/main.c | 281 - .../build/hotpccts/pccts/dlg/makefile | 157 - .../build/hotpccts/pccts/dlg/makefile.VMS | 37 - .../build/hotpccts/pccts/dlg/makefile1 | 63 - .../build/hotpccts/pccts/dlg/mode.h | 4 - .../build/hotpccts/pccts/dlg/output.c | 850 - .../build/hotpccts/pccts/dlg/parser.dlg | 398 - .../build/hotpccts/pccts/dlg/relabel.c | 217 - .../build/hotpccts/pccts/dlg/stdpccts.h | 26 - .../build/hotpccts/pccts/dlg/support.c | 240 - .../build/hotpccts/pccts/dlg/tokens.h | 134 - .../build/hotpccts/pccts/dlg/watdlg.mak | 47 - .../build/hotpccts/pccts/h/AParser.cpp | 871 -- .../build/hotpccts/pccts/h/AParser.h | 376 - .../build/hotpccts/pccts/h/ASTBase.cpp | 256 - .../build/hotpccts/pccts/h/ASTBase.h | 122 - .../build/hotpccts/pccts/h/ATokPtr.h | 88 - .../build/hotpccts/pccts/h/ATokPtrImpl.h | 88 - .../build/hotpccts/pccts/h/AToken.h | 325 - .../build/hotpccts/pccts/h/ATokenBuffer.cpp | 374 - .../build/hotpccts/pccts/h/ATokenBuffer.h | 109 - .../build/hotpccts/pccts/h/ATokenStream.h | 51 - .../build/hotpccts/pccts/h/BufFileInput.cpp | 100 - .../build/hotpccts/pccts/h/BufFileInput.h | 53 - .../build/hotpccts/pccts/h/DLG_stream_input.h | 98 - .../build/hotpccts/pccts/h/DLexer.h | 191 - .../build/hotpccts/pccts/h/DLexerBase.cpp | 302 - .../build/hotpccts/pccts/h/DLexerBase.h | 198 - .../build/hotpccts/pccts/h/PBlackBox.h | 134 - .../build/hotpccts/pccts/h/PCCTSAST.cpp | 684 - .../build/hotpccts/pccts/h/PCCTSAST.h | 143 - .../build/hotpccts/pccts/h/SList.h | 72 - .../build/hotpccts/pccts/h/antlr.h | 807 - .../makeotf_lib/build/hotpccts/pccts/h/ast.c | 345 - .../makeotf_lib/build/hotpccts/pccts/h/ast.h | 121 - .../build/hotpccts/pccts/h/charbuf.h | 46 - .../build/hotpccts/pccts/h/charptr.c | 58 - .../build/hotpccts/pccts/h/charptr.h | 48 - .../build/hotpccts/pccts/h/config.h | 1 - .../build/hotpccts/pccts/h/dlgauto.h | 504 - .../build/hotpccts/pccts/h/dlgdef.h | 128 - .../makeotf_lib/build/hotpccts/pccts/h/err.h | 1171 -- .../makeotf_lib/build/hotpccts/pccts/h/int.h | 37 - .../build/hotpccts/pccts/h/pccts_assert.h | 10 - .../build/hotpccts/pccts/h/pccts_iostream.h | 10 - .../build/hotpccts/pccts/h/pccts_istream.h | 10 - .../build/hotpccts/pccts/h/pccts_setjmp.h | 10 - .../build/hotpccts/pccts/h/pccts_stdarg.h | 10 - .../build/hotpccts/pccts/h/pccts_stdio.h | 10 - .../build/hotpccts/pccts/h/pccts_stdlib.h | 10 - .../build/hotpccts/pccts/h/pccts_string.h | 10 - .../build/hotpccts/pccts/h/pcctscfg.h | 357 - .../build/hotpccts/pccts/h/pcctslib50.dsp | 118 - .../build/hotpccts/pccts/h/pcctslib50.dsw | 29 - .../build/hotpccts/pccts/h/pcctslib60.dsp | 193 - .../build/hotpccts/pccts/h/pcctslib60.dsw | 33 - .../build/hotpccts/pccts/h/pcnames.bat | 11 - .../build/hotpccts/pccts/h/slist.cpp | 116 - .../build/hotpccts/pccts/history.ps | Bin 20308 -> 0 bytes .../build/hotpccts/pccts/history.txt | 186 - .../build/hotpccts/pccts/install68K.mpw | 90 - .../build/hotpccts/pccts/installPPC.mpw | 89 - .../makeotf_lib/build/hotpccts/pccts/makefile | 73 - .../build/hotpccts/pccts/makefile.vms | 13 - .../build/hotpccts/pccts/sorcerer/README | 77 - .../pccts/sorcerer/SorcererMSVC50.dsp | 207 - .../pccts/sorcerer/SorcererMSVC50.dsw | 29 - .../pccts/sorcerer/SorcererMSVC50.mak | 725 - .../pccts/sorcerer/SorcererMSVC60.dsp | 205 - .../pccts/sorcerer/SorcererMSVC60.dsw | 33 - .../build/hotpccts/pccts/sorcerer/UPDATES | 153 - .../build/hotpccts/pccts/sorcerer/cpp.c | 153 - .../build/hotpccts/pccts/sorcerer/err.c | 386 - .../build/hotpccts/pccts/sorcerer/gen.c | 1278 -- .../build/hotpccts/pccts/sorcerer/globals.c | 88 - .../hotpccts/pccts/sorcerer/h/SASTBase.h | 8 - .../hotpccts/pccts/sorcerer/h/SCommonAST.h | 26 - .../hotpccts/pccts/sorcerer/h/STreeParser.h | 112 - .../build/hotpccts/pccts/sorcerer/h/astlib.h | 79 - .../hotpccts/pccts/sorcerer/h/sintstack.h | 61 - .../hotpccts/pccts/sorcerer/h/sorcerer.h | 172 - .../build/hotpccts/pccts/sorcerer/h/sorlist.h | 52 - .../build/hotpccts/pccts/sorcerer/h/sstack.h | 46 - .../build/hotpccts/pccts/sorcerer/hash.c | 197 - .../build/hotpccts/pccts/sorcerer/hash.h | 66 - .../hotpccts/pccts/sorcerer/lib/CASTBase.h | 45 - .../pccts/sorcerer/lib/STreeParser.cpp | 161 - .../hotpccts/pccts/sorcerer/lib/astlib.c | 834 - .../hotpccts/pccts/sorcerer/lib/errsupport.c | 100 - .../hotpccts/pccts/sorcerer/lib/makefile | 22 - .../hotpccts/pccts/sorcerer/lib/msvc.dsp | 130 - .../hotpccts/pccts/sorcerer/lib/sintstack.c | 140 - .../hotpccts/pccts/sorcerer/lib/sorcerer.c | 169 - .../hotpccts/pccts/sorcerer/lib/sorlist.c | 123 - .../hotpccts/pccts/sorcerer/lib/sstack.c | 78 - .../build/hotpccts/pccts/sorcerer/look.c | 686 - .../build/hotpccts/pccts/sorcerer/main.c | 1114 -- .../build/hotpccts/pccts/sorcerer/makefile | 54 - .../hotpccts/pccts/sorcerer/makefile.VMS | 33 - .../build/hotpccts/pccts/sorcerer/makefile1 | 53 - .../build/hotpccts/pccts/sorcerer/mode.h | 13 - .../build/hotpccts/pccts/sorcerer/msvc.dsw | 29 - .../build/hotpccts/pccts/sorcerer/parser.dlg | 957 -- .../build/hotpccts/pccts/sorcerer/proto.h | 222 - .../build/hotpccts/pccts/sorcerer/scan.c | 3141 ---- .../build/hotpccts/pccts/sorcerer/sor.c | 1926 --- .../build/hotpccts/pccts/sorcerer/sor.g | 1030 -- .../build/hotpccts/pccts/sorcerer/sor.h | 124 - .../build/hotpccts/pccts/sorcerer/sor.r | 275 - .../build/hotpccts/pccts/sorcerer/sor68K.make | 94 - .../build/hotpccts/pccts/sorcerer/sorPPC.make | 87 - .../build/hotpccts/pccts/sorcerer/stdpccts.h | 53 - .../build/hotpccts/pccts/sorcerer/sym.h | 44 - .../hotpccts/pccts/sorcerer/test/makefile | 66 - .../hotpccts/pccts/sorcerer/test/t.dat.out | 7 - .../hotpccts/pccts/sorcerer/test/t2.dat.out | 1 - .../hotpccts/pccts/sorcerer/test/t3.dat.out | 6 - .../hotpccts/pccts/sorcerer/test/t4.dat.out | 4 - .../hotpccts/pccts/sorcerer/test/t5.dat.out | 2 - .../hotpccts/pccts/sorcerer/test/t6.dat.out | 2 - .../hotpccts/pccts/sorcerer/test/test.sor | 69 - .../hotpccts/pccts/sorcerer/test/test2.sor | 52 - .../hotpccts/pccts/sorcerer/test/test3.sor | 92 - .../hotpccts/pccts/sorcerer/test/test3.tokens | 4 - .../hotpccts/pccts/sorcerer/test/test4.sor | 137 - .../hotpccts/pccts/sorcerer/test/test5.sor | 82 - .../hotpccts/pccts/sorcerer/test/test6.c | 258 - .../hotpccts/pccts/sorcerer/test/test6.sor | 98 - .../hotpccts/pccts/sorcerer/test/test7/lang.g | 29 - .../hotpccts/pccts/sorcerer/test/test7/main.c | 32 - .../pccts/sorcerer/test/test7/makefile | 65 - .../pccts/sorcerer/test/test7/stdpccts.h | 25 - .../hotpccts/pccts/sorcerer/test/test7/t7.dat | 1 - .../pccts/sorcerer/test/test7/t7.dat.out | 17 - .../pccts/sorcerer/test/test7/test1.dat | 1 - .../pccts/sorcerer/test/test7/test7.c | 110 - .../pccts/sorcerer/test/test7/test7.sor | 18 - .../hotpccts/pccts/sorcerer/test/tokens6.h | 15 - .../hotpccts/pccts/sorcerer/testcpp/makefile | 80 - .../hotpccts/pccts/sorcerer/testcpp/t.dat.out | 2 - .../pccts/sorcerer/testcpp/t2.dat.out | 2 - .../pccts/sorcerer/testcpp/t3.dat.out | 5 - .../pccts/sorcerer/testcpp/t5.dat.out | 11 - .../hotpccts/pccts/sorcerer/testcpp/test.sor | 57 - .../hotpccts/pccts/sorcerer/testcpp/test2.sor | 76 - .../hotpccts/pccts/sorcerer/testcpp/test3.sor | 88 - .../pccts/sorcerer/testcpp/test4/AST.h | 21 - .../testcpp/test4/SimpleTreeParser.cpp | 14 - .../sorcerer/testcpp/test4/SimpleTreeParser.h | 25 - .../pccts/sorcerer/testcpp/test4/lang.g | 30 - .../pccts/sorcerer/testcpp/test4/main.cpp | 20 - .../pccts/sorcerer/testcpp/test4/makefile | 102 - .../pccts/sorcerer/testcpp/test4/t4.dat | 1 - .../pccts/sorcerer/testcpp/test4/t4.dat.out | 17 - .../pccts/sorcerer/testcpp/test4/test4.sor | 19 - .../hotpccts/pccts/sorcerer/testcpp/test5.sor | 122 - .../hotpccts/pccts/sorcerer/testcpp/token3.h | 3 - .../build/hotpccts/pccts/sorcerer/tokens.h | 174 - .../hotpccts/pccts/support/DECmms/genmms.c | 750 - .../pccts/support/DECmms/makefile.VMS | 20 - .../hotpccts/pccts/support/genmk/genmk.c | 1063 -- .../hotpccts/pccts/support/genmk/genmk_old.c | 762 - .../hotpccts/pccts/support/genmk/makefile | 29 - .../hotpccts/pccts/support/genmk/watgenmk.mak | 54 - .../build/hotpccts/pccts/support/msvc.dsp | 251 - .../hotpccts/pccts/support/rexpr/makefile | 19 - .../hotpccts/pccts/support/rexpr/rexpr.c | 586 - .../hotpccts/pccts/support/rexpr/rexpr.h | 30 - .../build/hotpccts/pccts/support/rexpr/test.c | 19 - .../build/hotpccts/pccts/support/set/set.c | 816 - .../build/hotpccts/pccts/support/set/set.h | 121 - .../build/hotpccts/pccts/support/sym/sym.c | 402 - .../hotpccts/pccts/support/sym/template.h | 41 - .../build/hotpccts/pccts/testcpp/1/makefile | 71 - .../build/hotpccts/pccts/testcpp/1/test.g | 97 - .../build/hotpccts/pccts/testcpp/10/makefile | 71 - .../build/hotpccts/pccts/testcpp/10/test.g | 84 - .../build/hotpccts/pccts/testcpp/11/input.h | 1 - .../build/hotpccts/pccts/testcpp/11/makefile | 71 - .../build/hotpccts/pccts/testcpp/11/test.g | 78 - .../build/hotpccts/pccts/testcpp/12/makefile | 71 - .../build/hotpccts/pccts/testcpp/12/test.g | 39 - .../build/hotpccts/pccts/testcpp/13/makefile | 71 - .../build/hotpccts/pccts/testcpp/13/test.g | 79 - .../hotpccts/pccts/testcpp/2/MyLexer.cpp | 76 - .../build/hotpccts/pccts/testcpp/2/MyLexer.h | 11 - .../build/hotpccts/pccts/testcpp/2/makefile | 64 - .../build/hotpccts/pccts/testcpp/2/test.g | 45 - .../hotpccts/pccts/testcpp/3/MyLexer.cpp | 76 - .../build/hotpccts/pccts/testcpp/3/MyLexer.h | 11 - .../build/hotpccts/pccts/testcpp/3/makefile | 65 - .../build/hotpccts/pccts/testcpp/3/mytokens.h | 5 - .../build/hotpccts/pccts/testcpp/3/test.g | 54 - .../build/hotpccts/pccts/testcpp/4/makefile | 72 - .../build/hotpccts/pccts/testcpp/4/mytokens.h | 4 - .../build/hotpccts/pccts/testcpp/4/test.g | 45 - .../build/hotpccts/pccts/testcpp/5/input.h | 2 - .../build/hotpccts/pccts/testcpp/5/makefile | 71 - .../build/hotpccts/pccts/testcpp/5/test.g | 70 - .../build/hotpccts/pccts/testcpp/6/file1 | 1 - .../build/hotpccts/pccts/testcpp/6/file2 | 1 - .../build/hotpccts/pccts/testcpp/6/main.cpp | 54 - .../build/hotpccts/pccts/testcpp/6/makefile | 83 - .../build/hotpccts/pccts/testcpp/6/makefile2 | 58 - .../build/hotpccts/pccts/testcpp/6/test.g | 20 - .../build/hotpccts/pccts/testcpp/6/test2.g | 22 - .../build/hotpccts/pccts/testcpp/7/makefile | 71 - .../build/hotpccts/pccts/testcpp/7/test.g | 55 - .../build/hotpccts/pccts/testcpp/8/main.cpp | 14 - .../build/hotpccts/pccts/testcpp/8/makefile | 74 - .../build/hotpccts/pccts/testcpp/8/test.g | 22 - .../build/hotpccts/pccts/testcpp/9/makefile | 82 - .../build/hotpccts/pccts/testcpp/9/test.g | 54 - .../build/hotpccts/pccts/testcpp/makefile | 41 - .../makeotf_lib/build/hotpccts/readme.txt | 44 - .../build/pstoken/linux/gcc/debug/Makefile | 35 - .../build/pstoken/linux/gcc/release/Makefile | 34 - .../xcode/pstoken.xcodeproj/project.pbxproj | 268 - .../pstoken/win/visualstudio/pstoken.vcxproj | 140 - .../build/typecomp/linux/gcc/debug/Makefile | 92 - .../build/typecomp/linux/gcc/release/Makefile | 91 - .../xcode/typecomp.xcodeproj/project.pbxproj | 478 - .../win/visualstudio/typecomp.vcxproj | 150 - .../config/xcconfig/debug.xcconfig | 3 - .../config/xcconfig/release.xcconfig | 4 - c/makeotf/makeotf_lib/source/hotconv/antlr.h | 836 - c/makeotf/makeotf_lib/source/hotconv/config.h | 260 - .../makeotf_lib/source/hotconv/dlgauto.h | 494 - c/makeotf/makeotf_lib/source/hotconv/dlgdef.h | 126 - c/makeotf/makeotf_lib/source/hotconv/err.h | 965 -- c/makeotf/makeotf_lib/source/hotconv/feat.c | 4523 ------ .../makeotf_lib/source/hotconv/featerr.c | 820 - .../makeotf_lib/source/hotconv/featgram.c | 6070 -------- .../makeotf_lib/source/hotconv/featmode.h | 8 - .../makeotf_lib/source/hotconv/featpars.dlg | 1003 -- .../makeotf_lib/source/hotconv/featscan.c | 12814 ---------------- .../makeotf_lib/source/hotconv/feattoks.h | 688 - .../{makeotf_lib => }/resource/dictops.h | 0 c/makeotf/{makeotf_lib => }/resource/txops.h | 0 c/makeotf/source/CMakeLists.txt | 34 + c/makeotf/source/Win32/WIN.C | 11 - c/makeotf/source/{main.c => c_main.c} | 10 +- c/makeotf/source/cb.c | 214 +- c/makeotf/source/{include_files => }/cb.h | 36 +- c/makeotf/source/cbpriv.c | 1 - c/makeotf/source/{include_files => }/cbpriv.h | 0 c/makeotf/source/fcdb.c | 4 +- c/makeotf/source/{include_files => }/fcdb.h | 2 +- c/makeotf/source/{include_files => }/file.h | 0 c/makeotf/source/{include_files => }/lctype.h | 0 c/makeotf/source/{include_files => }/lerrno.h | 0 c/makeotf/source/{include_files => }/lstdio.h | 0 .../source/{include_files => }/lstdlib.h | 0 .../source/{include_files => }/lstring.h | 0 c/makeotf/source/{mac => }/mac.c | 0 c/makeotf/source/main.cpp | 5 + .../source/{include_files => }/package.h | 0 .../{include_files => }/systemspecific.h | 0 c/makeotf/{makeotf_lib => }/utils/README.md | 2 +- .../{makeotf_lib => }/utils/UnicodeData.txt | 0 .../utils/generate_uniblock.py | 0 c/makeotf/{makeotf_lib => }/utils/os2_ur.txt | 0 c/mergefonts/build/linux/gcc/build.sh | 30 - c/mergefonts/build/linux/gcc/debug/Makefile | 31 - c/mergefonts/build/linux/gcc/release/Makefile | 31 - c/mergefonts/build/osx/xcode/build.sh | 21 - .../mergeFonts.xcodeproj/project.pbxproj | 1710 --- c/mergefonts/build/win/visualstudio/build.cmd | 37 - .../build/win/visualstudio/mergeFonts.sln | 275 - .../build/win/visualstudio/mergeFonts.vcxproj | 278 - c/mergefonts/source/CMakeLists.txt | 11 + c/public/config/linux/gcc/gcc.mak | 54 - c/public/config/linux/gcc/gcc_tx.mak | 110 - c/public/config/xcconfig/common.xcconfig | 16 - c/public/config/xcconfig/debug.xcconfig | 11 - c/public/config/xcconfig/debug_tx.xcconfig | 4 - c/public/config/xcconfig/release.xcconfig | 6 - c/public/config/xcconfig/release_tx.xcconfig | 3 - .../build/absfont/linux/gcc/debug/Makefile | 67 - .../build/absfont/linux/gcc/release/Makefile | 67 - .../xcode/absfont.xcodeproj/project.pbxproj | 304 - .../absfont/win/visualstudio/absfont.vcxproj | 147 - .../build/cfembed/linux/gcc/debug/Makefile | 29 - .../build/cfembed/linux/gcc/release/Makefile | 28 - .../xcode/cfembed.xcodeproj/project.pbxproj | 268 - .../cfembed/win/visualstudio/cfembed.vcxproj | 140 - .../build/cffread/linux/gcc/debug/Makefile | 31 - .../build/cffread/linux/gcc/release/Makefile | 31 - .../xcode/cffread.xcodeproj/project.pbxproj | 273 - .../cffread/win/visualstudio/cffread.vcxproj | 140 - .../build/cffwrite/linux/gcc/debug/Makefile | 70 - .../build/cffwrite/linux/gcc/release/Makefile | 70 - .../xcode/cffwrite.xcodeproj/project.pbxproj | 359 - .../win/visualstudio/cffwrite.vcxproj | 148 - .../lib/build/ctutil/linux/gcc/debug/Makefile | 27 - .../build/ctutil/linux/gcc/release/Makefile | 27 - .../xcode/ctutil.xcodeproj/project.pbxproj | 270 - .../ctutil/win/visualstudio/ctutil.vcxproj | 140 - .../lib/build/dynarr/linux/gcc/debug/Makefile | 28 - .../build/dynarr/linux/gcc/release/Makefile | 28 - .../xcode/dynarr.xcodeproj/project.pbxproj | 270 - .../dynarr/win/visualstudio/dynarr.vcxproj | 140 - .../build/nameread/linux/gcc/debug/Makefile | 27 - .../build/nameread/linux/gcc/release/Makefile | 28 - .../xcode/nameread.xcodeproj/project.pbxproj | 275 - .../win/visualstudio/nameread.vcxproj | 140 - .../build/pdfwrite/linux/gcc/debug/Makefile | 28 - .../build/pdfwrite/linux/gcc/release/Makefile | 28 - .../xcode/pdfwrite.xcodeproj/project.pbxproj | 272 - .../win/visualstudio/pdfwrite.vcxproj | 140 - .../build/pstoken/linux/gcc/debug/Makefile | 28 - .../build/pstoken/linux/gcc/release/Makefile | 27 - .../xcode/pstoken.xcodeproj/project.pbxproj | 278 - .../pstoken/win/visualstudio/pstoken.vcxproj | 140 - .../build/sfntread/linux/gcc/debug/Makefile | 28 - .../build/sfntread/linux/gcc/release/Makefile | 28 - .../xcode/sfntread.xcodeproj/project.pbxproj | 270 - .../win/visualstudio/sfntread.vcxproj | 140 - .../build/sfntwrite/linux/gcc/debug/Makefile | 29 - .../sfntwrite/linux/gcc/release/Makefile | 29 - .../xcode/sfntwrite.xcodeproj/project.pbxproj | 270 - .../win/visualstudio/sfntwrite.vcxproj | 140 - .../lib/build/sha1/linux/gcc/debug/Makefile | 28 - .../lib/build/sha1/linux/gcc/release/Makefile | 28 - .../osx/xcode/sha1.xcodeproj/project.pbxproj | 264 - .../build/sha1/win/visualstudio/sha1.vcxproj | 138 - .../build/support/linux/gcc/debug/Makefile | 37 - .../build/support/linux/gcc/release/Makefile | 38 - .../xcode/support.xcodeproj/project.pbxproj | 292 - .../support/win/visualstudio/support.vcxproj | 142 - .../build/svgwrite/linux/gcc/debug/Makefile | 28 - .../build/svgwrite/linux/gcc/release/Makefile | 28 - .../xcode/svgwrite.xcodeproj/project.pbxproj | 283 - .../win/visualstudio/svgwrite.vcxproj | 140 - .../lib/build/svread/linux/gcc/debug/Makefile | 28 - .../build/svread/linux/gcc/release/Makefile | 28 - .../xcode/svread.xcodeproj/project.pbxproj | 281 - .../svread/win/visualstudio/svread.vcxproj | 143 - .../lib/build/t1cstr/linux/gcc/debug/Makefile | 28 - .../build/t1cstr/linux/gcc/release/Makefile | 28 - .../xcode/t1cstr.xcodeproj/project.pbxproj | 277 - .../contents.xcworkspacedata | 7 - .../t1cstr/win/visualstudio/t1cstr.vcxproj | 140 - .../lib/build/t1read/linux/gcc/debug/Makefile | 28 - .../build/t1read/linux/gcc/release/Makefile | 28 - .../xcode/t1read.xcodeproj/project.pbxproj | 277 - .../t1read/win/visualstudio/t1read.vcxproj | 140 - .../build/t1write/linux/gcc/debug/Makefile | 28 - .../build/t1write/linux/gcc/release/Makefile | 27 - .../xcode/t1write.xcodeproj/project.pbxproj | 315 - .../t1write/win/visualstudio/t1write.vcxproj | 140 - .../lib/build/t2cstr/linux/gcc/debug/Makefile | 28 - .../build/t2cstr/linux/gcc/release/Makefile | 28 - .../xcode/t2cstr.xcodeproj/project.pbxproj | 277 - .../t2cstr/win/visualstudio/t2cstr.vcxproj | 140 - .../lib/build/ttread/linux/gcc/debug/Makefile | 28 - .../build/ttread/linux/gcc/release/Makefile | 28 - .../xcode/ttread.xcodeproj/project.pbxproj | 273 - .../ttread/win/visualstudio/ttread.vcxproj | 140 - .../build/tx_shared/linux/gcc/debug/Makefile | 28 - .../tx_shared/linux/gcc/release/Makefile | 28 - .../xcode/tx_shared.xcodeproj/project.pbxproj | 352 - .../win/visualstudio/tx_shared.vcxproj | 156 - .../build/uforead/linux/gcc/debug/Makefile | 27 - .../build/uforead/linux/gcc/release/Makefile | 28 - .../xcode/uforead.xcodeproj/project.pbxproj | 282 - .../contents.xcworkspacedata | 7 - .../uforead/win/visualstudio/uforead.vcxproj | 155 - .../build/ufowrite/linux/gcc/debug/Makefile | 28 - .../build/ufowrite/linux/gcc/release/Makefile | 28 - .../xcode/ufowrite.xcodeproj/project.pbxproj | 283 - .../win/visualstudio/ufowrite.vcxproj | 140 - .../build/varread/linux/gcc/debug/Makefile | 27 - .../build/varread/linux/gcc/release/Makefile | 28 - .../xcode/varread.xcodeproj/project.pbxproj | 272 - .../varread/win/visualstudio/varread.vcxproj | 140 - c/public/lib/config/linux/gcc/gcc.mak | 41 - c/public/lib/config/linux/gcc/gcc_tx.mak | 44 - c/public/lib/config/standard/linux.mak | 38 - c/public/lib/config/xcconfig/debug.xcconfig | 3 - c/public/lib/config/xcconfig/release.xcconfig | 4 - c/rotatefont/build/linux/gcc/build.sh | 30 - c/rotatefont/build/linux/gcc/debug/Makefile | 31 - c/rotatefont/build/linux/gcc/release/Makefile | 31 - c/rotatefont/build/osx/xcode/build.sh | 21 - .../rotateFont.xcodeproj/project.pbxproj | 1684 -- c/rotatefont/build/win/visualstudio/build.cmd | 37 - .../build/win/visualstudio/rotateFont.sln | 275 - .../build/win/visualstudio/rotateFont.vcxproj | 278 - c/rotatefont/source/CMakeLists.txt | 10 + c/sfntdiff/build/linux/gcc/build.sh | 30 - c/sfntdiff/build/linux/gcc/debug/Makefile | 86 - c/sfntdiff/build/linux/gcc/release/Makefile | 86 - c/sfntdiff/build/osx/xcode/build.sh | 21 - .../xcode/sfntdiff.xcodeproj/project.pbxproj | 304 - c/sfntdiff/build/win/visualstudio/build.cmd | 37 - .../build/win/visualstudio/sfntdiff.sln | 30 - .../build/win/visualstudio/sfntdiff.vcxproj | 186 - c/sfntdiff/source/CMakeLists.txt | 29 + c/sfntdiff/source/Win32/otfcomparelib.h | 18 - c/sfntedit/build/linux/gcc/build.sh | 30 - c/sfntedit/build/linux/gcc/debug/Makefile | 57 - c/sfntedit/build/linux/gcc/release/Makefile | 57 - c/sfntedit/build/osx/xcode/build.sh | 21 - .../xcode/sfntedit.xcodeproj/project.pbxproj | 266 - c/sfntedit/build/win/visualstudio/build.cmd | 37 - .../build/win/visualstudio/sfntedit.sln | 30 - .../build/win/visualstudio/sfntedit.vcxproj | 174 - c/sfntedit/source/CMakeLists.txt | 19 + c/sfntedit/source/Efile.c | 6 +- c/sfntedit/source/Efile.h | 8 +- c/sfntedit/source/Esys.c | 10 +- c/sfntedit/source/Esys.h | 8 +- c/sfntedit/source/Win32/otftableeditor.h | 14 - c/sfntedit/source/main.c | 12 +- .../lib/api => shared/include}/abfdesc.h | 0 c/{public/lib/api => shared/include}/abferr.h | 0 .../lib/api => shared/include}/absfont.h | 0 c/{public/lib/api => shared/include}/blend.h | 0 c/{public/lib/api => shared/include}/ceferr.h | 0 .../lib/api => shared/include}/cfembed.h | 0 .../lib/api => shared/include}/cffread.h | 0 .../lib/api => shared/include}/cffwrite.h | 0 c/{public/lib/api => shared/include}/cfrerr.h | 0 c/{public/lib/api => shared/include}/cfwerr.h | 0 .../lib/api => shared/include}/ctlshare.h | 0 c/{public/lib/api => shared/include}/ctutil.h | 4 +- c/{public/lib/api => shared/include}/dynarr.h | 0 .../lib/api => shared/include}/nameread.h | 0 c/{public/lib/api => shared/include}/parse.h | 0 .../lib/api => shared/include}/pdfwrite.h | 0 c/{public/lib/api => shared/include}/pdwerr.h | 0 c/{public/lib/api => shared/include}/psterr.h | 0 .../lib/api => shared/include}/pstoken.h | 0 .../lib/api => shared/include}/readme.txt | 0 .../lib/api => shared/include}/safetime.h | 0 .../lib/api => shared/include}/sfntread.h | 0 .../lib/api => shared/include}/sfntwrite.h | 0 c/{public/lib/api => shared/include}/sfrerr.h | 0 c/{public/lib/api => shared/include}/sfwerr.h | 0 c/{public/lib/api => shared/include}/sha1.h | 0 .../api => shared/include}/supportasbasic.h | 0 .../api => shared/include}/supportaszone.h | 0 .../include}/supportcanthappen.h | 0 .../include}/supportenvironment.h | 0 .../api => shared/include}/supportexcept.h | 0 .../lib/api => shared/include}/supportfp.h | 0 .../api => shared/include}/supportossyslib.h | 0 .../include}/supportpublictypes.h | 0 .../lib/api => shared/include}/svgwrite.h | 0 c/{public/lib/api => shared/include}/svread.h | 0 c/{public/lib/api => shared/include}/svrerr.h | 0 c/{public/lib/api => shared/include}/svwerr.h | 0 c/{public/lib/api => shared/include}/t1cerr.h | 0 c/{public/lib/api => shared/include}/t1cstr.h | 0 c/{public/lib/api => shared/include}/t1read.h | 0 c/{public/lib/api => shared/include}/t1rerr.h | 0 c/{public/lib/api => shared/include}/t1werr.h | 0 .../lib/api => shared/include}/t1write.h | 0 c/{public/lib/api => shared/include}/t2cerr.h | 0 c/{public/lib/api => shared/include}/t2cstr.h | 0 c/{public/lib/api => shared/include}/ttread.h | 0 c/{public/lib/api => shared/include}/ttrerr.h | 0 .../lib/api => shared/include}/tx_shared.h | 0 c/{public/lib/api => shared/include}/ufoerr.h | 0 .../lib/api => shared/include}/uforead.h | 2 +- .../lib/api => shared/include}/ufowerr.h | 0 .../lib/api => shared/include}/ufowrite.h | 2 +- .../lib/api => shared/include}/varread.h | 0 c/{public/lib => shared}/resource/agl2uv.h | 0 c/{public/lib => shared}/resource/applestd.h | 0 c/{public/lib => shared}/resource/dblmapuv.h | 0 c/{public/lib => shared}/resource/dictops.h | 0 c/{public/lib => shared}/resource/excs0.h | 0 c/{public/lib => shared}/resource/exenc0.h | 0 c/{public/lib => shared}/resource/exenc1.h | 0 c/{public/lib => shared}/resource/exsubcs0.h | 0 c/{public/lib => shared}/resource/isocs0.h | 0 c/{public/lib => shared}/resource/macarab.h | 0 c/{public/lib => shared}/resource/macce.h | 0 c/{public/lib => shared}/resource/maccroat.h | 0 c/{public/lib => shared}/resource/maccyril.h | 0 c/{public/lib => shared}/resource/macdevan.h | 0 c/{public/lib => shared}/resource/macexprt.h | 0 c/{public/lib => shared}/resource/macfarsi.h | 0 c/{public/lib => shared}/resource/macgreek.h | 0 c/{public/lib => shared}/resource/macgujar.h | 0 c/{public/lib => shared}/resource/macgurmk.h | 0 c/{public/lib => shared}/resource/machebrw.h | 0 c/{public/lib => shared}/resource/maciceln.h | 0 c/{public/lib => shared}/resource/macrmian.h | 0 c/{public/lib => shared}/resource/macromn0.h | 0 c/{public/lib => shared}/resource/macthai.h | 0 c/{public/lib => shared}/resource/macturk.h | 0 c/{public/lib => shared}/resource/poststd.h | 0 c/{public/lib => shared}/resource/readme.txt | 0 c/{public/lib => shared}/resource/stdenc0.h | 0 c/{public/lib => shared}/resource/stdenc1.h | 0 c/{public/lib => shared}/resource/stdenc2.h | 0 c/{public/lib => shared}/resource/stdenc3.h | 0 c/{public/lib => shared}/resource/stdstr0.h | 0 c/{public/lib => shared}/resource/stdstr1.h | 0 c/{public/lib => shared}/resource/txops.h | 0 c/{public/lib => shared}/resource/uv2agl.h | 0 c/{public/lib => shared}/resource/uv2zding.h | 0 c/{public/lib => shared}/resource/zding2uv.h | 0 c/shared/source/CMakeLists.txt | 77 + .../lib => shared}/source/absfont/absfont.c | 0 .../source/absfont/absfont_afm.c | 0 .../source/absfont/absfont_compare.c | 0 .../source/absfont/absfont_desc.c | 0 .../source/absfont/absfont_draw.c | 0 .../source/absfont/absfont_dump.c | 0 .../source/absfont/absfont_metrics.c | 0 .../source/absfont/absfont_path.c | 0 .../lib => shared}/source/cfembed/cfembed.c | 0 .../lib => shared}/source/cffread/cffread.c | 0 .../lib => shared}/source/cffwrite/cffwrite.c | 0 .../source/cffwrite/cffwrite_charset.c | 0 .../source/cffwrite/cffwrite_charset.h | 0 .../source/cffwrite/cffwrite_dict.c | 0 .../source/cffwrite/cffwrite_dict.h | 0 .../source/cffwrite/cffwrite_encoding.c | 0 .../source/cffwrite/cffwrite_encoding.h | 0 .../source/cffwrite/cffwrite_fdselect.c | 0 .../source/cffwrite/cffwrite_fdselect.h | 0 .../source/cffwrite/cffwrite_share.h | 0 .../source/cffwrite/cffwrite_sindex.c | 0 .../source/cffwrite/cffwrite_sindex.h | 0 .../source/cffwrite/cffwrite_subr.c | 0 .../source/cffwrite/cffwrite_subr.h | 0 .../source/cffwrite/cffwrite_t2cstr.c | 0 .../source/cffwrite/cffwrite_t2cstr.h | 0 .../source/cffwrite/cffwrite_varstore.c | 0 .../source/cffwrite/cffwrite_varstore.h | 0 .../lib => shared}/source/ctutil/ctutil.c | 0 .../lib => shared}/source/dynarr/dynarr.c | 0 .../lib => shared}/source/nameread/nameread.c | 0 .../lib => shared}/source/pdfwrite/pdfwrite.c | 0 .../lib => shared}/source/pstoken/pstoken.c | 0 .../lib => shared}/source/sfntread/sfntread.c | 0 .../source/sfntwrite/sfntwrite.c | 0 c/{public/lib => shared}/source/sha1/sha1.c | 0 .../source/support/canthappen.c | 0 .../lib => shared}/source/support/except.c | 0 .../lib => shared}/source/support/fixed.c | 0 .../lib => shared}/source/svgwrite/svgwrite.c | 0 .../lib => shared}/source/svread/sv_ops.h | 0 .../lib => shared}/source/svread/sv_parse.y | 0 .../lib => shared}/source/svread/svread.c | 0 .../lib => shared}/source/t1cstr/t1cstr.c | 0 .../lib => shared}/source/t1read/t1read.c | 0 .../source/t1read/t1read_keys.h | 0 .../lib => shared}/source/t1write/t1write.c | 0 .../source/t1write/t1write_flexothers.h | 0 .../source/t1write/t1write_gcothers.h | 0 .../source/t1write/t1write_hintothers.h | 0 .../source/t1write/t1write_procsetothers.h | 0 .../lib => shared}/source/t2cstr/t2cstr.c | 0 .../lib => shared}/source/ttread/ttread.c | 0 .../lib => shared}/source/tx_shared/afm.h | 0 .../lib => shared}/source/tx_shared/cef.h | 0 .../lib => shared}/source/tx_shared/cff.h | 0 .../lib => shared}/source/tx_shared/cff2.h | 0 .../lib => shared}/source/tx_shared/dcf.h | 0 .../lib => shared}/source/tx_shared/dump.h | 0 .../lib => shared}/source/tx_shared/mtx.h | 0 .../lib => shared}/source/tx_shared/path.h | 0 .../lib => shared}/source/tx_shared/pdf.h | 0 .../lib => shared}/source/tx_shared/ps.h | 0 .../lib => shared}/source/tx_shared/svg.h | 0 .../lib => shared}/source/tx_shared/t1.h | 0 .../source/tx_shared/tx_shared.c | 0 .../lib => shared}/source/tx_shared/ufo.h | 0 .../lib => shared}/source/uforead/ufo_ops.h | 0 .../lib => shared}/source/uforead/uforead.c | 20 +- .../lib => shared}/source/ufowrite/ufowrite.c | 8 +- .../lib => shared}/source/varread/varread.c | 0 c/spot/build/linux/gcc/build.sh | 30 - c/spot/build/linux/gcc/debug/Makefile | 400 - c/spot/build/linux/gcc/release/Makefile | 401 - c/spot/build/osx/xcode/build.sh | 21 - .../osx/xcode/spot.xcodeproj/project.pbxproj | 619 - c/spot/build/win/visualstudio/build.cmd | 37 - c/spot/build/win/visualstudio/spot.sln | 30 - c/spot/build/win/visualstudio/spot.vcxproj | 292 - c/spot/source/CMakeLists.txt | 145 + c/tx/build/linux/gcc/build.sh | 30 - c/tx/build/linux/gcc/debug/Makefile | 31 - c/tx/build/linux/gcc/release/Makefile | 31 - c/tx/build/osx/xcode/build.sh | 22 - .../osx/xcode/tx.xcodeproj/project.pbxproj | 1733 --- c/tx/build/win/visualstudio/build.cmd | 37 - c/tx/build/win/visualstudio/tx.sln | 273 - c/tx/build/win/visualstudio/tx.vcxproj | 290 - c/tx/source/CMakeLists.txt | 10 + c/type1/build/linux/gcc/build.sh | 30 - c/type1/build/linux/gcc/debug/Makefile | 29 - c/type1/build/linux/gcc/release/Makefile | 30 - c/type1/build/osx/xcode/build.sh | 21 - .../osx/xcode/type1.xcodeproj/project.pbxproj | 234 - c/type1/build/win/visualstudio/build.cmd | 37 - c/type1/build/win/visualstudio/type1.sln | 30 - c/type1/build/win/visualstudio/type1.vcxproj | 162 - c/type1/source/CMakeLists.txt | 6 + cmake/AddAFDKOTests.cmake | 72 + cmake/AddSanitizer.cmake | 21 + cmake/ExternalAntlr4Cpp.cmake | 159 + docs/FDK_Build_Notes.md | 97 +- docs/Feature_Parser_Notes.md | 183 + docs/OpenTypeFeatureFileSpecification.md | 64 +- docs/README.md | 1 + pyproject.toml | 6 +- python/afdko/makeotf.py | 2 +- requirements-dev.txt | 3 + setup.py | 43 +- tests/makeotf_data/expected_output/bug751.txt | 3 +- .../expected_output/clinum_output.txt | 3 +- .../expected_output/font_dev_output.txt | 7 +- .../expected_output/font_rel_output.txt | 13 +- tests/makeotf_test.py | 8 + .../expected_output/bug1017.GSUB.txt | 2 +- .../expected_output/bug1349.ttx | 2 +- .../expected_output/fealib/GPOS_3.ttx | 2 +- .../expected_output/font_dev_output.txt | 11 +- .../expected_output/font_rel_output.txt | 13 +- .../expected_output/spec/8a-11.ttx | 70 + tests/makeotfexe_data/input/bug993/feat.fea | 4 +- .../makeotfexe_data/input/spec/2eii-1.bad.fea | 2 +- tests/makeotfexe_data/input/spec/3-2.fea | 2 +- tests/makeotfexe_data/input/spec/6d-3.fea | 4 +- tests/makeotfexe_data/input/spec/8a-11.fea | 13 + tests/makeotfexe_test.py | 95 +- tests/otc2otf_test.py | 13 + tests/otf2otc_test.py | 15 + tests/runner.py | 42 +- tests/runner_test.py | 2 +- 889 files changed, 25299 insertions(+), 151394 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 c/build_all/this_folder_intentionally_left_empty delete mode 100755 c/buildall.cmd delete mode 100755 c/buildall.sh delete mode 100755 c/buildalllinux.sh delete mode 100755 c/detype1/build/linux/gcc/build.sh delete mode 100755 c/detype1/build/linux/gcc/debug/Makefile delete mode 100755 c/detype1/build/linux/gcc/release/Makefile delete mode 100755 c/detype1/build/osx/xcode/build.sh delete mode 100644 c/detype1/build/osx/xcode/detype1.xcodeproj/project.pbxproj delete mode 100644 c/detype1/build/win/visualstudio/build.cmd delete mode 100644 c/detype1/build/win/visualstudio/detype1.sln delete mode 100644 c/detype1/build/win/visualstudio/detype1.vcxproj create mode 100644 c/detype1/source/CMakeLists.txt create mode 100644 c/makeotf/CMakeLists.txt delete mode 100755 c/makeotf/build/linux/gcc/build.sh delete mode 100755 c/makeotf/build/linux/gcc/debug/Makefile delete mode 100755 c/makeotf/build/linux/gcc/release/Makefile delete mode 100755 c/makeotf/build/osx/xcode/build.sh delete mode 100644 c/makeotf/build/osx/xcode/makeotf.xcodeproj/project.pbxproj delete mode 100644 c/makeotf/build/win/visualstudio/build.cmd delete mode 100644 c/makeotf/build/win/visualstudio/makeotf.sln delete mode 100644 c/makeotf/build/win/visualstudio/makeotf.vcxproj delete mode 100644 c/makeotf/config/xcconfig/debug_makeotf.xcconfig delete mode 100644 c/makeotf/config/xcconfig/release_makeotf.xcconfig rename c/makeotf/{makeotf_lib/api => include}/cffread.h (100%) rename c/makeotf/{makeotf_lib/api => include}/hotconv.h (95%) rename c/makeotf/{makeotf_lib/api => include}/pstoken.h (95%) rename c/makeotf/{makeotf_lib/api => include}/readme.txt (100%) rename c/makeotf/{makeotf_lib/api => include}/typecomp.h (93%) create mode 100644 c/makeotf/lib/CMakeLists.txt create mode 100644 c/makeotf/lib/cffread/CMakeLists.txt rename c/makeotf/{makeotf_lib/source => lib}/cffread/cffread.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/cffread/t13fail.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/BASE.c (97%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/BASE.h (92%) create mode 100644 c/makeotf/lib/hotconv/BuildGrammar.py rename c/makeotf/{makeotf_lib/source => lib}/hotconv/CFF_.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/CFF_.h (100%) create mode 100644 c/makeotf/lib/hotconv/CMakeLists.txt create mode 100644 c/makeotf/lib/hotconv/CPPLINT.cfg create mode 100644 c/makeotf/lib/hotconv/FeatCtx.cpp create mode 100644 c/makeotf/lib/hotconv/FeatCtx.h create mode 100644 c/makeotf/lib/hotconv/FeatLexer.cpp create mode 100644 c/makeotf/lib/hotconv/FeatLexer.g4 create mode 100644 c/makeotf/lib/hotconv/FeatLexer.h create mode 100644 c/makeotf/lib/hotconv/FeatLexer.interp create mode 100644 c/makeotf/lib/hotconv/FeatLexer.tokens create mode 100644 c/makeotf/lib/hotconv/FeatLexerBase.g4 create mode 100644 c/makeotf/lib/hotconv/FeatParser.cpp create mode 100644 c/makeotf/lib/hotconv/FeatParser.g4 create mode 100644 c/makeotf/lib/hotconv/FeatParser.h create mode 100644 c/makeotf/lib/hotconv/FeatParser.interp create mode 100644 c/makeotf/lib/hotconv/FeatParser.tokens create mode 100644 c/makeotf/lib/hotconv/FeatParserBaseVisitor.cpp create mode 100644 c/makeotf/lib/hotconv/FeatParserBaseVisitor.h create mode 100644 c/makeotf/lib/hotconv/FeatParserVisitor.cpp create mode 100644 c/makeotf/lib/hotconv/FeatParserVisitor.h create mode 100644 c/makeotf/lib/hotconv/FeatVisitor.cpp create mode 100644 c/makeotf/lib/hotconv/FeatVisitor.h rename c/makeotf/{makeotf_lib/source => lib}/hotconv/GDEF.c (98%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/GDEF.h (94%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/GPOS.c (94%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/GPOS.h (87%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/GSUB.c (98%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/GSUB.h (97%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/OS_2.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/OS_2.h (95%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/STAT.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/STAT.h (93%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/VORG.c (97%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/VORG.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/anon.c (97%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/anon.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/cmap.c (98%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/cmap.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/codepage.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/common.h (95%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/feat.h (79%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/head.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/head.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/hhea.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/hhea.h (90%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/hmtx.c (96%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/hmtx.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/hot.c (94%) rename c/makeotf/{makeotf_lib/source/hotconv/map.h => lib/hotconv/hotmap.h} (85%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/map.c (98%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/maxp.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/maxp.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/name.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/name.h (94%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/otl.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/otl.h (98%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/post.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/post.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/schinese.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/sfnt.c (98%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/sfnt.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/uniblock.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/vhea.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/vhea.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/vmtx.c (96%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/vmtx.h (90%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/winansi.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/xxxx.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/hotconv/xxxx.h (89%) create mode 100644 c/makeotf/lib/pstoken/CMakeLists.txt rename c/makeotf/{makeotf_lib/source => lib}/pstoken/pstoken.c (99%) create mode 100644 c/makeotf/lib/typecomp/CMakeLists.txt rename c/makeotf/{makeotf_lib/source => lib}/typecomp/cdv1axis.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/charset.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/charset.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/common.h (95%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/cs.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/cs.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/dict.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/dict.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/encoding.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/encoding.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/eurosans.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/euroserf.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/fdselect.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/fdselect.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/fill_in_mm.cs (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/fill_in_mm.uni_cs (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/fillinmm_sans.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/fillinmm_serif.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/font.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/igara0.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/igara1.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/igara2.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/igara3.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/igara4.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/isocenm.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/jenson.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/jimbo0.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/jimbo1.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/jimbo2.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/kepler.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/package.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/parse.c (99%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/parse.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/recode.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/recode.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/rgara0.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/rgara1.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/rgara2.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/rgara3.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/sindex.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/sindex.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/subr.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/subr.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/t13.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/t13.h (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/t13fail.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/t13supp.c (100%) rename c/makeotf/{makeotf_lib/source => lib}/typecomp/tc.c (97%) delete mode 100755 c/makeotf/makeotf_lib/build/cffread/linux/gcc/debug/Makefile delete mode 100755 c/makeotf/makeotf_lib/build/cffread/linux/gcc/release/Makefile delete mode 100644 c/makeotf/makeotf_lib/build/cffread/osx/xcode/cffread.xcodeproj/project.pbxproj delete mode 100644 c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj delete mode 100755 c/makeotf/makeotf_lib/build/hotconv/linux/gcc/debug/Makefile delete mode 100755 c/makeotf/makeotf_lib/build/hotconv/linux/gcc/release/Makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotconv/osx/xcode/hotconv.xcodeproj/project.pbxproj delete mode 100644 c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/Makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/featgram.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_131.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133_BEFORE_MR13.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_SUMMARY.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/antlr.icc delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/dlg.icc delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/sorcerer.icc delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/KNOWN_PROBLEMS.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/MPW_Read_Me delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.OS2 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.bcc delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.msvc delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.watcom delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/README delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/RIGHTS delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMS.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/README delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.1 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.r delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr1.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr68K.make delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlrPPC.make delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/bits.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/build.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/dumpcycles.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/dumpnode.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/egman.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/err.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fcache.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset2.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/gen.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/generic.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/globals.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/lex.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/main.c delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile.VMS delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile1 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/misc.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mode.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mrhoist.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/parser.dlg delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/pred.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/proto.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/scan.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/stdpccts.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/syn.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/tokens.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/watantlr.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMS.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/automata.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.1 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.r delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg1.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg68K.make delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlgPPC.make delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_a.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/err.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/main.c delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/makefile.VMS delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/makefile1 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/mode.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/output.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/parser.dlg delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/relabel.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/stdpccts.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/support.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/tokens.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/watdlg.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtr.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtrImpl.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AToken.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenStream.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLG_stream_input.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexer.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PBlackBox.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/SList.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/antlr.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charbuf.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/config.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/dlgauto.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/dlgdef.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/err.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/int.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_assert.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_iostream.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_istream.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_setjmp.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdarg.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdio.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdlib.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_string.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctscfg.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcnames.bat delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/h/slist.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/history.ps delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/history.txt delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/install68K.mpw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/installPPC.mpw delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile.vms delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/README delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/UPDATES delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/cpp.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/err.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/gen.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/globals.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SASTBase.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SCommonAST.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/STreeParser.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/astlib.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sintstack.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorcerer.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorlist.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sstack.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/CASTBase.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/STreeParser.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/astlib.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/errsupport.c delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/msvc.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sintstack.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorcerer.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorlist.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sstack.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/look.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/main.c delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile.VMS delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile1 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/mode.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/msvc.dsw delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/parser.dlg delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/proto.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/scan.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.r delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor68K.make delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sorPPC.make delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/stdpccts.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sym.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/t.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/t2.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/t3.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/t4.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/t5.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/t6.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test2.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test3.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test3.tokens delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test4.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test5.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test6.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test6.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/lang.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/main.c delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/stdpccts.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/t7.dat delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/t7.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/test1.dat delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/test7.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/test7/test7.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/test/tokens6.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/t.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/t2.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/t3.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/t5.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test2.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test3.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/AST.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/SimpleTreeParser.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/SimpleTreeParser.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/lang.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/main.cpp delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/t4.dat delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/t4.dat.out delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test4/test4.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/test5.sor delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/testcpp/token3.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/tokens.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/DECmms/genmms.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/DECmms/makefile.VMS delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/genmk/genmk.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/genmk/genmk_old.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/genmk/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/genmk/watgenmk.mak delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/msvc.dsp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/rexpr/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/rexpr/rexpr.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/rexpr/rexpr.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/rexpr/test.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/set/set.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/set/set.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/sym/sym.c delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/support/sym/template.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/1/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/1/test.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/10/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/10/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/11/input.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/11/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/11/test.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/12/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/12/test.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/13/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/13/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/2/MyLexer.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/2/MyLexer.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/2/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/2/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/3/MyLexer.cpp delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/3/MyLexer.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/3/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/3/mytokens.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/3/test.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/4/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/4/mytokens.h delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/4/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/5/input.h delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/5/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/5/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/file1 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/file2 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/main.cpp delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/makefile2 delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/6/test2.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/7/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/7/test.g delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/8/main.cpp delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/8/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/8/test.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/9/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/9/test.g delete mode 100755 c/makeotf/makeotf_lib/build/hotpccts/pccts/testcpp/makefile delete mode 100644 c/makeotf/makeotf_lib/build/hotpccts/readme.txt delete mode 100755 c/makeotf/makeotf_lib/build/pstoken/linux/gcc/debug/Makefile delete mode 100755 c/makeotf/makeotf_lib/build/pstoken/linux/gcc/release/Makefile delete mode 100644 c/makeotf/makeotf_lib/build/pstoken/osx/xcode/pstoken.xcodeproj/project.pbxproj delete mode 100644 c/makeotf/makeotf_lib/build/pstoken/win/visualstudio/pstoken.vcxproj delete mode 100755 c/makeotf/makeotf_lib/build/typecomp/linux/gcc/debug/Makefile delete mode 100755 c/makeotf/makeotf_lib/build/typecomp/linux/gcc/release/Makefile delete mode 100644 c/makeotf/makeotf_lib/build/typecomp/osx/xcode/typecomp.xcodeproj/project.pbxproj delete mode 100644 c/makeotf/makeotf_lib/build/typecomp/win/visualstudio/typecomp.vcxproj delete mode 100644 c/makeotf/makeotf_lib/config/xcconfig/debug.xcconfig delete mode 100644 c/makeotf/makeotf_lib/config/xcconfig/release.xcconfig delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/antlr.h delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/config.h delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/dlgauto.h delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/dlgdef.h delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/err.h delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/feat.c delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/featerr.c delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/featgram.c delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/featmode.h delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/featpars.dlg delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/featscan.c delete mode 100644 c/makeotf/makeotf_lib/source/hotconv/feattoks.h rename c/makeotf/{makeotf_lib => }/resource/dictops.h (100%) rename c/makeotf/{makeotf_lib => }/resource/txops.h (100%) create mode 100644 c/makeotf/source/CMakeLists.txt delete mode 100644 c/makeotf/source/Win32/WIN.C rename c/makeotf/source/{main.c => c_main.c} (99%) rename c/makeotf/source/{include_files => }/cb.h (70%) rename c/makeotf/source/{include_files => }/cbpriv.h (100%) rename c/makeotf/source/{include_files => }/fcdb.h (99%) rename c/makeotf/source/{include_files => }/file.h (100%) rename c/makeotf/source/{include_files => }/lctype.h (100%) rename c/makeotf/source/{include_files => }/lerrno.h (100%) rename c/makeotf/source/{include_files => }/lstdio.h (100%) rename c/makeotf/source/{include_files => }/lstdlib.h (100%) rename c/makeotf/source/{include_files => }/lstring.h (100%) rename c/makeotf/source/{mac => }/mac.c (100%) create mode 100644 c/makeotf/source/main.cpp rename c/makeotf/source/{include_files => }/package.h (100%) rename c/makeotf/source/{include_files => }/systemspecific.h (100%) rename c/makeotf/{makeotf_lib => }/utils/README.md (89%) rename c/makeotf/{makeotf_lib => }/utils/UnicodeData.txt (100%) rename c/makeotf/{makeotf_lib => }/utils/generate_uniblock.py (100%) rename c/makeotf/{makeotf_lib => }/utils/os2_ur.txt (100%) delete mode 100755 c/mergefonts/build/linux/gcc/build.sh delete mode 100755 c/mergefonts/build/linux/gcc/debug/Makefile delete mode 100755 c/mergefonts/build/linux/gcc/release/Makefile delete mode 100755 c/mergefonts/build/osx/xcode/build.sh delete mode 100644 c/mergefonts/build/osx/xcode/mergeFonts.xcodeproj/project.pbxproj delete mode 100644 c/mergefonts/build/win/visualstudio/build.cmd delete mode 100644 c/mergefonts/build/win/visualstudio/mergeFonts.sln delete mode 100644 c/mergefonts/build/win/visualstudio/mergeFonts.vcxproj create mode 100644 c/mergefonts/source/CMakeLists.txt delete mode 100644 c/public/config/linux/gcc/gcc.mak delete mode 100644 c/public/config/linux/gcc/gcc_tx.mak delete mode 100644 c/public/config/xcconfig/common.xcconfig delete mode 100644 c/public/config/xcconfig/debug.xcconfig delete mode 100644 c/public/config/xcconfig/debug_tx.xcconfig delete mode 100644 c/public/config/xcconfig/release.xcconfig delete mode 100644 c/public/config/xcconfig/release_tx.xcconfig delete mode 100755 c/public/lib/build/absfont/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/absfont/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/absfont/osx/xcode/absfont.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/absfont/win/visualstudio/absfont.vcxproj delete mode 100755 c/public/lib/build/cfembed/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/cfembed/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/cfembed/osx/xcode/cfembed.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/cfembed/win/visualstudio/cfembed.vcxproj delete mode 100755 c/public/lib/build/cffread/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/cffread/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/cffread/osx/xcode/cffread.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/cffread/win/visualstudio/cffread.vcxproj delete mode 100755 c/public/lib/build/cffwrite/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/cffwrite/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/cffwrite/osx/xcode/cffwrite.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/cffwrite/win/visualstudio/cffwrite.vcxproj delete mode 100755 c/public/lib/build/ctutil/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/ctutil/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/ctutil/osx/xcode/ctutil.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/ctutil/win/visualstudio/ctutil.vcxproj delete mode 100755 c/public/lib/build/dynarr/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/dynarr/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/dynarr/osx/xcode/dynarr.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/dynarr/win/visualstudio/dynarr.vcxproj delete mode 100755 c/public/lib/build/nameread/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/nameread/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/nameread/osx/xcode/nameread.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/nameread/win/visualstudio/nameread.vcxproj delete mode 100755 c/public/lib/build/pdfwrite/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/pdfwrite/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/pdfwrite/osx/xcode/pdfwrite.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/pdfwrite/win/visualstudio/pdfwrite.vcxproj delete mode 100755 c/public/lib/build/pstoken/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/pstoken/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/pstoken/osx/xcode/pstoken.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/pstoken/win/visualstudio/pstoken.vcxproj delete mode 100755 c/public/lib/build/sfntread/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/sfntread/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/sfntread/osx/xcode/sfntread.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/sfntread/win/visualstudio/sfntread.vcxproj delete mode 100755 c/public/lib/build/sfntwrite/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/sfntwrite/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/sfntwrite/osx/xcode/sfntwrite.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/sfntwrite/win/visualstudio/sfntwrite.vcxproj delete mode 100755 c/public/lib/build/sha1/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/sha1/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/sha1/osx/xcode/sha1.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/sha1/win/visualstudio/sha1.vcxproj delete mode 100755 c/public/lib/build/support/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/support/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/support/osx/xcode/support.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/support/win/visualstudio/support.vcxproj delete mode 100755 c/public/lib/build/svgwrite/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/svgwrite/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/svgwrite/osx/xcode/svgwrite.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/svgwrite/win/visualstudio/svgwrite.vcxproj delete mode 100755 c/public/lib/build/svread/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/svread/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/svread/osx/xcode/svread.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/svread/win/visualstudio/svread.vcxproj delete mode 100755 c/public/lib/build/t1cstr/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/t1cstr/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/t1cstr/osx/xcode/t1cstr.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/t1cstr/osx/xcode/t1cstr.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 c/public/lib/build/t1cstr/win/visualstudio/t1cstr.vcxproj delete mode 100755 c/public/lib/build/t1read/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/t1read/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/t1read/osx/xcode/t1read.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/t1read/win/visualstudio/t1read.vcxproj delete mode 100755 c/public/lib/build/t1write/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/t1write/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/t1write/osx/xcode/t1write.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/t1write/win/visualstudio/t1write.vcxproj delete mode 100755 c/public/lib/build/t2cstr/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/t2cstr/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/t2cstr/osx/xcode/t2cstr.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/t2cstr/win/visualstudio/t2cstr.vcxproj delete mode 100755 c/public/lib/build/ttread/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/ttread/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/ttread/osx/xcode/ttread.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/ttread/win/visualstudio/ttread.vcxproj delete mode 100755 c/public/lib/build/tx_shared/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/tx_shared/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/tx_shared/osx/xcode/tx_shared.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/tx_shared/win/visualstudio/tx_shared.vcxproj delete mode 100755 c/public/lib/build/uforead/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/uforead/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/uforead/osx/xcode/uforead.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/uforead/osx/xcode/uforead.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 c/public/lib/build/uforead/win/visualstudio/uforead.vcxproj delete mode 100755 c/public/lib/build/ufowrite/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/ufowrite/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/ufowrite/osx/xcode/ufowrite.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/ufowrite/win/visualstudio/ufowrite.vcxproj delete mode 100755 c/public/lib/build/varread/linux/gcc/debug/Makefile delete mode 100755 c/public/lib/build/varread/linux/gcc/release/Makefile delete mode 100644 c/public/lib/build/varread/osx/xcode/varread.xcodeproj/project.pbxproj delete mode 100644 c/public/lib/build/varread/win/visualstudio/varread.vcxproj delete mode 100644 c/public/lib/config/linux/gcc/gcc.mak delete mode 100644 c/public/lib/config/linux/gcc/gcc_tx.mak delete mode 100644 c/public/lib/config/standard/linux.mak delete mode 100644 c/public/lib/config/xcconfig/debug.xcconfig delete mode 100644 c/public/lib/config/xcconfig/release.xcconfig delete mode 100755 c/rotatefont/build/linux/gcc/build.sh delete mode 100755 c/rotatefont/build/linux/gcc/debug/Makefile delete mode 100755 c/rotatefont/build/linux/gcc/release/Makefile delete mode 100755 c/rotatefont/build/osx/xcode/build.sh delete mode 100644 c/rotatefont/build/osx/xcode/rotateFont.xcodeproj/project.pbxproj delete mode 100644 c/rotatefont/build/win/visualstudio/build.cmd delete mode 100644 c/rotatefont/build/win/visualstudio/rotateFont.sln delete mode 100644 c/rotatefont/build/win/visualstudio/rotateFont.vcxproj create mode 100644 c/rotatefont/source/CMakeLists.txt delete mode 100755 c/sfntdiff/build/linux/gcc/build.sh delete mode 100755 c/sfntdiff/build/linux/gcc/debug/Makefile delete mode 100755 c/sfntdiff/build/linux/gcc/release/Makefile delete mode 100755 c/sfntdiff/build/osx/xcode/build.sh delete mode 100644 c/sfntdiff/build/osx/xcode/sfntdiff.xcodeproj/project.pbxproj delete mode 100644 c/sfntdiff/build/win/visualstudio/build.cmd delete mode 100644 c/sfntdiff/build/win/visualstudio/sfntdiff.sln delete mode 100644 c/sfntdiff/build/win/visualstudio/sfntdiff.vcxproj create mode 100644 c/sfntdiff/source/CMakeLists.txt delete mode 100644 c/sfntdiff/source/Win32/otfcomparelib.h delete mode 100755 c/sfntedit/build/linux/gcc/build.sh delete mode 100755 c/sfntedit/build/linux/gcc/debug/Makefile delete mode 100755 c/sfntedit/build/linux/gcc/release/Makefile delete mode 100755 c/sfntedit/build/osx/xcode/build.sh delete mode 100644 c/sfntedit/build/osx/xcode/sfntedit.xcodeproj/project.pbxproj delete mode 100644 c/sfntedit/build/win/visualstudio/build.cmd delete mode 100644 c/sfntedit/build/win/visualstudio/sfntedit.sln delete mode 100644 c/sfntedit/build/win/visualstudio/sfntedit.vcxproj create mode 100644 c/sfntedit/source/CMakeLists.txt delete mode 100644 c/sfntedit/source/Win32/otftableeditor.h rename c/{public/lib/api => shared/include}/abfdesc.h (100%) rename c/{public/lib/api => shared/include}/abferr.h (100%) rename c/{public/lib/api => shared/include}/absfont.h (100%) rename c/{public/lib/api => shared/include}/blend.h (100%) rename c/{public/lib/api => shared/include}/ceferr.h (100%) rename c/{public/lib/api => shared/include}/cfembed.h (100%) rename c/{public/lib/api => shared/include}/cffread.h (100%) rename c/{public/lib/api => shared/include}/cffwrite.h (100%) rename c/{public/lib/api => shared/include}/cfrerr.h (100%) rename c/{public/lib/api => shared/include}/cfwerr.h (100%) rename c/{public/lib/api => shared/include}/ctlshare.h (100%) rename c/{public/lib/api => shared/include}/ctutil.h (98%) rename c/{public/lib/api => shared/include}/dynarr.h (100%) rename c/{public/lib/api => shared/include}/nameread.h (100%) rename c/{public/lib/api => shared/include}/parse.h (100%) rename c/{public/lib/api => shared/include}/pdfwrite.h (100%) rename c/{public/lib/api => shared/include}/pdwerr.h (100%) rename c/{public/lib/api => shared/include}/psterr.h (100%) rename c/{public/lib/api => shared/include}/pstoken.h (100%) rename c/{public/lib/api => shared/include}/readme.txt (100%) rename c/{public/lib/api => shared/include}/safetime.h (100%) rename c/{public/lib/api => shared/include}/sfntread.h (100%) rename c/{public/lib/api => shared/include}/sfntwrite.h (100%) rename c/{public/lib/api => shared/include}/sfrerr.h (100%) rename c/{public/lib/api => shared/include}/sfwerr.h (100%) rename c/{public/lib/api => shared/include}/sha1.h (100%) rename c/{public/lib/api => shared/include}/supportasbasic.h (100%) rename c/{public/lib/api => shared/include}/supportaszone.h (100%) rename c/{public/lib/api => shared/include}/supportcanthappen.h (100%) rename c/{public/lib/api => shared/include}/supportenvironment.h (100%) rename c/{public/lib/api => shared/include}/supportexcept.h (100%) rename c/{public/lib/api => shared/include}/supportfp.h (100%) rename c/{public/lib/api => shared/include}/supportossyslib.h (100%) rename c/{public/lib/api => shared/include}/supportpublictypes.h (100%) rename c/{public/lib/api => shared/include}/svgwrite.h (100%) rename c/{public/lib/api => shared/include}/svread.h (100%) rename c/{public/lib/api => shared/include}/svrerr.h (100%) rename c/{public/lib/api => shared/include}/svwerr.h (100%) rename c/{public/lib/api => shared/include}/t1cerr.h (100%) rename c/{public/lib/api => shared/include}/t1cstr.h (100%) rename c/{public/lib/api => shared/include}/t1read.h (100%) rename c/{public/lib/api => shared/include}/t1rerr.h (100%) rename c/{public/lib/api => shared/include}/t1werr.h (100%) rename c/{public/lib/api => shared/include}/t1write.h (100%) rename c/{public/lib/api => shared/include}/t2cerr.h (100%) rename c/{public/lib/api => shared/include}/t2cstr.h (100%) rename c/{public/lib/api => shared/include}/ttread.h (100%) rename c/{public/lib/api => shared/include}/ttrerr.h (100%) rename c/{public/lib/api => shared/include}/tx_shared.h (100%) rename c/{public/lib/api => shared/include}/ufoerr.h (100%) rename c/{public/lib/api => shared/include}/uforead.h (99%) rename c/{public/lib/api => shared/include}/ufowerr.h (100%) rename c/{public/lib/api => shared/include}/ufowrite.h (98%) rename c/{public/lib/api => shared/include}/varread.h (100%) rename c/{public/lib => shared}/resource/agl2uv.h (100%) rename c/{public/lib => shared}/resource/applestd.h (100%) rename c/{public/lib => shared}/resource/dblmapuv.h (100%) rename c/{public/lib => shared}/resource/dictops.h (100%) rename c/{public/lib => shared}/resource/excs0.h (100%) rename c/{public/lib => shared}/resource/exenc0.h (100%) rename c/{public/lib => shared}/resource/exenc1.h (100%) rename c/{public/lib => shared}/resource/exsubcs0.h (100%) rename c/{public/lib => shared}/resource/isocs0.h (100%) rename c/{public/lib => shared}/resource/macarab.h (100%) rename c/{public/lib => shared}/resource/macce.h (100%) rename c/{public/lib => shared}/resource/maccroat.h (100%) rename c/{public/lib => shared}/resource/maccyril.h (100%) rename c/{public/lib => shared}/resource/macdevan.h (100%) rename c/{public/lib => shared}/resource/macexprt.h (100%) rename c/{public/lib => shared}/resource/macfarsi.h (100%) rename c/{public/lib => shared}/resource/macgreek.h (100%) rename c/{public/lib => shared}/resource/macgujar.h (100%) rename c/{public/lib => shared}/resource/macgurmk.h (100%) rename c/{public/lib => shared}/resource/machebrw.h (100%) rename c/{public/lib => shared}/resource/maciceln.h (100%) rename c/{public/lib => shared}/resource/macrmian.h (100%) rename c/{public/lib => shared}/resource/macromn0.h (100%) rename c/{public/lib => shared}/resource/macthai.h (100%) rename c/{public/lib => shared}/resource/macturk.h (100%) rename c/{public/lib => shared}/resource/poststd.h (100%) rename c/{public/lib => shared}/resource/readme.txt (100%) rename c/{public/lib => shared}/resource/stdenc0.h (100%) rename c/{public/lib => shared}/resource/stdenc1.h (100%) rename c/{public/lib => shared}/resource/stdenc2.h (100%) rename c/{public/lib => shared}/resource/stdenc3.h (100%) rename c/{public/lib => shared}/resource/stdstr0.h (100%) rename c/{public/lib => shared}/resource/stdstr1.h (100%) rename c/{public/lib => shared}/resource/txops.h (100%) rename c/{public/lib => shared}/resource/uv2agl.h (100%) rename c/{public/lib => shared}/resource/uv2zding.h (100%) rename c/{public/lib => shared}/resource/zding2uv.h (100%) create mode 100644 c/shared/source/CMakeLists.txt rename c/{public/lib => shared}/source/absfont/absfont.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_afm.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_compare.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_desc.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_draw.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_dump.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_metrics.c (100%) rename c/{public/lib => shared}/source/absfont/absfont_path.c (100%) rename c/{public/lib => shared}/source/cfembed/cfembed.c (100%) rename c/{public/lib => shared}/source/cffread/cffread.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_charset.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_charset.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_dict.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_dict.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_encoding.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_encoding.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_fdselect.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_fdselect.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_share.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_sindex.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_sindex.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_subr.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_subr.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_t2cstr.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_t2cstr.h (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_varstore.c (100%) rename c/{public/lib => shared}/source/cffwrite/cffwrite_varstore.h (100%) rename c/{public/lib => shared}/source/ctutil/ctutil.c (100%) rename c/{public/lib => shared}/source/dynarr/dynarr.c (100%) rename c/{public/lib => shared}/source/nameread/nameread.c (100%) rename c/{public/lib => shared}/source/pdfwrite/pdfwrite.c (100%) rename c/{public/lib => shared}/source/pstoken/pstoken.c (100%) rename c/{public/lib => shared}/source/sfntread/sfntread.c (100%) rename c/{public/lib => shared}/source/sfntwrite/sfntwrite.c (100%) rename c/{public/lib => shared}/source/sha1/sha1.c (100%) rename c/{public/lib => shared}/source/support/canthappen.c (100%) rename c/{public/lib => shared}/source/support/except.c (100%) rename c/{public/lib => shared}/source/support/fixed.c (100%) rename c/{public/lib => shared}/source/svgwrite/svgwrite.c (100%) rename c/{public/lib => shared}/source/svread/sv_ops.h (100%) rename c/{public/lib => shared}/source/svread/sv_parse.y (100%) rename c/{public/lib => shared}/source/svread/svread.c (100%) rename c/{public/lib => shared}/source/t1cstr/t1cstr.c (100%) rename c/{public/lib => shared}/source/t1read/t1read.c (100%) rename c/{public/lib => shared}/source/t1read/t1read_keys.h (100%) rename c/{public/lib => shared}/source/t1write/t1write.c (100%) rename c/{public/lib => shared}/source/t1write/t1write_flexothers.h (100%) rename c/{public/lib => shared}/source/t1write/t1write_gcothers.h (100%) rename c/{public/lib => shared}/source/t1write/t1write_hintothers.h (100%) rename c/{public/lib => shared}/source/t1write/t1write_procsetothers.h (100%) rename c/{public/lib => shared}/source/t2cstr/t2cstr.c (100%) rename c/{public/lib => shared}/source/ttread/ttread.c (100%) rename c/{public/lib => shared}/source/tx_shared/afm.h (100%) rename c/{public/lib => shared}/source/tx_shared/cef.h (100%) rename c/{public/lib => shared}/source/tx_shared/cff.h (100%) rename c/{public/lib => shared}/source/tx_shared/cff2.h (100%) rename c/{public/lib => shared}/source/tx_shared/dcf.h (100%) rename c/{public/lib => shared}/source/tx_shared/dump.h (100%) rename c/{public/lib => shared}/source/tx_shared/mtx.h (100%) rename c/{public/lib => shared}/source/tx_shared/path.h (100%) rename c/{public/lib => shared}/source/tx_shared/pdf.h (100%) rename c/{public/lib => shared}/source/tx_shared/ps.h (100%) rename c/{public/lib => shared}/source/tx_shared/svg.h (100%) rename c/{public/lib => shared}/source/tx_shared/t1.h (100%) rename c/{public/lib => shared}/source/tx_shared/tx_shared.c (100%) rename c/{public/lib => shared}/source/tx_shared/ufo.h (100%) rename c/{public/lib => shared}/source/uforead/ufo_ops.h (100%) rename c/{public/lib => shared}/source/uforead/uforead.c (99%) rename c/{public/lib => shared}/source/ufowrite/ufowrite.c (99%) rename c/{public/lib => shared}/source/varread/varread.c (100%) delete mode 100755 c/spot/build/linux/gcc/build.sh delete mode 100755 c/spot/build/linux/gcc/debug/Makefile delete mode 100755 c/spot/build/linux/gcc/release/Makefile delete mode 100755 c/spot/build/osx/xcode/build.sh delete mode 100644 c/spot/build/osx/xcode/spot.xcodeproj/project.pbxproj delete mode 100644 c/spot/build/win/visualstudio/build.cmd delete mode 100644 c/spot/build/win/visualstudio/spot.sln delete mode 100644 c/spot/build/win/visualstudio/spot.vcxproj create mode 100644 c/spot/source/CMakeLists.txt delete mode 100755 c/tx/build/linux/gcc/build.sh delete mode 100755 c/tx/build/linux/gcc/debug/Makefile delete mode 100755 c/tx/build/linux/gcc/release/Makefile delete mode 100755 c/tx/build/osx/xcode/build.sh delete mode 100644 c/tx/build/osx/xcode/tx.xcodeproj/project.pbxproj delete mode 100644 c/tx/build/win/visualstudio/build.cmd delete mode 100644 c/tx/build/win/visualstudio/tx.sln delete mode 100644 c/tx/build/win/visualstudio/tx.vcxproj create mode 100644 c/tx/source/CMakeLists.txt delete mode 100755 c/type1/build/linux/gcc/build.sh delete mode 100755 c/type1/build/linux/gcc/debug/Makefile delete mode 100755 c/type1/build/linux/gcc/release/Makefile delete mode 100755 c/type1/build/osx/xcode/build.sh delete mode 100644 c/type1/build/osx/xcode/type1.xcodeproj/project.pbxproj delete mode 100644 c/type1/build/win/visualstudio/build.cmd delete mode 100644 c/type1/build/win/visualstudio/type1.sln delete mode 100644 c/type1/build/win/visualstudio/type1.vcxproj create mode 100644 c/type1/source/CMakeLists.txt create mode 100644 cmake/AddAFDKOTests.cmake create mode 100644 cmake/AddSanitizer.cmake create mode 100644 cmake/ExternalAntlr4Cpp.cmake create mode 100644 docs/Feature_Parser_Notes.md create mode 100644 tests/makeotfexe_data/expected_output/spec/8a-11.ttx create mode 100644 tests/makeotfexe_data/input/spec/8a-11.fea diff --git a/.flake8 b/.flake8 index 928c21c16..7ab311f8b 100644 --- a/.flake8 +++ b/.flake8 @@ -23,4 +23,6 @@ exclude = **/pdflib/pdfgeom.py, **/pdflib/pdfutils.py, **/pdflib/ttfpdf.py, + build, + _skbuild, ./venv* diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 2d02f6515..c84e37990 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -30,7 +30,7 @@ jobs: run: sudo apt-get install gcc-multilib g++-multilib - name: Set ASAN-related environment variables - run: echo '::set-env name=XFLAGS::-Og -g -fsanitize=address -fno-omit-frame-pointer' + run: echo "ADD_SANITIZER=address" >> $GITHUB_ENV - name: Install AFDKO and dependencies run: | diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index dda624f89..f38e75cc7 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -31,10 +31,12 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install wheel setuptools_scm cibuildwheel + pip install wheel setuptools_scm cibuildwheel scikit-build cmake ninja - name: Build wheel - run: python -m cibuildwheel --output-dir dist + run: | + git config --global url.https://github.com/.insteadOf git://github.com/ + python -m cibuildwheel --output-dir dist env: CIBW_BUILD: "cp36-*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 diff --git a/.github/workflows/run_cvg.yml b/.github/workflows/run_cvg.yml index fdaf81324..769167b8f 100644 --- a/.github/workflows/run_cvg.yml +++ b/.github/workflows/run_cvg.yml @@ -36,7 +36,8 @@ jobs: XFLAGS: '--coverage' run: | python -m pip install --upgrade pip - pip install wheel + pip install wheel setuptools_scm cibuildwheel scikit-build cmake ninja + git config --global url.https://github.com/.insteadOf git://github.com/ python setup.py bdist_wheel echo 'Installing AFDKO wheel...' pip install dist/*.whl -q @@ -44,5 +45,5 @@ jobs: - name: Generate and upload Python and C coverage run: | pip install pytest pytest-cov - python -m pytest --cov --cov-report=xml + python -m pytest tests --cov --cov-report=xml bash <(curl -s https://codecov.io/bash) -y .codecov.yml diff --git a/.github/workflows/testpythonpackage.yml b/.github/workflows/testpythonpackage.yml index bb3f1238b..a928c83c5 100644 --- a/.github/workflows/testpythonpackage.yml +++ b/.github/workflows/testpythonpackage.yml @@ -55,6 +55,8 @@ jobs: - name: Use MSBuild (Windows) uses: microsoft/setup-msbuild@v1.0.2 + with: + vs-version: '[16.4,]' if: matrix.os == 'windows-latest' - name: Set up Python ${{ matrix.python-version }} @@ -65,8 +67,21 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt -r requirements-dev.txt . + pip install -r requirements.txt -r requirements-dev.txt + + - name: Set Windows generator to Visual Studio + run: | + echo "CMAKE_GENERATOR=Visual Studio 16 2019" >> $GITHUB_ENV + echo "CMAKE_GENERATOR_PLATFORM=x64" >> $GITHUB_ENV + shell: bash + if: matrix.os == 'windows-latest' + + - name: Install AFDKO (Other) + run: | + git config --global url.https://github.com/.insteadOf git://github.com/ + pip install . pip freeze --all + shell: bash - name: Lint Python code with flake8 using .flake8 config file run: | @@ -79,4 +94,4 @@ jobs: - name: Test with pytest run: | - pytest --cov + pytest --no-cov tests diff --git a/.gitignore b/.gitignore index dca8e8e10..10f28bd0a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # temporary wheel build directories afdko.egg-info/ build/* +_skbuild/* dist/* .eggs/ @@ -23,29 +24,5 @@ htmlcov *.gcda cov*.xml -# ignore the compiled programs -c/build_all/* -!c/build_all/this_folder_intentionally_left_empty -# ANTLR binaries -**/hotpccts/pccts/bin/** - -# ignore the temp build directories and files -*.o -*.a -exe/ - -# Xcode files -project.xcworkspace/ -xcuserdata/ -**/xcode/build/ -*.xcscheme - - -# Windows build directories -*vcxproj.user -**/visualstudio/Debug/* -**/visualstudio/Release/* -**/visualstudio/x64/* - # temp output dirs created during tests **/temp_output diff --git a/.lgtm.yml b/.lgtm.yml index fca2cd62b..eae0f5820 100644 --- a/.lgtm.yml +++ b/.lgtm.yml @@ -7,13 +7,17 @@ extraction: after_prepare: - "pip3 install --upgrade --user cython" - "pip3 install --upgrade --user wheel" + - "pip3 install --upgrade --user scikit-build" + - "pip3 install --upgrade --user cmake" + - "pip3 install --upgrade --user ninja" + - "git config --global url.https://github.com/.insteadOf git://github.com/" - "export PATH=\"$HOME/.local/bin:$PATH\"" index: build_command: "python3 setup.py build" path_classifiers: generated: # Classify files generated from featgram.g as generated code so no alerts: - - c/makeotf/makeotf_lib/source/hotconv/featerr.c - - c/makeotf/makeotf_lib/source/hotconv/featgram.c - - c/makeotf/makeotf_lib/source/hotconv/featscan.c - - c/makeotf/makeotf_lib/source/hotconv/feattoks.h + - c/makeotf/lib/hotconv/FeatParser.cpp + - c/makeotf/lib/hotconv/FeatLexer.cpp + - c/makeotf/lib/hotconv/FeatParserVisitor.cpp + - c/makeotf/lib/hotconv/FeatParserBaseVisitor.cpp diff --git a/.run_cpplint.sh b/.run_cpplint.sh index adee8fbff..aeccebc53 100755 --- a/.run_cpplint.sh +++ b/.run_cpplint.sh @@ -1,10 +1,10 @@ cpplint --recursive --quiet c/detype1 -cpplint --recursive --quiet c/makeotf/makeotf_lib/source -cpplint --recursive --quiet c/makeotf/makeotf_lib/api -cpplint --recursive --quiet c/makeotf/makeotf_lib/resource +cpplint --recursive --quiet c/makeotf/include +cpplint --recursive --quiet c/makeotf/resource +cpplint --recursive --quiet c/makeotf/lib cpplint --recursive --quiet c/makeotf/source cpplint --recursive --quiet c/mergefonts -cpplint --recursive --quiet c/public +cpplint --recursive --quiet c/shared cpplint --recursive --quiet c/rotatefont cpplint --recursive --quiet c/sfntdiff cpplint --recursive --quiet c/sfntedit diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..373189086 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required(VERSION 3.16) + +project(afdko) + +# set(CMAKE_VERBOSE_MAKEFILE ON) + +# This matches the MSVC_RUNTIME_LIBRARY property in +# c/makeotf/source/CMakeLists.txt, which can theoretically be used to +# statically link the runtime on Windows. However, the neededruntime DLL +# seems to be present in Windows and setting this caused problems in testing. +# (Setting ANTLR4_WITH_STATIC_CRT below to ON may or may not fix the problem.) +# cmake_policy(SET CMP0091 NEW) # Style of MSVC runtime selection + +# RelWithDebInfo builds an optimized binary but includes debugging symbols +# Other common possibilities are "Debug" and "Release" +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type configuration" FORCE) +endif() +message(STATUS "Build type is ${CMAKE_BUILD_TYPE}") + +set(CMAKE_CXX_STANDARD 11) + +# scikit-build +if(SKBUILD) + find_package(PythonExtensions REQUIRED) +endif() + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +# Antlr 4 configuration + +# This is an alternate way of supplying the Antlr 4 sources that will override +# the git clone of the tag listed below. This is especially useful if you +# encounter compiler problems and need to make small edits to compensate. Start +# with the Antlr project's sources, e.g. +# https://www.antlr.org/download/antlr4-cpp-runtime-4.9.2-source.zip +# set(ANTLR4_ZIP_REPOSITORY "/path_to_antlr4_archive/a4.zip") + +add_definitions(-DANTLR4CPP_STATIC) +set(ANTLR4_WITH_STATIC_CRT OFF) +set(ANTLR4_TAG tags/4.9.2) +include(ExternalAntlr4Cpp) + +# sanitizer support +# work around https://github.com/pypa/setuptools/issues/1928 with environment +# variable +if(DEFINED ENV{ADD_SANITIZER}) + set(ADD_SANITIZER "$ENV{ADD_SANITIZER}" CACHE STRING "Sanitizer type (\"none\" for no sanitizer") +else() + set(ADD_SANITIZER "none" CACHE STRING "Sanitizer type (\"none\" for no sanitizer") +endif() +include(AddSanitizer) +add_sanitizer("${ADD_SANITIZER}") + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +# Ported from old build files, XXX not sure if all of these are needed +if(WIN32) + add_compile_definitions(CTL_CDECL=__cdecl CDECL=__cdecl + OS=os_windowsNT ISP=isp_i80486 _CRT_SECURE_NO_DEPRECATE + $<$:NDEBUG>) +endif() + +include(CheckLibraryExists) +CHECK_LIBRARY_EXISTS(m floor "" HAVE_M_LIB) + +include(CTest) +include(AddAFDKOTests) + +add_subdirectory(c/shared/source) +add_subdirectory(c/detype1/source) +add_subdirectory(c/mergefonts/source) +add_subdirectory(c/rotatefont/source) +add_subdirectory(c/sfntdiff/source) +add_subdirectory(c/sfntedit/source) +add_subdirectory(c/spot/source) +add_subdirectory(c/tx/source) +add_subdirectory(c/type1/source) +add_subdirectory(c/makeotf) diff --git a/LICENSE.md b/LICENSE.md index b2f3706e5..5c817f45a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2014-2018 Adobe. All rights reserved. +Copyright 2014-2021 Adobe. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. @@ -11,3 +11,36 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +--------------------------------------------------------------------------- + +The file ExternalAntlr4Cpp.cmake is copied from the Antlr 4 project +(https://github.com/antlr/antlr4/tree/master/runtime/Cpp/cmake) under +the BSD 3-clause license: + +[The "BSD 3-clause license"] +Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/c/build_all/this_folder_intentionally_left_empty b/c/build_all/this_folder_intentionally_left_empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/c/buildall.cmd b/c/buildall.cmd deleted file mode 100755 index 66191fff5..000000000 --- a/c/buildall.cmd +++ /dev/null @@ -1,48 +0,0 @@ -@echo off -set do_target=0 -if "%1"=="" set do_target=1 -if "%1"=="release" set do_target=1 -if "%1"=="debug" set do_target=1 -if "%1"=="clean" set do_target=1 -if %do_target%==0 ( - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" - exit /B -) - -echo " " -echo "Building detype1..." -call %~dp0detype1\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building makeotf..." -call %~dp0makeotf\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building mergefonts..." -call %~dp0mergefonts\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building rotatefont..." -call %~dp0rotatefont\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building sfntdiff..." -call %~dp0sfntdiff\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building sfntedit..." -call %~dp0sfntedit\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building spot..." -call %~dp0spot\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building tx..." -call %~dp0tx\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -echo " " -echo "Building type1..." -call %~dp0type1\build\win\visualstudio\build.cmd %1 || EXIT /B 1 - -cd %~dp0 diff --git a/c/buildall.sh b/c/buildall.sh deleted file mode 100755 index 17685911c..000000000 --- a/c/buildall.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -# How to find and add all the xcode files for a new program: -# find . \( -path "*/xcode/*" \) -and \( \( -name build.sh \) -or \( -name project.pbxproj \) -or \( -name contents.xcworkspacedata \) \) -exec p4 add {} \;curDir=`pwd` - -set -e -set -x - -curDir=$(pwd) - -if [ -z "$1" ] || [ "$1" = "release" ] || [ "$1" = "debug" ] || [ "$1" = "clean" ] -then - buildAllList=$(ls -1 ./*/build/osx/xcode/build.sh) - for shFile in $buildAllList - do - echo "***Running $shFile" - newDir=$(dirname "$shFile") - shFile=$(basename "$shFile") - cd "$newDir" - sh "$shFile" "$1" - failed=$? - cd "$curDir" - if [ "$failed" -ne 0 ]; then - exit "$failed" - fi - done - echo "Done" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi - diff --git a/c/buildalllinux.sh b/c/buildalllinux.sh deleted file mode 100755 index c1784101d..000000000 --- a/c/buildalllinux.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/sh - -# How to find and add all the xcode files for a new program: -# find . \( -path "*/xcode/*" \) -and \( \( -name build.sh \) -or \( -name project.pbxproj \) -or \( -name contents.xcworkspacedata \) \) -exec p4 add {} \;curDir=`pwd` - -set -e -set -x - -curDir=$(pwd) - -if [ -z "$1" ] || [ "$1" = "release" ] || [ "$1" = "debug" ] || [ "$1" = "clean" ] -then - buildAllList=$(ls -1 ./*/build/linux/gcc/build.sh) - for shFile in $buildAllList - do - echo "***Running $shFile" - newDir=$(dirname "$shFile") - shFile=$(basename "$shFile") - cd "$newDir" - sh "$shFile" "$1" - failed=$? - cd "$curDir" - if [ "$failed" -ne 0 ]; then - exit "$failed" - fi - done - echo "Done" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/detype1/build/linux/gcc/build.sh b/c/detype1/build/linux/gcc/build.sh deleted file mode 100755 index c5f514336..000000000 --- a/c/detype1/build/linux/gcc/build.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/sh -set -e -set -x - -target=detype1 -curdir=$(pwd) - -if [ -z "$1" ] || [ "$1" = "release" ] -then - cd release - make - cd "$curdir" - cp -dR ../../../exe/linux/release/$target ../../../../build_all -elif [ "$1" = "debug" ] -then - cd debug - make - cd "$curdir" - cp -dR ../../../exe/linux/debug/$target ../../../../build_all -elif [ "$1" = "clean" ] -then - cd release - make "$1" - cd "$curdir" - cd debug - make "$1" - cd "$curdir" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/detype1/build/linux/gcc/debug/Makefile b/c/detype1/build/linux/gcc/debug/Makefile deleted file mode 100755 index c456831fa..000000000 --- a/c/detype1/build/linux/gcc/debug/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = debug -ROOT_DIR = ../../../.. - -CFLAGS = $(STD_OPTS) -g - -# Program -PRG_SRCS = $(SRC_DIR)/detype1.c -PRG_OBJS = detype1.o -PRG_TARGET = $(EXE_DIR)/detype1 - -# Build targets -TARGETS = $(PRG_TARGET) - -# Standard definitions -include ../../../../../public/config/linux/gcc/gcc.mak - -# Object rules -detype1.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/detype1.c -o $@ - -# AUTO-GENERATED DEPENDENCIES -detype1.o: $(SRC_DIR)/detype1.c diff --git a/c/detype1/build/linux/gcc/release/Makefile b/c/detype1/build/linux/gcc/release/Makefile deleted file mode 100755 index db50c3cb0..000000000 --- a/c/detype1/build/linux/gcc/release/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = release -ROOT_DIR = $(realpath ../../../..) - -CFLAGS = $(STD_OPTS) -g - -# Program -PRG_SRCS = $(SRC_DIR)/detype1.c -PRG_OBJS = detype1.o -PRG_TARGET = $(EXE_DIR)/detype1 - -# Build targets -TARGETS = $(PRG_TARGET) - -# Standard definitions -include $(realpath ../../../../../public/config/linux/gcc/gcc.mak) - -# Object rules -detype1.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/detype1.c -o $@ - -# AUTO-GENERATED DEPENDENCIES -detype1.o: $(SRC_DIR)/detype1.c diff --git a/c/detype1/build/osx/xcode/build.sh b/c/detype1/build/osx/xcode/build.sh deleted file mode 100755 index bd3d3b0ac..000000000 --- a/c/detype1/build/osx/xcode/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/sh -set -e -set -x - -target=detype1 - -if [ -z "$1" ] || [ "$1" = "release" ] -then - xcodebuild -target $target -project $target.xcodeproj -configuration Release - cp ../../../exe/osx/release/$target ../../../../build_all -elif [ "$1" = "debug" ] -then - xcodebuild -target $target -project $target.xcodeproj -configuration Debug - cp ../../../exe/osx/debug/$target ../../../../build_all -elif [ "$1" = "clean" ] -then - xcodebuild -target $target -project $target.xcodeproj -configuration Debug "$1" - xcodebuild -target $target -project $target.xcodeproj -configuration Release "$1" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/detype1/build/osx/xcode/detype1.xcodeproj/project.pbxproj b/c/detype1/build/osx/xcode/detype1.xcodeproj/project.pbxproj deleted file mode 100644 index 735b470d4..000000000 --- a/c/detype1/build/osx/xcode/detype1.xcodeproj/project.pbxproj +++ /dev/null @@ -1,234 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - BD55C6FA0DAD357F00CA71B7 /* detype1.c in Sources */ = {isa = PBXBuildFile; fileRef = BD55C6F90DAD357F00CA71B7 /* detype1.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 8DD76FB20486AB0100D96B5E /* detype1 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = detype1; sourceTree = BUILT_PRODUCTS_DIR; }; - BD55C6F40DAD352F00CA71B7 /* debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../../../../public/config/xcconfig/debug.xcconfig; sourceTree = SOURCE_ROOT; }; - BD55C6F50DAD353600CA71B7 /* release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = release.xcconfig; path = ../../../../public/config/xcconfig/release.xcconfig; sourceTree = SOURCE_ROOT; }; - BD55C6F90DAD357F00CA71B7 /* detype1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = detype1.c; path = ../../../source/detype1.c; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76FAD0486AB0100D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* detype1 */ = { - isa = PBXGroup; - children = ( - BD55C6F30DAD351800CA71B7 /* xcconfig */, - 08FB7795FE84155DC02AAC07 /* Source */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = detype1; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - BD55C6F90DAD357F00CA71B7 /* detype1.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FB20486AB0100D96B5E /* detype1 */, - ); - name = Products; - sourceTree = ""; - }; - BD55C6F30DAD351800CA71B7 /* xcconfig */ = { - isa = PBXGroup; - children = ( - BD55C6F40DAD352F00CA71B7 /* debug.xcconfig */, - BD55C6F50DAD353600CA71B7 /* release.xcconfig */, - ); - name = xcconfig; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76FA90486AB0100D96B5E /* detype1 */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "detype1" */; - buildPhases = ( - 8DD76FAB0486AB0100D96B5E /* Sources */, - 8DD76FAD0486AB0100D96B5E /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = detype1; - productInstallPath = "$(HOME)/bin"; - productName = detype1; - productReference = 8DD76FB20486AB0100D96B5E /* detype1 */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1000; - }; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "detype1" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* detype1 */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8DD76FA90486AB0100D96B5E /* detype1 */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76FAB0486AB0100D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD55C6FA0DAD357F00CA71B7 /* detype1.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB928608733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD55C6F40DAD352F00CA71B7 /* debug.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Debug; - }; - 1DEB928708733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD55C6F50DAD353600CA71B7 /* release.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Release; - }; - 1DEB928A08733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD55C6F40DAD352F00CA71B7 /* debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = detype1; - }; - name = Debug; - }; - 1DEB928B08733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD55C6F50DAD353600CA71B7 /* release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = detype1; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "detype1" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928608733DD80010E9CD /* Debug */, - 1DEB928708733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "detype1" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928A08733DD80010E9CD /* Debug */, - 1DEB928B08733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/c/detype1/build/win/visualstudio/build.cmd b/c/detype1/build/win/visualstudio/build.cmd deleted file mode 100644 index 7bb7c5495..000000000 --- a/c/detype1/build/win/visualstudio/build.cmd +++ /dev/null @@ -1,37 +0,0 @@ -@echo off -cd %~dp0 -setlocal enabledelayedexpansion -set targetProgram=detype1 - -set do_release=0 -set do_target=0 - -if "%1"=="" set do_release=1 - -if "%1"=="release" set do_release=1 - -if %do_release%==1 ( - set buildConfig=Build - msbuild /target:!buildConfig! /p:configuration=Release %~dp0%targetProgram%.sln - set do_target=1 -) - -if "%1"=="debug" ( - set buildConfig=Build - msbuild /target:!buildConfig! /p:configuration=Debug %~dp0%targetProgram%.sln - set do_target=1 -) - -if %do_target%==1 ( - copy /Y ..\..\..\exe\win\release\%targetProgram%.exe ..\..\..\..\build_all -) - -if "%1"=="clean" ( - set buildConfig=Clean - msbuild /target:!buildConfig! /p:configuration=Debug %~dp0%targetProgram%.sln - msbuild /target:!buildConfig! /p:configuration=Release %~dp0%targetProgram%.sln - set do_target=1 -) -if %do_target%==0 ( - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -) diff --git a/c/detype1/build/win/visualstudio/detype1.sln b/c/detype1/build/win/visualstudio/detype1.sln deleted file mode 100644 index b9e45fd54..000000000 --- a/c/detype1/build/win/visualstudio/detype1.sln +++ /dev/null @@ -1,30 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2047 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "detype1", "detype1.vcxproj", "{BBE0C559-C528-4619-9449-AB466605C1C8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x64.ActiveCfg = Debug|x64 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x64.Build.0 = Debug|x64 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x86.ActiveCfg = Debug|Win32 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x86.Build.0 = Debug|Win32 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x64.ActiveCfg = Release|x64 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x64.Build.0 = Release|x64 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x86.ActiveCfg = Release|Win32 - {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A8C13E9C-EA5C-4ECF-8FBD-BD332ED50AEC} - EndGlobalSection -EndGlobal diff --git a/c/detype1/build/win/visualstudio/detype1.vcxproj b/c/detype1/build/win/visualstudio/detype1.vcxproj deleted file mode 100644 index b967c825a..000000000 --- a/c/detype1/build/win/visualstudio/detype1.vcxproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {BBE0C559-C528-4619-9449-AB466605C1C8} - detype1 - 10.0.17134.0 - - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\exe\win\debug\ - $(Configuration)\ - true - true - ..\..\..\exe\win\release\ - $(Configuration)\ - false - false - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - ..\..\..\exe\win\release\ - - - ..\..\..\exe\win\debug\ - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - EditAndContinue - - - $(OutDir) - $(TargetPath) - true - Console - MachineX86 - - - - - Disabled - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - $(OutDir) - $(TargetPath) - true - Console - - - - - MaxSpeed - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - $(OutDir) - $(TargetPath) - Console - MachineX86 - - - - - MaxSpeed - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - $(OutDir) - $(TargetPath) - Console - - - - - - - - - diff --git a/c/detype1/source/CMakeLists.txt b/c/detype1/source/CMakeLists.txt new file mode 100644 index 000000000..3279e6a08 --- /dev/null +++ b/c/detype1/source/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(detype1 detype1.c) +install(TARGETS detype1 DESTINATION bin) diff --git a/c/makeotf/CMakeLists.txt b/c/makeotf/CMakeLists.txt new file mode 100644 index 000000000..31d19d4ff --- /dev/null +++ b/c/makeotf/CMakeLists.txt @@ -0,0 +1,4 @@ +include_directories(include resource ../shared/include) + +add_subdirectory(lib) +add_subdirectory(source) diff --git a/c/makeotf/build/linux/gcc/build.sh b/c/makeotf/build/linux/gcc/build.sh deleted file mode 100755 index 51f61a500..000000000 --- a/c/makeotf/build/linux/gcc/build.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/sh -set -e -set -x - -target=makeotfexe -curdir=$(pwd) - -if [ -z "$1" ] || [ "$1" = "release" ] -then - cd release - make - cd "$curdir" - cp -dR ../../../exe/linux/release/$target ../../../../build_all -elif [ "$1" = "debug" ] -then - cd debug - make - cd "$curdir" - cp -dR ../../../exe/linux/debug/$target ../../../../build_all -elif [ "$1" = "clean" ] -then - cd release - make "$1" - cd "$curdir" - cd debug - make "$1" - cd "$curdir" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/makeotf/build/linux/gcc/debug/Makefile b/c/makeotf/build/linux/gcc/debug/Makefile deleted file mode 100755 index a05148f48..000000000 --- a/c/makeotf/build/linux/gcc/debug/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -######################################################################### -# # -# Copyright 1997-2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = debug -ROOT_DIR = ../../../.. -OBJECT_DIR = . -LIB_DIR = $(ROOT_DIR)/makeotf_lib/lib/$(PLATFORM)/$(CONFIG) -CT_LIB_DIR = $(ROOT_DIR)/../public/lib/lib/$(PLATFORM)/$(CONFIG) - -CFLAGS = $(STD_OPTS) \ - -I$(ROOT_DIR)/source/include_files \ - -I$(ROOT_DIR)/makeotf_lib/api \ - -I$(ROOT_DIR)/makeotf_lib/resource \ - -I$(ROOT_DIR)/.../public/lib/api - -DMAKEOTFLIB_EXPORTS=1 \ - -g - - -# Program -PRG_SRCS = \ - $(SRC_DIR)/cb.c \ - $(SRC_DIR)/cbpriv.c \ - $(SRC_DIR)/fcdb.c \ - $(SRC_DIR)/file.c \ - $(SRC_DIR)/mac/mac.c \ - $(SRC_DIR)/main.c - -PRG_OBJS = \ - $(OBJECT_DIR)/cb.o \ - $(OBJECT_DIR)/cbpriv.o \ - $(OBJECT_DIR)/fcdb.o \ - $(OBJECT_DIR)/file.o \ - $(OBJECT_DIR)/mac.o \ - $(OBJECT_DIR)/main.o - -PRG_LIBS = \ - $(CT_LIB_DIR)/ctutil.a \ - $(CT_LIB_DIR)/dynarr.a \ - $(LIB_DIR)/hotconv.a \ - $(LIB_DIR)/pstoken.a \ - $(LIB_DIR)/typecomp.a \ - $(LIB_DIR)/cffread.a - -PRG_TARGET = $(EXE_DIR)/makeotfexe - -# Build targets -TARGETS = $(PRG_TARGET) - -# Standard definitions -include ../../../../../public/config/linux/gcc/gcc.mak - -# program rule is in gcc.mak - -# Object rules - -$(OBJECT_DIR)/cb.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cb.c -o $@ - -$(OBJECT_DIR)/cbpriv.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cbpriv.c -o $@ - -$(OBJECT_DIR)/fcdb.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/fcdb.c -o $@ - -$(OBJECT_DIR)/file.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/file.c -o $@ - -$(OBJECT_DIR)/mac.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/mac/mac.c -o $@ - -$(OBJECT_DIR)/main.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/main.c -o $@ - -# Lib rules -CT_LIB_BUILD_DIR = $(ROOT_DIR)/../public/lib/build -LIB_BUILD_DIR = $(ROOT_DIR)/makeotf_lib/build - -$(CT_LIB_DIR)/ctutil.a: - cd $(CT_LIB_BUILD_DIR)/ctutil/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(CT_LIB_DIR)/dynarr.a: - cd $(CT_LIB_BUILD_DIR)/dynarr/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/hotconv.a: - cd $(LIB_BUILD_DIR)/hotconv/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/pstoken.a: - cd $(LIB_BUILD_DIR)/pstoken/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/typecomp.a: - cd $(LIB_BUILD_DIR)/typecomp/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/cffread.a: - cd $(LIB_BUILD_DIR)/cffread/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - diff --git a/c/makeotf/build/linux/gcc/release/Makefile b/c/makeotf/build/linux/gcc/release/Makefile deleted file mode 100755 index 9b8ba76b7..000000000 --- a/c/makeotf/build/linux/gcc/release/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -######################################################################### -# # -# Copyright 1997-2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = release -ROOT_DIR = $(realpath ../../../..) -OBJECT_DIR = . -LIB_DIR = $(ROOT_DIR)/makeotf_lib/lib/$(PLATFORM)/$(CONFIG) -CT_LIB_DIR = $(ROOT_DIR)/../public/lib/lib/$(PLATFORM)/$(CONFIG) - -CFLAGS = $(STD_OPTS) \ - -I$(ROOT_DIR)/source/include_files \ - -I$(ROOT_DIR)/makeotf_lib/api \ - -I$(ROOT_DIR)/makeotf_lib/resource \ - -I$(realpath $(ROOT_DIR)/.../public/lib/api) \ - -DMAKEOTFLIB_EXPORTS=1 - -# Program -PRG_SRCS = \ - $(SRC_DIR)/cb.c \ - $(SRC_DIR)/cbpriv.c \ - $(SRC_DIR)/fcdb.c \ - $(SRC_DIR)/file.c \ - $(SRC_DIR)/mac/mac.c \ - $(SRC_DIR)/main.c - -PRG_OBJS = \ - $(OBJECT_DIR)/cb.o \ - $(OBJECT_DIR)/cbpriv.o \ - $(OBJECT_DIR)/fcdb.o \ - $(OBJECT_DIR)/file.o \ - $(OBJECT_DIR)/mac.o \ - $(OBJECT_DIR)/main.o - -PRG_LIBS = \ - $(CT_LIB_DIR)/ctutil.a \ - $(CT_LIB_DIR)/dynarr.a \ - $(LIB_DIR)/hotconv.a \ - $(LIB_DIR)/pstoken.a \ - $(LIB_DIR)/typecomp.a \ - $(LIB_DIR)/cffread.a - -PRG_TARGET = $(EXE_DIR)/makeotfexe - -# Build targets -TARGETS = $(PRG_TARGET) - -# Standard definitions -include $(realpath ../../../../../public/config/linux/gcc/gcc.mak) - -# program rule is in gcc.mak - -# Object rules - -$(OBJECT_DIR)/cb.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cb.c -o $@ - -$(OBJECT_DIR)/cbpriv.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cbpriv.c -o $@ - -$(OBJECT_DIR)/fcdb.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/fcdb.c -o $@ - -$(OBJECT_DIR)/file.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/file.c -o $@ - -$(OBJECT_DIR)/mac.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/mac/mac.c -o $@ - -$(OBJECT_DIR)/main.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/main.c -o $@ - -# Lib rules -CT_LIB_BUILD_DIR = $(ROOT_DIR)/../public/lib/build -LIB_BUILD_DIR = $(ROOT_DIR)/makeotf_lib/build - -$(CT_LIB_DIR)/ctutil.a: - cd $(CT_LIB_BUILD_DIR)/ctutil/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(CT_LIB_DIR)/dynarr.a: - cd $(CT_LIB_BUILD_DIR)/dynarr/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/hotconv.a: - cd $(LIB_BUILD_DIR)/hotconv/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/pstoken.a: - cd $(LIB_BUILD_DIR)/pstoken/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/typecomp.a: - cd $(LIB_BUILD_DIR)/typecomp/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - -$(LIB_DIR)/cffread.a: - cd $(LIB_BUILD_DIR)/cffread/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - diff --git a/c/makeotf/build/osx/xcode/build.sh b/c/makeotf/build/osx/xcode/build.sh deleted file mode 100755 index 5b5da1490..000000000 --- a/c/makeotf/build/osx/xcode/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/sh -set -e -set -x - -target=makeotf - -if [ -z "$1" ] || [ "$1" = "release" ] -then - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Release - cp ../../../exe/osx/release/${target}exe ../../../../build_all -elif [ "$1" = "debug" ] -then - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Debug - cp ../../../exe/osx/debug/${target}exe ../../../../build_all -elif [ "$1" = "clean" ] -then - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Debug "$1" - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Release "$1" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/makeotf/build/osx/xcode/makeotf.xcodeproj/project.pbxproj b/c/makeotf/build/osx/xcode/makeotf.xcodeproj/project.pbxproj deleted file mode 100644 index 73b9650d0..000000000 --- a/c/makeotf/build/osx/xcode/makeotf.xcodeproj/project.pbxproj +++ /dev/null @@ -1,709 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXAggregateTarget section */ - BDA3D11A14E57C4C00BCED0F /* BuildAll */ = { - isa = PBXAggregateTarget; - buildConfigurationList = BDA3D12C14E57C6D00BCED0F /* Build configuration list for PBXAggregateTarget "BuildAll" */; - buildPhases = ( - ); - dependencies = ( - BDA3D11E14E57C5200BCED0F /* PBXTargetDependency */, - BDA3D12014E57C5500BCED0F /* PBXTargetDependency */, - BDA3D12214E57C5800BCED0F /* PBXTargetDependency */, - BDA3D12414E57C5B00BCED0F /* PBXTargetDependency */, - BDA3D12614E57C5E00BCED0F /* PBXTargetDependency */, - BDA3D12814E57C6100BCED0F /* PBXTargetDependency */, - BDA3D12A14E57C6600BCED0F /* PBXTargetDependency */, - ); - name = BuildAll; - productName = BuildAll; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - BD55CB4D0DAD5D0E00CA71B7 /* libcffread.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD55CB220DAD5CCB00CA71B7 /* libcffread.a */; }; - BD55CB4E0DAD5D1300CA71B7 /* libhotconv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD55CB370DAD5CD800CA71B7 /* libhotconv.a */; }; - BD55CB4F0DAD5D1600CA71B7 /* libpstoken.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD55CB400DAD5CE700CA71B7 /* libpstoken.a */; }; - BD55CB500DAD5D1B00CA71B7 /* libtypecomp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD55CB490DAD5CF500CA71B7 /* libtypecomp.a */; }; - BD55CBB80DAD6C4C00CA71B7 /* libdynarr.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD55CBB70DAD6C4600CA71B7 /* libdynarr.a */; }; - BD55CBB90DAD6C5100CA71B7 /* libctutil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD55CBAE0DAD6C3400CA71B7 /* libctutil.a */; }; - BD6159100D2D751300C1E0CA /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61590B0D2D751300C1E0CA /* main.c */; }; - BD6159110D2D751300C1E0CA /* fcdb.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61590C0D2D751300C1E0CA /* fcdb.c */; }; - BD6159120D2D751300C1E0CA /* cbpriv.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61590D0D2D751300C1E0CA /* cbpriv.c */; }; - BD6159130D2D751300C1E0CA /* file.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61590E0D2D751300C1E0CA /* file.c */; }; - BD6159140D2D751300C1E0CA /* cb.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61590F0D2D751300C1E0CA /* cb.c */; }; - BD6159200D2D752D00C1E0CA /* file.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD6159150D2D752D00C1E0CA /* file.h */; }; - BD6159210D2D752D00C1E0CA /* lctype.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD6159160D2D752D00C1E0CA /* lctype.h */; }; - BD6159220D2D752D00C1E0CA /* fcdb.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD6159170D2D752D00C1E0CA /* fcdb.h */; }; - BD6159230D2D752D00C1E0CA /* cb.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD6159180D2D752D00C1E0CA /* cb.h */; }; - BD6159240D2D752D00C1E0CA /* cbpriv.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD6159190D2D752D00C1E0CA /* cbpriv.h */; }; - BD6159250D2D752D00C1E0CA /* systemspecific.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD61591A0D2D752D00C1E0CA /* systemspecific.h */; }; - BD6159260D2D752D00C1E0CA /* lstdio.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD61591B0D2D752D00C1E0CA /* lstdio.h */; }; - BD6159270D2D752D00C1E0CA /* lstring.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD61591C0D2D752D00C1E0CA /* lstring.h */; }; - BD6159280D2D752D00C1E0CA /* lerrno.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD61591D0D2D752D00C1E0CA /* lerrno.h */; }; - BD6159290D2D752D00C1E0CA /* lstdlib.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD61591E0D2D752D00C1E0CA /* lstdlib.h */; }; - BD61592A0D2D752D00C1E0CA /* package.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BD61591F0D2D752D00C1E0CA /* package.h */; }; - BD61592C0D2D754000C1E0CA /* mac.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61592B0D2D754000C1E0CA /* mac.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - BD55CB210DAD5CCB00CA71B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB1A0DAD5CCB00CA71B7 /* cffread.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = cffread; - }; - BD55CB360DAD5CD800CA71B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB230DAD5CD800CA71B7 /* hotconv.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = hotconv; - }; - BD55CB3F0DAD5CE700CA71B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB380DAD5CE700CA71B7 /* pstoken.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = pstoken; - }; - BD55CB480DAD5CF500CA71B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB410DAD5CF500CA71B7 /* typecomp.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = typecomp; - }; - BD55CBAD0DAD6C3400CA71B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CBA60DAD6C3400CA71B7 /* ctutil.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = ctutil; - }; - BD55CBB60DAD6C4600CA71B7 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CBAF0DAD6C4600CA71B7 /* dynarr.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = dynarr; - }; - BDA3D11D14E57C5200BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB380DAD5CE700CA71B7 /* pstoken.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = pstoken; - }; - BDA3D11F14E57C5500BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB410DAD5CF500CA71B7 /* typecomp.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = typecomp; - }; - BDA3D12114E57C5800BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB1A0DAD5CCB00CA71B7 /* cffread.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = cffread; - }; - BDA3D12314E57C5B00BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CBAF0DAD6C4600CA71B7 /* dynarr.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = dynarr; - }; - BDA3D12514E57C5E00BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CB230DAD5CD800CA71B7 /* hotconv.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = hotconv; - }; - BDA3D12714E57C6100BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD55CBA60DAD6C3400CA71B7 /* ctutil.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = ctutil; - }; - BDA3D12914E57C6600BCED0F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8DD76FA90486AB0100D96B5E; - remoteInfo = makeotf; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 8DD76FAF0486AB0100D96B5E /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - BD6159200D2D752D00C1E0CA /* file.h in CopyFiles */, - BD6159210D2D752D00C1E0CA /* lctype.h in CopyFiles */, - BD6159220D2D752D00C1E0CA /* fcdb.h in CopyFiles */, - BD6159230D2D752D00C1E0CA /* cb.h in CopyFiles */, - BD6159240D2D752D00C1E0CA /* cbpriv.h in CopyFiles */, - BD6159250D2D752D00C1E0CA /* systemspecific.h in CopyFiles */, - BD6159260D2D752D00C1E0CA /* lstdio.h in CopyFiles */, - BD6159270D2D752D00C1E0CA /* lstring.h in CopyFiles */, - BD6159280D2D752D00C1E0CA /* lerrno.h in CopyFiles */, - BD6159290D2D752D00C1E0CA /* lstdlib.h in CopyFiles */, - BD61592A0D2D752D00C1E0CA /* package.h in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 8DD76FB20486AB0100D96B5E /* makeotfexe */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = makeotfexe; sourceTree = BUILT_PRODUCTS_DIR; }; - BD55CB1A0DAD5CCB00CA71B7 /* cffread.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cffread.xcodeproj; path = ../../../makeotf_lib/build/cffread/osx/xcode/cffread.xcodeproj; sourceTree = SOURCE_ROOT; }; - BD55CB230DAD5CD800CA71B7 /* hotconv.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = hotconv.xcodeproj; path = ../../../makeotf_lib/build/hotconv/osx/xcode/hotconv.xcodeproj; sourceTree = SOURCE_ROOT; }; - BD55CB380DAD5CE700CA71B7 /* pstoken.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = pstoken.xcodeproj; path = ../../../makeotf_lib/build/pstoken/osx/xcode/pstoken.xcodeproj; sourceTree = SOURCE_ROOT; }; - BD55CB410DAD5CF500CA71B7 /* typecomp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = typecomp.xcodeproj; path = ../../../makeotf_lib/build/typecomp/osx/xcode/typecomp.xcodeproj; sourceTree = SOURCE_ROOT; }; - BD55CBA60DAD6C3400CA71B7 /* ctutil.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ctutil.xcodeproj; path = ../../../../public/lib/build/ctutil/osx/xcode/ctutil.xcodeproj; sourceTree = SOURCE_ROOT; }; - BD55CBAF0DAD6C4600CA71B7 /* dynarr.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = dynarr.xcodeproj; path = ../../../../public/lib/build/dynarr/osx/xcode/dynarr.xcodeproj; sourceTree = SOURCE_ROOT; }; - BD61590B0D2D751300C1E0CA /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../../source/main.c; sourceTree = SOURCE_ROOT; }; - BD61590C0D2D751300C1E0CA /* fcdb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fcdb.c; path = ../../../source/fcdb.c; sourceTree = SOURCE_ROOT; }; - BD61590D0D2D751300C1E0CA /* cbpriv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cbpriv.c; path = ../../../source/cbpriv.c; sourceTree = SOURCE_ROOT; }; - BD61590E0D2D751300C1E0CA /* file.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = file.c; path = ../../../source/file.c; sourceTree = SOURCE_ROOT; }; - BD61590F0D2D751300C1E0CA /* cb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cb.c; path = ../../../source/cb.c; sourceTree = SOURCE_ROOT; }; - BD6159150D2D752D00C1E0CA /* file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file.h; path = ../../../source/include_files/file.h; sourceTree = SOURCE_ROOT; }; - BD6159160D2D752D00C1E0CA /* lctype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lctype.h; path = ../../../source/include_files/lctype.h; sourceTree = SOURCE_ROOT; }; - BD6159170D2D752D00C1E0CA /* fcdb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fcdb.h; path = ../../../source/include_files/fcdb.h; sourceTree = SOURCE_ROOT; }; - BD6159180D2D752D00C1E0CA /* cb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cb.h; path = ../../../source/include_files/cb.h; sourceTree = SOURCE_ROOT; }; - BD6159190D2D752D00C1E0CA /* cbpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cbpriv.h; path = ../../../source/include_files/cbpriv.h; sourceTree = SOURCE_ROOT; }; - BD61591A0D2D752D00C1E0CA /* systemspecific.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = systemspecific.h; path = ../../../source/include_files/systemspecific.h; sourceTree = SOURCE_ROOT; }; - BD61591B0D2D752D00C1E0CA /* lstdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstdio.h; path = ../../../source/include_files/lstdio.h; sourceTree = SOURCE_ROOT; }; - BD61591C0D2D752D00C1E0CA /* lstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstring.h; path = ../../../source/include_files/lstring.h; sourceTree = SOURCE_ROOT; }; - BD61591D0D2D752D00C1E0CA /* lerrno.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lerrno.h; path = ../../../source/include_files/lerrno.h; sourceTree = SOURCE_ROOT; }; - BD61591E0D2D752D00C1E0CA /* lstdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lstdlib.h; path = ../../../source/include_files/lstdlib.h; sourceTree = SOURCE_ROOT; }; - BD61591F0D2D752D00C1E0CA /* package.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = package.h; path = ../../../source/include_files/package.h; sourceTree = SOURCE_ROOT; }; - BD61592B0D2D754000C1E0CA /* mac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mac.c; path = ../../../source/mac/mac.c; sourceTree = SOURCE_ROOT; }; - BD61592D0D2D755300C1E0CA /* debug_makeotf.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = debug_makeotf.xcconfig; path = ../../../config/xcconfig/debug_makeotf.xcconfig; sourceTree = SOURCE_ROOT; }; - BD61592E0D2D755300C1E0CA /* release_makeotf.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = release_makeotf.xcconfig; path = ../../../config/xcconfig/release_makeotf.xcconfig; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76FAD0486AB0100D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - BD55CB4D0DAD5D0E00CA71B7 /* libcffread.a in Frameworks */, - BD55CB4E0DAD5D1300CA71B7 /* libhotconv.a in Frameworks */, - BD55CB4F0DAD5D1600CA71B7 /* libpstoken.a in Frameworks */, - BD55CB500DAD5D1B00CA71B7 /* libtypecomp.a in Frameworks */, - BD55CBB90DAD6C5100CA71B7 /* libctutil.a in Frameworks */, - BD55CBB80DAD6C4C00CA71B7 /* libdynarr.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* makeotf */ = { - isa = PBXGroup; - children = ( - BD6159430D2DC12300C1E0CA /* lib */, - BD6159090D2D74DD00C1E0CA /* xconfig */, - BD61590A0D2D74E600C1E0CA /* Headers */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = makeotf; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - BD61590B0D2D751300C1E0CA /* main.c */, - BD61590C0D2D751300C1E0CA /* fcdb.c */, - BD61590D0D2D751300C1E0CA /* cbpriv.c */, - BD61590E0D2D751300C1E0CA /* file.c */, - BD61590F0D2D751300C1E0CA /* cb.c */, - BD61592B0D2D754000C1E0CA /* mac.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8DD76FB20486AB0100D96B5E /* makeotfexe */, - ); - name = Products; - sourceTree = ""; - }; - BD55CB1B0DAD5CCB00CA71B7 /* Products */ = { - isa = PBXGroup; - children = ( - BD55CB220DAD5CCB00CA71B7 /* libcffread.a */, - ); - name = Products; - sourceTree = ""; - }; - BD55CB240DAD5CD800CA71B7 /* Products */ = { - isa = PBXGroup; - children = ( - BD55CB370DAD5CD800CA71B7 /* libhotconv.a */, - ); - name = Products; - sourceTree = ""; - }; - BD55CB390DAD5CE700CA71B7 /* Products */ = { - isa = PBXGroup; - children = ( - BD55CB400DAD5CE700CA71B7 /* libpstoken.a */, - ); - name = Products; - sourceTree = ""; - }; - BD55CB420DAD5CF500CA71B7 /* Products */ = { - isa = PBXGroup; - children = ( - BD55CB490DAD5CF500CA71B7 /* libtypecomp.a */, - ); - name = Products; - sourceTree = ""; - }; - BD55CBA70DAD6C3400CA71B7 /* Products */ = { - isa = PBXGroup; - children = ( - BD55CBAE0DAD6C3400CA71B7 /* libctutil.a */, - ); - name = Products; - sourceTree = ""; - }; - BD55CBB00DAD6C4600CA71B7 /* Products */ = { - isa = PBXGroup; - children = ( - BD55CBB70DAD6C4600CA71B7 /* libdynarr.a */, - ); - name = Products; - sourceTree = ""; - }; - BD6159090D2D74DD00C1E0CA /* xconfig */ = { - isa = PBXGroup; - children = ( - BD61592D0D2D755300C1E0CA /* debug_makeotf.xcconfig */, - BD61592E0D2D755300C1E0CA /* release_makeotf.xcconfig */, - ); - name = xconfig; - sourceTree = ""; - }; - BD61590A0D2D74E600C1E0CA /* Headers */ = { - isa = PBXGroup; - children = ( - BD6159150D2D752D00C1E0CA /* file.h */, - BD6159160D2D752D00C1E0CA /* lctype.h */, - BD6159170D2D752D00C1E0CA /* fcdb.h */, - BD6159180D2D752D00C1E0CA /* cb.h */, - BD6159190D2D752D00C1E0CA /* cbpriv.h */, - BD61591A0D2D752D00C1E0CA /* systemspecific.h */, - BD61591B0D2D752D00C1E0CA /* lstdio.h */, - BD61591C0D2D752D00C1E0CA /* lstring.h */, - BD61591D0D2D752D00C1E0CA /* lerrno.h */, - BD61591E0D2D752D00C1E0CA /* lstdlib.h */, - BD61591F0D2D752D00C1E0CA /* package.h */, - ); - name = Headers; - sourceTree = ""; - }; - BD6159430D2DC12300C1E0CA /* lib */ = { - isa = PBXGroup; - children = ( - BD55CB1A0DAD5CCB00CA71B7 /* cffread.xcodeproj */, - BD55CB230DAD5CD800CA71B7 /* hotconv.xcodeproj */, - BD55CB380DAD5CE700CA71B7 /* pstoken.xcodeproj */, - BD55CB410DAD5CF500CA71B7 /* typecomp.xcodeproj */, - BD55CBA60DAD6C3400CA71B7 /* ctutil.xcodeproj */, - BD55CBAF0DAD6C4600CA71B7 /* dynarr.xcodeproj */, - ); - name = lib; - sourceTree = ""; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76FA90486AB0100D96B5E /* makeotf */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "makeotf" */; - buildPhases = ( - 8DD76FAB0486AB0100D96B5E /* Sources */, - 8DD76FAD0486AB0100D96B5E /* Frameworks */, - 8DD76FAF0486AB0100D96B5E /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = makeotf; - productInstallPath = "$(HOME)/bin"; - productName = makeotf; - productReference = 8DD76FB20486AB0100D96B5E /* makeotfexe */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1000; - }; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "makeotf" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* makeotf */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = BD55CB1B0DAD5CCB00CA71B7 /* Products */; - ProjectRef = BD55CB1A0DAD5CCB00CA71B7 /* cffread.xcodeproj */; - }, - { - ProductGroup = BD55CBA70DAD6C3400CA71B7 /* Products */; - ProjectRef = BD55CBA60DAD6C3400CA71B7 /* ctutil.xcodeproj */; - }, - { - ProductGroup = BD55CBB00DAD6C4600CA71B7 /* Products */; - ProjectRef = BD55CBAF0DAD6C4600CA71B7 /* dynarr.xcodeproj */; - }, - { - ProductGroup = BD55CB240DAD5CD800CA71B7 /* Products */; - ProjectRef = BD55CB230DAD5CD800CA71B7 /* hotconv.xcodeproj */; - }, - { - ProductGroup = BD55CB390DAD5CE700CA71B7 /* Products */; - ProjectRef = BD55CB380DAD5CE700CA71B7 /* pstoken.xcodeproj */; - }, - { - ProductGroup = BD55CB420DAD5CF500CA71B7 /* Products */; - ProjectRef = BD55CB410DAD5CF500CA71B7 /* typecomp.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 8DD76FA90486AB0100D96B5E /* makeotf */, - BDA3D11A14E57C4C00BCED0F /* BuildAll */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - BD55CB220DAD5CCB00CA71B7 /* libcffread.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libcffread.a; - remoteRef = BD55CB210DAD5CCB00CA71B7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - BD55CB370DAD5CD800CA71B7 /* libhotconv.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libhotconv.a; - remoteRef = BD55CB360DAD5CD800CA71B7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - BD55CB400DAD5CE700CA71B7 /* libpstoken.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libpstoken.a; - remoteRef = BD55CB3F0DAD5CE700CA71B7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - BD55CB490DAD5CF500CA71B7 /* libtypecomp.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libtypecomp.a; - remoteRef = BD55CB480DAD5CF500CA71B7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - BD55CBAE0DAD6C3400CA71B7 /* libctutil.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libctutil.a; - remoteRef = BD55CBAD0DAD6C3400CA71B7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - BD55CBB70DAD6C4600CA71B7 /* libdynarr.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libdynarr.a; - remoteRef = BD55CBB60DAD6C4600CA71B7 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76FAB0486AB0100D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD6159100D2D751300C1E0CA /* main.c in Sources */, - BD6159110D2D751300C1E0CA /* fcdb.c in Sources */, - BD6159120D2D751300C1E0CA /* cbpriv.c in Sources */, - BD6159130D2D751300C1E0CA /* file.c in Sources */, - BD6159140D2D751300C1E0CA /* cb.c in Sources */, - BD61592C0D2D754000C1E0CA /* mac.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - BDA3D11E14E57C5200BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = pstoken; - targetProxy = BDA3D11D14E57C5200BCED0F /* PBXContainerItemProxy */; - }; - BDA3D12014E57C5500BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = typecomp; - targetProxy = BDA3D11F14E57C5500BCED0F /* PBXContainerItemProxy */; - }; - BDA3D12214E57C5800BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = cffread; - targetProxy = BDA3D12114E57C5800BCED0F /* PBXContainerItemProxy */; - }; - BDA3D12414E57C5B00BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = dynarr; - targetProxy = BDA3D12314E57C5B00BCED0F /* PBXContainerItemProxy */; - }; - BDA3D12614E57C5E00BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = hotconv; - targetProxy = BDA3D12514E57C5E00BCED0F /* PBXContainerItemProxy */; - }; - BDA3D12814E57C6100BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ctutil; - targetProxy = BDA3D12714E57C6100BCED0F /* PBXContainerItemProxy */; - }; - BDA3D12A14E57C6600BCED0F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8DD76FA90486AB0100D96B5E /* makeotf */; - targetProxy = BDA3D12914E57C6600BCED0F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1DEB928608733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD61592D0D2D755300C1E0CA /* debug_makeotf.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - "CFF_T13_SUPPORT=0", - "TC_HINT_CHECK=1", - "TC_EURO_SUPPORT=1", - "TC_SUBR_SUPPORT=1", - "CFF_DEBUG=1", - "HOT_DEBUG=1", - "TC_DEBUG=1", - ); - }; - name = Debug; - }; - 1DEB928708733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD61592E0D2D755300C1E0CA /* release_makeotf.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - "CFF_T13_SUPPORT=0", - "TC_HINT_CHECK=1", - "TC_EURO_SUPPORT=1", - "TC_SUBR_SUPPORT=1", - ); - }; - name = Release; - }; - 1DEB928A08733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD61592D0D2D755300C1E0CA /* debug_makeotf.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - "CFF_T13_SUPPORT=0", - "TC_HINT_CHECK=1", - "TC_EURO_SUPPORT=1", - "TC_SUBR_SUPPORT=1", - "CFF_DEBUG=1", - "HOT_DEBUG=1", - "TC_DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(SDKROOT)/usr/include", - "../../../makeotf_lib/api/**", - "../../../makeotf_lib/resource/**", - "../../../../public/lib/api/**", - "../../../../public/lib/resource/**", - ); - "HEADER_SEARCH_PATHS[arch=*]" = ( - "$(SDKROOT)/usr/include", - "../../../makeotf_lib/api/**", - "../../../makeotf_lib/resource/**", - "../../../../public/lib/api/**", - "../../../../public/lib/resource/**", - ); - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = makeotfexe; - }; - name = Debug; - }; - 1DEB928B08733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD61592E0D2D755300C1E0CA /* release_makeotf.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - "CFF_T13_SUPPORT=0", - "TC_HINT_CHECK=1", - "TC_EURO_SUPPORT=1", - "TC_SUBR_SUPPORT=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = makeotfexe; - }; - name = Release; - }; - BDA3D11B14E57C4C00BCED0F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD61592D0D2D755300C1E0CA /* debug_makeotf.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Debug; - }; - BDA3D11C14E57C4C00BCED0F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD61592E0D2D755300C1E0CA /* release_makeotf.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "makeotf" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928608733DD80010E9CD /* Debug */, - 1DEB928708733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "makeotf" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928A08733DD80010E9CD /* Debug */, - 1DEB928B08733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - BDA3D12C14E57C6D00BCED0F /* Build configuration list for PBXAggregateTarget "BuildAll" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - BDA3D11B14E57C4C00BCED0F /* Debug */, - BDA3D11C14E57C4C00BCED0F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/c/makeotf/build/win/visualstudio/build.cmd b/c/makeotf/build/win/visualstudio/build.cmd deleted file mode 100644 index 00999bdbc..000000000 --- a/c/makeotf/build/win/visualstudio/build.cmd +++ /dev/null @@ -1,37 +0,0 @@ -@echo off -cd %~dp0 -setlocal enabledelayedexpansion -set targetProgram=makeotf - -set do_release=0 -set do_target=0 - -if "%1"=="" set do_release=1 - -if "%1"=="release" set do_release=1 - -if %do_release%==1 ( - set buildConfig=Build - msbuild /target:!buildConfig! /p:configuration=Release %~dp0%targetProgram%.sln - set do_target=1 -) - -if "%1"=="debug" ( - set buildConfig=Build - msbuild /target:!buildConfig! /p:configuration=Debug %~dp0%targetProgram%.sln - set do_target=1 -) - -if %do_target%==1 ( - copy /Y ..\..\..\exe\win\release\%targetProgram%exe.exe ..\..\..\..\build_all -) - -if "%1"=="clean" ( - set buildConfig=Clean - msbuild /target:!buildConfig! /p:configuration=Debug %~dp0%targetProgram%.sln - msbuild /target:!buildConfig! /p:configuration=Release %~dp0%targetProgram%.sln - set do_target=1 -) -if %do_target%==0 ( - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -) diff --git a/c/makeotf/build/win/visualstudio/makeotf.sln b/c/makeotf/build/win/visualstudio/makeotf.sln deleted file mode 100644 index 9cd0ea563..000000000 --- a/c/makeotf/build/win/visualstudio/makeotf.sln +++ /dev/null @@ -1,90 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2047 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cffread", "..\..\..\makeotf_lib\build\cffread\win\visualstudio\cffread.vcxproj", "{00D7DB77-ABC2-440B-A2EB-7F8C51884E05}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ctutil", "..\..\..\..\public\lib\build\ctutil\win\visualstudio\ctutil.vcxproj", "{6F3528C4-AD05-4CB9-BC94-F09BF41B415A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dynarr", "..\..\..\..\public\lib\build\dynarr\win\visualstudio\dynarr.vcxproj", "{41075538-EB2C-43DD-90DF-21C6ED004AB7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hotconv", "..\..\..\makeotf_lib\build\hotconv\win\visualstudio\hotconv.vcxproj", "{5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makeotf", "makeotf.vcxproj", "{3B478F53-4BAB-49FA-A4F5-DEB315241C7C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pstoken", "..\..\..\makeotf_lib\build\pstoken\win\visualstudio\pstoken.vcxproj", "{2B131B1A-B54A-48BF-9B5E-5B446E6C662C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "typecomp", "..\..\..\makeotf_lib\build\typecomp\win\visualstudio\typecomp.vcxproj", "{89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x64.ActiveCfg = Debug|x64 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x64.Build.0 = Debug|x64 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x86.ActiveCfg = Debug|Win32 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x86.Build.0 = Debug|Win32 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x64.ActiveCfg = Release|x64 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x64.Build.0 = Release|x64 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x86.ActiveCfg = Release|Win32 - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x86.Build.0 = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.ActiveCfg = Debug|x64 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.Build.0 = Debug|x64 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.ActiveCfg = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.Build.0 = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.ActiveCfg = Release|x64 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.Build.0 = Release|x64 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.ActiveCfg = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.Build.0 = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.ActiveCfg = Debug|x64 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.Build.0 = Debug|x64 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.ActiveCfg = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.Build.0 = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.ActiveCfg = Release|x64 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.Build.0 = Release|x64 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.ActiveCfg = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.Build.0 = Release|Win32 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x64.ActiveCfg = Debug|x64 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x64.Build.0 = Debug|x64 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x86.ActiveCfg = Debug|Win32 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x86.Build.0 = Debug|Win32 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x64.ActiveCfg = Release|x64 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x64.Build.0 = Release|x64 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x86.ActiveCfg = Release|Win32 - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x86.Build.0 = Release|Win32 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x64.ActiveCfg = Debug|x64 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x64.Build.0 = Debug|x64 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x86.ActiveCfg = Debug|Win32 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x86.Build.0 = Debug|Win32 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x64.ActiveCfg = Release|x64 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x64.Build.0 = Release|x64 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x86.ActiveCfg = Release|Win32 - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x86.Build.0 = Release|Win32 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x64.ActiveCfg = Debug|x64 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x64.Build.0 = Debug|x64 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x86.ActiveCfg = Debug|Win32 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x86.Build.0 = Debug|Win32 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x64.ActiveCfg = Release|x64 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x64.Build.0 = Release|x64 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x86.ActiveCfg = Release|Win32 - {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x86.Build.0 = Release|Win32 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x64.ActiveCfg = Debug|x64 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x64.Build.0 = Debug|x64 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x86.ActiveCfg = Debug|Win32 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x86.Build.0 = Debug|Win32 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x64.ActiveCfg = Release|x64 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x64.Build.0 = Release|x64 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x86.ActiveCfg = Release|Win32 - {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {16D968A9-6E36-4173-B87A-8A15610DAC82} - EndGlobalSection -EndGlobal diff --git a/c/makeotf/build/win/visualstudio/makeotf.vcxproj b/c/makeotf/build/win/visualstudio/makeotf.vcxproj deleted file mode 100644 index 747ee4c37..000000000 --- a/c/makeotf/build/win/visualstudio/makeotf.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {3B478F53-4BAB-49FA-A4F5-DEB315241C7C} - makeotfexe - 10.0.17134.0 - - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\exe\win\debug\ - $(Configuration)\ - true - true - ..\..\..\exe\win\release\ - $(Configuration)\ - false - false - $(ProjectName)exe - $(ProjectName)exe - $(ProjectName)exe - $(ProjectName)exe - - - ..\..\..\exe\win\release\ - - - ..\..\..\exe\win\debug\ - - - - Disabled - ..\..\..\source\include_files;..\..\..\makeotf_lib\api;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;MAKEOTFLIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - EditAndContinue - - - %(AdditionalDependencies) - $(OutDir) - 536870912 - 536870912 - 32000000 - 32000000 - $(TargetPath) - true - Console - MachineX86 - - - - - Disabled - ..\..\..\source\include_files;..\..\..\makeotf_lib\api;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) - WIN32;DEBUG;_WINDOWS;MAKEOTFLIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - %(AdditionalDependencies) - $(OutDir) - 536870912 - 536870912 - 32000000 - 32000000 - $(TargetPath) - true - Console - - - - - MaxSpeed - ..\..\..\source\include_files;..\..\..\makeotf_lib\api;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) - CDECL=__cdecl;WIN32;NDEBUG;_WINDOWS;MAKEOTFLIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - %(AdditionalDependencies) - $(OutDir) - 8000000 - 8000000 - $(TargetPath) - Console - MachineX86 - - - - - MaxSpeed - ..\..\..\source\include_files;..\..\..\makeotf_lib\api;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) - CDECL=__cdecl;WIN32;NDEBUG;_WINDOWS;MAKEOTFLIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - %(AdditionalDependencies) - $(OutDir) - 8000000 - 8000000 - $(TargetPath) - Console - - - - - - - - - - - - - {6f3528c4-ad05-4cb9-bc94-f09bf41b415a} - false - - - {41075538-eb2c-43dd-90df-21c6ed004ab7} - false - - - {00d7db77-abc2-440b-a2eb-7f8c51884e05} - false - - - {5d5223a6-5a8a-4f7e-b9b0-9f0567935cad} - false - - - {2b131b1a-b54a-48bf-9b5e-5b446e6c662c} - false - - - {89d0ccf4-7829-42f6-a42a-8adce2d2f036} - false - - - - - - diff --git a/c/makeotf/config/xcconfig/debug_makeotf.xcconfig b/c/makeotf/config/xcconfig/debug_makeotf.xcconfig deleted file mode 100644 index 9a20e655d..000000000 --- a/c/makeotf/config/xcconfig/debug_makeotf.xcconfig +++ /dev/null @@ -1,4 +0,0 @@ -#include "../../../public/config/xcconfig/debug_tx.xcconfig" -HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include ../../../makeotf_lib/api/** ../../../makeotf_lib/resource/** ../../../../public/lib/api/** ../../../../public/lib/resource/** -LIBRARY_SEARCH_PATHS = ../../../makeotf_lib/lib/osx/debug - diff --git a/c/makeotf/config/xcconfig/release_makeotf.xcconfig b/c/makeotf/config/xcconfig/release_makeotf.xcconfig deleted file mode 100644 index 103441348..000000000 --- a/c/makeotf/config/xcconfig/release_makeotf.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -#include "../../../public/config/xcconfig/release_tx.xcconfig" -HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include ../../../makeotf_lib/api/** ../../../makeotf_lib/resource/** ../../../../public/lib/api/** ../../../../public/lib/resource/** -LIBRARY_SEARCH_PATHS = ../../../makeotf_lib/lib/osx/release diff --git a/c/makeotf/makeotf_lib/api/cffread.h b/c/makeotf/include/cffread.h similarity index 100% rename from c/makeotf/makeotf_lib/api/cffread.h rename to c/makeotf/include/cffread.h diff --git a/c/makeotf/makeotf_lib/api/hotconv.h b/c/makeotf/include/hotconv.h similarity index 95% rename from c/makeotf/makeotf_lib/api/hotconv.h rename to c/makeotf/include/hotconv.h index 10c5f392b..bd2a6a826 100644 --- a/c/makeotf/makeotf_lib/api/hotconv.h +++ b/c/makeotf/include/hotconv.h @@ -12,7 +12,7 @@ This software is licensed as OpenSource, under the Apache License, Version 2.0. extern "C" { #endif -#define HOT_VERSION 0x010077 /* Library version (1.0.119) */ +#define HOT_VERSION 0x010100 /* Library version (1.1.0) */ /* Major, minor, build = (HOT_VERSION >> 16) & 0xff, (HOT_VERSION >> 8) & 0xff, HOT_VERSION & 0xff) */ /* Warning: this string is now part of heuristic used by CoolType to identify the first round of CoolType fonts which had the backtrack sequence of a chaining @@ -29,6 +29,20 @@ inside the (1,0,0) nameID 5 "Version: string. */ /* Hatch OpenType (HOT) Font Conversion Library ============================================ + 2021 Note + --------- + + The original design of this library anticipated its use in a broad variety + of contexts and with differently organized source materials. It has turned + out that it is mainly or exclusively used by the AFDKO makeotfexe program. + + As one consequence the 2021 reorganization of the code has eliminated + some of the now-unneeded encapsulation of the library. The memory allocation + callbacks have been removed and the feature files are opened from within + the library. Contributors should feel free to make further changes along + the same lines if and when they reduce the complexity of fixing bugs or + adding new features. + Overview -------- This library converts platform independent font data (PostScript outline @@ -161,6 +175,7 @@ hotCtx hotNew(hotCallbacks *cb); /* Message types (for use with message callback) */ enum { + hotHEADING, hotNOTE, hotWARNING, hotERROR, @@ -184,26 +199,13 @@ struct hotCallbacks_ { must NOT return and the client should use longjmp() to return control to a point prior to calling tcNew(). */ - void (*message)(void *ctx, int type, char *text); /* (optional) */ + void (*message)(void *ctx, int type, const char *text); /* (optional) */ /* [Optional] message() simply passes a message back to the client as a null-terminated string. Four message types are supported: hotNOTE, hotWARNING, hotERROR, and hotFATAL. A client is free to handle messages in any manner they choose. - Memory management: */ - - void *(*malloc)(void *ctx, size_t size); - void *(*realloc)(void *ctx, void *old, size_t size); - void (*free)(void *ctx, void *ptr); - - /* [Required] These three memory management functions manage memory in the same - manner as the Standard C Library functions of the same name. (This means - that they must observe the alignment requirements imposed by the standard.) - The client is required to handle any error conditions that may arise. - Specifically, a client must ensure requested memory is available and must - never return a NULL pointer from malloc() or realloc(). - PostScript data input: */ char *(*psId)(void *ctx); @@ -282,29 +284,15 @@ struct hotCallbacks_ { Feature file data input: */ - char *(*featOpen)(void *ctx, char *name, long offset); - char *(*featRefill)(void *ctx, long *count); - void (*featClose)(void *ctx); - void (*featAddAnonData)(void *ctx, char *data, long count, + char *(*featTopLevelFile)(void *ctx); + void (*featAddAnonData)(void *ctx, const char *data, long count, unsigned long tag); - /* [Optional] These functions are called to handle feature file support. - featOpen() is called to open either the main feature file for the font - (indicated by name being NULL) or a feature include file (name will be the - file name indicated in the "include" directive in a feature file). - featOpen() should locate the file if name is not absolute (typically by - searching first in the directory in which the main feature file resides, and - then in a standard directory). If the file is not found or not needed (in - the case of name being NULL), featOpen() should return NULL. If the file is - found, featOpen() should open it, seek to offset, and return a descriptive - identifier (typically the full file name), which hotconv will use to report - any feature error messages within the file. - - featRefill() is identical to cffRefill() except that it operates on the - feature file opened by featOpen(). - - featClose() closes the feature file opened by featOpen(). - + /* [Required] These functions are called to handle feature file support. + featTopLevelFile() should return a relative or absolute path (which need + only be valid for the length of the call) to the top-level feature file + or NULL if there is no file. + featAddAnonData() is called at the end of every anonymous block in the feature file. It supplies a pointer to the data seen within the block (from the beginning of the line after the opening brace and up to the end of the @@ -317,6 +305,9 @@ struct hotCallbacks_ { anonymous tables by calls to hotAddAnonTable() within the duration of the featAddAnonData() callbacks. + Anon blocks are now deprecated in the spec and makeotfexe does nothing with + them. + Temporary file I/O (all optional) */ void (*tmpOpen)(void *ctx); @@ -651,7 +642,7 @@ Blank lines, and characters following the comment char "#" on a line, are ignore int hotAddName(hotCtx g, unsigned short platformId, unsigned short platspecId, unsigned short languageId, unsigned short nameId, - signed char *str); + const char *str); /* hotAddName() is called to add menu names. This name will be directly stored in the name table using the various id arguments specified. The actual name diff --git a/c/makeotf/makeotf_lib/api/pstoken.h b/c/makeotf/include/pstoken.h similarity index 95% rename from c/makeotf/makeotf_lib/api/pstoken.h rename to c/makeotf/include/pstoken.h index b0ad66f37..3a5b0bb04 100644 --- a/c/makeotf/makeotf_lib/api/pstoken.h +++ b/c/makeotf/include/pstoken.h @@ -65,11 +65,7 @@ typedef struct { /* Exception handling */ void (*fatal)(void *ctx); - void (*message)(void *ctx, int type, char *text); /* (optional) */ - - /* Memory management */ - void *(*malloc)(void *ctx, size_t size); - void (*free)(void *ctx, void *ptr); + void (*message)(void *ctx, int type, const char *text); /* (optional) */ /* PostScript data input */ char *(*psId)(void *ctx); /* Data id (optional) */ diff --git a/c/makeotf/makeotf_lib/api/readme.txt b/c/makeotf/include/readme.txt similarity index 100% rename from c/makeotf/makeotf_lib/api/readme.txt rename to c/makeotf/include/readme.txt diff --git a/c/makeotf/makeotf_lib/api/typecomp.h b/c/makeotf/include/typecomp.h similarity index 93% rename from c/makeotf/makeotf_lib/api/typecomp.h rename to c/makeotf/include/typecomp.h index 733ed8210..bd1161851 100644 --- a/c/makeotf/makeotf_lib/api/typecomp.h +++ b/c/makeotf/include/typecomp.h @@ -33,10 +33,12 @@ tcCtx tcNew(tcCallbacks *cb); tcCallbacks data structure whose fields are described below. Optional fields should be passed with a NULL value if not required. */ -/* Message types (for use with message callback) */ +/* Message types (for use with message callback, adatpted from hotconv.h) */ + enum { - tcNOTE = 0, - tcWARNING = 1, + tcHEADING, + tcNOTE, + tcWARNING, tcERROR, tcFATAL }; @@ -58,26 +60,13 @@ struct tcCallbacks_ { NOT return and the client should use longjmp() to return control to a point prior to calling tcNew(). */ - void (*message)(void *ctx, int type, char *text); + void (*message)(void *ctx, int type, const char *text); /* [Optional] message() simply passes a message back to the client as a null-terminated string. Four message types are supported: tcNOTE, tcWARNING, tcERROR, and tcFATAL. The client can handle messages in any manner they choose. - Memory management: */ - - void *(*malloc)(void *ctx, size_t size); - void *(*realloc)(void *ctx, void *old, size_t size); - void (*free)(void *ctx, void *ptr); - - /* [Required] The malloc(), realloc(), and free() functions manage memory in the - same manner as the Standard C Library functions of the same name. (This - means that they must observe the alignment requirements imposed by the - standard.) The client is required to handle any error conditions that may - arise. Specifically, a client must ensure requested memory is available and - must never return a NULL pointer from malloc() or realloc(). - PostScript data input: */ char *(*psId)(void *ctx); diff --git a/c/makeotf/lib/CMakeLists.txt b/c/makeotf/lib/CMakeLists.txt new file mode 100644 index 000000000..3ae2df7d7 --- /dev/null +++ b/c/makeotf/lib/CMakeLists.txt @@ -0,0 +1,6 @@ +include_directories(AFTER ../../shared/resource) + +add_subdirectory(cffread) +add_subdirectory(pstoken) +add_subdirectory(typecomp) +add_subdirectory(hotconv) diff --git a/c/makeotf/lib/cffread/CMakeLists.txt b/c/makeotf/lib/cffread/CMakeLists.txt new file mode 100644 index 000000000..5497ab7a2 --- /dev/null +++ b/c/makeotf/lib/cffread/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(makeotf_cffread STATIC cffread.c) + +target_compile_definitions(makeotf_cffread PRIVATE $<$:CFF_DEBUG=1> CFF_T13_SUPPORT=0) + diff --git a/c/makeotf/makeotf_lib/source/cffread/cffread.c b/c/makeotf/lib/cffread/cffread.c similarity index 100% rename from c/makeotf/makeotf_lib/source/cffread/cffread.c rename to c/makeotf/lib/cffread/cffread.c diff --git a/c/makeotf/makeotf_lib/source/cffread/t13fail.c b/c/makeotf/lib/cffread/t13fail.c similarity index 100% rename from c/makeotf/makeotf_lib/source/cffread/t13fail.c rename to c/makeotf/lib/cffread/t13fail.c diff --git a/c/makeotf/makeotf_lib/source/hotconv/BASE.c b/c/makeotf/lib/hotconv/BASE.c similarity index 97% rename from c/makeotf/makeotf_lib/source/hotconv/BASE.c rename to c/makeotf/lib/hotconv/BASE.c index 14e9f2354..52bda8a90 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/BASE.c +++ b/c/makeotf/lib/hotconv/BASE.c @@ -143,7 +143,7 @@ static void baseScriptInit(void *ctx, long count, BaseScriptInfo *bsi) { hotCtx g = ctx; int i; for (i = 0; i < count; i++) { - dnaINIT(g->dnaCtx, bsi->coordInx, 5, 5); + dnaINIT(g->DnaCTX, bsi->coordInx, 5, 5); bsi++; } } @@ -151,14 +151,14 @@ static void baseScriptInit(void *ctx, long count, BaseScriptInfo *bsi) { void BASENew(hotCtx g) { BASECtx h = MEM_NEW(g, sizeof(struct BASECtx_)); - dnaINIT(g->dnaCtx, h->horiz.baseline, 5, 5); - dnaINIT(g->dnaCtx, h->horiz.script, 10, 10); - dnaINIT(g->dnaCtx, h->vert.baseline, 5, 5); - dnaINIT(g->dnaCtx, h->vert.script, 10, 10); + dnaINIT(g->DnaCTX, h->horiz.baseline, 5, 5); + dnaINIT(g->DnaCTX, h->horiz.script, 10, 10); + dnaINIT(g->DnaCTX, h->vert.baseline, 5, 5); + dnaINIT(g->DnaCTX, h->vert.script, 10, 10); - dnaINIT(g->dnaCtx, h->baseScript, 10, 10); + dnaINIT(g->DnaCTX, h->baseScript, 10, 10); h->baseScript.func = baseScriptInit; - dnaINIT(g->dnaCtx, h->coord, 10, 20); + dnaINIT(g->DnaCTX, h->coord, 10, 20); /* Link contexts */ h->g = g; diff --git a/c/makeotf/makeotf_lib/source/hotconv/BASE.h b/c/makeotf/lib/hotconv/BASE.h similarity index 92% rename from c/makeotf/makeotf_lib/source/hotconv/BASE.h rename to c/makeotf/lib/hotconv/BASE.h index 7eda77986..9e539a53e 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/BASE.h +++ b/c/makeotf/lib/hotconv/BASE.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define BASE_ TAG('B', 'A', 'S', 'E') /* Standard functions */ @@ -22,5 +26,8 @@ void BASESetBaselineTags(hotCtx g, int vert, int nTag, void BASEAddScript(hotCtx g, int vert, Tag script, Tag dfltBaseline, short *coord); /* [nTag] */ +#ifdef __cplusplus +} +#endif #endif /* HOTCONV_BASE_H */ diff --git a/c/makeotf/lib/hotconv/BuildGrammar.py b/c/makeotf/lib/hotconv/BuildGrammar.py new file mode 100644 index 000000000..74d8ba7a2 --- /dev/null +++ b/c/makeotf/lib/hotconv/BuildGrammar.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +import subprocess +import argparse +import re +import sys +import os + +antlr_program = "antlr4" +antlr_version = "4.9.2" + +antlr_args = ['-no-listener', '-Dlanguage=Cpp'] + +lex_in = ['FeatLexer.g4', 'FeatLexerBase.g4'] +lex_out = ['FeatLexer.cpp', 'FeatLexer.h', 'FeatLexer.interp', + 'FeatLexer.tokens'] + +parse_in = ['FeatParser.g4'] +parse_out = ['FeatParser.cpp', 'FeatParser.h', + 'FeatParserVisitor.h', 'FeatParserVisitor.cpp', + 'FeatParser.interp', 'FeatParserBaseVisitor.h', + 'FeatParserBaseVisitor.cpp', 'FeatParser.tokens'] + +parser = argparse.ArgumentParser() +parser.add_argument('-c', '--clean', + help="remove generated files", + action="store_true") +parser.add_argument('-n', '--dry-run', + help="just print what the program would do", + action="store_true") +parser.add_argument('-f', '--force', + help="Regenerate even if current files are newer", + action="store_true") +args = parser.parse_args() + + +def q(r, *m, **kwargs): + print(*m, file=sys.stderr, **kwargs) + sys.exit(r) + + +def file_newer(p1, p2): + return os.path.exists(p1) and os.path.getmtime(p1) > os.path.getmtime(p2) + + +def check_version(): + try: + command = subprocess.run([antlr_program], capture_output=True) + except (subprocess.CalledProcessError, OSError): + q(1, "ERROR: Did not find '" + antlr_program + "' program in path") + v = re.search(b'([0-9.]+)\n', command.stdout).group(1).decode('ascii') + if v != antlr_version: + q(1, "ERROR: Program version is " + v + " should be " + antlr_version) + + +def run_program(prog): + print(' '.join(prog)) + if not args.dry_run: + a = subprocess.run(prog, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + print(a.stdout.decode('ascii'), end='') + + +check_version() + +os.chdir(os.path.dirname(os.path.abspath(__file__))) + +if args.clean: + d = [] + for fp in lex_out + parse_out: + if os.path.exists(fp): + d.append(fp) + if len(d) == 0: + print("No files to remove") + if args.dry_run: + print('Remove files ' + ' '.join(d)) + else: + for fp in d: + os.remove(fp) +else: + lexer_ok = all([file_newer(lex_out[0], p) for p in lex_in]) + parser_ok = all([file_newer(parse_out[0], p) for p in lex_in + parse_in]) + + if lexer_ok and parser_ok and not args.force: + q(0, "Generated files are newer than sources") + + if not lexer_ok or args.force: + run_program([antlr_program] + antlr_args + [lex_in[0]]) + if not parser_ok or args.force: + run_program([antlr_program] + antlr_args + ['-visitor'] + + [parse_in[0]]) diff --git a/c/makeotf/makeotf_lib/source/hotconv/CFF_.c b/c/makeotf/lib/hotconv/CFF_.c similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/CFF_.c rename to c/makeotf/lib/hotconv/CFF_.c diff --git a/c/makeotf/makeotf_lib/source/hotconv/CFF_.h b/c/makeotf/lib/hotconv/CFF_.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/CFF_.h rename to c/makeotf/lib/hotconv/CFF_.h diff --git a/c/makeotf/lib/hotconv/CMakeLists.txt b/c/makeotf/lib/hotconv/CMakeLists.txt new file mode 100644 index 000000000..82257bf2f --- /dev/null +++ b/c/makeotf/lib/hotconv/CMakeLists.txt @@ -0,0 +1,77 @@ +set(GENERATED_SOURCES + FeatCtx.cpp + FeatCtx.h + FeatLexer.cpp + FeatLexer.h + FeatParserBaseVisitor.cpp + FeatParserBaseVisitor.h + FeatParser.cpp + FeatParser.h + FeatParserVisitor.cpp + FeatParserVisitor.h +) + +add_library(hotconv STATIC + anon.c + anon.h + BASE.c + BASE.h + CFF_.c + CFF_.h + cmap.c + cmap.h + common.h + feat.h + FeatCtx.cpp + FeatCtx.h + ${GENERATED_SOURCES} + FeatVisitor.cpp + FeatVisitor.h + GDEF.c + GDEF.h + GPOS.c + GPOS.h + GSUB.c + GSUB.h + head.c + head.h + hhea.c + hhea.h + hmtx.c + hmtx.h + hot.c + hotmap.h + map.c + maxp.c + maxp.h + name.c + name.h + OS_2.c + OS_2.h + otl.c + otl.h + post.c + post.h + schinese.h + sfnt.c + sfnt.h + STAT.c + STAT.h + uniblock.h + vhea.c + vhea.h + vmtx.c + vmtx.h + VORG.c + VORG.h + winansi.h +) + +set_property(TARGET hotconv PROPERTY C_STANDARD 99) +target_include_directories(hotconv PRIVATE AFTER $<$:${ANTLR4_INCLUDE_DIRS}>) +target_link_libraries(hotconv PUBLIC antlr4_static) + +if ( CMAKE_COMPILER_IS_GNUCC ) + target_compile_options(hotconv PRIVATE -Wall -Wno-attributes) + # set_source_files_properties(${GENERATED_SOURCES} PROPERTIES COMPILE_FLAGS -Wno-attributes) +endif() diff --git a/c/makeotf/lib/hotconv/CPPLINT.cfg b/c/makeotf/lib/hotconv/CPPLINT.cfg new file mode 100644 index 000000000..0ab15e6ac --- /dev/null +++ b/c/makeotf/lib/hotconv/CPPLINT.cfg @@ -0,0 +1 @@ +exclude_files=FeatParser|FeatLexer diff --git a/c/makeotf/lib/hotconv/FeatCtx.cpp b/c/makeotf/lib/hotconv/FeatCtx.cpp new file mode 100644 index 000000000..b7407dfe7 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatCtx.cpp @@ -0,0 +1,3278 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +#include "FeatCtx.h" +#include "FeatVisitor.h" +#include "FeatParser.h" +#include "otl.h" +#include "GPOS.h" +#include "GSUB.h" +#include "GDEF.h" +#include "OS_2.h" +#include "BASE.h" +#include "STAT.h" +#include "name.h" + +#include "antlr4-runtime.h" +#include +#include "assert.h" +#include +#include +#include "string.h" + +#define kDEFAULT_BASECLASS_NAME "FDK_BASE_CLASS" +#define kDEFAULT_LIGATURECLASS_NAME "FDK_LIGATURE_CLASS" +#define kDEFAULT_MARKCLASS_NAME "FDK_DEFAULT_MARK_CLASS" +#define kDEFAULT_COMPONENTCLASS_NAME "FDK_DEFAULT_COMPONENT_CLASS" + +const int FeatCtx::kMaxCodePageValue {32}; +const int FeatCtx::kCodePageUnSet {-1}; + +const int MAX_NUM_LEN {3}; // For glyph ranges +const int AALT_INDEX {-1}; // used as feature index for sorting alt glyphs in rule for aalt feature + +#define USE_LANGSYS_MSG \ + "use \"languagesystem\" statement(s) at beginning of file instead to" \ + " specify the language system(s) this feature should be registered under" + +bool FeatCtx::LangSys::operator<(const FeatCtx::LangSys &b) const { + return std::tie(script, lang) < std::tie(b.script, b.lang); +} + +bool FeatCtx::LangSys::operator==(const FeatCtx::LangSys &b) const { + return std::tie(script, lang) == std::tie(b.script, b.lang); +} + +bool FeatCtx::State::operator==(const FeatCtx::State &b) const { + return memcmp(this, &b, sizeof(State)) == 0; +} + +bool FeatCtx::AALT::FeatureRecord::operator==(const FeatCtx::AALT::FeatureRecord &b) const { + return feature == b.feature; +} + +bool FeatCtx::AALT::FeatureRecord::operator==(const Tag &b) const { + return feature == b; +} + +FeatCtx::FeatCtx(hotCtx g) : g(g) { + memset(&cvParameters, 0, sizeof(cvParameters)); + dnaINIT(g->DnaCTX, cvParameters.charValues, 10, 10); +} + +FeatCtx::~FeatCtx() { + dnaFREE(cvParameters.charValues); + freeBlocks(); +} + +// --------------------------- Main entry point ------------------------------ + +void FeatCtx::fill(void) { + char *featpathname = g->cb.featTopLevelFile(g->cb.ctx); + if ( featpathname == nullptr ) + return; + + root_visitor = new FeatVisitor(this, featpathname); + + root_visitor->Parse(); + + // Report any parsing errors and quit before moving on to other + // errors and warnings + hotQuitOnError(g); + + root_visitor->Translate(); + + reportOldSyntax(); + + aaltCreate(); + + if ( gFlags & (seenIgnoreClassFlag | seenMarkClassFlag) ) + createDefaultGDEFClasses(); + + reportUnusedaaltTags(); + + hotQuitOnError(g); +} + +// ------------------------ GNode memory management -------------------------- + +void FeatCtx::addBlock() { + auto &bl = blockList; + if (bl.first == nullptr) { + /* Initial allocation */ + bl.first = bl.curr = (BlockNode *) MEM_NEW(g, sizeof(BlockNode)); + bl.curr->data = (GNode *) MEM_NEW(g, sizeof(GNode) * bl.intl); + } else { + /* Incremental allocation */ + bl.curr->next = (BlockNode *) MEM_NEW(g, sizeof(BlockNode)); + bl.curr = bl.curr->next; + bl.curr->data = (GNode *) MEM_NEW(g, sizeof(GNode) * bl.incr); + } + bl.curr->next = nullptr; + bl.cnt = 0; +} + +void FeatCtx::freeBlocks() { + BlockNode *p, *pNext; + + for (p = blockList.first; p != nullptr; p = pNext) { + pNext = p->next; + MEM_FREE(g, p->data); + MEM_FREE(g, p); + } +} + +GNode *FeatCtx::newNodeFromBlock() { + auto &bl = blockList; + if ( bl.first == nullptr || bl.cnt == (bl.curr == bl.first ? bl.intl : bl.incr) ) + addBlock(); + return bl.curr->data + bl.cnt++; +} + +#if HOT_DEBUG + +void FeatCtx::nodeStats() { + BlockNode *p; + auto &bl = blockList; + + fprintf(stderr, + "### GNode Stats\n" + "nAdded2FreeList: %ld, " + "nNewFromBlockList: %ld, " + "nNewFromFreeList: %ld.\n", + nAdded2FreeList, nNewFromBlockList, nNewFromFreeList); + fprintf(stderr, "%ld not freed\n", + nNewFromBlockList + nNewFromFreeList - nAdded2FreeList); + + fprintf(stderr, "### BlockList:"); + + for (p = bl.first; p != NULL; p = p->next) { + long blSize = p == bl.first ? bl.intl : bl.incr; + if (p->next != NULL) { + fprintf(stderr, " %ld ->", blSize); + } else { + fprintf(stderr, " %ld/%ld\n", bl.cnt, blSize); + } + } +} + +void FeatCtx::tagDump(Tag tag) { + if (tag == TAG_UNDEF) { + fprintf(stderr, "****"); + } else { + fprintf(stderr, "%c%c%c%c", TAG_ARG(tag)); + } +} + +void FeatCtx::stateDump(State &st) { + fprintf(stderr, "scr='"); + tagDump(st.script); + fprintf(stderr, "' lan='"); + tagDump(st.language); + fprintf(stderr, "' fea='"); + tagDump(st.feature); + fprintf(stderr, "' tbl='"); + tagDump(st.tbl); + fprintf(stderr, "' lkpTyp=%d lkpFlg=%d label=%X\n", + st.lkpType, st.lkpFlag, st.label); +} + +#endif /* HOT_DEBUG */ + +/* Returns a glyph node, uninitialized except for flags */ +static void initAnchor(AnchorMarkInfo *anchor) { + anchor->x = 0; + anchor->y = 0; + anchor->contourpoint = 0; + anchor->format = 0; + anchor->markClass = NULL; + anchor->markClassIndex = 0; + anchor->componentIndex = 0; + return; +} + +// Returns a glyph node, uninitialized except for flags +GNode *FeatCtx::newNode() { + GNode *ret; + if (freelist != nullptr) { +#if HOT_DEBUG + h->nNewFromFreeList++; +#endif + /* Return first item from freelist */ + ret = freelist; + freelist = freelist->nextSeq; + } else { + /* Return new item from da */ +#if HOT_DEBUG + nNewFromBlockList++; +#endif + ret = newNodeFromBlock(); + } + + ret->flags = 0; + ret->nextSeq = NULL; + ret->nextCl = NULL; + ret->lookupLabelCount = 0; + ret->metricsInfo = METRICSINFOEMPTYPP; + ret->aaltIndex = 0; + ret->markClassName = NULL; + initAnchor(&ret->markClassAnchorInfo); + return ret; +} + +GNode *FeatCtx::setNewNode(GID gid) { + GNode *n = newNode(); + n->gid = gid; + return n; +} + +#if HOT_DEBUG + +void FeatCtx::checkFreeNode(GNode *node) { + GNode *testNode = freelist; + long cnt = 0; + while ( testNode != NULL ) { + if ( testNode == node ) + printf("Node duplication in free list %lu. gid: %d!\n", (unsigned long)node, node->gid); + testNode = testNode->nextSeq; + cnt++; + if ( cnt > nAdded2FreeList ) { + printf("Endless loop in checkFreeList.\n"); + break; + } + } +} + +#endif + +/* Add node to freelist (Insert at beginning) */ + +void FeatCtx::recycleNode(GNode *node) { +#if HOT_DEBUG + nAdded2FreeList++; +#endif +#if HOT_DEBUG + checkFreeNode(node); +#endif + node->nextSeq = freelist; + freelist = node; +} + +#define ITERATIONLIMIT 100000 + +/* Add nodes to freelist */ + +void FeatCtx::recycleNodes(GNode *node) { + GNode *nextSeq; + long iterations = 0; + + for (; node != nullptr; node = nextSeq) { + nextSeq = node->nextSeq; + GNode *nextCl; + + /* Recycle class */ + for (GNode *cl = node; cl != nullptr; cl = nextCl) { + nextCl = cl->nextCl; + recycleNode(cl); + if (iterations++ > ITERATIONLIMIT) { + fprintf(stderr, "Makeotf [WARNING]: Many cycles in featRecycleNode. Possible error.\n"); + return; + } + } + } +} + +// ---------------------------- Console messages ----------------------------- + +void FeatCtx::msgPrefix(char **premsg, char **prefix) { + assert(premsg != nullptr && prefix != nullptr); + *premsg = *prefix = nullptr; + + if ( current_visitor == nullptr ) + return; + + current_visitor->newFileMsg(premsg); + current_visitor->tokenPositionMsg(prefix); +} + +void FeatCtx::featMsg(int msgType, const char *fmt, ...) { + va_list ap; + std::vector buf; + buf.resize(128); + + va_start(ap, fmt); + int l = vsnprintf(buf.data(), 128, fmt, ap) + 1; + if ( l > 128 ) { + buf.resize(l); + vsnprintf(buf.data(), l, fmt, ap); + } + hotMsg(g, msgType, buf.data()); +} + +void FeatCtx::featMsg(int msgType, FeatVisitor *v, + antlr4::Token *t, const char *fmt, ...) { + va_list ap; + std::vector buf; + buf.resize(128); + FeatVisitor *tmpv = current_visitor; + antlr4::Token *tmpt = v->current_msg_token; + + va_start(ap, fmt); + int l = VSPRINTF_S(buf.data(), 128, fmt, ap) + 1; + if ( l > 128 ) { + buf.resize(l); + VSPRINTF_S(buf.data(), l, fmt, ap); + } + + if ( v != tmpv ) { + current_visitor = v; + v->need_file_msg = tmpv->need_file_msg = true; + } + + v->current_msg_token = t; + hotMsg(g, msgType, buf.data()); + v->current_msg_token = tmpt; + current_visitor = tmpv; +} + +const char *FeatCtx::tokstr() { + assert(current_visitor != NULL); + return current_visitor->currentTokStr(); +} + +void FeatCtx::setIDText() +{ + int len; + if (curr.feature == TAG_STAND_ALONE) + len = snprintf(g->error_id_text, ID_TEXT_SIZE, "standalone"); + else + len = snprintf(g->error_id_text, ID_TEXT_SIZE, "feature '%c%c%c%c'", + TAG_ARG(curr.feature)); + if (IS_NAMED_LAB(curr.label)) + { + char* p = g->error_id_text + len; + NamedLkp *curr = lab2NamedLkp(currNamedLkp); + snprintf(p, ID_TEXT_SIZE-len, " lookup '%s'", curr->name.c_str()); + } +} + +/* Emit report on any deprecated feature file syntax encountered */ + +void FeatCtx::reportOldSyntax() { + if (syntax.numExcept > 0) { + int one = syntax.numExcept == 1; + + featMsg(hotNOTE, + "There %s %hd instance%s of the deprecated \"except\" syntax in the" + " feature file. Though such statements are processed correctly by" + " this parser for backward compatibility, please update them to the" + " newer \"ignore substitute\" syntax. For example, change \"except a @LET" + " sub a by a.end;\" to \"ignore sub a @LET; sub a' by a.end;\". (Note that" + " the second rule is now required to be marked to identify it as a Chain" + " Contextual and not a Single Substitution rule.)", + one ? "is" : "are", + syntax.numExcept, + one ? "" : "s"); + } +} + +// ---------------------------- Glyphs and Classes ----------------------------- + +/* Map feature file glyph name to gid; emit error message and return notdef if + not found (in order to continue until hotQuitOnError() called) */ +GID FeatCtx::mapGName2GID(const char *gname, bool allowNotdef) { + GID gid; + char *realname; + + // if (IS_CID(g)) { + // zzerr("glyph name specified for a CID font"); + // } + if ( gname[0] == '\\' ) + gname++; + + gid = mapName2GID(g, gname, &realname); + + /* Return the glyph if found in the font. When allowNotdef is set, we + * always return and callers should check for GID_UNDEF as we can't return + * GID_NOTDEF in this case. */ + if (gid != GID_UNDEF || allowNotdef == 1) { + return gid; + } + + if (realname != NULL && strcmp(gname, realname) != 0) { + featMsg(hotERROR, "Glyph \"%s\" (alias \"%s\") not in font", + realname, gname); + } else { + featMsg(hotERROR, "Glyph \"%s\" not in font.", gname); + } + return GID_NOTDEF; +} + +GID FeatCtx::cid2gid(const std::string &cidstr) { + GID gid = 0; /* Suppress optimizer warning */ + if (!IS_CID(g)) { + featMsg(hotERROR, "CID specified for a non-CID font"); + } else { + int t = strtoll(cidstr.c_str() + 1, NULL, 10); /* Skip initial '\' */ + if (t < 0 || t > 65535) + featMsg(hotERROR, "CID not in range 0 .. 65535"); + else if ((gid = mapCID2GID(g, t)) == GID_UNDEF) + featMsg(hotERROR, "CID not found in font"); + } + return gid; /* Suppress compiler warning */ +} + +/* Get count of number of nodes in glyph class */ + +int FeatCtx::getGlyphClassCount(GNode *gc) { + int cnt = 0; + for (; gc != NULL; gc = gc->nextCl) { + cnt++; + } + return cnt; +} + +/* If gid not in cl, return address of end insertion point, else NULL */ + +static int glyphInClass(GID gid, GNode **cl, GNode ***lastClass) { + GNode **p = cl; + + for (p = cl; *p != NULL; p = &((*p)->nextCl)) { + if ((*p)->gid == gid) { + *lastClass = p; + return 1; + } + } + + *lastClass = p; + return 0; +} + +/* Return address of last nextCl. Preserves everything */ +/* but sets nextSeq of each copied GNode to NULL */ +GNode **FeatCtx::copyGlyphClass(GNode **dst, GNode *src) { + GNode **newDst = dst; + for (; src != NULL; src = src->nextCl) { + *newDst = newNode(); + **newDst = *src; + (*newDst)->nextSeq = NULL; + newDst = &(*newDst)->nextCl; + } + return newDst; +} + +/* Sort a glyph class; head node retains flags of original head node */ +/* nextSeq, flags, markClassName, and markCnt of head now are zeroed. */ + +void FeatCtx::sortGlyphClass(GNode **list, bool unique, bool reportDups) { + unsigned long i; + GNode *p = *list; + /* Preserve values that are kept with the head node only, and then zero them in the head node. */ + GNode *nextTarg = p->nextSeq; + short flags = (*list)->flags; + MetricsInfo metricsInfo = p->metricsInfo; + char *markClassName = p->markClassName; + p->markClassName = NULL; + p->metricsInfo = METRICSINFOEMPTYPP; + p->nextSeq = NULL; + p->flags = 0; + + /* Copy over pointers */ + std::vector sortTmp; + + for (; p != NULL; p = p->nextCl) + sortTmp.push_back(p); + + struct { + bool operator()(GNode *a, GNode *b) const { return a->gid < b->gid; } + } cmpNode; + std::sort(sortTmp.begin(), sortTmp.end(), cmpNode); + + /* Move pointers around */ + for (i = 0; i < sortTmp.size() - 1; i++) + sortTmp[i]->nextCl = sortTmp[i + 1]; + sortTmp[i]->nextCl = NULL; + + *list = sortTmp[0]; + + /* Check for duplicates */ + if (unique && !g->hadError) { + for (p = *list; p->nextCl != NULL;) { + if (p->gid == p->nextCl->gid) { + GNode *tmp = p->nextCl; + + p->nextCl = tmp->nextCl; + tmp->nextCl = NULL; + tmp->nextSeq = NULL; + + /* If current_visitor is null we are being called after the + * feature files have been closed. In this case, we are + * sorting GDEF classes, and duplicates don't need a + * warning. */ + if ( current_visitor != nullptr && reportDups ) { + dumpGlyph(tmp->gid, '\0', 0); + featMsg(hotNOTE, "Removing duplicate glyph <%s>", + g->note.array); + } + recycleNodes(tmp); + } else { + p = p->nextCl; + } + } + } + + /*restore head node values to the new head node.*/ + p = *list; + p->flags = flags; + p->nextSeq = nextTarg; + p->metricsInfo = metricsInfo; + p->markClassName = markClassName; +} + +void FeatCtx::resetCurrentGC() { + assert(curGCHead == nullptr && curGCTailAddr == NULL && curGCName.empty()); + curGCTailAddr = &curGCHead; +} + +void FeatCtx::defineCurrentGC(const std::string &gcname) { + resetCurrentGC(); + auto search = namedGlyphClasses.find(gcname); + if ( search != namedGlyphClasses.end() ) { + featMsg(hotWARNING, "Glyph class %s redefined", gcname.c_str()); + recycleNodes(search->second); + namedGlyphClasses.erase(search); + } + curGCName = gcname; +} + +bool FeatCtx::openAsCurrentGC(const std::string &gcname) { + resetCurrentGC(); + auto search = namedGlyphClasses.find(gcname); + if ( search != namedGlyphClasses.end() ) { + GNode *nextClass = curGCHead = search->second; + while ( nextClass->nextCl != NULL ) + nextClass = nextClass->nextCl; + curGCTailAddr = &nextClass->nextCl; + // If the class is found don't set curGCName as it doesn't need to + // be stored on Close. + return true; + } else { + curGCName = gcname; + return false; + } +} + +GNode *FeatCtx::finishCurrentGC() { + if ( !curGCName.empty() && curGCHead != nullptr ) + namedGlyphClasses.insert({curGCName, curGCHead}); + + GNode *ret = curGCHead; + curGCName.clear(); + curGCHead = nullptr; + curGCTailAddr = nullptr; + return ret; +} + +/* Add glyph to end of current glyph class */ + +void FeatCtx::addGlyphToCurrentGC(GID gid) { + *curGCTailAddr = setNewNode(gid); + curGCTailAddr = &(*curGCTailAddr)->nextCl; +} + +void FeatCtx::addGlyphClassToCurrentGC(GNode *src) { + curGCTailAddr = copyGlyphClass(curGCTailAddr, src); +} + +void FeatCtx::addGlyphClassToCurrentGC(const std::string &subGCName) { + // XXX consider checking curGCName against subGCName and reporting that + // error specifically + auto search = namedGlyphClasses.find(subGCName); + + if ( search == namedGlyphClasses.end() ) { + featMsg(hotERROR, "glyph class not defined"); + addGlyphToCurrentGC(GID_NOTDEF); + return; + } + + curGCTailAddr = copyGlyphClass(curGCTailAddr, search->second); +} + +static long getNum(const char *str, int length) { + char buf[MAX_NUM_LEN + 1]; + strncpy(buf, str, length); + buf[length] = '\0'; + return strtol(buf, NULL, 10); +} + +/* Glyph names in range differ by a single letter */ + +void FeatCtx::addAlphaRangeToCurrentGC(GID first, GID last, + const char *firstName, const char *p, + char q) { + int l = strlen(firstName)+1; + char *gname = (char *) MEM_NEW(g, l); // Extra shouldn't be needed + char *ptr; + + strcpy(gname, firstName); + ptr = &gname[p - firstName]; + + for (; *ptr <= q; (*ptr)++) { + GID gid = (*ptr == *p) ? first : (*ptr == q) ? last : mapGName2GID(gname, false); + addGlyphToCurrentGC(gid); + } + MEM_FREE(g, gname); +} + +/* Glyph names in range differ by a decimal number */ + +void FeatCtx::addNumRangeToCurrentGC(GID first, GID last, const char *firstName, + const char *p1, const char *p2, + const char *q1, int numLen) { + /* --- Range is valid number range --- */ + long i, l = strlen(firstName)+1; + long firstNum = getNum(p1, numLen); + long lastNum = getNum(q1, numLen); + char *gname = (char *) MEM_NEW(g, l+3); // Extra shouldn't be needed + char *preNum = (char *) MEM_NEW(g, l); + char fmt[128]; + + for (i = firstNum; i <= lastNum; i++) { + GID gid; + fmt[0] = '\0'; + if (i == firstNum) { + gid = first; + } else if (i == lastNum) { + gid = last; + } else { + if (i == firstNum + 1) { + snprintf(fmt, 128, "%%s%%0%dd%%s", numLen); + /* Part of glyph name before number; */ + /* p2 marks post-number */ + strncpy(preNum, firstName, p1 - firstName); + preNum[p1 - firstName] = '\0'; + } + snprintf(gname, l+4, fmt, preNum, i, p2); + gid = mapGName2GID(gname, false); + } + addGlyphToCurrentGC(gid); + } + MEM_FREE(g, gname); + MEM_FREE(g, preNum); +} + +/* Add glyph range to end of current glyph class */ + +void FeatCtx::addRangeToCurrentGC(GID first, GID last, const std::string &firstName, + const std::string &lastName) { +#define INVALID_RANGE featMsg(hotFATAL, "Invalid glyph range [%s-%s]", \ + firstName.c_str(), lastName.c_str()) + if (IS_CID(g)) { + if (first <= last) { + for (GID i = first; i <= last; i++) { + addGlyphToCurrentGC(i); + } + } else { + featMsg(hotFATAL, "Bad GID range: %u thru %u", first, last); + } + } else { + if (firstName.length() != lastName.length()) { + INVALID_RANGE; + } + + /* Enforce glyph range rules */ + const char *fn = firstName.c_str(), *p1, *p2; + const char *ln = lastName.c_str(), *q1, *q2; + + for (p1 = fn, q1 = ln; *p1 != '\0' && *p1 == *q1; p1++, q1++) + ; + + if (*p1 == '\0') { + INVALID_RANGE; /* names are same */ + } + for (p2 = p1, q2 = q1; + *p2 != '\0' && *p2 != *q2; + p2++, q2++) { + } + /* Both ends of the first difference are now marked. */ + /* The remainder should be the same: */ + if (strcmp(p2, q2) != 0) { + INVALID_RANGE; + } + + /* A difference of up to 3 digits is allowed; 1 for letters */ + switch (p2 - p1) { + int i; + + case 1: + if (isalpha(*p1) && isalpha(*q1) && *q1 > *p1 && *q1 - *p1 < 26) { + addAlphaRangeToCurrentGC(first, last, fn, p1, *q1); + return; + } + + case 2: + case 3: + /* All differences should be digits */ + for (i = 0; i < p2 - p1; i++) { + if (!isdigit(p1[i]) || !isdigit(q1[i])) { + INVALID_RANGE; + } + } + /* Search for largest enclosing number */ + for (; p1 > firstName && isdigit(*(p1 - 1)); p1--, q1--) { + } + for (; isdigit(*p2); p2++, q2++) { + } + if (p2 - p1 > MAX_NUM_LEN) { + INVALID_RANGE; + } else { + addNumRangeToCurrentGC(first, last, fn, p1, p2, q1, p2 - p1); + return; + } + break; + + default: + INVALID_RANGE; + } + } +} + +GNode *FeatCtx::lookupGlyphClass(const std::string &gcname) { + auto search = namedGlyphClasses.find(gcname); + if ( search == namedGlyphClasses.end() ) { + featMsg(hotERROR, "glyph class not defined"); + return nullptr; + } + return search->second; +} + +/* Return 1 if targ and repl have same number of glyphs in class, else + emit error message and return 0 */ + +bool FeatCtx::compareGlyphClassCount(GNode *targ, GNode *repl, bool isSubrule) { + int nTarg = getGlyphClassCount(targ); + int nRepl = getGlyphClassCount(repl); + + if (nTarg == nRepl) { + return true; + } + featMsg(hotERROR, + "Target glyph class in %srule doesn't have the same" + " number of elements as the replacement class; the target has %d," + " the replacement, %d", + isSubrule ? "sub-" : "", nTarg, nRepl); + return false; +} + +/* Duplicates node (copies GID) num times to create a class */ +void FeatCtx::extendNodeToClass(GNode *node, int num) { + if (node->nextCl != NULL) { + featMsg(hotFATAL, "[internal] can't extend glyph class"); + } + + if (!(node->flags & FEAT_GCLASS)) { + node->flags |= FEAT_GCLASS; + } + + for (int i = 0; i < num; i++) { + node->nextCl = setNewNode(node->gid); + node = node->nextCl; + } +} + +/* Gets length of pattern sequence (ignores any classes) */ +unsigned int FeatCtx::getPatternLen(GNode *pat) { + unsigned int len = 0; + for (; pat != NULL; pat = pat->nextSeq) { + len++; + } + return len; +} + +/* Make a copy of src pattern. If num != -1, copy up to num nodes only */ +/* (assumes they exist); set the last nextSeq to NULL. Preserves all flags. */ +/* Return address of last nextSeq (so that client may add on to the end). */ + +GNode **FeatCtx::copyPattern(GNode **dst, GNode *src, int num) { + int i = 0; + + for (; (num == -1) ? src != NULL : i < num; i++, src = src->nextSeq) { + copyGlyphClass(dst, src); + dst = &(*dst)->nextSeq; + } + return dst; +} + +void FeatCtx::dumpGlyph(GID gid, int ch, bool print) { + char msg[512]; + int len; + if (IS_CID(g)) { + len = snprintf(msg, 512, "\\%hd", mapGID2CID(gid)); + } else { + mapGID2Name(g, gid, msg); + len = strlen(msg); + } + if (ch >= 0) { + msg[len++] = ch; + } + msg[len] = '\0'; + + if (print) { + fprintf(stderr, "%s", msg); + } else { + strncpy(dnaEXTEND(g->note, len), msg, len); + } +} + +#define DUMP_CH(ch, print) \ + do { \ + if (print) \ + fprintf(stderr, "%c", ch); \ + else \ + *dnaNEXT(g->note) = (ch); \ + } while (0) + +/* If !print, add to g->notes */ + +void FeatCtx::dumpGlyphClass(GNode *gc, int ch, bool print) { + GNode *p = gc; + + DUMP_CH('[', print); + for (; p != NULL; p = p->nextCl) { + dumpGlyph(p->gid, (char)(p->nextCl != NULL ? ' ' : -1), print); + } + DUMP_CH(']', print); + if (ch >= 0) { + DUMP_CH(ch, print); + } +} + +/* If !print, add to g->notes */ + +void FeatCtx::dumpPattern(GNode *pat, int ch, bool print) { + DUMP_CH('{', print); + for (; pat != NULL; pat = pat->nextSeq) { + if (pat->nextCl == NULL) { + dumpGlyph(pat->gid, -1, print); + } else { + dumpGlyphClass(pat, -1, print); + } + if (pat->flags & FEAT_MARKED) { + DUMP_CH('\'', print); + } + if (pat->nextSeq != NULL) { + DUMP_CH(' ', print); + } + } + DUMP_CH('}', print); + if (ch >= 0) { + DUMP_CH(ch, print); + } +} + +// ----------------------------------- Tags ------------------------------------ + +Tag FeatCtx::str2tag(const std::string &tagName) { + if ( tagName.length() > 4 ) + featMsg(hotERROR, "Tag %s exceeds 4 characters", tagName.c_str()); + if ( tagName == "dflt" ) { + return dflt_; + } else { + int i; + char buf[5]; + strncpy(buf, tagName.c_str(), 4); + for (i = 3; buf[i] == '\0'; i--) + buf[i] = ' '; + return TAG(buf[0], buf[1], buf[2], buf[3]); + } +} + +bool FeatCtx::tagAssign(Tag tag, enum TagType type, bool checkIfDef) { + TagArray *ta = NULL; + Tag *t = NULL; + + if (type == featureTag) { + ta = &feature; + t = &curr.feature; + } else if (type == scriptTag) { + ta = &script; + if (tag == dflt_) { + tag = DFLT_; + featMsg(hotWARNING, "'dflt' is not a valid tag for a script statement; using 'DFLT'."); + } + t = &curr.script; + } else if (type == languageTag) { + ta = &language; + if (tag == DFLT_) { + tag = dflt_; + featMsg(hotWARNING, "'DFLT' is not a valid tag for a language statement; using 'dflt'."); + } + t = &curr.language; + } else if (type == tableTag) { + ta = &table; + } else if (type != featureTag) { + featMsg(hotFATAL, "[internal] unrecognized tag type"); + return false; + } + + if (checkIfDef && ta->find(tag) != ta->end()) { + if ((type == featureTag)) { + assert(t != NULL); + *t = tag; + } + return false; + } + + ta->emplace(tag); + if (t != NULL) + *t = tag; + + return true; +} + +// --------------------------- Scripts and Languages --------------------------- + +int FeatCtx::startScriptOrLang(TagType type, Tag tag) { + if (curr.feature == aalt_ || curr.feature == size_) { + featMsg(hotERROR, + "\"script\" and \"language\" statements " + "are not allowed in 'aalt' or 'size' features; " USE_LANGSYS_MSG); + return -1; + } else if ((tag != TAG_STAND_ALONE) && (curr.feature == TAG_STAND_ALONE)) { + featMsg(hotERROR, + "\"script\" and \"language\" statements " + "are not allowed within standalone lookup blocks; "); + } + /* + if (h->fFlags & FF_LANGSYS_MODE) { + featMsg(hotWARNING, + "If you don't want feature '%c%c%c%c' registered under all" + " the language systems you specified earlier on in the feature" + " file by the \"languagesystem\" keyword, you must start this" + " feature with an explicit \"script\" statement", + TAG_ARG(h->curr.feature)); + return -1; + } + */ + fFlags |= seenScriptLang; + + if (type == scriptTag) { + if (tag == curr.script && curr.language == dflt_) + return 0; + + /* Once we have seen a script or a language statement other */ + /* than 'dflt' any further rules in the feature should not */ + /* be added to the default list. */ + fFlags &= ~langSysMode; + + if (tag != curr.script) { + if ( !tagAssign(tag, scriptTag, true) ) + featMsg(hotERROR, "script behavior already specified"); + + language.clear(); + DFLTLkps.clear(); /* reset the script-specific default list to 0 */ + } + if (curr.language != dflt_) + tagAssign(dflt_, languageTag, false); + + include_dflt = true; + curr.lkpFlag = 0; + curr.markSetIndex = 0; + } else { + assert(type == languageTag); + if (tag == DFLT_) { + tag = dflt_; + featMsg(hotWARNING, "'DFLT' is not a valid tag for a language statement; using 'dflt'."); + } + + /* Once we have seen a script or a language statement other */ + /* than 'dflt' any further rules in the feature should not */ + /* be added to the default list. */ + if ((fFlags & langSysMode) && (tag != dflt_)) + fFlags &= ~langSysMode; + + if (tag == curr.language) + return 0; /* Statement has no effect */ + + if (tag == dflt_) + featMsg(hotERROR, "dflt must precede language-specific behavior"); + + if ( !tagAssign(tag, languageTag, true) ) + featMsg(hotERROR, "language-specific behavior already specified"); + } + return 1; +} + +/* Include dflt rules in lang-specific behavior if includeDFLT != 0 */ + +void FeatCtx::includeDFLT(bool includeDFLT, int langChange, bool seenOD) { + if (seenOD && !seenOldDFLT) { + seenOldDFLT = true; + featMsg(hotWARNING, "Use of includeDFLT and excludeDFLT tags has been deprecated. It will work, but please use 'include_dflt' and 'exclude_dflt' tags instead."); + } + /* Set value */ + if (langChange) { + include_dflt = includeDFLT; + } else if (includeDFLT != include_dflt) { + featMsg(hotERROR, + "can't change whether a language should include dflt rules once " + "this has already been indicated"); + } + + if (includeDFLT) { + /* Include dflt rules for current script and explicit language */ + /* statement. Languages which don't exclude_dflt get the feature- */ + /* level defaults at the end of the feature. */ + for (auto &i : DFLTLkps) + callLkp(i); + } else { + /* Defaults have been explicitly excluded from the this language. */ + /* Find the matching script-lang lang-sys, and set the flag so it */ + /* won't add the feature level defaults at the end of the feature. */ + auto ls = langSysMap.find({curr.script, curr.language}); + if ( ls != langSysMap.end() ) + ls->second = true; + } +} + +/* Add a language system that all features (that do not contain language or + script statements) would be registered under */ + +void FeatCtx::addLangSys(Tag script, Tag language, bool checkBeforeFeature, + FeatParser::TagContext *langctx) { + if (checkBeforeFeature && gFlags & seenFeature) { + featMsg(hotERROR, + "languagesystem must be specified before all" + " feature blocks"); + return; + } + if (!(gFlags & seenLangSys)) { + gFlags |= seenLangSys; + } else if (script == DFLT_) { + if (gFlags & seenNonDFLTScriptLang) + featMsg(hotERROR, "All references to the script tag DFLT must precede all other script references."); + } else { + gFlags |= seenNonDFLTScriptLang; + } + + if (script == dflt_) { + featMsg(hotWARNING, "'dflt' is not a valid script tag for a languagesystem statement; using 'DFLT'."); + script = DFLT_; + } + + if ( langctx != NULL ) + current_visitor->TOK(langctx); + + if (language == DFLT_) { + featMsg(hotWARNING, "'DFLT' is not a valid language tag for a languagesystem statement; using 'dflt'."); + language = dflt_; + } + + /* First check if already exists */ + if ( langSysMap.find({script, language}) != langSysMap.end() ) { + featMsg(hotWARNING, "Duplicate specification of language system"); + return; + } + + langSysMap.emplace(LangSys{script, language}, false); + +#if HOT_DEBUG + if (!checkBeforeFeature) { + DF(2, (stderr, "languagesystem '%c%c%c%c' '%c%c%c%c' ;\n", + TAG_ARG(script), TAG_ARG(language))); + } +#endif +} + +/* Register current feature under remaining language systems */ + +void FeatCtx::registerFeatureLangSys() { + for (auto &ls : langSysMap) { + bool seenGSUB = false, seenGPOS = false; + + /* If we have seen an explicit language statement for this script, */ + /* then the default lookups have already been included ( or */ + /* excluded) by the includeDDflt function. */ + if (ls.second) { + ls.second = false; + continue; + } + + for (const auto &lkp : lookup) { + if (lkp.tbl == GSUB_) { + if (!seenGSUB) { + GSUBFeatureBegin(g, ls.first.script, ls.first.lang, curr.feature); + seenGSUB = 1; + } + GSUBLookupBegin(g, lkp.lkpType, lkp.lkpFlag, + (Label)(lkp.label | REF_LAB), + lkp.useExtension, lkp.markSetIndex); + GSUBLookupEnd(g, curr.feature); + } else { + /* lkp->tbl == GPOS_ */ + if (!seenGPOS) { + GPOSFeatureBegin(g, ls.first.script, ls.first.lang, curr.feature); + seenGPOS = true; + } + GPOSLookupBegin(g, lkp.lkpType, lkp.lkpFlag, + (Label)(lkp.label | REF_LAB), + lkp.useExtension, lkp.markSetIndex); + GPOSLookupEnd(g, curr.feature); + } + } + if (seenGSUB) { + GSUBFeatureEnd(g); + } + if (seenGPOS) { + GPOSFeatureEnd(g); + } + } +} + +// --------------------------------- Features ---------------------------------- + +void FeatCtx::startFeature(Tag tag) { + /* Allow interleaving features */ + if ( !tagAssign(tag, featureTag, true) ) { + if (tag != TAG_STAND_ALONE) { + /* This is normal for standalone lookup blocks- we use the same feature tag for each. */ + featMsg(hotWARNING, "feature already defined: %s", tokstr()); + } + } + + fFlags = 0; + gFlags |= seenFeature; + + lookup.clear(); + script.clear(); + if (langSysMap.size() == 0) { + featMsg(hotWARNING, + "[internal] Feature block seen before any language system statement. You should place languagesystem statements before any feature definition"); + addLangSys(DFLT_, dflt_, false); + } + tagAssign(langSysMap.cbegin()->first.script, scriptTag, false); + + language.clear(); + tagAssign(langSysMap.cbegin()->first.lang, languageTag, false); + + include_dflt = true; + DFLTLkps.clear(); + + curr.lkpFlag = 0; + curr.markSetIndex = 0; +} + +void FeatCtx::endFeature() { + if ( curr.feature != aalt_ ) { + closeFeatScriptLang(curr); + registerFeatureLangSys(); + prev.tbl = TAG_UNDEF; + } +} + +/* Indicate current feature or labeled lookup block to be created with + extension lookupTypes. */ + +void FeatCtx::flagExtension(bool isLookup) { + if ( isLookup ) { + /* lookup block scope */ + NamedLkp *curr = lab2NamedLkp(currNamedLkp); + if ( curr == nullptr ) { + featMsg(hotFATAL, "[internal] label not found\n"); + } + curr->useExtension = true; + } else { + /* feature block scope */ + if (curr.feature == aalt_) { + aalt.useExtension = true; + } else { + featMsg(hotERROR, + "\"useExtension\" allowed in feature-scope only" + " for 'aalt'"); + } + } +} + +void FeatCtx::closeFeatScriptLang(State &st) { + if ( st.tbl == TAG_UNDEF ) + return; + + if ( st.tbl == GSUB_ ) { + if ( st.lkpType != 0 ) + GSUBLookupEnd(g, st.feature); + g->error_id_text[0] = '\0'; + GSUBFeatureEnd(g); + } else if ( st.tbl == GPOS_ ) { + if ( st.lkpType != 0 ) + GPOSLookupEnd(g, st.feature); + g->error_id_text[0] = '\0'; + GPOSFeatureEnd(g); + } +} + +void FeatCtx::addFeatureParam(const std::vector ¶ms) { + switch (curr.feature) { + case size_: + prepRule(GPOS_, GPOSFeatureParam, NULL, NULL); + + GPOSAddSize(g, (short *) params.data(), params.size()); + + wrapUpRule(); + + break; + + default: + featMsg(hotERROR, + "A feature parameter is supported only for the 'size' feature."); + } +} + +void FeatCtx::subtableBreak() { + bool retval = false; + + if (curr.feature == aalt_ || curr.feature == size_) { + featMsg(hotERROR, "\"subtable\" use not allowed in 'aalt' or 'size' feature"); + return; + } + + if (curr.tbl == GSUB_) { + retval = GSUBSubtableBreak(g); + } else if (curr.tbl == GPOS_) { + retval = GPOSSubtableBreak(g); + } else { + featMsg(hotWARNING, "Statement not expected here"); + return; + } + + if (retval) + featMsg(hotWARNING, "subtable break is supported only in class kerning lookups"); +} + +// --------------------------------- Lookups ----------------------------------- + +void FeatCtx::startLookup(const std::string &name, bool isTopLevel) { + if (isTopLevel) { + /* This is a standalone lookup, used outside of a feature block. */ + /* Add it to the dummy feature 'A\0\0A' */ + startFeature(TAG_STAND_ALONE); + startScriptOrLang(scriptTag, TAG_STAND_ALONE); + } else { + if (curr.feature == aalt_) { + featMsg(hotERROR, "\"lookup\" use not allowed in 'aalt' feature"); + return; + } + if (curr.feature == size_) { + featMsg(hotERROR, + "\"lookup\" use not allowed anymore in 'size'" + " feature; " USE_LANGSYS_MSG); + return; + } + } + + DF(2, (stderr, "# at start of named lookup %s\n", name)); + if (name2NamedLkp(name) != NULL) + featMsg(hotFATAL, "lookup name \"%s\" already defined", name.c_str()); + + currNamedLkp = getNextNamedLkpLabel(name, isTopLevel); + /* State will be recorded at end of block section, below */ +} + +void FeatCtx::endLookup() { + if ( curr.feature == aalt_ || curr.feature == size_) + return; + + NamedLkp *c = lab2NamedLkp(currNamedLkp); + + if (c == nullptr) { + featMsg(hotFATAL, "[internal] label not found\n"); + } + DF(2, (stderr, "# at end of named lookup %s\n", c->name.c_str())); + + if (c->isTopLevel) + endFeature(); + + endOfNamedLkpOrRef = true; + + /* Store state for future lookup references to it */ + c->state = curr; + + currNamedLkp = LAB_UNDEF; +} + +/* Validate and set a particular flag/subcomponent of the lookupflag. markType + only used if attr is otlMarkAttachmentType */ + +uint16_t FeatCtx::setLkpFlagAttribute(uint16_t val, unsigned int attr, + uint16_t markAttachClassIndex) { + if (attr > 1) { + /* 1 is the RTL flag - does not need to set this */ + gFlags |= seenIgnoreClassFlag; + } + + if (attr == otlMarkAttachmentType) { + if (markAttachClassIndex == 0) { + featMsg(hotERROR, "must specify non-zero MarkAttachmentType value"); + } else if (val & attr) { + featMsg(hotERROR, + "MarkAttachmentType already specified in this statement"); + } else { + val |= (markAttachClassIndex & 0xFF) << 8; + } + } else if (attr == otlUseMarkFilteringSet) { + if (val & attr) { + featMsg(hotERROR, + "UseMarkSetType already specified in this statement"); + } + curr.markSetIndex = markAttachClassIndex; + val |= attr; + } else { + if (val & attr) { + featMsg(hotWARNING, + "\"%s\" repeated in this statement; ignoring", tokstr()); + } else { + val |= attr; + } + } + return val; +} + +void FeatCtx::setLkpFlag(uint16_t flag) { + if (curr.feature == aalt_ || curr.feature == size_) + featMsg(hotERROR, "\"lookupflag\" use not allowed in 'aalt' or 'size' feature"); + curr.lkpFlag = flag; + /* if UseMarkSet, then the markSetIndex is set in setLkpFlagAttribute() */ +} + +void FeatCtx::callLkp(State &st) { + Label lab = st.label; + +#if HOT_DEBUG + if (g->font.debug & HOT_DB_FEAT_2) { + if (curr.tbl == GSUB_) { + fprintf(stderr, "\n"); + } + fprintf(stderr, "# call lkp "); + if (IS_REF_LAB(lab)) { + fprintf(stderr, "REF->"); + } + if (IS_NAMED_LAB(lab)) { + fprintf(stderr, "<%s>", lab2NamedLkp(lab)->name); + } else if (IS_ANON_LAB(lab)) { + fprintf(stderr, ""); + } else { + hotMsg(g, hotFATAL, "undefined label"); + } + fprintf(stderr, "[label=%x]", lab); + /* fprintf(stderr, " : %s:%d:%d", st->tbl == GPOS_ ? "GPOS" : "GSUB", st->lkpType, st->lkpFlag); */ + fprintf(stderr, "(but with s'%c%c%c%c' l'%c%c%c%c' f'%c%c%c%c') :\n", + TAG_ARG(h->curr.script), TAG_ARG(h->curr.language), + TAG_ARG(h->curr.feature)); + } +#endif + + /* Use the scr, lan, fea that's *currently* set. */ + /* Use the *original* lkpFlag and, of course, tbl and lkpType. */ + /* Copy the lookup label, set its reference bit. */ + /* Simulate the first rule in the original block simply by calling */ + /* prepRule() ! */ + + currNamedLkp = (Label)(lab | REF_LAB); /* As in: lookup { */ + curr.lkpFlag = st.lkpFlag; + curr.markSetIndex = st.markSetIndex; + prepRule(st.tbl, st.lkpType, NULL, NULL); + /* No actual rules will be fed into GPOS/GSUB */ + wrapUpRule(); + currNamedLkp = LAB_UNDEF; /* As in: } ; */ + endOfNamedLkpOrRef = true; +} + +void FeatCtx::useLkp(const std::string &name) { + NamedLkp *lkp = name2NamedLkp(name); + + if (curr.feature == aalt_) { + featMsg(hotERROR, "\"lookup\" use not allowed in 'aalt' feature"); + return; + } else { + AALT::FeatureRecord t { curr.feature, false }; + auto it = std::find(std::begin(aalt.features), std::end(aalt.features), t); + if ( it != std::end(aalt.features) ) + it->used = true; + } + + if (curr.feature == size_) { + featMsg(hotERROR, + "\"lookup\" use not allowed anymore in 'size'" + " feature; " USE_LANGSYS_MSG); + return; + } + + if (lkp == NULL) { + featMsg(hotERROR, "lookup name \"%s\" not defined", name.c_str()); + } else { + callLkp(lkp->state); + } +} + +FeatCtx::NamedLkp *FeatCtx::name2NamedLkp(const std::string &lkpName) { + for (auto &it : namedLkp) { + if ( it.name == lkpName ) + return ⁢ + } + return nullptr; +} + +FeatCtx::NamedLkp *FeatCtx::lab2NamedLkp(Label lab) { + Label baselab = (Label)(lab & ~REF_LAB); + + if ( !IS_NAMED_LAB(baselab) || baselab >= (Label) namedLkp.size() ) + return nullptr; + else + return &namedLkp[baselab]; +} + +Label FeatCtx::getNextNamedLkpLabel(const std::string &str, bool isa) { + if (namedLkp.size() >= FEAT_NAMED_LKP_END) { + featMsg(hotFATAL, + "[internal] maximum number of named lookups reached:" + " %d", + FEAT_NAMED_LKP_END + 1); + } + namedLkp.push_back({str, isa}); + return namedLkp.size()-1; +} + +Label FeatCtx::getLabelIndex(const std::string &name) { + NamedLkp *curr = name2NamedLkp(name); + if (curr == NULL) { + featMsg(hotFATAL, "lookup name \"%s\" not defined", name.c_str()); + } + return curr->state.label; +} + +Label FeatCtx::getNextAnonLabel() { + if (anonLabelCnt > FEAT_ANON_LKP_END) { + featMsg(hotFATAL, + "[internal] maximum number of lookups reached: %d", + FEAT_ANON_LKP_END - FEAT_ANON_LKP_BEG + 1); + } + return anonLabelCnt++; +} + +// ---------------------------------- Tables ----------------------------------- + +void FeatCtx::startTable(Tag tag) { + if ( !tagAssign(tag, tableTag, true) ) + featMsg(hotERROR, "table already specified"); +} + +void FeatCtx::setGDEFGlyphClassDef(GNode *simple, GNode *ligature, GNode *mark, + GNode *component) { + gFlags |= seenGDEFGC; + setGlyphClassGDef(g, simple, ligature, mark, component); +} + +void FeatCtx::createDefaultGDEFClasses() { + if ( !(gFlags & seenGDEFGC) ) { + GNode *classes[4] = {nullptr}; + const char *classnames[4] = { kDEFAULT_BASECLASS_NAME, + kDEFAULT_LIGATURECLASS_NAME, + kDEFAULT_MARKCLASS_NAME, + kDEFAULT_COMPONENTCLASS_NAME }; + + /* The source glyph classes are all named classes. Named class */ + /* glyphs get recycled when featFree() is called so we need to */ + /* make a copy of these classes here and recycle the copy after in */ + /* GDEF.c::createGlyphClassDef(). This is because */ + /* createGlyphClassDef deletes glyphs from within the class lists */ + /* to eliminate duplicates. If we operate on a named class list, */ + /* then any deleted duplicated glyphs gets deleted again when */ + /* hashFree() is called. Also, the hash element head points to the */ + /* original first glyph, which may be sorted further down the list. */ + + for (int i = 0; i < 4; ++i) { + openAsCurrentGC(classnames[i]); + if (curGCHead != NULL) { + copyGlyphClass(classes + i, curGCHead); + sortGlyphClass(classes + i, true, false); + } + finishCurrentGC(); + } + + setGlyphClassGDef(g, classes[0], classes[1], classes[2], classes[3]); + } +} + +void FeatCtx::setFontRev(const std::string &rev) { + char *fraction = 0; + double minor = 0; + + long major = strtol(rev.c_str(), &fraction, 10); + + if ((fraction != 0) && (strlen(fraction) > 0)) { + short strLen = strlen(fraction); + minor = strtod(fraction, NULL); + + if (strLen != 4) { + double version = major + minor; + featMsg(hotWARNING, "head FontRevision entry <%s> should have 3 fractional decimal places. Stored as <%.3f>", rev.c_str(), version); + } + } else { + featMsg(hotWARNING, "head FontRevision entry <%ld> should have 3 fractional decimal places; it now has none.", major); + } + + /* limit of 32767 as anything higher sets the sign bit to negative */ + major = MIN(major, 32767); + + /* Convert to Fixed */ + g->font.version.otf = (Fixed)((major + minor) * 65536.0); +} + +/* Add name string to name table. */ + +void FeatCtx::addNameString(long platformId, long platspecId, + long languageId, long nameId, const std::string &str) { + bool nameError = false; + if ((nameId == 2) || (nameId == 6) || ((nameId >= 26) && (nameId <= 255))) + nameError = true; + else if ((nameId > 0) && ((nameId < 7) && (!(g->convertFlags & HOT_OVERRIDE_MENUNAMES)))) { + nameError = true; + } + if (nameError) { + featMsg(hotWARNING, + "name id %ld cannot be set from the feature file. " + "ignoring record", nameId); + return; + } + + /* Add defaults */ + if (platformId == -1) { + platformId = HOT_NAME_MS_PLATFORM; + } + if (platformId == HOT_NAME_MS_PLATFORM) { + if (platspecId == -1) { + platspecId = HOT_NAME_MS_UGL; + } + if (languageId == -1) { + languageId = HOT_NAME_MS_ENGLISH; + } + } else if (platformId == HOT_NAME_MAC_PLATFORM) { + if (platspecId == -1) { + platspecId = HOT_NAME_MAC_ROMAN; + } + if (languageId == -1) { + languageId = HOT_NAME_MAC_ENGLISH; + } + } + + if (hotAddName(g, + (unsigned short)platformId, (unsigned short)platspecId, + (unsigned short)languageId, (unsigned short)nameId, + str.c_str())) { + featMsg(hotERROR, "Bad string"); + } +} + +/* Add 'size' feature submenuname name string to name table. */ + +void FeatCtx::addSizeNameString(long platformId, long platspecId, + long languageId, const std::string &str) { + unsigned short nameID; + + /* We only need to reserve a name ID *once*; after the first time, */ + /* all subsequent sizemenunames will share the same nameID. */ + if (featNameID == 0) { + nameID = nameReserveUserID(g); + GPOSSetSizeMenuNameID(g, nameID); + featNameID = nameID; + } else { + nameID = featNameID; + } + + addNameString(platformId, platspecId, languageId, nameID, str); +} + +/* Add 'name for feature string to name table. */ + +void FeatCtx::addFeatureNameString(long platformId, long platspecId, + long languageId, const std::string &str) { + unsigned short nameID; + + /* We only need to reserve a name ID *once*; after the first time, */ + /* all subsequent sizemenunames will share the same nameID. */ + if (featNameID == 0) { + nameID = nameReserveUserID(g); + GSUBSetFeatureNameID(g, curr.feature, nameID); + featNameID = nameID; + } else { + nameID = featNameID; + } + + addNameString(platformId, platspecId, languageId, nameID, str); +} + +void FeatCtx::addFeatureNameParam() { + prepRule(GSUB_, GSUBFeatureNameParam, NULL, NULL); + + GSUBAddFeatureMenuParam(g, &featNameID); + + wrapUpRule(); +} + +void FeatCtx::addUserNameString(long platformId, long platspecId, + long languageId, const std::string &str) { + unsigned short nameID; + + /* We only need to reserve a name ID *once*. */ + if (featNameID == 0) { + nameID = nameReserveUserID(g); + featNameID = nameID; + } else { + nameID = featNameID; + } + + addNameString(platformId, platspecId, languageId, nameID, str); +} + +/* Add vendor name to OS/2 table. */ +/* ------------------------------------------------------------------- */ +/* ------------------------------------------------------------------- */ +void FeatCtx::addVendorString(std::string str) { + bool tooshort = false; + + while (str.size() < 4) { + str += ' '; + tooshort = true; + } + if (tooshort) { + featMsg(hotWARNING, "Vendor name too short. Padded automatically to 4 characters."); + } + + if (str.size() > 4) { + featMsg(hotERROR, "Vendor name too long. Max is 4 characters."); + } + + setVendId_str(g, str.c_str()); +} + +// --------------------------------- Anchors ----------------------------------- + +void FeatCtx::addAnchorDef(const std::string &name, const AnchorDef &a) { + auto ret = anchorDefs.insert(std::make_pair(name, a)); + + if ( !ret.second ) + featMsg(hotFATAL, "Named anchor definition '%s' is a a duplicate of an earlier named anchor definition.", name.c_str()); +} + +void FeatCtx::addAnchorByName(const std::string &name, int componentIndex) { + auto search = anchorDefs.find(name); + if ( search == anchorDefs.end() ) { + featMsg(hotERROR, "Named anchor reference '%s' is not in list of named anchors.", name.c_str()); + return; + } + + addAnchorByValue(search->second, false, componentIndex); +} + +void FeatCtx::addAnchorByValue(const AnchorDef &a, bool isNull, int componentIndex) { + AnchorMarkInfo am; + initAnchor(&am); + am.x = a.x; + am.y = a.y; + if ( isNull ) { + am.format = 0; + } else if ( a.hasContour ) { + am.format = 2; + am.contourpoint = a.contourpoint; + } else { + am.format = 1; + } + am.componentIndex = componentIndex; + anchorMarkInfo.push_back(am); +} + +/* Make a copy of a string */ + +static void copyStr(hotCtx g, char **dst, const char *src) { + if (src == NULL) { + *dst = NULL; + } else { + *dst = (char *) MEM_NEW(g, strlen(src) + 1); + strcpy(*dst, src); + } +} + +/* Add new mark class definition */ +void FeatCtx::addMark(const std::string &name, GNode *targ) { + GNode *curNode; + + /* save this anchor info in all glyphs of this mark class */ + curNode = targ; + while (curNode != NULL) { + curNode->markClassAnchorInfo = anchorMarkInfo.back(); + curNode = curNode->nextCl; + } + + bool found = openAsCurrentGC(name); + addGlyphClassToCurrentGC(targ); + + if ( curGCHead->flags & FEAT_USED_MARK_CLASS ) + featMsg(hotERROR, "You cannot add glyphs to a mark class after the mark class has been used in a position statement. %s.", name.c_str()); + + if ( !found ) { + /* this is the first time this mark class name has been referenced; save the class name in the head node. */ + copyStr(g, &curGCHead->markClassName, name.c_str()); + } + + finishCurrentGC(); // Save new entry if needed + + /* add mark glyphs to default base class */ + openAsCurrentGC(kDEFAULT_MARKCLASS_NAME); + addGlyphClassToCurrentGC(targ); + finishCurrentGC(); + + recycleNodes(targ); + + gFlags |= seenMarkClassFlag; +} + +// --------------------------------- Metrics ----------------------------------- + +void FeatCtx::addValueDef(const std::string &name, const MetricsInfo &mi) { + auto ret = valueDefs.insert(std::make_pair(name, mi)); + + if ( !ret.second ) + featMsg(hotERROR, "Named value record definition '%s' is a a duplicate of an earlier named value record definition.", name.c_str()); +} + +void FeatCtx::getValueDef(const std::string &name, MetricsInfo &mi) { + auto search = valueDefs.find(name); + if ( search == valueDefs.end() ) + featMsg(hotERROR, "Named value reference '%s' is not in list of named value records.", name.c_str()); + else + mi = search->second; +} + +// ------------------------------ Substitutions -------------------------------- + +void FeatCtx::prepRule(Tag newTbl, int newlkpType, GNode *targ, GNode *repl) { + int accumDFLTLkps = 1; + + curr.tbl = newTbl; + curr.lkpType = newlkpType; + + /* Proceed in language system mode for this feature if (1) languagesystem */ + /* specified at global scope and (2) this feature did not start with an */ + /* explicit script or language statement */ + if ( !(fFlags & langSysMode) + && gFlags & seenLangSys + && !(fFlags & seenScriptLang) ) { + fFlags |= langSysMode; + + /* We're now poised at the start of the first rule of this feature. */ + /* Start registering rules under the first language system (register */ + /* under the rest of the language systems at end of feature). */ + auto fls = langSysMap.cbegin(); + assert(fls !=langSysMap.cend()); + tagAssign(fls->first.script, scriptTag, false); + tagAssign(fls->first.lang, languageTag, false); + } + + /* Set the label */ + if (currNamedLkp != LAB_UNDEF) { + /* This is a named lkp or a reference (to an anon/named) lkp */ + if (curr.label != currNamedLkp) { + curr.label = currNamedLkp; + } else if (curr.script == prev.script && + curr.feature == prev.feature) { + /* Store lkp state only once per lookup. If the script/feature */ + /* has changed but the named label hasn't, accumDFLTLkps should */ + /* be 1. */ + accumDFLTLkps = 0; + } + } else { + /* This is an anonymous rule */ + if (prev.script == curr.script && + prev.language == curr.language && + prev.feature == curr.feature && + prev.tbl == curr.tbl && + prev.lkpType == curr.lkpType) { + /* I don't test against lookupFlag and markSetIndex, as I do */ + /* not want to silently start a new lookup because these changed */ + if ( endOfNamedLkpOrRef ) { + curr.label = getNextAnonLabel(); + } else { + curr.label = prev.label; + accumDFLTLkps = 0; /* Store lkp state only once per lookup */ + } + } else { + curr.label = getNextAnonLabel(); + } + } + + /* --- Everything is now in current state for the new rule --- */ + + /* Check that rules in a named lkp block */ + /* are of the same tbl, lkpType, lkpFlag */ + if (currNamedLkp != LAB_UNDEF && IS_NAMED_LAB(curr.label) && + !IS_REF_LAB(curr.label) && prev.label == curr.label) { + if (curr.tbl != prev.tbl || curr.lkpType != prev.lkpType) { + featMsg(hotFATAL, + "Lookup type different from previous " + "rules in this lookup block"); + } else if (curr.lkpFlag != prev.lkpFlag) { + featMsg(hotFATAL, + "Lookup flags different from previous " + "rules in this block"); + } else if (curr.markSetIndex != prev.markSetIndex) { + featMsg(hotFATAL, + "Lookup flag UseMarkSetIndex different from previous " + "rules in this block"); + } + } + + /* Reset DFLTLkp accumulator at feature change or start of DFLT run */ + if ((curr.feature != prev.feature) || (curr.script != prev.script)) + DFLTLkps.clear(); + + /* stop accumulating script specific defaults once a language other than 'dflt' is seen */ + if (accumDFLTLkps && curr.language != dflt_) + accumDFLTLkps = 0; + + if (accumDFLTLkps) + /* Save for possible inclusion later in lang-specific stuff */ + DFLTLkps.push_back(curr); + + /* Store, if applicable, for GPOSContext and aalt creation */ + if ((!IS_REF_LAB(curr.label)) && (repl != NULL)) + storeRuleInfo(targ, repl); + + /* If h->prev != h->curr (ignoring markSet) */ + if (prev.script != curr.script || + prev.language != curr.language || + prev.feature != curr.feature || + prev.tbl != curr.tbl || + prev.lkpType != curr.lkpType || + prev.label != curr.label) { + bool useExtension = false; + + closeFeatScriptLang(prev); + + /* Determine whether extension lookups are to be used */ + if (currNamedLkp != LAB_UNDEF && IS_NAMED_LAB(curr.label)) { + NamedLkp *lkp = lab2NamedLkp(currNamedLkp); + if (lkp == NULL) { + featMsg(hotFATAL, "[internal] label not found\n"); + } + useExtension = lkp->useExtension; + } + + /* Initiate calls to GSUB/GPOS */ + if (curr.tbl == GSUB_) { + GSUBFeatureBegin(g, curr.script, curr.language, curr.feature); + GSUBLookupBegin(g, curr.lkpType, curr.lkpFlag, + curr.label, useExtension, curr.markSetIndex); + } else if (curr.tbl == GPOS_) { + GPOSFeatureBegin(g, curr.script, curr.language, curr.feature); + GPOSLookupBegin(g, curr.lkpType, curr.lkpFlag, + curr.label, useExtension, curr.markSetIndex); + } + + /* If LANGSYS mode, snapshot lookup info for registration under */ + /* other language systems at end of feature */ + if (fFlags & langSysMode) + lookup.emplace_back(curr.tbl, curr.lkpType, curr.lkpFlag, + curr.markSetIndex, curr.label, useExtension); + setIDText(); + + /* --- COPY CURRENT TO PREVIOUS STATE: */ + prev = curr; + } else { + /* current state sate is the same for everything except maybe lkpFlag and markSetIndex */ + if (curr.lkpFlag != prev.lkpFlag) { + featMsg(hotFATAL, + "Lookup flags different from previous " + "rules in this block"); + } else if (curr.markSetIndex != prev.markSetIndex) { + featMsg(hotFATAL, + "Lookup flag UseMarkSetIndex different from previous " + "rules in this block"); + } + } +} + +void FeatCtx::addGSUB(int lkpType, GNode *targ, GNode *repl) { + if (aaltCheckRule(lkpType, targ, repl)) + return; + + prepRule(GSUB_, lkpType, targ, repl); + + GSUBRuleAdd(g, targ, repl); + + wrapUpRule(); +} + +/* Validate targ and repl for GSUBSingle. targ and repl come in with nextSeq + NULL and repl not marked. If valid return 1, else emit error message(s) and + return 0 */ + +bool FeatCtx::validateGSUBSingle(GNode *targ, GNode *repl, bool isSubrule) { + if (!isSubrule && targ->flags & FEAT_MARKED) { + featMsg(hotERROR, "Target must not be marked in this rule"); + return false; + } + + if (is_glyph(targ)) { + if (!is_glyph(repl)) { + featMsg(hotERROR, "Replacement in %srule must be a single glyph", isSubrule ? "sub-" : ""); + return false; + } + } else if (repl->nextCl != NULL && + !compareGlyphClassCount(targ, repl, isSubrule)) { + return false; + } + + return true; +} + +/* Return 1 if node is an unmarked pattern of 2 or more glyphs; glyph classes + may be present */ +static bool isUnmarkedSeq(GNode *node) { + if (node == nullptr || node->flags & FEAT_HAS_MARKED || node->nextSeq == nullptr) { + return false; + } + return true; +} + +/* Return 1 if node is an unmarked pattern of 2 or more glyphs, and no glyph + classes are present */ +static bool isUnmarkedGlyphSeq(GNode *node) { + if (!isUnmarkedSeq(node)) { + return false; + } + + for (; node != nullptr; node = node->nextSeq) { + if (node->nextCl != nullptr) { + return true; /* A glyph class is present */ + } + } + return true; +} + +/* Validate targ and repl for GSUBMultiple. targ comes in with nextSeq NULL and + repl NULL or with nextSeq non-NULL (and unmarked). If valid return 1, else + emit error message(s) and return 0 */ + +bool FeatCtx::validateGSUBMultiple(GNode *targ, GNode *repl, bool isSubrule) { + if (!isSubrule && targ->flags & FEAT_MARKED) { + featMsg(hotERROR, "Target must not be marked in this rule"); + return false; + } + + if (!((isSubrule || is_glyph(targ)) && isUnmarkedGlyphSeq(repl)) && (repl != NULL || targ->flags & FEAT_LOOKUP_NODE)) { + featMsg(hotERROR, "Invalid multiple substitution rule"); + return false; + } + return true; +} + +/* Validate targ and repl for GSUBAlternate. repl is not marked. If valid + return 1, else emit error message(s) and return 0 */ + +bool FeatCtx::validateGSUBAlternate(GNode *targ, GNode *repl, bool isSubrule) { + if (!isSubrule && targ->flags & FEAT_MARKED) { + featMsg(hotERROR, "Target must not be marked in this rule"); + return false; + } + + if (!is_unmarked_glyph(targ)) { + featMsg(hotERROR, + "Target of alternate substitution %srule must be a" + " single unmarked glyph", + isSubrule ? "sub-" : ""); + return false; + } + if (!is_class(repl)) { + featMsg(hotERROR, + "Replacement of alternate substitution %srule must " + "be a glyph class", + isSubrule ? "sub-" : ""); + return false; + } + return true; +} + +/* Validate targ and repl for GSUBLigature. targ comes in with nextSeq + non-NULL and repl is unmarked. If valid return 1, else emit error message(s) + and return 0 */ + +bool FeatCtx::validateGSUBLigature(GNode *targ, GNode *repl, bool isSubrule) { + if (!isSubrule && targ->flags & FEAT_HAS_MARKED) { + featMsg(hotERROR, "Target must not be marked in this rule"); + return false; + } + + if (!(is_glyph(repl))) { + featMsg(hotERROR, "Invalid ligature %srule replacement", isSubrule ? "sub-" : ""); + return false; + } + return true; +} + +/* Analyze GSUBChain targ and repl. Return 1 if valid, else 0 */ + +bool FeatCtx::validateGSUBReverseChain(GNode *targ, GNode *repl) { + int state; + GNode *p; + GNode *input = NULL; /* first node of input sequence */ + // GNode *m = NULL; + int nMarked = 0; + + if (repl == NULL) { + /* Except clause */ + if (targ->flags & FEAT_HAS_MARKED) { + /* Mark backtrack */ + for (p = targ; p != NULL && !(p->flags & FEAT_MARKED); + p = p->nextSeq) { + p->flags |= FEAT_BACKTRACK; + } + for (; p != NULL && p->flags & FEAT_MARKED; p = p->nextSeq) { + p->flags |= FEAT_INPUT; + } + } else { + /* If clause is unmarked: first char is INPUT, rest LOOKAHEAD */ + targ->flags |= FEAT_INPUT; + p = targ->nextSeq; + } + /* Mark rest of glyphs as lookahead */ + for (; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + featMsg(hotERROR, + "ignore clause may have at most one run " + "of marked glyphs"); + return false; + } else { + p->flags |= FEAT_LOOKAHEAD; + } + } + return true; + } + + /* At most one run of marked positions supported, for now */ + for (p = targ; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + if (++nMarked == 1) { + ; // m = p; + } + } else if (p->nextSeq != NULL && p->nextSeq->flags & FEAT_MARKED && nMarked > 0) { + featMsg(hotERROR, "Reverse contextual GSUB rule may must have one and only one glyph or class marked for replacement"); + return false; + } + } + + /* If nothing is marked, mark everything [xxx?] */ + if (nMarked == 0) { + // m = targ; + for (p = targ; p != NULL; p = p->nextSeq) { + p->flags |= FEAT_MARKED; + nMarked++; + } + } + /* m now points to beginning of marked run */ + +#if 0 + targ->flags |= (nMarked == 1) ? FEAT_HAS_SINGLE_MARK + : FEAT_HAS_LIGATURE_MARK; +#endif + + if (repl->nextSeq != NULL) { + featMsg(hotERROR, "Reverse contextual GSUB replacement sequence may have only one glyph or class"); + return false; + } + + if (nMarked != 1) { + featMsg(hotERROR, "Reverse contextual GSUB rule may must have one and only one glyph or class marked for replacement"); + return false; + } + + /* Divide into backtrack, input, and lookahead (xxx ff interface?). */ + /* For now, input is marked glyphs */ + state = FEAT_BACKTRACK; + for (p = targ; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + if (input == NULL) { + input = p; + } + state = FEAT_INPUT; + } else if (state != FEAT_BACKTRACK) { + state = FEAT_LOOKAHEAD; + } + p->flags |= state; + } + + if (!compareGlyphClassCount(input, repl, false)) { + return false; + } + + return true; +} + + +/* Analyze GSUBChain targ and repl. Return 1 if valid, else 0 */ + +bool FeatCtx::validateGSUBChain(GNode *targ, GNode *repl) { + int state; + GNode *p; + int nMarked = 0; + GNode *m = NULL; /* Suppress optimizer warning */ + int hasDirectLookups = (targ->flags & FEAT_LOOKUP_NODE); + + if (targ->flags & FEAT_IGNORE_CLAUSE) { + /* Except clause */ + if (targ->flags & FEAT_HAS_MARKED) { + /* Mark backtrack */ + for (p = targ; p != NULL && !(p->flags & FEAT_MARKED); + p = p->nextSeq) { + p->flags |= FEAT_BACKTRACK; + } + for (; p != NULL && p->flags & FEAT_MARKED; p = p->nextSeq) { + p->flags |= FEAT_INPUT; + } + } else { + /* If clause is unmarked: first char is INPUT, rest LOOKAHEAD */ + targ->flags |= FEAT_INPUT; + p = targ->nextSeq; + } + /* Mark rest of glyphs as lookahead */ + for (; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + featMsg(hotERROR, + "ignore clause may have at most one run " + "of marked glyphs"); + return false; + } else { + p->flags |= FEAT_LOOKAHEAD; + } + } + return 1; + } else if ((repl == NULL) && (!hasDirectLookups)) { + featMsg(hotERROR, "contextual substitution clause must have a replacement rule or direct lookup reference."); + return false; + } + + if (hasDirectLookups) { + if (repl != NULL) { + featMsg(hotERROR, "contextual substitution clause cannot both have a replacement rule and a direct lookup reference."); + return false; + } + if (!(targ->flags & FEAT_HAS_MARKED)) { + featMsg(hotERROR, "The direct lookup reference in a contextual substitution clause must be marked as part of a contextual input sequence."); + return false; + } + } + + /* At most one run of marked positions supported, for now */ + for (p = targ; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + if (++nMarked == 1) { + m = p; + } + } else if (p->lookupLabelCount > 0) { + featMsg(hotERROR, "The direct lookup reference in a contextual substitution clause must be marked as part of a contextual input sequence."); + return false; + } else if (p->nextSeq != NULL && p->nextSeq->flags & FEAT_MARKED && nMarked > 0) { + featMsg(hotERROR, "Unsupported contextual GSUB target sequence"); + return false; + } + } + + /* If nothing is marked, mark everything [xxx?] */ + if (nMarked == 0) { + m = targ; + for (p = targ; p != NULL; p = p->nextSeq) { + p->flags |= FEAT_MARKED; + nMarked++; + } + } + /* m now points to beginning of marked run */ + + if (repl) { + if (nMarked == 1) { + if (is_glyph(m) && is_class(repl)) { + featMsg(hotERROR, "Contextual alternate rule not yet supported"); + return false; + } + + if (repl->nextSeq != NULL) { + if (!validateGSUBMultiple(m, repl, 1)) { + return false; + } + } else if (!validateGSUBSingle(m, repl, 1)) { + return false; + } + } else if (nMarked > 1) { + if (repl->nextSeq != NULL) { + featMsg(hotERROR, "Unsupported contextual GSUB replacement sequence"); + return false; + } + + /* Ligature run may contain classes, but only with a single repl */ + if (!validateGSUBLigature(m, repl, 1)) { + return false; + } + } + } + + /* Divide into backtrack, input, and lookahead (xxx ff interface?). */ + /* For now, input is marked glyphs */ + state = FEAT_BACKTRACK; + for (p = targ; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + state = FEAT_INPUT; + } else if (state != FEAT_BACKTRACK) { + state = FEAT_LOOKAHEAD; + } + p->flags |= state; + } + + return true; +} + +void FeatCtx::addSub(GNode *targ, GNode *repl, int lkpType) { + GNode *nextNode = targ; + + for (nextNode = targ; nextNode != NULL; nextNode = nextNode->nextSeq) { + if (nextNode->flags & FEAT_MARKED) { + targ->flags |= FEAT_HAS_MARKED; + if ((lkpType != GSUBReverse) && (lkpType != GSUBChain)) { + lkpType = GSUBChain; + } + break; + } + } + + if (lkpType == GSUBChain || (targ->flags & FEAT_IGNORE_CLAUSE)) { + /* Chain sub exceptions (further analyzed below). */ + /* "sub f i by fi;" will be here if there was an "except" clause */ + + if (!g->hadError) { + if (validateGSUBChain(targ, repl)) { + lkpType = GSUBChain; + addGSUB(GSUBChain, targ, repl); + } + } + } else if (lkpType == GSUBReverse) { + if (validateGSUBReverseChain(targ, repl)) { + addGSUB(GSUBReverse, targ, repl); + } + } else if (lkpType == GSUBAlternate) { + if (validateGSUBAlternate(targ, repl, 0)) { + addGSUB(GSUBAlternate, targ, repl); + } + } else if (targ->nextSeq == NULL && (repl == NULL || repl->nextSeq != NULL)) { + if (validateGSUBMultiple(targ, repl, 0)) { + addGSUB(GSUBMultiple, targ, repl); + } + } else if (targ->nextSeq == NULL && repl->nextSeq == NULL) { + if (validateGSUBSingle(targ, repl, 0)) { + addGSUB(GSUBSingle, targ, repl); + } + } else { + GNode *next; + + if (validateGSUBLigature(targ, repl, 0)) { + /* add glyphs to lig and component classes, in case we need to + make a default GDEF table. Note that we may make a lot of + duplicated. These get weeded out later. The components are + linked by the next->nextSeq fields. For each component*/ + openAsCurrentGC(kDEFAULT_COMPONENTCLASS_NAME); /* looks up class, making if needed. Sets h->gcInsert to address of nextCl of last node, and returns it.*/ + next = targ; + while (next != NULL) { + if (next->nextCl != NULL) { + /* the current target node is a glyph class. Need to add all members of the class to the kDEFAULT_COMPONENTCLASS_NAME. */ + addGlyphClassToCurrentGC(next); + } else { + addGlyphToCurrentGC(next->gid); /* adds new node at h->gcInsert, sets h->gcInsert to address of new node's nextCl */ + } + next = next->nextSeq; + } + finishCurrentGC(); + openAsCurrentGC(kDEFAULT_LIGATURECLASS_NAME); + next = repl; + while (next != NULL) { + if (next->nextCl != NULL) { + addGlyphClassToCurrentGC(next); + } else { + addGlyphToCurrentGC(next->gid); + } + next = next->nextSeq; + } + finishCurrentGC(); + addGSUB(GSUBLigature, targ, repl); + } + } +} + +void FeatCtx::wrapUpRule() { + prev = curr; + endOfNamedLkpOrRef = false; +} + +// -------------------------------- Positions ---------------------------------- + +/* Add mark class reference to current anchorMarkInfo for the rule. */ +void FeatCtx::addMarkClass(const std::string &markClassName) { + if ( !openAsCurrentGC(markClassName) ) { + featMsg(hotERROR, "MarkToBase or MarkToMark rule references a mark class (%s) that has not yet been defined", markClassName.c_str()); + return; + } + curGCHead->flags |= FEAT_USED_MARK_CLASS; + anchorMarkInfo.back().markClass = curGCHead; + finishCurrentGC(); +} + +void FeatCtx::addGPOS(int lkpType, GNode *targ, int anchorCount, const AnchorMarkInfo *ami) { + prepRule(GPOS_, (targ->flags & FEAT_HAS_MARKED) ? GPOSChain : lkpType, targ, NULL); + + char *locDesc; + current_visitor->tokenPositionMsg(&locDesc, true); + GPOSRuleAdd(g, lkpType, targ, locDesc, anchorCount, ami); + MEM_FREE(g, locDesc); + + wrapUpRule(); +} + +/* Analyze featValidateGPOSChain targ metrics. Return 1 if valid, else 0 */ +/* Also sets flags in backtrack and look-ahead sequences */ + +bool FeatCtx::validateGPOSChain(GNode *targ, int lkpType) { + int state; + GNode *p; + int nMarked = 0; + int nNodesWithMetrics = 0; + bool seenTerminalMetrics = false; /* special case for kern -like syntax in a contextual sub statement. */ + int nBaseGlyphs = 0; + int nLookupRefs = 0; + GNode *m = NULL; /* Suppress optimizer warning */ + GNode *lastNode = NULL; /* Suppress optimizer warning */ + + /* At most one run of marked positions supported, for now */ + for (p = targ; p != NULL; p = p->nextSeq) { + lastNode = p; + + if (p->flags & FEAT_MARKED) { + if (++nMarked == 1) { + m = p; + } + if (p->metricsInfo.cnt != -1) { + nNodesWithMetrics++; + } + if (p->lookupLabelCount > 0) { + nLookupRefs++; + } + } else { + if (p->lookupLabelCount > 0) { + featMsg(hotERROR, "Lookup references are allowed only in the input sequence: this is the sequence of marked glyphs."); + } + + if (p->flags & FEAT_IS_MARK_NODE) { + featMsg(hotERROR, "The final mark class must be marked as part of the input sequence: this is the sequence of marked glyphs."); + } + + if ((p->nextSeq != NULL) && (p->nextSeq->flags & FEAT_MARKED) && (nMarked > 0)) { + featMsg(hotERROR, "Unsupported contextual GPOS target sequence: only one run of marked glyphs is supported."); + return false; + } + + /* We actually do allow a value records after the last glyph node, if there is only one marked glyph */ + if (p->metricsInfo.cnt != -1) { + if (nMarked == 0) { + featMsg(hotERROR, "Positioning cannot be applied in the backtrack glyph sequence, before the marked glyph sequence."); + return false; + } + if ((p->nextSeq != NULL) || (nMarked > 1)) { + featMsg(hotERROR, "Positioning values are allowed only in the marked glyph sequence, or after the final glyph node when only one glyph node is marked."); + return false; + } + + if ((p->nextSeq == NULL) && (nMarked == 1)) { + seenTerminalMetrics = true; + } + + nNodesWithMetrics++; + } + } + + if (p->flags & FEAT_IS_BASE_NODE) { + nBaseGlyphs++; + if ((lkpType == GPOSCursive) && (!(p->flags & FEAT_MARKED))) { + featMsg(hotERROR, "The base glyph or glyph class must be marked as part of the input sequence in a contextual pos cursive statement."); + } + } + } + + /* m now points to beginning of marked run */ + + /* Check for special case of a single marked node, with one or more lookahead nodes, and a single value record attached to the last node */ + if (seenTerminalMetrics) { + m->metricsInfo = lastNode->metricsInfo; + lastNode->metricsInfo = METRICSINFOEMPTYPP; + } + + if (targ->flags & FEAT_IGNORE_CLAUSE) { + /* An ignore clause is always contextual. If not marked, then mark the first glyph in the sequence */ + if (nMarked == 0) { + targ->flags |= FEAT_MARKED; + nMarked = 1; + } + } else if ((nNodesWithMetrics == 0) && (nBaseGlyphs == 0) && (nLookupRefs == 0)) { + featMsg(hotERROR, "Contextual positioning rule must specify a positioning value or a mark attachment rule or a direct lookup reference."); + return false; + } + + /* Divide into backtrack, input, and lookahead (xxx ff interface?). */ + /* For now, input is marked glyphs */ + state = FEAT_BACKTRACK; + for (p = targ; p != NULL; p = p->nextSeq) { + if (p->flags & FEAT_MARKED) { + state = FEAT_INPUT; + } else if (state != FEAT_BACKTRACK) { + state = FEAT_LOOKAHEAD; + } + p->flags |= state; + } + + return true; +} + +/* ----------- ----------- ------------------------- + Targ Metrics Lookup type + ----------- ----------- ------------------------- + g m m m m Single g: single glyph + c m m m m Single (range) c: glyph class (2 or more) + x: g or c + g g m Pair (specific) + g c m Pair (class) + c g m Pair (class) + c c m Pair (class) + + x x' x x' m m Chain ctx (not supported) + ----------- ----------- ------------------------- + + Add a pos rule from the feature file. + Can assume targ is at least one node. If h->metrics.cnt == 0 + then targ is an "ignore position" pattern. */ + +void FeatCtx::addBaseClass(GNode *targ, const std::string &defaultClassName) { + /* Find base node in a possibly contextual sequence, */ + /* and add it to the default base glyph class */ + GNode *nextNode = targ; + + /* If it is contextual, first find the base glyph */ + if (targ->flags & FEAT_HAS_MARKED) { + while (nextNode != NULL) { + if (nextNode->flags & FEAT_IS_BASE_NODE) { + break; + } + nextNode = nextNode->nextSeq; + } + } + + if (nextNode->flags & FEAT_IS_BASE_NODE) { + openAsCurrentGC(defaultClassName); + if (nextNode->nextCl != NULL) { + addGlyphClassToCurrentGC(nextNode); + } else { + addGlyphToCurrentGC(nextNode->gid); + } + finishCurrentGC(); + } +} + +void FeatCtx::addPos(GNode *targ, int type, bool enumerate) { + int glyphCount = 0; + int markedCount = 0; + int lookupLabelCnt = 0; + GNode *next_targ = NULL; + GNode *copyHeadNode; + + if (enumerate) { + targ->flags |= FEAT_ENUMERATE; + } + + /* count glyphs, figure out if is single, pair, or context. */ + next_targ = targ; + while (next_targ != NULL) { + glyphCount++; + if (next_targ->flags & FEAT_MARKED) { + markedCount++; + } + if (next_targ->lookupLabelCount > 0) { + lookupLabelCnt++; + if (!(next_targ->flags & FEAT_MARKED)) { + featMsg(hotERROR, "the glyph which precedes the 'lookup' keyword must be marked as part of the contextual input sequence"); + } + } + next_targ = next_targ->nextSeq; + } + + /* The ignore statement can only be used with contextual lookups. */ + /* If no glyph is marked, then mark the first. */ + if (targ->flags & FEAT_IGNORE_CLAUSE) { + type = GPOSChain; + if (markedCount == 0) { + markedCount = 1; + targ->flags |= FEAT_MARKED; + } + } + + if (markedCount > 0) { + targ->flags |= FEAT_HAS_MARKED; /* used later to decide if stuff is contextual */ + } + if ((glyphCount == 2) && (markedCount == 0) && (type == GPOSSingle)) { + type = GPOSPair; + } else if (enumerate) { + featMsg(hotERROR, "\"enumerate\" only allowed with pair positioning,"); + } + + if (type == GPOSSingle) { + addGPOS(GPOSSingle, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + /* These nodes are recycled in GPOS.c */ + } else if (type == GPOSPair) { + next_targ = targ->nextSeq; + if (targ->nextCl != NULL) { + /* In order to sort and remove duplicates, I need to copy the */ + /* original class definition. This is because class definitions */ + /* may be used for sequences as well as real classes, and */ + /* sorting and removing duplicates from the original class is a */ + /* bad idea. */ + copyGlyphClass(©HeadNode, targ); + targ = copyHeadNode; + sortGlyphClass(&targ, true, true); + targ->nextSeq = next_targ; /* featGlyphClassCopy zeros the nextSeq field in all nodes.*/ + } + if (next_targ->nextCl != NULL) { + /* In order to sort and remove duplicates, I need to copy the */ + /* original class definition. This is because class definitions */ + /* may be used for sequences as well as real classes, and */ + /* sorting and removing duplicates from the original class is a */ + /* bad idea. */ + copyGlyphClass(©HeadNode, next_targ); + next_targ = copyHeadNode; + sortGlyphClass(&next_targ, true, true); + targ->nextSeq = next_targ; /* featGlyphClassSort may change which node in the next_targ class is the head node. */ + } + /* addGPOSPair(targ, second, enumerate); */ + addGPOS(GPOSPair, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + /* These nodes are recycled in GPOS.c due to some complicated copying of nodes. */ + } else if (type == GPOSCursive) { + if (anchorMarkInfo.size() != 2) { + featMsg(hotERROR, "The 'cursive' statement requires two anchors. This has %ld. Skipping rule.", anchorMarkInfo.size()); + } else if ((!(targ->flags & FEAT_HAS_MARKED)) && ((!(targ->flags & FEAT_IS_BASE_NODE)) || (targ->nextSeq != NULL))) { + featMsg(hotERROR, "This statement has contextual glyphs around the cursive statement, but no glyphs are marked as part of the input sequence. Skipping rule."); + } else { + addGPOS(GPOSCursive, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + } + /* These nodes are recycled in GPOS.c */ + } else if (type == GPOSMarkToBase) { + addBaseClass(targ, kDEFAULT_BASECLASS_NAME); + if ((!(targ->flags & FEAT_HAS_MARKED)) && ((!(targ->flags & FEAT_IS_BASE_NODE)) || ((targ->nextSeq != NULL) && (targ->nextSeq->nextSeq != NULL)))) { + featMsg(hotERROR, "This statement has contextual glyphs around the base-to-mark statement, but no glyphs are marked as part of the input sequence. Skipping rule."); + } + addGPOS(GPOSMarkToBase, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + /* These nodes are recycled in GPOS.c */ + } else if (type == GPOSMarkToLigature) { + addBaseClass(targ, kDEFAULT_LIGATURECLASS_NAME); + if ((!(targ->flags & FEAT_HAS_MARKED)) && ((!(targ->flags & FEAT_IS_BASE_NODE)) || ((targ->nextSeq != NULL) && (targ->nextSeq->nextSeq != NULL)))) { + featMsg(hotERROR, "This statement has contextual glyphs around the ligature statement, but no glyphs are marked as part of the input sequence. Skipping rule."); + } + + /* With mark to ligatures, we may see the same mark class on */ + /* different components, which leads to duplicate GID's in the */ + /* contextual mark node. As a result, we need to sort and get rid of */ + /* duplicates. */ + + if (targ->flags & FEAT_HAS_MARKED) { + /* find the mark node */ + GNode *markClassNode = targ; + GNode *prevNode = NULL; + + while (markClassNode != NULL) { + if (markClassNode->flags & FEAT_IS_MARK_NODE) { + break; + } + prevNode = markClassNode; + markClassNode = markClassNode->nextSeq; + } + if ((markClassNode != NULL) && (markClassNode->flags & FEAT_IS_MARK_NODE)) { + copyGlyphClass(©HeadNode, markClassNode); + markClassNode = copyHeadNode; + sortGlyphClass(&markClassNode, true, false); /* changes value of markClassNode. I specify to NOT warn of duplicates, because they can happen with correct syntax. */ + prevNode->nextSeq = markClassNode; + } + } + + addGPOS(GPOSMarkToLigature, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + /* These nodes are recycled in GPOS.c */ + } else if (type == GPOSMarkToMark) { + addBaseClass(targ, kDEFAULT_MARKCLASS_NAME); + if ((!(targ->flags & FEAT_HAS_MARKED)) && ((!(targ->flags & FEAT_IS_BASE_NODE)) || ((targ->nextSeq != NULL) && (targ->nextSeq->nextSeq != NULL)))) { + featMsg(hotERROR, "This statement has contextual glyphs around the mark-to-mark statement, but no glyphs are marked as part of the input sequence. Skipping rule."); + } + addGPOS(GPOSMarkToMark, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + /* These nodes are recycled in GPOS.c */ + } else if (type == GPOSChain) { + /* is contextual */ + if (markedCount == 0) { + featMsg(hotERROR, "The 'lookup' keyword can be used only in a contextual statement. At least one glyph in the sequence must be marked. Skipping rule."); + } else { + validateGPOSChain(targ, type); + addGPOS(GPOSChain, targ, anchorMarkInfo.size(), anchorMarkInfo.data()); + } + /* These nodes are recycled in GPOS.c, as they are used in the fill phase, some time after this function returns. */ + } else { + featMsg(hotERROR, "This rule type is not recognized.."); + } +} + +// ------------------------------ CV Parameters -------------------------------- + +void FeatCtx::clearCVParameters() { + sawCVParams = true; + cvParameters.FeatUILabelNameID = 0; + cvParameters.FeatUITooltipTextNameID = 0; + cvParameters.SampleTextNameID = 0; + cvParameters.NumNamedParameters = 0; + cvParameters.FirstParamUILabelNameID = 0; + cvParameters.charValues.cnt = 0; +} + +void FeatCtx::addCVNameID(int labelID) { + switch (labelID) { + case cvUILabelEnum: { + if (cvParameters.FeatUILabelNameID != 0) { + featMsg(hotERROR, "A Character Variant parameter table can have only one FeatUILabelNameID entry."); + } + cvParameters.FeatUILabelNameID = featNameID; + break; + } + + case cvToolTipEnum: { + if (cvParameters.FeatUITooltipTextNameID != 0) { + featMsg(hotERROR, "A Character Variant parameter table can have only one SampleTextNameID entry."); + } + cvParameters.FeatUITooltipTextNameID = featNameID; + break; + } + + case cvSampleTextEnum: { + if (cvParameters.SampleTextNameID != 0) { + featMsg(hotERROR, "A Character Variant parameter table can have only one SampleTextNameID entry."); + } + cvParameters.SampleTextNameID = featNameID; + break; + } + + case kCVParameterLabelEnum: { + if ( cvParameters.FirstParamUILabelNameID == 0 ) + cvParameters.FirstParamUILabelNameID = featNameID; + else if ( cvParameters.FirstParamUILabelNameID + + cvParameters.NumNamedParameters != featNameID ) + featMsg(hotERROR, "Character variant AParamUILabelNameID statements must be contiguous."); + cvParameters.NumNamedParameters++; + break; + } + } + + featNameID = 0; +} + +void FeatCtx::addCVParametersCharValue(unsigned long uv) { + unsigned long *uvp = dnaNEXT(cvParameters.charValues); + *uvp = uv; +} + +void FeatCtx::addCVParam() { + prepRule(GSUB_, GSUBCVParam, NULL, NULL); + + GSUBAddCVParam(g, &cvParameters); + + wrapUpRule(); +} + +// --------------------------------- Ranges ------------------------------------ + +/* Add Unicode and CodePage ranges to OS/2 table. */ +/* ------------------------------------------------------------------- */ +/* ------------------------------------------------------------------- */ +#define SET_BIT_ARR(a, b) (a[(b) / 32] |= 1UL << (b) % 32) + +const short kValidCodePageNumbers[kLenCodePageList] = { + 1252, /* bit 0 Latin 1 */ + 1250, /* bit 1 Latin 2: Eastern Europe */ + 1251, /* bit 2 Cyrillic */ + 1253, /* bit 3 Greek */ + 1254, /* bit 4 Turkish */ + 1255, /* bit 5 Hebrew */ + 1256, /* bit 6 Arabic */ + 1257, /* bit 7 Windows Baltic */ + 1258, /* bit 8 Vietnamese */ + FeatCtx::kCodePageUnSet, /* bit 9 Reserved for Alternate ANSI */ + FeatCtx::kCodePageUnSet, /* bit 10 Reserved for Alternate ANSI */ + FeatCtx::kCodePageUnSet, /* bit 11 Reserved for Alternate ANSI */ + FeatCtx::kCodePageUnSet, /* bit 12 Reserved for Alternate ANSI */ + FeatCtx::kCodePageUnSet, /* bit 13 Reserved for Alternate ANSI */ + FeatCtx::kCodePageUnSet, /* bit 14 Reserved for Alternate ANSI */ + FeatCtx::kCodePageUnSet, /* bit 15 Reserved for Alternate ANSI */ + 874, /* bit 16 Thai */ + 932, /* bit 17 JIS/Japan */ + 936, /* bit 18 Chinese: Simplified chars--PRC and Singapore */ + 949, /* bit 19 Korean Wansung */ + 950, /* bit 20 Chinese: Traditional chars--Taiwan and Hong Kong */ + 1361, /* bit 21 Korean Johab */ + FeatCtx::kCodePageUnSet, /* bit 22-28 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 23 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 24 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 25 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 26 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 27 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 28 Reserved for Alternate ANSI & OEM */ + FeatCtx::kCodePageUnSet, /* bit 29 Macintosh Character Set (US Roman) */ + FeatCtx::kCodePageUnSet, /* bit 30 OEM Character Set */ + FeatCtx::kCodePageUnSet, /* bit 31 Symbol Character Set */ + FeatCtx::kCodePageUnSet, /* bit 32 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 33 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 34 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 35 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 36 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 37 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 38 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 39 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 40 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 41 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 42 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 43 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 44 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 45 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 46 Reserved for OEM */ + FeatCtx::kCodePageUnSet, /* bit 47 Reserved for OEM */ + 869, /* bit 48 IBM Greek */ + 866, /* bit 49 MS-DOS Russian */ + 865, /* bit 50 MS-DOS Nordic */ + 864, /* bit 51 Arabic */ + 863, /* bit 52 MS-DOS Canadian French */ + 862, /* bit 53 Hebrew */ + 861, /* bit 54 MS-DOS Icelandic */ + 860, /* bit 55 MS-DOS Portuguese */ + 857, /* bit 56 IBM Turkish */ + 855, /* bit 57 IBM Cyrillic; primarily Russian */ + 852, /* bit 58 Latin 2 */ + 775, /* bit 59 MS-DOS Baltic */ + 737, /* bit 60 Greek; former 437 G */ + 708, /* bit 61 Arabic; ASMO 708 */ + 850, /* bit 62 WE/Latin 1 */ + 437, /* bit 63 US */ +}; + +static int validateCodePage(short pageNum) { + int validPageBitIndex = FeatCtx::kCodePageUnSet; + + for (int i = 0; i < kLenCodePageList; i++) { + if (pageNum == kValidCodePageNumbers[i]) { + validPageBitIndex = i; + break; + } + } + + return validPageBitIndex; +} + +void FeatCtx::setUnicodeRange(short unicodeList[kLenUnicodeList]) { + unsigned long unicodeRange[4] { 0, 0, 0, 0 }; + short i = 0; + + while (i < kLenUnicodeList) { + short bitnum = unicodeList[i]; + + if (bitnum != kCodePageUnSet) { + if ((bitnum >= 0) && (bitnum < kLenUnicodeList)) { + SET_BIT_ARR(unicodeRange, bitnum); + } else { + featMsg(hotERROR, "OS/2 Bad Unicode block value <%d>. All values must be in [0 ...127] inclusive.", bitnum); + } + } else { + break; + } + i++; + } + + OS_2SetUnicodeRanges(g, unicodeRange[0], unicodeRange[1], + unicodeRange[2], unicodeRange[3]); +} + +void FeatCtx::setCodePageRange(short codePageList[kLenCodePageList]) { + unsigned long codePageRange[2] { 0, 0 }; + short validPageBitIndex; + int i = 0; + + while (i < kLenCodePageList) { + short pageNumber = codePageList[i]; + + if (pageNumber != kCodePageUnSet) { + validPageBitIndex = validateCodePage(pageNumber); + if (validPageBitIndex != kCodePageUnSet) { + SET_BIT_ARR(codePageRange, validPageBitIndex); + } else { + featMsg(hotERROR, "OS/2 Code page value <%d> is not permitted according to the OpenType spec v1.4.", pageNumber); + } + } else { + break; + } + + i++; + } + + OS_2SetCodePageRanges(g, codePageRange[0], codePageRange[1]); +} + +// ---------------------------------- aalt ------------------------------------- + +void FeatCtx::aaltAddFeatureTag(Tag tag) { + if (curr.feature != aalt_) { + featMsg(hotERROR, "\"feature\" statement allowed only in 'aalt' feature"); + } else if ( tag != aalt_ ) { + AALT::FeatureRecord t { tag, true }; + auto it = std::find(std::begin(aalt.features), std::end(aalt.features), t); + if ( it == std::end(aalt.features) ) + aalt.features.push_back(t); + } +} + +void FeatCtx::reportUnusedaaltTags() { + for (auto &f : aalt.features) { + if ( !f.used ) { + featMsg(hotWARNING, + "feature '%c%c%c%c', referenced in aalt feature, either is" + " not defined or had no rules which could be included in" + " the aalt feature.", + TAG_ARG(f.feature)); + } + } +} + +/* For the alternate glyphs in a GSUBAlternate rule, sort them */ +/* in the order of the GNode aaltIndex field, aka the order that */ +/* the features were named in the aalt definition. Alts that are */ +/* explicitly defined in the aalt feature have an index of -1. */ +/* See aaltAddAlternates. */ +void FeatCtx::aaltRuleSort(GNode **list) { + unsigned int i; + GNode *p = *list; + short flags = (*list)->flags; + + /* Copy over pointers */ + std::vector sortTmp; + + for (; p != NULL; p = p->nextCl) + sortTmp.push_back(p); + + struct { + bool operator()(GNode *a, GNode *b) const { return a->aaltIndex < b->aaltIndex; } + } cmpNode; + std::stable_sort(sortTmp.begin(), sortTmp.end(), cmpNode); + + /* Move pointers around */ + for (i = 0; i < sortTmp.size() - 1; i++) + sortTmp[i]->nextCl = sortTmp[i + 1]; + sortTmp[i]->nextCl = NULL; + + *list = sortTmp[0]; + + (*list)->flags = flags; +} + +/* Input GNodes will be copied. Ranges of 1-1, single 1-1, or 1 from n. (Only + first glyph position in targ will be looked at) */ +/* The aaltIndex is set to non-zero here in order to facilitate later sorting */ +/* of the target glyph alternates, by the order that the current feature file is */ +/* named in the aalt feature. If the alt glyph is defined explicitly in the */ +/* aalt feature, via a 'sub' directive, it gets an index of AALT_INDEX, aka, -1, */ +/* so that it will sort before all the alts from included features. */ + +void FeatCtx::aaltAddAlternates(GNode *targ, GNode *repl) { + bool range = targ->nextCl != nullptr; + + /* Duplicate repl if a single glyph: */ + if ( targ->nextCl != nullptr && repl->nextCl == nullptr ) + extendNodeToClass(repl, getGlyphClassCount(targ) - 1); + + for (; targ != nullptr; targ = targ->nextCl, repl = repl->nextCl) { + GNode *replace; + + /* Start new accumulator for targ->gid, if it doesn't already exist */ + auto ru = aalt.rules.find(targ->gid); + if ( ru == aalt.rules.end() ) { + GNode *t = setNewNode(targ->gid); + aalt.rules.insert(std::make_pair(targ->gid, AALT::RuleInfo{ t, nullptr })); + ru = aalt.rules.find(targ->gid); + } + + auto &ri = ru->second; + /* Add alternates to alt set, */ + /* checking for uniqueness & preserving order */ + replace = repl; + for (; replace != nullptr; replace = range ? nullptr : replace->nextCl) { + GNode **lastClass; + GNode *p; + + auto it = std::find(std::begin(aalt.features), std::end(aalt.features), curr.feature); + short aaltTagIndex = it != std::end(aalt.features) ? it - aalt.features.begin() : -1; + if (glyphInClass(replace->gid, &ri.repl, &lastClass)) { + p = *lastClass; + + if ( aaltTagIndex < p->aaltIndex ) { + p->aaltIndex = aaltTagIndex; + } + } else { + *lastClass = setNewNode(replace->gid); + p = *lastClass; + + if (curr.feature == aalt_) { + p->aaltIndex = AALT_INDEX; + } else { + p->aaltIndex = aaltTagIndex; + } + } + } + } +} + +/* Create aalt at end of feature file processing */ + +void FeatCtx::aaltCreate() { +#if HOT_DEBUG + long nInterSingleRules = 0; /* Rules that interact with the alt rules; i.e. */ + /* its repl GID == an alt rule's targ GID */ +#endif + Label labelSingle = LAB_UNDEF; /* Init to suppress compiler warning */ + Label labelAlternate = LAB_UNDEF; /* Init to Suppress compiler warning */ + + if (aalt.rules.size() == 0) { + return; + } + + // Create and sort a vector of RuleInfo pointers into the aalt.rules map + // (the latter must not be altered during this function) + std::vector sortTmp; + sortTmp.reserve(aalt.rules.size()); + for (auto &ru : aalt.rules) + sortTmp.push_back(&ru.second); + + /* Sort single subs before alt subs, sort alt subs by targ GID */ + struct { + bool operator()(AALT::RuleInfo *aa, AALT::RuleInfo *bb) const { + GNode *a = aa->repl, *b = bb->repl; + + /* Sort single sub rules before alt sub rules */ + if (is_glyph(a) && is_mult_class(b)) { + return true; + } else if (is_mult_class(a) && is_glyph(b)) { + return false; + } else if (is_mult_class(a) && is_mult_class(b)) { + // Sort alt sub rules by targ GID + return aa->targ->gid < bb->targ->gid; + } else { + return aa->targ->gid < bb->targ->gid; + } + } + } cmpNode; + std::sort(sortTmp.begin(), sortTmp.end(), cmpNode); + + auto single_end = sortTmp.begin(); + while ( single_end != sortTmp.end() && is_glyph((*single_end)->repl) ) + single_end++; + + if ( single_end != sortTmp.begin() && single_end != sortTmp.end() ) { + /* If the repl GID of a SingleSub rule is the same as an AltSub */ + /* rule's targ GID, then the SingleSub rule sinks to the bottom of */ + /* the SingleSub rules, and becomes part of the AltSub rules */ + /* section: */ + for (auto si = single_end-1; si >= sortTmp.begin(); si--) { + auto search = aalt.rules.find((*si)->repl->gid); + if ( search != aalt.rules.end() && is_mult_class(search->second.repl) ) { + single_end--; + if ( si != single_end ) { + AALT::RuleInfo *tmp = *single_end; + *single_end = *si; + *si = tmp; + } +#if HOT_DEBUG + nInterSingleRules++; +#endif + } + } +#if HOT_DEBUG + if (nInterSingleRules) { + DF(1, (stderr, + "# aalt: %ld SingleSub rule%s moved to AltSub " + "lookup to prevent lookup interaction\n", + nInterSingleRules, + nInterSingleRules == 1 ? "" : "s")); + } +#endif + } + + /* Add default lang sys if none specified */ + if (langSysMap.size() == 0) { + addLangSys(DFLT_, dflt_, false); + if (fFlags & langSysMode) { + hotMsg(g, hotWARNING, "[internal] aalt language system unspecified"); + } + } + + auto i = langSysMap.cbegin(); + assert(i != langSysMap.cend()); + GSUBFeatureBegin(g, i->first.script, i->first.lang, aalt_); + + /* --- Feed in single subs --- */ + if (sortTmp.begin() != single_end) { + labelSingle = getNextAnonLabel(); + GSUBLookupBegin(g, GSUBSingle, 0, labelSingle, aalt.useExtension, 0); + for (auto i = sortTmp.begin(); i != single_end; i++) { + GSUBRuleAdd(g, (*i)->targ, (*i)->repl); + } + GSUBLookupEnd(g, aalt_); + } + + /* --- Feed in alt subs --- */ + if (single_end != sortTmp.end()) { + labelAlternate = getNextAnonLabel(); + GSUBLookupBegin(g, GSUBAlternate, 0, labelAlternate, aalt.useExtension, 0); + for (auto i = single_end; i != sortTmp.end(); i++) { + aaltRuleSort(&(*i)->repl); // sort alts in order of feature def + // in aalt feature + GSUBRuleAdd(g, (*i)->targ, (*i)->repl); + } + GSUBLookupEnd(g, aalt_); + } + + GSUBFeatureEnd(g); + + /* Also register these lookups under any other lang systems, if needed: */ + for (auto ls = langSysMap.cbegin(); ls != langSysMap.cend(); ls++) { + if ( ls == langSysMap.cbegin() ) + continue; + + GSUBFeatureBegin(g, ls->first.script, ls->first.lang, aalt_); + + if (sortTmp.begin() != single_end) { + GSUBLookupBegin(g, GSUBSingle, 0, (Label)(labelSingle | REF_LAB), + aalt.useExtension, 0); + GSUBLookupEnd(g, aalt_); + } + if (single_end != sortTmp.end()) { + GSUBLookupBegin(g, GSUBAlternate, 0, + (Label)(labelAlternate | REF_LAB), + aalt.useExtension, 0); + GSUBLookupEnd(g, aalt_); + } + + GSUBFeatureEnd(g); + } +} + +/* Return 1 if this rule is to be treated specially */ + +bool FeatCtx::aaltCheckRule(int type, GNode *targ, GNode *repl) { + if (curr.feature == aalt_) { + if (type == GSUBSingle || type == GSUBAlternate) { + aaltAddAlternates(targ, repl); + recycleNodes(targ); + recycleNodes(repl); + } else { + featMsg(hotWARNING, + "Only single and alternate " + "substitutions are allowed within an 'aalt' feature"); + } + return true; + } + return false; +} + +void FeatCtx::storeRuleInfo(GNode *targ, GNode *repl) { + if (curr.tbl == GPOS_ || repl == NULL) { + return; /* No GPOS or except clauses */ + } + AALT::FeatureRecord t { curr.feature, false }; + auto f = std::find(std::begin(aalt.features), std::end(aalt.features), t); + if ( curr.feature == aalt_ || f != std::end(aalt.features) ) { + /* Now check if lkpType is appropriate */ + + switch (curr.lkpType) { + case GSUBSingle: + case GSUBAlternate: + break; + + case GSUBChain: + /* Go to first marked glyph (guaranteed to be present) */ + for (; !(targ->flags & FEAT_MARKED); targ = targ->nextSeq) { + } + if (targ->nextSeq != NULL && targ->nextSeq->flags & FEAT_MARKED) { + return; /* Ligature sub-substitution */ + } + break; + + default: + return; + } + + if (curr.feature != aalt_) { + assert(f != std::end(aalt.features)); + f->used = true; + } + aaltAddAlternates(targ, repl); + } +} + +/* Creates the cross product of pattern pat, and returns the array of *n + * resulting sequences. pat is left intact; the client is responsible for + recycling the result. */ + +GNode **FeatCtx::makeCrossProduct(GNode *pat, unsigned *n) { + GNode *cl; + + prod.clear(); + + /* Add each glyph class in pat to the cross product */ + for (cl = pat; cl != NULL; cl = cl->nextSeq) { + long i; + long nProd; + + if (cl == pat) + prod.push_back(nullptr); + + nProd = prod.size(); + + for (i = 0; i < nProd; i++) { + GNode *p; + int cntCl = 0; + int lenSrc = 0; + + /* h->prod.array[i] is the source. Don't store its address as a */ + /* pointer in a local variable since dnaINDEX below may */ + /* obsolete it! */ + for (p = cl; p != NULL; p = p->nextCl) { + GNode **r; + + if (p == cl) { + for (r = &prod[i]; *r != NULL; r = &(*r)->nextSeq) { + lenSrc++; + } + } else { + size_t inxTarg = nProd * cntCl + i; + if ( inxTarg >= prod.size() ) + prod.resize(inxTarg+1); + + r = copyPattern(&prod[inxTarg], prod[i], lenSrc); + } + *r = setNewNode(p->gid); + cntCl++; + } + } + } + + *n = prod.size(); + return prod.data(); +} + +// -------------------------------- C Hooks ----------------------------------- + +inline FeatCtx *hctofc(hotCtx g) { + assert(g->ctx.feat != nullptr); + return (FeatCtx *) g->ctx.feat; +} + +extern "C" { + +void featNew(hotCtx g) { + assert(g->ctx.feat == nullptr); + FeatCtx *hfp = new FeatCtx(g); + g->ctx.feat = (void *) hfp; +} + +void featFree(hotCtx g) { + delete hctofc(g); + g->ctx.feat = nullptr; +} + +// Prior to Antlr 4 the old code reset the context here but with an object +// that's an invitation for bugs so just reallocate. +void featReuse(hotCtx g) { + featFree(g); + featNew(g); +} + +void featFill(hotCtx g) { hctofc(g)->fill(); } + +GNode *featSetNewNode(hotCtx g, GID gid) { + return hctofc(g)->setNewNode(gid); +} + +void featRecycleNodes(hotCtx g, GNode *node) { + hctofc(g)->recycleNodes(node); +} + +GNode **featGlyphClassCopy(hotCtx g, GNode **dst, GNode *src) { + return hctofc(g)->copyGlyphClass(dst, src); +} + +void featGlyphDump(hotCtx g, GID gid, int ch, int print) { + hctofc(g)->dumpGlyph(gid, ch, print); +} + +void featGlyphClassDump(hotCtx g, GNode *gc, int ch, int print) { + hctofc(g)->dumpGlyphClass(gc, ch, print); +} + +void featPatternDump(hotCtx g, GNode *pat, int ch, int print) { + hctofc(g)->dumpPattern(pat, ch, print); +} + +GNode **featPatternCopy(hotCtx g, GNode **dst, GNode *src, int num) { + return hctofc(g)->copyPattern(dst, src, num); +} + +void featExtendNodeToClass(hotCtx g, GNode *node, int num) { + hctofc(g)->extendNodeToClass(node, num); +} + +int featGetGlyphClassCount(hotCtx g, GNode *gc) { + return hctofc(g)->getGlyphClassCount(gc); +} + +unsigned int featGetPatternLen(hotCtx g, GNode *pat) { + return hctofc(g)->getPatternLen(pat); +} + +void featGlyphClassSort(hotCtx g, GNode **list, int unique, int reportDups) { + hctofc(g)->sortGlyphClass(list, unique, reportDups); +} + +void featMsgPrefix(hotCtx g, char **premsg, char **prefix) { + hctofc(g)->msgPrefix(premsg, prefix); +} + +GNode **featMakeCrossProduct(hotCtx g, GNode *pat, unsigned *n) { + return hctofc(g)->makeCrossProduct(pat, n); +} + +Label featGetNextAnonLabel(hotCtx g) { + return hctofc(g)->getNextAnonLabel(); +} + +int featValidateGPOSChain(hotCtx g, GNode *targ, int lookupType) { + return hctofc(g)->validateGPOSChain(targ, lookupType); +} + +} // extern "C" diff --git a/c/makeotf/lib/hotconv/FeatCtx.h b/c/makeotf/lib/hotconv/FeatCtx.h new file mode 100644 index 000000000..cb066049a --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatCtx.h @@ -0,0 +1,386 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +#pragma once + +#include "feat.h" +#include "FeatParser.h" +#include "hotmap.h" + +#include "assert.h" +#include +#include +#include +#include +#include + +// number of possible entries in list of Unicode blocks +#define kLenUnicodeList 128 +// number of possible entries in list of code page numbers +#define kLenCodePageList 64 + +class FeatVisitor; + +class FeatCtx { + friend class FeatVisitor; + + public: + FeatCtx() = delete; + explicit FeatCtx(hotCtx g); + ~FeatCtx(); + + // Implementations of "external" calls in feat.h + void fill(); + + GNode *setNewNode(GID gid); + void recycleNodes(GNode *node); + + void dumpGlyph(GID gid, int ch, bool print); + void dumpGlyphClass(GNode *gc, int ch, bool print); + void dumpPattern(GNode *pat, int ch, bool print); + + GNode **copyGlyphClass(GNode **dst, GNode *src); + GNode **copyPattern(GNode **dst, GNode *src, int num); + void extendNodeToClass(GNode *node, int num); + static int getGlyphClassCount(GNode *gc); + static unsigned int getPatternLen(GNode *pat); + void sortGlyphClass(GNode **list, bool unique, bool reportDups); + + void msgPrefix(char **premsg, char **prefix); + GNode **makeCrossProduct(GNode *pat, unsigned *n); + bool validateGPOSChain(GNode *targ, int lookupType); + Label getNextAnonLabel(); + + // Utility + Tag str2tag(const std::string &tagName); + + static inline bool is_glyph(GNode *p) { + return p != nullptr && p->nextSeq == nullptr && + p->nextCl == nullptr && + !(p->flags & FEAT_GCLASS); + } + static inline bool is_class(GNode *p) { + return p != nullptr && p->nextSeq == nullptr && + (p->nextCl != nullptr || (p->flags & FEAT_GCLASS)); + } + static inline bool is_mult_class(GNode *p) { + return p != nullptr && p->nextSeq == nullptr && p->nextCl != nullptr; + } + static inline bool is_unmarked_glyph(GNode *p) { + return is_glyph(p) && !(p->flags & FEAT_HAS_MARKED); + } + static inline bool is_unmarked_class(GNode *p) { + return is_class(p) && !(p->flags & FEAT_HAS_MARKED); + } + +#if HOT_DEBUG + void nodeStats(); + void tagDump(Tag); + void stateDump(State &st); +#endif + static const int kMaxCodePageValue; + static const int kCodePageUnSet; + + private: + // GNode memory management and utilities + struct BlockNode { + GNode *data; + BlockNode *next; + }; + + struct { + BlockNode *first {nullptr}; + // Current BlockNode being filled + BlockNode *curr {nullptr}; + // Index of next free GNode, relative to curr->data + long cnt {0}; + long intl {3000}; + long incr {6000}; + } blockList; + GNode *freelist {nullptr}; +#if HOT_DEBUG + long int nAdded2FreeList {0}; + long int nNewFromBlockList {0}; + long int nNewFromFreeList {0}; + + void checkFreeNode(GNode *node); +#endif + void addBlock(); + void freeBlocks(); + GNode *newNodeFromBlock(); + GNode *newNode(); + void recycleNode(GNode *pat); + + // Console message hooks + struct { + unsigned short numExcept {0}; + } syntax; + + void CDECL featMsg(int msgType, const char *fmt, ...); + void CDECL featMsg(int msgType, FeatVisitor *v, + antlr4::Token *t, const char *fmt, ...); + const char *tokstr(); + void setIDText(); + void reportOldSyntax(); + + // State flags + enum gFlagValues { gNone = 0, seenFeature = 1<<0, seenLangSys = 1<<1, + seenGDEFGC = 1<<2, seenIgnoreClassFlag = 1<<3, + seenMarkClassFlag = 1<<4, + seenNonDFLTScriptLang = 1<<5 }; + unsigned int gFlags {gNone}; + + enum fFlagValues { fNone = 0, seenScriptLang = 1<<0, + langSysMode = 1<<1 }; + unsigned int fFlags {fNone}; + + // Glyphs + GID mapGName2GID(const char *gname, bool allowNotdef); + inline GID mapGName2GID(const std::string &gname, bool allowNotdef) { + return mapGName2GID(gname.c_str(), allowNotdef); + } + GID cid2gid(const std::string &cidstr); + + // Glyph Classes + GNode *curGCHead {nullptr}, **curGCTailAddr {nullptr}; + std::string curGCName; + std::unordered_map namedGlyphClasses; + + void resetCurrentGC(); + void defineCurrentGC(const std::string &gcname); + bool openAsCurrentGC(const std::string &gcname); + GNode *finishCurrentGC(); + void addGlyphToCurrentGC(GID gid); + void addGlyphClassToCurrentGC(GNode *src); + void addGlyphClassToCurrentGC(const std::string &gcname); + void addAlphaRangeToCurrentGC(GID first, GID last, + const char *firstname, const char *p, + char q); + void addNumRangeToCurrentGC(GID first, GID last, const char *firstname, + const char *p1, const char *p2, + const char *q1, int numLen); + void addRangeToCurrentGC(GID first, GID last, + const std::string &firstName, + const std::string &lastName); + GNode *lookupGlyphClass(const std::string &gcname); + bool compareGlyphClassCount(GNode *targ, GNode *repl, bool isSubrule); + + // Tag management + enum TagType { featureTag, scriptTag, languageTag, tableTag }; + typedef std::unordered_set TagArray; + TagArray script, language, feature, table; + + inline bool addTag(TagArray &a, Tag t) { + if ( a.find(t) == a.end() ) + return false; + a.emplace(t); + return true; + } + bool tagAssign(Tag tag, enum TagType type, bool checkIfDef); + + // Scripts and languages + struct LangSys { + LangSys() = delete; + LangSys(Tag script, Tag lang) : script(script), lang(lang) {} + Tag script; + Tag lang; + bool operator<(const LangSys &b) const; + bool operator==(const LangSys &b) const; + }; + + std::map langSysMap; + bool include_dflt = true, seenOldDFLT = false; + + int startScriptOrLang(TagType type, Tag tag); + void includeDFLT(bool includeDFLT, int langChange, bool seenOD); + void addLangSys(Tag script, Tag language, bool checkBeforeFeature, + FeatParser::TagContext *langctx = nullptr); + void registerFeatureLangSys(); + + // Features + struct State { + Tag script {TAG_UNDEF}; + Tag language {TAG_UNDEF}; + Tag feature {TAG_UNDEF}; + Tag tbl {TAG_UNDEF}; // GSUB_ or GPOS_ + int lkpType {0}; // GSUBsingle, GPOSSingle, etc. + unsigned int lkpFlag {0}; + unsigned short markSetIndex {0}; + Label label {LAB_UNDEF}; + bool operator==(const State &b) const; + }; + State curr, prev; + std::vector DFLTLkps; + + void startFeature(Tag tag); + void endFeature(); + void flagExtension(bool isLookup); + void closeFeatScriptLang(State &st); + void addFeatureParam(const std::vector ¶ms); + void subtableBreak(); + + // Lookups + struct LookupInfo { + LookupInfo(Tag t, int lt, unsigned int lf, unsigned short msi, + Label l, bool ue) : tbl(t), lkpType(lt), lkpFlag(lf), + markSetIndex(msi), label(l), + useExtension(ue) {} + Tag tbl; // GSUB_ or GPOS_ + int lkpType; // GSUBsingle, GPOSSingle, etc. + unsigned int lkpFlag; + unsigned short markSetIndex; + Label label; + bool useExtension; + }; + std::vector lookup; + + void startLookup(const std::string &name, bool isTopLevel); + void endLookup(); + uint16_t setLkpFlagAttribute(uint16_t val, unsigned int attr, + uint16_t markAttachClassIndex); + void setLkpFlag(uint16_t flagVal); + void callLkp(State &st); + void useLkp(const std::string &name); + + struct NamedLkp { + NamedLkp() = delete; + NamedLkp(const std::string &name, bool tl) : name(name), + isTopLevel(tl) {} + std::string name; + State state; + bool useExtension {false}, isTopLevel; + }; + static_assert(FEAT_NAMED_LKP_BEG == 0, + "Named label values must start at zero"); + std::vector namedLkp; + Label currNamedLkp {LAB_UNDEF}; + bool endOfNamedLkpOrRef {false}; + Label anonLabelCnt = FEAT_ANON_LKP_BEG; + + NamedLkp *name2NamedLkp(const std::string &lkpName); + NamedLkp *lab2NamedLkp(Label lab); + Label getNextNamedLkpLabel(const std::string &name, bool isa); + Label getLabelIndex(const std::string &name); + + // Tables + uint16_t featNameID; + bool sawSTAT {false}; + bool sawFeatNames {false}; + struct STAT { + uint16_t flags, format, prev; + std::vector axisTags; + std::vector values; + Fixed min, max; + } stat; + bool axistag_vert {false}, sawBASEvert {false}, sawBASEhoriz {false}; + size_t axistag_count {0}; + antlr4::Token *axistag_token {nullptr}; + FeatVisitor *axistag_visitor {nullptr}; + void (FeatCtx::*addNameFn)(long platformId, long platspecId, + long languageId, const std::string &str); + + void startTable(Tag tag); + void setGDEFGlyphClassDef(GNode *simple, GNode *ligature, GNode *mark, + GNode *component); + void createDefaultGDEFClasses(); + void setFontRev(const std::string &rev); + void addNameString(long platformId, long platspecId, + long languageId, long nameId, + const std::string &str); + void addSizeNameString(long platformId, long platspecId, + long languageId, const std::string &str); + void addFeatureNameString(long platformId, long platspecId, + long languageId, const std::string &str); + void addFeatureNameParam(); + void addUserNameString(long platformId, long platspecId, + long languageId, const std::string &str); + void addVendorString(std::string str); + + // Anchors + struct AnchorDef { + short x {0}; + short y {0}; + unsigned int contourpoint {0}; + bool hasContour {false}; + }; + std::map anchorDefs; + std::vector anchorMarkInfo; + std::vector markClasses; + void addAnchorDef(const std::string &name, const AnchorDef &a); + void addAnchorByName(const std::string &name, int componentIndex); + void addAnchorByValue(const AnchorDef &a, bool isNull, + int componentIndex); + void addMark(const std::string &name, GNode *targ); + + // Metrics + std::map valueDefs; + void addValueDef(const std::string &name, const MetricsInfo &mi); + void getValueDef(const std::string &name, MetricsInfo &mi); + + // Substitutions + void prepRule(Tag newTbl, int newlkpType, GNode *targ, GNode *repl); + void addGSUB(int lkpType, GNode *targ, GNode *repl); + bool validateGSUBSingle(GNode *targ, GNode *repl, bool isSubrule); + bool validateGSUBMultiple(GNode *targ, GNode *repl, bool isSubrule); + bool validateGSUBAlternate(GNode *targ, GNode *repl, bool isSubrule); + bool validateGSUBLigature(GNode *targ, GNode *repl, bool isSubrule); + bool validateGSUBReverseChain(GNode *targ, GNode *repl); + bool validateGSUBChain(GNode *targ, GNode *repl); + void addSub(GNode *targ, GNode *repl, int lkpType); + void wrapUpRule(); + + // Positions + void addMarkClass(const std::string &markClassName); + void addGPOS(int lkpType, GNode *targ, int anchorCount, + const AnchorMarkInfo *ami); + void addBaseClass(GNode *targ, const std::string &defaultClassName); + void addPos(GNode *targ, int type, bool enumerate); + + // CVParameters + enum { cvUILabelEnum = 1, cvToolTipEnum, cvSampleTextEnum, + kCVParameterLabelEnum }; + CVParameterFormat cvParameters; + bool sawCVParams {false}; + void clearCVParameters(); + void addCVNameID(int labelID); + void addCVParametersCharValue(unsigned long uv); + void addCVParam(); + + // Ranges + void setUnicodeRange(short unicodeList[kLenUnicodeList]); + void setCodePageRange(short codePageList[kLenCodePageList]); + + // AALT + struct AALT { + State state; + short useExtension {false}; + struct FeatureRecord { + Tag feature; + bool used; + bool operator==(const FeatureRecord &b) const; + bool operator==(const Tag &b) const; + }; + std::vector features; + struct RuleInfo { + GNode *targ; + GNode *repl; + }; + std::unordered_map rules; + } aalt; + + void aaltAddFeatureTag(Tag tag); + void reportUnusedaaltTags(); + void aaltRuleSort(GNode **list); + void aaltAddAlternates(GNode *targ, GNode *repl); + void aaltCreate(); + bool aaltCheckRule(int type, GNode *targ, GNode *repl); + void storeRuleInfo(GNode *targ, GNode *repl); + + // Temporary for cross product + std::vector prod; + + hotCtx g; + FeatVisitor *root_visitor {nullptr}, *current_visitor {nullptr}; +}; diff --git a/c/makeotf/lib/hotconv/FeatLexer.cpp b/c/makeotf/lib/hotconv/FeatLexer.cpp new file mode 100644 index 000000000..d1ec35588 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatLexer.cpp @@ -0,0 +1,1466 @@ + +// Generated from FeatLexer.g4 by ANTLR 4.9.2 + + +#include "FeatLexer.h" + + +using namespace antlr4; + + +FeatLexer::FeatLexer(CharStream *input) : Lexer(input) { + _interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); +} + +FeatLexer::~FeatLexer() { + delete _interpreter; +} + +std::string FeatLexer::getGrammarFileName() const { + return "FeatLexer.g4"; +} + +const std::vector& FeatLexer::getRuleNames() const { + return _ruleNames; +} + +const std::vector& FeatLexer::getChannelNames() const { + return _channelNames; +} + +const std::vector& FeatLexer::getModeNames() const { + return _modeNames; +} + +const std::vector& FeatLexer::getTokenNames() const { + return _tokenNames; +} + +dfa::Vocabulary& FeatLexer::getVocabulary() const { + return _vocabulary; +} + +const std::vector FeatLexer::getSerializedATN() const { + return _serializedATN; +} + +const atn::ATN& FeatLexer::getATN() const { + return _atn; +} + + +void FeatLexer::action(RuleContext *context, size_t ruleIndex, size_t actionIndex) { + switch (ruleIndex) { + case 141: A_LABELAction(dynamic_cast(context), actionIndex); break; + + default: + break; + } +} + +bool FeatLexer::sempred(RuleContext *context, size_t ruleIndex, size_t predicateIndex) { + switch (ruleIndex) { + case 143: return A_CLOSESempred(dynamic_cast(context), predicateIndex); + + default: + break; + } + return true; +} + +void FeatLexer::A_LABELAction(antlr4::RuleContext *context, size_t actionIndex) { + switch (actionIndex) { + case 0: anon_tag = getText(); break; + + default: + break; + } +} + + +bool FeatLexer::A_CLOSESempred(antlr4::RuleContext *_localctx, size_t predicateIndex) { + switch (predicateIndex) { + case 0: return verify_anon(getText()) ; + + default: + break; + } + return true; +} + + +// Static vars and initialization. +std::vector FeatLexer::_decisionToDFA; +atn::PredictionContextCache FeatLexer::_sharedContextCache; + +// We own the ATN which in turn owns the ATN states. +atn::ATN FeatLexer::_atn; +std::vector FeatLexer::_serializedATN; + +std::vector FeatLexer::_ruleNames = { + "ANON", "ANON_v", "COMMENT", "WHITESPACE", "INCLUDE", "FEATURE", "TABLE", + "SCRIPT", "LANGUAGE", "LANGSYS", "SUBTABLE", "LOOKUP", "LOOKUPFLAG", "NOTDEF", + "RIGHT_TO_LEFT", "IGNORE_BASE_GLYPHS", "IGNORE_LIGATURES", "IGNORE_MARKS", + "USE_MARK_FILTERING_SET", "MARK_ATTACHMENT_TYPE", "EXCLUDE_DFLT", "INCLUDE_DFLT", + "EXCLUDE_dflt", "INCLUDE_dflt", "USE_EXTENSION", "BEGINVALUE", "ENDVALUE", + "ENUMERATE", "ENUMERATE_v", "EXCEPT", "IGNORE", "SUBSTITUTE", "SUBSTITUTE_v", + "REVERSE", "REVERSE_v", "BY", "FROM", "POSITION", "POSITION_v", "PARAMETERS", + "FEATURE_NAMES", "CV_PARAMETERS", "CV_UI_LABEL", "CV_TOOLTIP", "CV_SAMPLE_TEXT", + "CV_PARAM_LABEL", "CV_CHARACTER", "SIZEMENUNAME", "CONTOURPOINT", "ANCHOR", + "ANCHOR_DEF", "VALUE_RECORD_DEF", "MARK", "MARK_CLASS", "CURSIVE", "MARKBASE", + "MARKLIG", "MARKLIG_v", "LIG_COMPONENT", "KNULL", "BASE", "HA_BTL", "VA_BTL", + "HA_BSL", "VA_BSL", "GDEF", "GLYPH_CLASS_DEF", "ATTACH", "LIG_CARET_BY_POS", + "LIG_CARET_BY_IDX", "HEAD", "FONT_REVISION", "HHEA", "ASCENDER", "DESCENDER", + "LINE_GAP", "CARET_OFFSET", "NAME", "NAMEID", "OS_2", "FS_TYPE", "FS_TYPE_v", + "OS2_LOWER_OP_SIZE", "OS2_UPPER_OP_SIZE", "PANOSE", "TYPO_ASCENDER", "TYPO_DESCENDER", + "TYPO_LINE_GAP", "WIN_ASCENT", "WIN_DESCENT", "X_HEIGHT", "CAP_HEIGHT", + "WEIGHT_CLASS", "WIDTH_CLASS", "VENDOR", "UNICODE_RANGE", "CODE_PAGE_RANGE", + "FAMILY_CLASS", "STAT", "ELIDED_FALLBACK_NAME", "ELIDED_FALLBACK_NAME_ID", + "DESIGN_AXIS", "AXIS_VALUE", "FLAG", "LOCATION", "AXIS_EAVN", "AXIS_OSFA", + "VHEA", "VERT_TYPO_ASCENDER", "VERT_TYPO_DESCENDER", "VERT_TYPO_LINE_GAP", + "VMTX", "VERT_ORIGIN_Y", "VERT_ADVANCE_Y", "LCBRACE", "RCBRACE", "LBRACKET", + "RBRACKET", "HYPHEN", "SEMI", "EQUALS", "MARKER", "COMMA", "QUOTE", "GNST", + "LCHR", "GCCHR", "GCLASS", "CID", "GNCHR", "ESCGNAME", "NAMELABEL", "EXTNAME", + "POINTNUM", "NUMEXT", "NUMOCT", "NUM", "TSTART", "TCHR", "CATCHTAG", "A_WHITESPACE", + "A_LABEL", "A_LBRACE", "A_CLOSE", "A_LINE", "I_WHITESPACE", "I_RPAREN", + "IFILE", "I_LPAREN", "STRVAL", "EQUOTE" +}; + +std::vector FeatLexer::_channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" +}; + +std::vector FeatLexer::_modeNames = { + "DEFAULT_MODE", "Anon", "AnonContent", "Include", "Ifile", "String" +}; + +std::vector FeatLexer::_literalNames = { + "", "'anon'", "'anonymous'", "", "", "'include'", "'feature'", "'table'", + "'script'", "'language'", "'languagesystem'", "'subtable'", "'lookup'", + "'lookupflag'", "'.notdef'", "'RightToLeft'", "'IgnoreBaseGlyphs'", "'IgnoreLigatures'", + "'IgnoreMarks'", "'UseMarkFilteringSet'", "'MarkAttachmentType'", "'excludeDFLT'", + "'includeDFLT'", "'exclude_dflt'", "'include_dflt'", "'useExtension'", + "'<'", "'>'", "'enumerate'", "'enum'", "'except'", "'ignore'", "'substitute'", + "'sub'", "'reversesub'", "'rsub'", "'by'", "'from'", "'position'", "'pos'", + "'parameters'", "'featureNames'", "'cvParameters'", "'FeatUILabelNameID'", + "'FeatUITooltipTextNameID'", "'SampleTextNameID'", "'ParamUILabelNameID'", + "'Character'", "'sizemenuname'", "'contourpoint'", "'anchor'", "'anchorDef'", + "'valueRecordDef'", "'mark'", "'markClass'", "'cursive'", "'base'", "'ligature'", + "'lig'", "'ligComponent'", "'NULL'", "'BASE'", "'HorizAxis.BaseTagList'", + "'VertAxis.BaseTagList'", "'HorizAxis.BaseScriptList'", "'VertAxis.BaseScriptList'", + "'GDEF'", "'GlyphClassDef'", "'Attach'", "'LigatureCaretByPos'", "'LigatureCaretByIndex'", + "'head'", "'FontRevision'", "'hhea'", "'Ascender'", "'Descender'", "'LineGap'", + "'CaretOffset'", "'name'", "'nameid'", "'OS/2'", "'FSType'", "'fsType'", + "'LowerOpSize'", "'UpperOpSize'", "'Panose'", "'TypoAscender'", "'TypoDescender'", + "'TypoLineGap'", "'winAscent'", "'winDescent'", "'XHeight'", "'CapHeight'", + "'WeightClass'", "'WidthClass'", "'Vendor'", "'UnicodeRange'", "'CodePageRange'", + "'FamilyClass'", "'STAT'", "'ElidedFallbackName'", "'ElidedFallbackNameID'", + "'DesignAxis'", "'AxisValue'", "'flag'", "'location'", "'ElidableAxisValueName'", + "'OlderSiblingFontAttribute'", "'vhea'", "'VertTypoAscender'", "'VertTypoDescender'", + "'VertTypoLineGap'", "'vmtx'", "'VertOriginY'", "'VertAdvanceY'", "", + "'}'", "'['", "']'", "'-'", "';'", "'='", "'''", "','", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "'('", "", "')'" +}; + +std::vector FeatLexer::_symbolicNames = { + "", "ANON", "ANON_v", "COMMENT", "WHITESPACE", "INCLUDE", "FEATURE", "TABLE", + "SCRIPT", "LANGUAGE", "LANGSYS", "SUBTABLE", "LOOKUP", "LOOKUPFLAG", "NOTDEF", + "RIGHT_TO_LEFT", "IGNORE_BASE_GLYPHS", "IGNORE_LIGATURES", "IGNORE_MARKS", + "USE_MARK_FILTERING_SET", "MARK_ATTACHMENT_TYPE", "EXCLUDE_DFLT", "INCLUDE_DFLT", + "EXCLUDE_dflt", "INCLUDE_dflt", "USE_EXTENSION", "BEGINVALUE", "ENDVALUE", + "ENUMERATE", "ENUMERATE_v", "EXCEPT", "IGNORE", "SUBSTITUTE", "SUBSTITUTE_v", + "REVERSE", "REVERSE_v", "BY", "FROM", "POSITION", "POSITION_v", "PARAMETERS", + "FEATURE_NAMES", "CV_PARAMETERS", "CV_UI_LABEL", "CV_TOOLTIP", "CV_SAMPLE_TEXT", + "CV_PARAM_LABEL", "CV_CHARACTER", "SIZEMENUNAME", "CONTOURPOINT", "ANCHOR", + "ANCHOR_DEF", "VALUE_RECORD_DEF", "MARK", "MARK_CLASS", "CURSIVE", "MARKBASE", + "MARKLIG", "MARKLIG_v", "LIG_COMPONENT", "KNULL", "BASE", "HA_BTL", "VA_BTL", + "HA_BSL", "VA_BSL", "GDEF", "GLYPH_CLASS_DEF", "ATTACH", "LIG_CARET_BY_POS", + "LIG_CARET_BY_IDX", "HEAD", "FONT_REVISION", "HHEA", "ASCENDER", "DESCENDER", + "LINE_GAP", "CARET_OFFSET", "NAME", "NAMEID", "OS_2", "FS_TYPE", "FS_TYPE_v", + "OS2_LOWER_OP_SIZE", "OS2_UPPER_OP_SIZE", "PANOSE", "TYPO_ASCENDER", "TYPO_DESCENDER", + "TYPO_LINE_GAP", "WIN_ASCENT", "WIN_DESCENT", "X_HEIGHT", "CAP_HEIGHT", + "WEIGHT_CLASS", "WIDTH_CLASS", "VENDOR", "UNICODE_RANGE", "CODE_PAGE_RANGE", + "FAMILY_CLASS", "STAT", "ELIDED_FALLBACK_NAME", "ELIDED_FALLBACK_NAME_ID", + "DESIGN_AXIS", "AXIS_VALUE", "FLAG", "LOCATION", "AXIS_EAVN", "AXIS_OSFA", + "VHEA", "VERT_TYPO_ASCENDER", "VERT_TYPO_DESCENDER", "VERT_TYPO_LINE_GAP", + "VMTX", "VERT_ORIGIN_Y", "VERT_ADVANCE_Y", "LCBRACE", "RCBRACE", "LBRACKET", + "RBRACKET", "HYPHEN", "SEMI", "EQUALS", "MARKER", "COMMA", "QUOTE", "GCLASS", + "CID", "ESCGNAME", "NAMELABEL", "EXTNAME", "POINTNUM", "NUMEXT", "NUMOCT", + "NUM", "CATCHTAG", "A_WHITESPACE", "A_LABEL", "A_LBRACE", "A_CLOSE", "A_LINE", + "I_WHITESPACE", "I_RPAREN", "IFILE", "I_LPAREN", "STRVAL", "EQUOTE" +}; + +dfa::Vocabulary FeatLexer::_vocabulary(_literalNames, _symbolicNames); + +std::vector FeatLexer::_tokenNames; + +FeatLexer::Initializer::Initializer() { + // This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there. + for (size_t i = 0; i < _symbolicNames.size(); ++i) { + std::string name = _vocabulary.getLiteralName(i); + if (name.empty()) { + name = _vocabulary.getSymbolicName(i); + } + + if (name.empty()) { + _tokenNames.push_back(""); + } else { + _tokenNames.push_back(name); + } + } + + static const uint16_t serializedATNSegment0[] = { + 0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, + 0x2, 0x93, 0x6f6, 0x8, 0x1, 0x8, 0x1, 0x8, 0x1, 0x8, 0x1, 0x8, 0x1, + 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4, 0x9, + 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x7, + 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, 0x4, + 0xb, 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, 0xe, + 0x9, 0xe, 0x4, 0xf, 0x9, 0xf, 0x4, 0x10, 0x9, 0x10, 0x4, 0x11, 0x9, + 0x11, 0x4, 0x12, 0x9, 0x12, 0x4, 0x13, 0x9, 0x13, 0x4, 0x14, 0x9, + 0x14, 0x4, 0x15, 0x9, 0x15, 0x4, 0x16, 0x9, 0x16, 0x4, 0x17, 0x9, + 0x17, 0x4, 0x18, 0x9, 0x18, 0x4, 0x19, 0x9, 0x19, 0x4, 0x1a, 0x9, + 0x1a, 0x4, 0x1b, 0x9, 0x1b, 0x4, 0x1c, 0x9, 0x1c, 0x4, 0x1d, 0x9, + 0x1d, 0x4, 0x1e, 0x9, 0x1e, 0x4, 0x1f, 0x9, 0x1f, 0x4, 0x20, 0x9, + 0x20, 0x4, 0x21, 0x9, 0x21, 0x4, 0x22, 0x9, 0x22, 0x4, 0x23, 0x9, + 0x23, 0x4, 0x24, 0x9, 0x24, 0x4, 0x25, 0x9, 0x25, 0x4, 0x26, 0x9, + 0x26, 0x4, 0x27, 0x9, 0x27, 0x4, 0x28, 0x9, 0x28, 0x4, 0x29, 0x9, + 0x29, 0x4, 0x2a, 0x9, 0x2a, 0x4, 0x2b, 0x9, 0x2b, 0x4, 0x2c, 0x9, + 0x2c, 0x4, 0x2d, 0x9, 0x2d, 0x4, 0x2e, 0x9, 0x2e, 0x4, 0x2f, 0x9, + 0x2f, 0x4, 0x30, 0x9, 0x30, 0x4, 0x31, 0x9, 0x31, 0x4, 0x32, 0x9, + 0x32, 0x4, 0x33, 0x9, 0x33, 0x4, 0x34, 0x9, 0x34, 0x4, 0x35, 0x9, + 0x35, 0x4, 0x36, 0x9, 0x36, 0x4, 0x37, 0x9, 0x37, 0x4, 0x38, 0x9, + 0x38, 0x4, 0x39, 0x9, 0x39, 0x4, 0x3a, 0x9, 0x3a, 0x4, 0x3b, 0x9, + 0x3b, 0x4, 0x3c, 0x9, 0x3c, 0x4, 0x3d, 0x9, 0x3d, 0x4, 0x3e, 0x9, + 0x3e, 0x4, 0x3f, 0x9, 0x3f, 0x4, 0x40, 0x9, 0x40, 0x4, 0x41, 0x9, + 0x41, 0x4, 0x42, 0x9, 0x42, 0x4, 0x43, 0x9, 0x43, 0x4, 0x44, 0x9, + 0x44, 0x4, 0x45, 0x9, 0x45, 0x4, 0x46, 0x9, 0x46, 0x4, 0x47, 0x9, + 0x47, 0x4, 0x48, 0x9, 0x48, 0x4, 0x49, 0x9, 0x49, 0x4, 0x4a, 0x9, + 0x4a, 0x4, 0x4b, 0x9, 0x4b, 0x4, 0x4c, 0x9, 0x4c, 0x4, 0x4d, 0x9, + 0x4d, 0x4, 0x4e, 0x9, 0x4e, 0x4, 0x4f, 0x9, 0x4f, 0x4, 0x50, 0x9, + 0x50, 0x4, 0x51, 0x9, 0x51, 0x4, 0x52, 0x9, 0x52, 0x4, 0x53, 0x9, + 0x53, 0x4, 0x54, 0x9, 0x54, 0x4, 0x55, 0x9, 0x55, 0x4, 0x56, 0x9, + 0x56, 0x4, 0x57, 0x9, 0x57, 0x4, 0x58, 0x9, 0x58, 0x4, 0x59, 0x9, + 0x59, 0x4, 0x5a, 0x9, 0x5a, 0x4, 0x5b, 0x9, 0x5b, 0x4, 0x5c, 0x9, + 0x5c, 0x4, 0x5d, 0x9, 0x5d, 0x4, 0x5e, 0x9, 0x5e, 0x4, 0x5f, 0x9, + 0x5f, 0x4, 0x60, 0x9, 0x60, 0x4, 0x61, 0x9, 0x61, 0x4, 0x62, 0x9, + 0x62, 0x4, 0x63, 0x9, 0x63, 0x4, 0x64, 0x9, 0x64, 0x4, 0x65, 0x9, + 0x65, 0x4, 0x66, 0x9, 0x66, 0x4, 0x67, 0x9, 0x67, 0x4, 0x68, 0x9, + 0x68, 0x4, 0x69, 0x9, 0x69, 0x4, 0x6a, 0x9, 0x6a, 0x4, 0x6b, 0x9, + 0x6b, 0x4, 0x6c, 0x9, 0x6c, 0x4, 0x6d, 0x9, 0x6d, 0x4, 0x6e, 0x9, + 0x6e, 0x4, 0x6f, 0x9, 0x6f, 0x4, 0x70, 0x9, 0x70, 0x4, 0x71, 0x9, + 0x71, 0x4, 0x72, 0x9, 0x72, 0x4, 0x73, 0x9, 0x73, 0x4, 0x74, 0x9, + 0x74, 0x4, 0x75, 0x9, 0x75, 0x4, 0x76, 0x9, 0x76, 0x4, 0x77, 0x9, + 0x77, 0x4, 0x78, 0x9, 0x78, 0x4, 0x79, 0x9, 0x79, 0x4, 0x7a, 0x9, + 0x7a, 0x4, 0x7b, 0x9, 0x7b, 0x4, 0x7c, 0x9, 0x7c, 0x4, 0x7d, 0x9, + 0x7d, 0x4, 0x7e, 0x9, 0x7e, 0x4, 0x7f, 0x9, 0x7f, 0x4, 0x80, 0x9, + 0x80, 0x4, 0x81, 0x9, 0x81, 0x4, 0x82, 0x9, 0x82, 0x4, 0x83, 0x9, + 0x83, 0x4, 0x84, 0x9, 0x84, 0x4, 0x85, 0x9, 0x85, 0x4, 0x86, 0x9, + 0x86, 0x4, 0x87, 0x9, 0x87, 0x4, 0x88, 0x9, 0x88, 0x4, 0x89, 0x9, + 0x89, 0x4, 0x8a, 0x9, 0x8a, 0x4, 0x8b, 0x9, 0x8b, 0x4, 0x8c, 0x9, + 0x8c, 0x4, 0x8d, 0x9, 0x8d, 0x4, 0x8e, 0x9, 0x8e, 0x4, 0x8f, 0x9, + 0x8f, 0x4, 0x90, 0x9, 0x90, 0x4, 0x91, 0x9, 0x91, 0x4, 0x92, 0x9, + 0x92, 0x4, 0x93, 0x9, 0x93, 0x4, 0x94, 0x9, 0x94, 0x4, 0x95, 0x9, + 0x95, 0x4, 0x96, 0x9, 0x96, 0x4, 0x97, 0x9, 0x97, 0x4, 0x98, 0x9, + 0x98, 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, + 0x3, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, + 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, + 0x3, 0x4, 0x3, 0x4, 0x7, 0x4, 0x14c, 0xa, 0x4, 0xc, 0x4, 0xe, 0x4, + 0x14f, 0xb, 0x4, 0x3, 0x4, 0x3, 0x4, 0x3, 0x5, 0x6, 0x5, 0x154, 0xa, + 0x5, 0xd, 0x5, 0xe, 0x5, 0x155, 0x3, 0x5, 0x3, 0x5, 0x3, 0x6, 0x3, + 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, + 0x3, 0x6, 0x3, 0x6, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, + 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x8, 0x3, 0x8, 0x3, 0x8, + 0x3, 0x8, 0x3, 0x8, 0x3, 0x8, 0x3, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, + 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, + 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, + 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, + 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, + 0xb, 0x3, 0xb, 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, + 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, 0x3, 0xd, 0x3, 0xd, 0x3, + 0xd, 0x3, 0xd, 0x3, 0xd, 0x3, 0xd, 0x3, 0xd, 0x3, 0xe, 0x3, 0xe, + 0x3, 0xe, 0x3, 0xe, 0x3, 0xe, 0x3, 0xe, 0x3, 0xe, 0x3, 0xe, 0x3, + 0xe, 0x3, 0xe, 0x3, 0xe, 0x3, 0xf, 0x3, 0xf, 0x3, 0xf, 0x3, 0xf, + 0x3, 0xf, 0x3, 0xf, 0x3, 0xf, 0x3, 0xf, 0x3, 0x10, 0x3, 0x10, 0x3, + 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, + 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x11, 0x3, 0x11, 0x3, + 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, + 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, + 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, + 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, + 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, + 0x12, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, + 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, + 0x13, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, + 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, + 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, + 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, + 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, + 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, + 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x15, 0x3, 0x16, 0x3, 0x16, 0x3, + 0x16, 0x3, 0x16, 0x3, 0x16, 0x3, 0x16, 0x3, 0x16, 0x3, 0x16, 0x3, + 0x16, 0x3, 0x16, 0x3, 0x16, 0x3, 0x16, 0x3, 0x17, 0x3, 0x17, 0x3, + 0x17, 0x3, 0x17, 0x3, 0x17, 0x3, 0x17, 0x3, 0x17, 0x3, 0x17, 0x3, + 0x17, 0x3, 0x17, 0x3, 0x17, 0x3, 0x17, 0x3, 0x18, 0x3, 0x18, 0x3, + 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, + 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x19, 0x3, + 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, + 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, 0x19, 0x3, + 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, + 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, + 0x1a, 0x3, 0x1b, 0x3, 0x1b, 0x3, 0x1c, 0x3, 0x1c, 0x3, 0x1d, 0x3, + 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, + 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, 0x1e, 0x3, 0x1e, 0x3, 0x1e, 0x3, + 0x1e, 0x3, 0x1e, 0x3, 0x1f, 0x3, 0x1f, 0x3, 0x1f, 0x3, 0x1f, 0x3, + 0x1f, 0x3, 0x1f, 0x3, 0x1f, 0x3, 0x20, 0x3, 0x20, 0x3, 0x20, 0x3, + 0x20, 0x3, 0x20, 0x3, 0x20, 0x3, 0x20, 0x3, 0x21, 0x3, 0x21, 0x3, + 0x21, 0x3, 0x21, 0x3, 0x21, 0x3, 0x21, 0x3, 0x21, 0x3, 0x21, 0x3, + 0x21, 0x3, 0x21, 0x3, 0x21, 0x3, 0x22, 0x3, 0x22, 0x3, 0x22, 0x3, + 0x22, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, + 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, + 0x24, 0x3, 0x24, 0x3, 0x24, 0x3, 0x24, 0x3, 0x24, 0x3, 0x25, 0x3, + 0x25, 0x3, 0x25, 0x3, 0x26, 0x3, 0x26, 0x3, 0x26, 0x3, 0x26, 0x3, + 0x26, 0x3, 0x27, 0x3, 0x27, 0x3, 0x27, 0x3, 0x27, 0x3, 0x27, 0x3, + 0x27, 0x3, 0x27, 0x3, 0x27, 0x3, 0x27, 0x3, 0x28, 0x3, 0x28, 0x3, + 0x28, 0x3, 0x28, 0x3, 0x29, 0x3, 0x29, 0x3, 0x29, 0x3, 0x29, 0x3, + 0x29, 0x3, 0x29, 0x3, 0x29, 0x3, 0x29, 0x3, 0x29, 0x3, 0x29, 0x3, + 0x29, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, + 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x3, + 0x2a, 0x3, 0x2a, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, + 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, + 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, + 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, + 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, + 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, + 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, + 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, + 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, + 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, + 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, + 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, 0x2e, 0x3, + 0x2e, 0x3, 0x2e, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, + 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, + 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, + 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x30, 0x3, 0x30, 0x3, 0x30, 0x3, + 0x30, 0x3, 0x30, 0x3, 0x30, 0x3, 0x30, 0x3, 0x30, 0x3, 0x30, 0x3, + 0x30, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, + 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, + 0x31, 0x3, 0x31, 0x3, 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, + 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, + 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, 0x33, 0x3, 0x33, 0x3, 0x33, 0x3, + 0x33, 0x3, 0x33, 0x3, 0x33, 0x3, 0x33, 0x3, 0x34, 0x3, 0x34, 0x3, + 0x34, 0x3, 0x34, 0x3, 0x34, 0x3, 0x34, 0x3, 0x34, 0x3, 0x34, 0x3, + 0x34, 0x3, 0x34, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, + 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, + 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x36, 0x3, + 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, 0x37, 0x3, 0x37, 0x3, + 0x37, 0x3, 0x37, 0x3, 0x37, 0x3, 0x37, 0x3, 0x37, 0x3, 0x37, 0x3, + 0x37, 0x3, 0x37, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, + 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, 0x38, 0x3, 0x39, 0x3, 0x39, 0x3, + 0x39, 0x3, 0x39, 0x3, 0x39, 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, + 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, + 0x3b, 0x3, 0x3b, 0x3, 0x3b, 0x3, 0x3b, 0x3, 0x3c, 0x3, 0x3c, 0x3, + 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, + 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3d, 0x3, + 0x3d, 0x3, 0x3d, 0x3, 0x3d, 0x3, 0x3d, 0x3, 0x3e, 0x3, 0x3e, 0x3, + 0x3e, 0x3, 0x3e, 0x3, 0x3e, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, + 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, + 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, + 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, + 0x3f, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, + 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, + 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, + 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x41, 0x3, 0x41, 0x3, + 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, + 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, + 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, + 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, 0x42, 0x3, + 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, + 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, + 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, + 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x43, 0x3, + 0x43, 0x3, 0x43, 0x3, 0x43, 0x3, 0x43, 0x3, 0x44, 0x3, 0x44, 0x3, + 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, + 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, 0x44, 0x3, + 0x45, 0x3, 0x45, 0x3, 0x45, 0x3, 0x45, 0x3, 0x45, 0x3, 0x45, 0x3, + 0x45, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, + 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, + 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, 0x46, 0x3, + 0x46, 0x3, 0x46, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, + 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, + 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, + 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x47, 0x3, 0x48, 0x3, + 0x48, 0x3, 0x48, 0x3, 0x48, 0x3, 0x48, 0x3, 0x49, 0x3, 0x49, 0x3, + 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, + 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, 0x49, 0x3, 0x4a, 0x3, + 0x4a, 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4b, 0x3, 0x4b, 0x3, + 0x4b, 0x3, 0x4b, 0x3, 0x4b, 0x3, 0x4b, 0x3, 0x4b, 0x3, 0x4b, 0x3, + 0x4b, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, + 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4d, 0x3, + 0x4d, 0x3, 0x4d, 0x3, 0x4d, 0x3, 0x4d, 0x3, 0x4d, 0x3, 0x4d, 0x3, + 0x4d, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, + 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, + 0x4e, 0x3, 0x4f, 0x3, 0x4f, 0x3, 0x4f, 0x3, 0x4f, 0x3, 0x4f, 0x3, + 0x50, 0x3, 0x50, 0x3, 0x50, 0x3, 0x50, 0x3, 0x50, 0x3, 0x50, 0x3, + 0x50, 0x3, 0x51, 0x3, 0x51, 0x3, 0x51, 0x3, 0x51, 0x3, 0x51, 0x3, + 0x52, 0x3, 0x52, 0x3, 0x52, 0x3, 0x52, 0x3, 0x52, 0x3, 0x52, 0x3, + 0x52, 0x3, 0x53, 0x3, 0x53, 0x3, 0x53, 0x3, 0x53, 0x3, 0x53, 0x3, + 0x53, 0x3, 0x53, 0x3, 0x54, 0x3, 0x54, 0x3, 0x54, 0x3, 0x54, 0x3, + 0x54, 0x3, 0x54, 0x3, 0x54, 0x3, 0x54, 0x3, 0x54, 0x3, 0x54, 0x3, + 0x54, 0x3, 0x54, 0x3, 0x55, 0x3, 0x55, 0x3, 0x55, 0x3, 0x55, 0x3, + 0x55, 0x3, 0x55, 0x3, 0x55, 0x3, 0x55, 0x3, 0x55, 0x3, 0x55, 0x3, + 0x55, 0x3, 0x55, 0x3, 0x56, 0x3, 0x56, 0x3, 0x56, 0x3, 0x56, 0x3, + 0x56, 0x3, 0x56, 0x3, 0x56, 0x3, 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, + 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, + 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, 0x57, 0x3, 0x58, 0x3, 0x58, 0x3, + 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, + 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, 0x58, 0x3, + 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, + 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, 0x59, 0x3, + 0x5a, 0x3, 0x5a, 0x3, 0x5a, 0x3, 0x5a, 0x3, 0x5a, 0x3, 0x5a, 0x3, + 0x5a, 0x3, 0x5a, 0x3, 0x5a, 0x3, 0x5a, 0x3, 0x5b, 0x3, 0x5b, 0x3, + 0x5b, 0x3, 0x5b, 0x3, 0x5b, 0x3, 0x5b, 0x3, 0x5b, 0x3, 0x5b, 0x3, + 0x5b, 0x3, 0x5b, 0x3, 0x5b, 0x3, 0x5c, 0x3, 0x5c, 0x3, 0x5c, 0x3, + 0x5c, 0x3, 0x5c, 0x3, 0x5c, 0x3, 0x5c, 0x3, 0x5c, 0x3, 0x5d, 0x3, + 0x5d, 0x3, 0x5d, 0x3, 0x5d, 0x3, 0x5d, 0x3, 0x5d, 0x3, 0x5d, 0x3, + 0x5d, 0x3, 0x5d, 0x3, 0x5d, 0x3, 0x5e, 0x3, 0x5e, 0x3, 0x5e, 0x3, + 0x5e, 0x3, 0x5e, 0x3, 0x5e, 0x3, 0x5e, 0x3, 0x5e, 0x3, 0x5e, 0x3, + 0x5e, 0x3, 0x5e, 0x3, 0x5e, 0x3, 0x5f, 0x3, 0x5f, 0x3, 0x5f, 0x3, + 0x5f, 0x3, 0x5f, 0x3, 0x5f, 0x3, 0x5f, 0x3, 0x5f, 0x3, 0x5f, 0x3, + 0x5f, 0x3, 0x5f, 0x3, 0x60, 0x3, 0x60, 0x3, 0x60, 0x3, 0x60, 0x3, + 0x60, 0x3, 0x60, 0x3, 0x60, 0x3, 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, + 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, + 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, 0x62, 0x3, 0x62, 0x3, + 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, + 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, 0x62, 0x3, + 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, + 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, + 0x64, 0x3, 0x64, 0x3, 0x64, 0x3, 0x64, 0x3, 0x64, 0x3, 0x65, 0x3, + 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, + 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, + 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, + 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, + 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, + 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, + 0x66, 0x3, 0x66, 0x3, 0x66, 0x3, 0x67, 0x3, 0x67, 0x3, 0x67, 0x3, + 0x67, 0x3, 0x67, 0x3, 0x67, 0x3, 0x67, 0x3, 0x67, 0x3, 0x67, 0x3, + 0x67, 0x3, 0x67, 0x3, 0x68, 0x3, 0x68, 0x3, 0x68, 0x3, 0x68, 0x3, + 0x68, 0x3, 0x68, 0x3, 0x68, 0x3, 0x68, 0x3, 0x68, 0x3, 0x68, 0x3, + 0x69, 0x3, 0x69, 0x3, 0x69, 0x3, 0x69, 0x3, 0x69, 0x3, 0x6a, 0x3, + 0x6a, 0x3, 0x6a, 0x3, 0x6a, 0x3, 0x6a, 0x3, 0x6a, 0x3, 0x6a, 0x3, + 0x6a, 0x3, 0x6a, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, + 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, + 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, + 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6b, 0x3, + 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, + 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, + 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, + 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, 0x6c, 0x3, + 0x6c, 0x3, 0x6c, 0x3, 0x6d, 0x3, 0x6d, 0x3, 0x6d, 0x3, 0x6d, 0x3, + 0x6d, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, + 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, + 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6e, 0x3, + 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, + 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, + 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, 0x6f, 0x3, + 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, + 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, + 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x3, 0x71, 0x3, 0x71, 0x3, + 0x71, 0x3, 0x71, 0x3, 0x71, 0x3, 0x72, 0x3, 0x72, 0x3, 0x72, 0x3, + 0x72, 0x3, 0x72, 0x3, 0x72, 0x3, 0x72, 0x3, 0x72, 0x3, 0x72, 0x3, + 0x72, 0x3, 0x72, 0x3, 0x72, 0x3, 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, + 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, + 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, 0x73, 0x3, 0x74, 0x3, 0x74, 0x3, + 0x75, 0x3, 0x75, 0x3, 0x76, 0x3, 0x76, 0x3, 0x77, 0x3, 0x77, 0x3, + 0x78, 0x3, 0x78, 0x3, 0x79, 0x3, 0x79, 0x3, 0x7a, 0x3, 0x7a, 0x3, + 0x7b, 0x3, 0x7b, 0x3, 0x7c, 0x3, 0x7c, 0x3, 0x7d, 0x3, 0x7d, 0x3, + 0x7d, 0x3, 0x7d, 0x3, 0x7e, 0x3, 0x7e, 0x3, 0x7f, 0x3, 0x7f, 0x5, + 0x7f, 0x63c, 0xa, 0x7f, 0x3, 0x80, 0x3, 0x80, 0x5, 0x80, 0x640, 0xa, + 0x80, 0x3, 0x81, 0x3, 0x81, 0x3, 0x81, 0x7, 0x81, 0x645, 0xa, 0x81, + 0xc, 0x81, 0xe, 0x81, 0x648, 0xb, 0x81, 0x3, 0x82, 0x3, 0x82, 0x6, + 0x82, 0x64c, 0xa, 0x82, 0xd, 0x82, 0xe, 0x82, 0x64d, 0x3, 0x83, 0x3, + 0x83, 0x5, 0x83, 0x652, 0xa, 0x83, 0x3, 0x84, 0x3, 0x84, 0x3, 0x84, + 0x7, 0x84, 0x657, 0xa, 0x84, 0xc, 0x84, 0xe, 0x84, 0x65a, 0xb, 0x84, + 0x3, 0x85, 0x3, 0x85, 0x7, 0x85, 0x65e, 0xa, 0x85, 0xc, 0x85, 0xe, + 0x85, 0x661, 0xb, 0x85, 0x3, 0x86, 0x3, 0x86, 0x7, 0x86, 0x665, 0xa, + 0x86, 0xc, 0x86, 0xe, 0x86, 0x668, 0xb, 0x86, 0x3, 0x87, 0x5, 0x87, + 0x66b, 0xa, 0x87, 0x3, 0x87, 0x6, 0x87, 0x66e, 0xa, 0x87, 0xd, 0x87, + 0xe, 0x87, 0x66f, 0x3, 0x87, 0x3, 0x87, 0x6, 0x87, 0x674, 0xa, 0x87, + 0xd, 0x87, 0xe, 0x87, 0x675, 0x3, 0x88, 0x3, 0x88, 0x3, 0x88, 0x3, + 0x88, 0x6, 0x88, 0x67c, 0xa, 0x88, 0xd, 0x88, 0xe, 0x88, 0x67d, 0x3, + 0x89, 0x3, 0x89, 0x6, 0x89, 0x682, 0xa, 0x89, 0xd, 0x89, 0xe, 0x89, + 0x683, 0x3, 0x8a, 0x5, 0x8a, 0x687, 0xa, 0x8a, 0x3, 0x8a, 0x3, 0x8a, + 0x7, 0x8a, 0x68b, 0xa, 0x8a, 0xc, 0x8a, 0xe, 0x8a, 0x68e, 0xb, 0x8a, + 0x3, 0x8a, 0x5, 0x8a, 0x691, 0xa, 0x8a, 0x3, 0x8b, 0x3, 0x8b, 0x3, + 0x8c, 0x3, 0x8c, 0x5, 0x8c, 0x697, 0xa, 0x8c, 0x3, 0x8d, 0x3, 0x8d, + 0x5, 0x8d, 0x69b, 0xa, 0x8d, 0x3, 0x8e, 0x6, 0x8e, 0x69e, 0xa, 0x8e, + 0xd, 0x8e, 0xe, 0x8e, 0x69f, 0x3, 0x8e, 0x3, 0x8e, 0x3, 0x8f, 0x3, + 0x8f, 0x7, 0x8f, 0x6a6, 0xa, 0x8f, 0xc, 0x8f, 0xe, 0x8f, 0x6a9, 0xb, + 0x8f, 0x3, 0x8f, 0x3, 0x8f, 0x3, 0x90, 0x3, 0x90, 0x3, 0x90, 0x3, + 0x90, 0x3, 0x91, 0x5, 0x91, 0x6b2, 0xa, 0x91, 0x3, 0x91, 0x3, 0x91, + 0x3, 0x91, 0x3, 0x91, 0x7, 0x91, 0x6b8, 0xa, 0x91, 0xc, 0x91, 0xe, + 0x91, 0x6bb, 0xb, 0x91, 0x3, 0x91, 0x3, 0x91, 0x7, 0x91, 0x6bf, 0xa, + 0x91, 0xc, 0x91, 0xe, 0x91, 0x6c2, 0xb, 0x91, 0x3, 0x91, 0x7, 0x91, + 0x6c5, 0xa, 0x91, 0xc, 0x91, 0xe, 0x91, 0x6c8, 0xb, 0x91, 0x3, 0x91, + 0x3, 0x91, 0x3, 0x91, 0x3, 0x91, 0x3, 0x91, 0x3, 0x92, 0x5, 0x92, + 0x6d0, 0xa, 0x92, 0x3, 0x92, 0x3, 0x92, 0x7, 0x92, 0x6d4, 0xa, 0x92, + 0xc, 0x92, 0xe, 0x92, 0x6d7, 0xb, 0x92, 0x3, 0x93, 0x6, 0x93, 0x6da, + 0xa, 0x93, 0xd, 0x93, 0xe, 0x93, 0x6db, 0x3, 0x93, 0x3, 0x93, 0x3, + 0x94, 0x3, 0x94, 0x3, 0x94, 0x3, 0x94, 0x3, 0x95, 0x6, 0x95, 0x6e5, + 0xa, 0x95, 0xd, 0x95, 0xe, 0x95, 0x6e6, 0x3, 0x96, 0x3, 0x96, 0x3, + 0x96, 0x3, 0x96, 0x3, 0x97, 0x7, 0x97, 0x6ee, 0xa, 0x97, 0xc, 0x97, + 0xe, 0x97, 0x6f1, 0xb, 0x97, 0x3, 0x98, 0x3, 0x98, 0x3, 0x98, 0x3, + 0x98, 0x2, 0x2, 0x99, 0x8, 0x3, 0xa, 0x4, 0xc, 0x5, 0xe, 0x6, 0x10, + 0x7, 0x12, 0x8, 0x14, 0x9, 0x16, 0xa, 0x18, 0xb, 0x1a, 0xc, 0x1c, + 0xd, 0x1e, 0xe, 0x20, 0xf, 0x22, 0x10, 0x24, 0x11, 0x26, 0x12, 0x28, + 0x13, 0x2a, 0x14, 0x2c, 0x15, 0x2e, 0x16, 0x30, 0x17, 0x32, 0x18, + 0x34, 0x19, 0x36, 0x1a, 0x38, 0x1b, 0x3a, 0x1c, 0x3c, 0x1d, 0x3e, + 0x1e, 0x40, 0x1f, 0x42, 0x20, 0x44, 0x21, 0x46, 0x22, 0x48, 0x23, + 0x4a, 0x24, 0x4c, 0x25, 0x4e, 0x26, 0x50, 0x27, 0x52, 0x28, 0x54, + 0x29, 0x56, 0x2a, 0x58, 0x2b, 0x5a, 0x2c, 0x5c, 0x2d, 0x5e, 0x2e, + 0x60, 0x2f, 0x62, 0x30, 0x64, 0x31, 0x66, 0x32, 0x68, 0x33, 0x6a, + 0x34, 0x6c, 0x35, 0x6e, 0x36, 0x70, 0x37, 0x72, 0x38, 0x74, 0x39, + 0x76, 0x3a, 0x78, 0x3b, 0x7a, 0x3c, 0x7c, 0x3d, 0x7e, 0x3e, 0x80, + 0x3f, 0x82, 0x40, 0x84, 0x41, 0x86, 0x42, 0x88, 0x43, 0x8a, 0x44, + 0x8c, 0x45, 0x8e, 0x46, 0x90, 0x47, 0x92, 0x48, 0x94, 0x49, 0x96, + 0x4a, 0x98, 0x4b, 0x9a, 0x4c, 0x9c, 0x4d, 0x9e, 0x4e, 0xa0, 0x4f, + 0xa2, 0x50, 0xa4, 0x51, 0xa6, 0x52, 0xa8, 0x53, 0xaa, 0x54, 0xac, + 0x55, 0xae, 0x56, 0xb0, 0x57, 0xb2, 0x58, 0xb4, 0x59, 0xb6, 0x5a, + 0xb8, 0x5b, 0xba, 0x5c, 0xbc, 0x5d, 0xbe, 0x5e, 0xc0, 0x5f, 0xc2, + 0x60, 0xc4, 0x61, 0xc6, 0x62, 0xc8, 0x63, 0xca, 0x64, 0xcc, 0x65, + 0xce, 0x66, 0xd0, 0x67, 0xd2, 0x68, 0xd4, 0x69, 0xd6, 0x6a, 0xd8, + 0x6b, 0xda, 0x6c, 0xdc, 0x6d, 0xde, 0x6e, 0xe0, 0x6f, 0xe2, 0x70, + 0xe4, 0x71, 0xe6, 0x72, 0xe8, 0x73, 0xea, 0x74, 0xec, 0x75, 0xee, + 0x76, 0xf0, 0x77, 0xf2, 0x78, 0xf4, 0x79, 0xf6, 0x7a, 0xf8, 0x7b, + 0xfa, 0x7c, 0xfc, 0x7d, 0xfe, 0x7e, 0x100, 0x2, 0x102, 0x2, 0x104, + 0x2, 0x106, 0x7f, 0x108, 0x80, 0x10a, 0x2, 0x10c, 0x81, 0x10e, 0x82, + 0x110, 0x83, 0x112, 0x84, 0x114, 0x85, 0x116, 0x86, 0x118, 0x87, + 0x11a, 0x2, 0x11c, 0x2, 0x11e, 0x88, 0x120, 0x89, 0x122, 0x8a, 0x124, + 0x8b, 0x126, 0x8c, 0x128, 0x8d, 0x12a, 0x8e, 0x12c, 0x8f, 0x12e, + 0x90, 0x130, 0x91, 0x132, 0x92, 0x134, 0x93, 0x8, 0x2, 0x3, 0x4, + 0x5, 0x6, 0x7, 0xd, 0x4, 0x2, 0xc, 0xc, 0xf, 0xf, 0x5, 0x2, 0xb, + 0xc, 0xf, 0xf, 0x22, 0x22, 0x5, 0x2, 0x43, 0x5c, 0x61, 0x61, 0x63, + 0x7c, 0x4, 0x2, 0x30, 0x30, 0x32, 0x3b, 0x7, 0x2, 0x2c, 0x2d, 0x3c, + 0x3c, 0x60, 0x60, 0x7e, 0x7e, 0x80, 0x80, 0x5, 0x2, 0x32, 0x3b, 0x43, + 0x48, 0x63, 0x68, 0xc, 0x2, 0x23, 0x23, 0x26, 0x28, 0x2c, 0x2d, 0x30, + 0x30, 0x3c, 0x3c, 0x41, 0x41, 0x43, 0x5c, 0x60, 0x7c, 0x7e, 0x7e, + 0x80, 0x80, 0x4, 0x2, 0x2f, 0x2f, 0x32, 0x3b, 0x4, 0x2, 0xb, 0xb, + 0x22, 0x22, 0x3, 0x2, 0x2b, 0x2b, 0x3, 0x2, 0x24, 0x24, 0x2, 0x709, + 0x2, 0x8, 0x3, 0x2, 0x2, 0x2, 0x2, 0xa, 0x3, 0x2, 0x2, 0x2, 0x2, + 0xc, 0x3, 0x2, 0x2, 0x2, 0x2, 0xe, 0x3, 0x2, 0x2, 0x2, 0x2, 0x10, + 0x3, 0x2, 0x2, 0x2, 0x2, 0x12, 0x3, 0x2, 0x2, 0x2, 0x2, 0x14, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x16, 0x3, 0x2, 0x2, 0x2, 0x2, 0x18, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x1a, 0x3, 0x2, 0x2, 0x2, 0x2, 0x1c, 0x3, 0x2, 0x2, + 0x2, 0x2, 0x1e, 0x3, 0x2, 0x2, 0x2, 0x2, 0x20, 0x3, 0x2, 0x2, 0x2, + 0x2, 0x22, 0x3, 0x2, 0x2, 0x2, 0x2, 0x24, 0x3, 0x2, 0x2, 0x2, 0x2, + 0x26, 0x3, 0x2, 0x2, 0x2, 0x2, 0x28, 0x3, 0x2, 0x2, 0x2, 0x2, 0x2a, + 0x3, 0x2, 0x2, 0x2, 0x2, 0x2c, 0x3, 0x2, 0x2, 0x2, 0x2, 0x2e, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x30, 0x3, 0x2, 0x2, 0x2, 0x2, 0x32, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x34, 0x3, 0x2, 0x2, 0x2, 0x2, 0x36, 0x3, 0x2, 0x2, + 0x2, 0x2, 0x38, 0x3, 0x2, 0x2, 0x2, 0x2, 0x3a, 0x3, 0x2, 0x2, 0x2, + 0x2, 0x3c, 0x3, 0x2, 0x2, 0x2, 0x2, 0x3e, 0x3, 0x2, 0x2, 0x2, 0x2, + 0x40, 0x3, 0x2, 0x2, 0x2, 0x2, 0x42, 0x3, 0x2, 0x2, 0x2, 0x2, 0x44, + 0x3, 0x2, 0x2, 0x2, 0x2, 0x46, 0x3, 0x2, 0x2, 0x2, 0x2, 0x48, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x4a, 0x3, 0x2, 0x2, 0x2, 0x2, 0x4c, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x4e, 0x3, 0x2, 0x2, 0x2, 0x2, 0x50, 0x3, 0x2, 0x2, + 0x2, 0x2, 0x52, 0x3, 0x2, 0x2, 0x2, 0x2, 0x54, 0x3, 0x2, 0x2, 0x2, + 0x2, 0x56, 0x3, 0x2, 0x2, 0x2, 0x2, 0x58, 0x3, 0x2, 0x2, 0x2, 0x2, + 0x5a, 0x3, 0x2, 0x2, 0x2, 0x2, 0x5c, 0x3, 0x2, 0x2, 0x2, 0x2, 0x5e, + 0x3, 0x2, 0x2, 0x2, 0x2, 0x60, 0x3, 0x2, 0x2, 0x2, 0x2, 0x62, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x64, 0x3, 0x2, 0x2, 0x2, 0x2, 0x66, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x68, 0x3, 0x2, 0x2, 0x2, 0x2, 0x6a, 0x3, 0x2, 0x2, + 0x2, 0x2, 0x6c, 0x3, 0x2, 0x2, 0x2, 0x2, 0x6e, 0x3, 0x2, 0x2, 0x2, + 0x2, 0x70, 0x3, 0x2, 0x2, 0x2, 0x2, 0x72, 0x3, 0x2, 0x2, 0x2, 0x2, + 0x74, 0x3, 0x2, 0x2, 0x2, 0x2, 0x76, 0x3, 0x2, 0x2, 0x2, 0x2, 0x78, + 0x3, 0x2, 0x2, 0x2, 0x2, 0x7a, 0x3, 0x2, 0x2, 0x2, 0x2, 0x7c, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x7e, 0x3, 0x2, 0x2, 0x2, 0x2, 0x80, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x82, 0x3, 0x2, 0x2, 0x2, 0x2, 0x84, 0x3, 0x2, 0x2, + 0x2, 0x2, 0x86, 0x3, 0x2, 0x2, 0x2, 0x2, 0x88, 0x3, 0x2, 0x2, 0x2, + 0x2, 0x8a, 0x3, 0x2, 0x2, 0x2, 0x2, 0x8c, 0x3, 0x2, 0x2, 0x2, 0x2, + 0x8e, 0x3, 0x2, 0x2, 0x2, 0x2, 0x90, 0x3, 0x2, 0x2, 0x2, 0x2, 0x92, + 0x3, 0x2, 0x2, 0x2, 0x2, 0x94, 0x3, 0x2, 0x2, 0x2, 0x2, 0x96, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x98, 0x3, 0x2, 0x2, 0x2, 0x2, 0x9a, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x9c, 0x3, 0x2, 0x2, 0x2, 0x2, 0x9e, 0x3, 0x2, 0x2, + 0x2, 0x2, 0xa0, 0x3, 0x2, 0x2, 0x2, 0x2, 0xa2, 0x3, 0x2, 0x2, 0x2, + 0x2, 0xa4, 0x3, 0x2, 0x2, 0x2, 0x2, 0xa6, 0x3, 0x2, 0x2, 0x2, 0x2, + 0xa8, 0x3, 0x2, 0x2, 0x2, 0x2, 0xaa, 0x3, 0x2, 0x2, 0x2, 0x2, 0xac, + 0x3, 0x2, 0x2, 0x2, 0x2, 0xae, 0x3, 0x2, 0x2, 0x2, 0x2, 0xb0, 0x3, + 0x2, 0x2, 0x2, 0x2, 0xb2, 0x3, 0x2, 0x2, 0x2, 0x2, 0xb4, 0x3, 0x2, + 0x2, 0x2, 0x2, 0xb6, 0x3, 0x2, 0x2, 0x2, 0x2, 0xb8, 0x3, 0x2, 0x2, + 0x2, 0x2, 0xba, 0x3, 0x2, 0x2, 0x2, 0x2, 0xbc, 0x3, 0x2, 0x2, 0x2, + 0x2, 0xbe, 0x3, 0x2, 0x2, 0x2, 0x2, 0xc0, 0x3, 0x2, 0x2, 0x2, 0x2, + 0xc2, 0x3, 0x2, 0x2, 0x2, 0x2, 0xc4, 0x3, 0x2, 0x2, 0x2, 0x2, 0xc6, + 0x3, 0x2, 0x2, 0x2, 0x2, 0xc8, 0x3, 0x2, 0x2, 0x2, 0x2, 0xca, 0x3, + 0x2, 0x2, 0x2, 0x2, 0xcc, 0x3, 0x2, 0x2, 0x2, 0x2, 0xce, 0x3, 0x2, + 0x2, 0x2, 0x2, 0xd0, 0x3, 0x2, 0x2, 0x2, 0x2, 0xd2, 0x3, 0x2, 0x2, + 0x2, 0x2, 0xd4, 0x3, 0x2, 0x2, 0x2, 0x2, 0xd6, 0x3, 0x2, 0x2, 0x2, + 0x2, 0xd8, 0x3, 0x2, 0x2, 0x2, 0x2, 0xda, 0x3, 0x2, 0x2, 0x2, 0x2, + 0xdc, 0x3, 0x2, 0x2, 0x2, 0x2, 0xde, 0x3, 0x2, 0x2, 0x2, 0x2, 0xe0, + 0x3, 0x2, 0x2, 0x2, 0x2, 0xe2, 0x3, 0x2, 0x2, 0x2, 0x2, 0xe4, 0x3, + 0x2, 0x2, 0x2, 0x2, 0xe6, 0x3, 0x2, 0x2, 0x2, 0x2, 0xe8, 0x3, 0x2, + 0x2, 0x2, 0x2, 0xea, 0x3, 0x2, 0x2, 0x2, 0x2, 0xec, 0x3, 0x2, 0x2, + 0x2, 0x2, 0xee, 0x3, 0x2, 0x2, 0x2, 0x2, 0xf0, 0x3, 0x2, 0x2, 0x2, + 0x2, 0xf2, 0x3, 0x2, 0x2, 0x2, 0x2, 0xf4, 0x3, 0x2, 0x2, 0x2, 0x2, + 0xf6, 0x3, 0x2, 0x2, 0x2, 0x2, 0xf8, 0x3, 0x2, 0x2, 0x2, 0x2, 0xfa, + 0x3, 0x2, 0x2, 0x2, 0x2, 0xfc, 0x3, 0x2, 0x2, 0x2, 0x2, 0xfe, 0x3, + 0x2, 0x2, 0x2, 0x2, 0x106, 0x3, 0x2, 0x2, 0x2, 0x2, 0x108, 0x3, 0x2, + 0x2, 0x2, 0x2, 0x10c, 0x3, 0x2, 0x2, 0x2, 0x2, 0x10e, 0x3, 0x2, 0x2, + 0x2, 0x2, 0x110, 0x3, 0x2, 0x2, 0x2, 0x2, 0x112, 0x3, 0x2, 0x2, 0x2, + 0x2, 0x114, 0x3, 0x2, 0x2, 0x2, 0x2, 0x116, 0x3, 0x2, 0x2, 0x2, 0x2, + 0x118, 0x3, 0x2, 0x2, 0x2, 0x2, 0x11e, 0x3, 0x2, 0x2, 0x2, 0x3, 0x120, + 0x3, 0x2, 0x2, 0x2, 0x3, 0x122, 0x3, 0x2, 0x2, 0x2, 0x3, 0x124, 0x3, + 0x2, 0x2, 0x2, 0x4, 0x126, 0x3, 0x2, 0x2, 0x2, 0x4, 0x128, 0x3, 0x2, + 0x2, 0x2, 0x5, 0x12a, 0x3, 0x2, 0x2, 0x2, 0x5, 0x12c, 0x3, 0x2, 0x2, + 0x2, 0x6, 0x12e, 0x3, 0x2, 0x2, 0x2, 0x6, 0x130, 0x3, 0x2, 0x2, 0x2, + 0x7, 0x132, 0x3, 0x2, 0x2, 0x2, 0x7, 0x134, 0x3, 0x2, 0x2, 0x2, 0x8, + 0x136, 0x3, 0x2, 0x2, 0x2, 0xa, 0x13d, 0x3, 0x2, 0x2, 0x2, 0xc, 0x149, + 0x3, 0x2, 0x2, 0x2, 0xe, 0x153, 0x3, 0x2, 0x2, 0x2, 0x10, 0x159, + 0x3, 0x2, 0x2, 0x2, 0x12, 0x163, 0x3, 0x2, 0x2, 0x2, 0x14, 0x16b, + 0x3, 0x2, 0x2, 0x2, 0x16, 0x171, 0x3, 0x2, 0x2, 0x2, 0x18, 0x178, + 0x3, 0x2, 0x2, 0x2, 0x1a, 0x181, 0x3, 0x2, 0x2, 0x2, 0x1c, 0x190, + 0x3, 0x2, 0x2, 0x2, 0x1e, 0x199, 0x3, 0x2, 0x2, 0x2, 0x20, 0x1a0, + 0x3, 0x2, 0x2, 0x2, 0x22, 0x1ab, 0x3, 0x2, 0x2, 0x2, 0x24, 0x1b3, + 0x3, 0x2, 0x2, 0x2, 0x26, 0x1bf, 0x3, 0x2, 0x2, 0x2, 0x28, 0x1d0, + 0x3, 0x2, 0x2, 0x2, 0x2a, 0x1e0, 0x3, 0x2, 0x2, 0x2, 0x2c, 0x1ec, + 0x3, 0x2, 0x2, 0x2, 0x2e, 0x200, 0x3, 0x2, 0x2, 0x2, 0x30, 0x213, + 0x3, 0x2, 0x2, 0x2, 0x32, 0x21f, 0x3, 0x2, 0x2, 0x2, 0x34, 0x22b, + 0x3, 0x2, 0x2, 0x2, 0x36, 0x238, 0x3, 0x2, 0x2, 0x2, 0x38, 0x245, + 0x3, 0x2, 0x2, 0x2, 0x3a, 0x252, 0x3, 0x2, 0x2, 0x2, 0x3c, 0x254, + 0x3, 0x2, 0x2, 0x2, 0x3e, 0x256, 0x3, 0x2, 0x2, 0x2, 0x40, 0x260, + 0x3, 0x2, 0x2, 0x2, 0x42, 0x265, 0x3, 0x2, 0x2, 0x2, 0x44, 0x26c, + 0x3, 0x2, 0x2, 0x2, 0x46, 0x273, 0x3, 0x2, 0x2, 0x2, 0x48, 0x27e, + 0x3, 0x2, 0x2, 0x2, 0x4a, 0x282, 0x3, 0x2, 0x2, 0x2, 0x4c, 0x28d, + 0x3, 0x2, 0x2, 0x2, 0x4e, 0x292, 0x3, 0x2, 0x2, 0x2, 0x50, 0x295, + 0x3, 0x2, 0x2, 0x2, 0x52, 0x29a, 0x3, 0x2, 0x2, 0x2, 0x54, 0x2a3, + 0x3, 0x2, 0x2, 0x2, 0x56, 0x2a7, 0x3, 0x2, 0x2, 0x2, 0x58, 0x2b2, + 0x3, 0x2, 0x2, 0x2, 0x5a, 0x2bf, 0x3, 0x2, 0x2, 0x2, 0x5c, 0x2cc, + 0x3, 0x2, 0x2, 0x2, 0x5e, 0x2de, 0x3, 0x2, 0x2, 0x2, 0x60, 0x2f6, + 0x3, 0x2, 0x2, 0x2, 0x62, 0x307, 0x3, 0x2, 0x2, 0x2, 0x64, 0x31a, + 0x3, 0x2, 0x2, 0x2, 0x66, 0x324, 0x3, 0x2, 0x2, 0x2, 0x68, 0x331, + 0x3, 0x2, 0x2, 0x2, 0x6a, 0x33e, 0x3, 0x2, 0x2, 0x2, 0x6c, 0x345, + 0x3, 0x2, 0x2, 0x2, 0x6e, 0x34f, 0x3, 0x2, 0x2, 0x2, 0x70, 0x35e, + 0x3, 0x2, 0x2, 0x2, 0x72, 0x363, 0x3, 0x2, 0x2, 0x2, 0x74, 0x36d, + 0x3, 0x2, 0x2, 0x2, 0x76, 0x375, 0x3, 0x2, 0x2, 0x2, 0x78, 0x37a, + 0x3, 0x2, 0x2, 0x2, 0x7a, 0x383, 0x3, 0x2, 0x2, 0x2, 0x7c, 0x387, + 0x3, 0x2, 0x2, 0x2, 0x7e, 0x394, 0x3, 0x2, 0x2, 0x2, 0x80, 0x399, + 0x3, 0x2, 0x2, 0x2, 0x82, 0x39e, 0x3, 0x2, 0x2, 0x2, 0x84, 0x3b4, + 0x3, 0x2, 0x2, 0x2, 0x86, 0x3c9, 0x3, 0x2, 0x2, 0x2, 0x88, 0x3e2, + 0x3, 0x2, 0x2, 0x2, 0x8a, 0x3fa, 0x3, 0x2, 0x2, 0x2, 0x8c, 0x3ff, + 0x3, 0x2, 0x2, 0x2, 0x8e, 0x40d, 0x3, 0x2, 0x2, 0x2, 0x90, 0x414, + 0x3, 0x2, 0x2, 0x2, 0x92, 0x427, 0x3, 0x2, 0x2, 0x2, 0x94, 0x43c, + 0x3, 0x2, 0x2, 0x2, 0x96, 0x441, 0x3, 0x2, 0x2, 0x2, 0x98, 0x44e, + 0x3, 0x2, 0x2, 0x2, 0x9a, 0x453, 0x3, 0x2, 0x2, 0x2, 0x9c, 0x45c, + 0x3, 0x2, 0x2, 0x2, 0x9e, 0x466, 0x3, 0x2, 0x2, 0x2, 0xa0, 0x46e, + 0x3, 0x2, 0x2, 0x2, 0xa2, 0x47a, 0x3, 0x2, 0x2, 0x2, 0xa4, 0x47f, + 0x3, 0x2, 0x2, 0x2, 0xa6, 0x486, 0x3, 0x2, 0x2, 0x2, 0xa8, 0x48b, + 0x3, 0x2, 0x2, 0x2, 0xaa, 0x492, 0x3, 0x2, 0x2, 0x2, 0xac, 0x499, + 0x3, 0x2, 0x2, 0x2, 0xae, 0x4a5, 0x3, 0x2, 0x2, 0x2, 0xb0, 0x4b1, + 0x3, 0x2, 0x2, 0x2, 0xb2, 0x4b8, 0x3, 0x2, 0x2, 0x2, 0xb4, 0x4c5, + 0x3, 0x2, 0x2, 0x2, 0xb6, 0x4d3, 0x3, 0x2, 0x2, 0x2, 0xb8, 0x4df, + 0x3, 0x2, 0x2, 0x2, 0xba, 0x4e9, 0x3, 0x2, 0x2, 0x2, 0xbc, 0x4f4, + 0x3, 0x2, 0x2, 0x2, 0xbe, 0x4fc, 0x3, 0x2, 0x2, 0x2, 0xc0, 0x506, + 0x3, 0x2, 0x2, 0x2, 0xc2, 0x512, 0x3, 0x2, 0x2, 0x2, 0xc4, 0x51d, + 0x3, 0x2, 0x2, 0x2, 0xc6, 0x524, 0x3, 0x2, 0x2, 0x2, 0xc8, 0x531, + 0x3, 0x2, 0x2, 0x2, 0xca, 0x53f, 0x3, 0x2, 0x2, 0x2, 0xcc, 0x54b, + 0x3, 0x2, 0x2, 0x2, 0xce, 0x550, 0x3, 0x2, 0x2, 0x2, 0xd0, 0x563, + 0x3, 0x2, 0x2, 0x2, 0xd2, 0x578, 0x3, 0x2, 0x2, 0x2, 0xd4, 0x583, + 0x3, 0x2, 0x2, 0x2, 0xd6, 0x58d, 0x3, 0x2, 0x2, 0x2, 0xd8, 0x592, + 0x3, 0x2, 0x2, 0x2, 0xda, 0x59b, 0x3, 0x2, 0x2, 0x2, 0xdc, 0x5b1, + 0x3, 0x2, 0x2, 0x2, 0xde, 0x5cb, 0x3, 0x2, 0x2, 0x2, 0xe0, 0x5d0, + 0x3, 0x2, 0x2, 0x2, 0xe2, 0x5e1, 0x3, 0x2, 0x2, 0x2, 0xe4, 0x5f3, + 0x3, 0x2, 0x2, 0x2, 0xe6, 0x603, 0x3, 0x2, 0x2, 0x2, 0xe8, 0x608, + 0x3, 0x2, 0x2, 0x2, 0xea, 0x614, 0x3, 0x2, 0x2, 0x2, 0xec, 0x621, + 0x3, 0x2, 0x2, 0x2, 0xee, 0x623, 0x3, 0x2, 0x2, 0x2, 0xf0, 0x625, + 0x3, 0x2, 0x2, 0x2, 0xf2, 0x627, 0x3, 0x2, 0x2, 0x2, 0xf4, 0x629, + 0x3, 0x2, 0x2, 0x2, 0xf6, 0x62b, 0x3, 0x2, 0x2, 0x2, 0xf8, 0x62d, + 0x3, 0x2, 0x2, 0x2, 0xfa, 0x62f, 0x3, 0x2, 0x2, 0x2, 0xfc, 0x631, + 0x3, 0x2, 0x2, 0x2, 0xfe, 0x633, 0x3, 0x2, 0x2, 0x2, 0x100, 0x637, + 0x3, 0x2, 0x2, 0x2, 0x102, 0x63b, 0x3, 0x2, 0x2, 0x2, 0x104, 0x63f, + 0x3, 0x2, 0x2, 0x2, 0x106, 0x641, 0x3, 0x2, 0x2, 0x2, 0x108, 0x649, + 0x3, 0x2, 0x2, 0x2, 0x10a, 0x651, 0x3, 0x2, 0x2, 0x2, 0x10c, 0x653, + 0x3, 0x2, 0x2, 0x2, 0x10e, 0x65b, 0x3, 0x2, 0x2, 0x2, 0x110, 0x662, + 0x3, 0x2, 0x2, 0x2, 0x112, 0x66a, 0x3, 0x2, 0x2, 0x2, 0x114, 0x677, + 0x3, 0x2, 0x2, 0x2, 0x116, 0x67f, 0x3, 0x2, 0x2, 0x2, 0x118, 0x686, + 0x3, 0x2, 0x2, 0x2, 0x11a, 0x692, 0x3, 0x2, 0x2, 0x2, 0x11c, 0x696, + 0x3, 0x2, 0x2, 0x2, 0x11e, 0x698, 0x3, 0x2, 0x2, 0x2, 0x120, 0x69d, + 0x3, 0x2, 0x2, 0x2, 0x122, 0x6a3, 0x3, 0x2, 0x2, 0x2, 0x124, 0x6ac, + 0x3, 0x2, 0x2, 0x2, 0x126, 0x6b1, 0x3, 0x2, 0x2, 0x2, 0x128, 0x6cf, + 0x3, 0x2, 0x2, 0x2, 0x12a, 0x6d9, 0x3, 0x2, 0x2, 0x2, 0x12c, 0x6df, + 0x3, 0x2, 0x2, 0x2, 0x12e, 0x6e4, 0x3, 0x2, 0x2, 0x2, 0x130, 0x6e8, + 0x3, 0x2, 0x2, 0x2, 0x132, 0x6ef, 0x3, 0x2, 0x2, 0x2, 0x134, 0x6f2, + 0x3, 0x2, 0x2, 0x2, 0x136, 0x137, 0x7, 0x63, 0x2, 0x2, 0x137, 0x138, + 0x7, 0x70, 0x2, 0x2, 0x138, 0x139, 0x7, 0x71, 0x2, 0x2, 0x139, 0x13a, + 0x7, 0x70, 0x2, 0x2, 0x13a, 0x13b, 0x3, 0x2, 0x2, 0x2, 0x13b, 0x13c, + 0x8, 0x2, 0x2, 0x2, 0x13c, 0x9, 0x3, 0x2, 0x2, 0x2, 0x13d, 0x13e, + 0x7, 0x63, 0x2, 0x2, 0x13e, 0x13f, 0x7, 0x70, 0x2, 0x2, 0x13f, 0x140, + 0x7, 0x71, 0x2, 0x2, 0x140, 0x141, 0x7, 0x70, 0x2, 0x2, 0x141, 0x142, + 0x7, 0x7b, 0x2, 0x2, 0x142, 0x143, 0x7, 0x6f, 0x2, 0x2, 0x143, 0x144, + 0x7, 0x71, 0x2, 0x2, 0x144, 0x145, 0x7, 0x77, 0x2, 0x2, 0x145, 0x146, + 0x7, 0x75, 0x2, 0x2, 0x146, 0x147, 0x3, 0x2, 0x2, 0x2, 0x147, 0x148, + 0x8, 0x3, 0x2, 0x2, 0x148, 0xb, 0x3, 0x2, 0x2, 0x2, 0x149, 0x14d, + 0x7, 0x25, 0x2, 0x2, 0x14a, 0x14c, 0xa, 0x2, 0x2, 0x2, 0x14b, 0x14a, + 0x3, 0x2, 0x2, 0x2, 0x14c, 0x14f, 0x3, 0x2, 0x2, 0x2, 0x14d, 0x14b, + 0x3, 0x2, 0x2, 0x2, 0x14d, 0x14e, 0x3, 0x2, 0x2, 0x2, 0x14e, 0x150, + 0x3, 0x2, 0x2, 0x2, 0x14f, 0x14d, 0x3, 0x2, 0x2, 0x2, 0x150, 0x151, + 0x8, 0x4, 0x3, 0x2, 0x151, 0xd, 0x3, 0x2, 0x2, 0x2, 0x152, 0x154, + 0x9, 0x3, 0x2, 0x2, 0x153, 0x152, 0x3, 0x2, 0x2, 0x2, 0x154, 0x155, + 0x3, 0x2, 0x2, 0x2, 0x155, 0x153, 0x3, 0x2, 0x2, 0x2, 0x155, 0x156, + 0x3, 0x2, 0x2, 0x2, 0x156, 0x157, 0x3, 0x2, 0x2, 0x2, 0x157, 0x158, + 0x8, 0x5, 0x3, 0x2, 0x158, 0xf, 0x3, 0x2, 0x2, 0x2, 0x159, 0x15a, + 0x7, 0x6b, 0x2, 0x2, 0x15a, 0x15b, 0x7, 0x70, 0x2, 0x2, 0x15b, 0x15c, + 0x7, 0x65, 0x2, 0x2, 0x15c, 0x15d, 0x7, 0x6e, 0x2, 0x2, 0x15d, 0x15e, + 0x7, 0x77, 0x2, 0x2, 0x15e, 0x15f, 0x7, 0x66, 0x2, 0x2, 0x15f, 0x160, + 0x7, 0x67, 0x2, 0x2, 0x160, 0x161, 0x3, 0x2, 0x2, 0x2, 0x161, 0x162, + 0x8, 0x6, 0x4, 0x2, 0x162, 0x11, 0x3, 0x2, 0x2, 0x2, 0x163, 0x164, + 0x7, 0x68, 0x2, 0x2, 0x164, 0x165, 0x7, 0x67, 0x2, 0x2, 0x165, 0x166, + 0x7, 0x63, 0x2, 0x2, 0x166, 0x167, 0x7, 0x76, 0x2, 0x2, 0x167, 0x168, + 0x7, 0x77, 0x2, 0x2, 0x168, 0x169, 0x7, 0x74, 0x2, 0x2, 0x169, 0x16a, + 0x7, 0x67, 0x2, 0x2, 0x16a, 0x13, 0x3, 0x2, 0x2, 0x2, 0x16b, 0x16c, + 0x7, 0x76, 0x2, 0x2, 0x16c, 0x16d, 0x7, 0x63, 0x2, 0x2, 0x16d, 0x16e, + 0x7, 0x64, 0x2, 0x2, 0x16e, 0x16f, 0x7, 0x6e, 0x2, 0x2, 0x16f, 0x170, + 0x7, 0x67, 0x2, 0x2, 0x170, 0x15, 0x3, 0x2, 0x2, 0x2, 0x171, 0x172, + 0x7, 0x75, 0x2, 0x2, 0x172, 0x173, 0x7, 0x65, 0x2, 0x2, 0x173, 0x174, + 0x7, 0x74, 0x2, 0x2, 0x174, 0x175, 0x7, 0x6b, 0x2, 0x2, 0x175, 0x176, + 0x7, 0x72, 0x2, 0x2, 0x176, 0x177, 0x7, 0x76, 0x2, 0x2, 0x177, 0x17, + 0x3, 0x2, 0x2, 0x2, 0x178, 0x179, 0x7, 0x6e, 0x2, 0x2, 0x179, 0x17a, + 0x7, 0x63, 0x2, 0x2, 0x17a, 0x17b, 0x7, 0x70, 0x2, 0x2, 0x17b, 0x17c, + 0x7, 0x69, 0x2, 0x2, 0x17c, 0x17d, 0x7, 0x77, 0x2, 0x2, 0x17d, 0x17e, + 0x7, 0x63, 0x2, 0x2, 0x17e, 0x17f, 0x7, 0x69, 0x2, 0x2, 0x17f, 0x180, + 0x7, 0x67, 0x2, 0x2, 0x180, 0x19, 0x3, 0x2, 0x2, 0x2, 0x181, 0x182, + 0x7, 0x6e, 0x2, 0x2, 0x182, 0x183, 0x7, 0x63, 0x2, 0x2, 0x183, 0x184, + 0x7, 0x70, 0x2, 0x2, 0x184, 0x185, 0x7, 0x69, 0x2, 0x2, 0x185, 0x186, + 0x7, 0x77, 0x2, 0x2, 0x186, 0x187, 0x7, 0x63, 0x2, 0x2, 0x187, 0x188, + 0x7, 0x69, 0x2, 0x2, 0x188, 0x189, 0x7, 0x67, 0x2, 0x2, 0x189, 0x18a, + 0x7, 0x75, 0x2, 0x2, 0x18a, 0x18b, 0x7, 0x7b, 0x2, 0x2, 0x18b, 0x18c, + 0x7, 0x75, 0x2, 0x2, 0x18c, 0x18d, 0x7, 0x76, 0x2, 0x2, 0x18d, 0x18e, + 0x7, 0x67, 0x2, 0x2, 0x18e, 0x18f, 0x7, 0x6f, 0x2, 0x2, 0x18f, 0x1b, + 0x3, 0x2, 0x2, 0x2, 0x190, 0x191, 0x7, 0x75, 0x2, 0x2, 0x191, 0x192, + 0x7, 0x77, 0x2, 0x2, 0x192, 0x193, 0x7, 0x64, 0x2, 0x2, 0x193, 0x194, + 0x7, 0x76, 0x2, 0x2, 0x194, 0x195, 0x7, 0x63, 0x2, 0x2, 0x195, 0x196, + 0x7, 0x64, 0x2, 0x2, 0x196, 0x197, 0x7, 0x6e, 0x2, 0x2, 0x197, 0x198, + 0x7, 0x67, 0x2, 0x2, 0x198, 0x1d, 0x3, 0x2, 0x2, 0x2, 0x199, 0x19a, + 0x7, 0x6e, 0x2, 0x2, 0x19a, 0x19b, 0x7, 0x71, 0x2, 0x2, 0x19b, 0x19c, + 0x7, 0x71, 0x2, 0x2, 0x19c, 0x19d, 0x7, 0x6d, 0x2, 0x2, 0x19d, 0x19e, + 0x7, 0x77, 0x2, 0x2, 0x19e, 0x19f, 0x7, 0x72, 0x2, 0x2, 0x19f, 0x1f, + 0x3, 0x2, 0x2, 0x2, 0x1a0, 0x1a1, 0x7, 0x6e, 0x2, 0x2, 0x1a1, 0x1a2, + 0x7, 0x71, 0x2, 0x2, 0x1a2, 0x1a3, 0x7, 0x71, 0x2, 0x2, 0x1a3, 0x1a4, + 0x7, 0x6d, 0x2, 0x2, 0x1a4, 0x1a5, 0x7, 0x77, 0x2, 0x2, 0x1a5, 0x1a6, + 0x7, 0x72, 0x2, 0x2, 0x1a6, 0x1a7, 0x7, 0x68, 0x2, 0x2, 0x1a7, 0x1a8, + 0x7, 0x6e, 0x2, 0x2, 0x1a8, 0x1a9, 0x7, 0x63, 0x2, 0x2, 0x1a9, 0x1aa, + 0x7, 0x69, 0x2, 0x2, 0x1aa, 0x21, 0x3, 0x2, 0x2, 0x2, 0x1ab, 0x1ac, + 0x7, 0x30, 0x2, 0x2, 0x1ac, 0x1ad, 0x7, 0x70, 0x2, 0x2, 0x1ad, 0x1ae, + 0x7, 0x71, 0x2, 0x2, 0x1ae, 0x1af, 0x7, 0x76, 0x2, 0x2, 0x1af, 0x1b0, + 0x7, 0x66, 0x2, 0x2, 0x1b0, 0x1b1, 0x7, 0x67, 0x2, 0x2, 0x1b1, 0x1b2, + 0x7, 0x68, 0x2, 0x2, 0x1b2, 0x23, 0x3, 0x2, 0x2, 0x2, 0x1b3, 0x1b4, + 0x7, 0x54, 0x2, 0x2, 0x1b4, 0x1b5, 0x7, 0x6b, 0x2, 0x2, 0x1b5, 0x1b6, + 0x7, 0x69, 0x2, 0x2, 0x1b6, 0x1b7, 0x7, 0x6a, 0x2, 0x2, 0x1b7, 0x1b8, + 0x7, 0x76, 0x2, 0x2, 0x1b8, 0x1b9, 0x7, 0x56, 0x2, 0x2, 0x1b9, 0x1ba, + 0x7, 0x71, 0x2, 0x2, 0x1ba, 0x1bb, 0x7, 0x4e, 0x2, 0x2, 0x1bb, 0x1bc, + 0x7, 0x67, 0x2, 0x2, 0x1bc, 0x1bd, 0x7, 0x68, 0x2, 0x2, 0x1bd, 0x1be, + 0x7, 0x76, 0x2, 0x2, 0x1be, 0x25, 0x3, 0x2, 0x2, 0x2, 0x1bf, 0x1c0, + 0x7, 0x4b, 0x2, 0x2, 0x1c0, 0x1c1, 0x7, 0x69, 0x2, 0x2, 0x1c1, 0x1c2, + 0x7, 0x70, 0x2, 0x2, 0x1c2, 0x1c3, 0x7, 0x71, 0x2, 0x2, 0x1c3, 0x1c4, + 0x7, 0x74, 0x2, 0x2, 0x1c4, 0x1c5, 0x7, 0x67, 0x2, 0x2, 0x1c5, 0x1c6, + 0x7, 0x44, 0x2, 0x2, 0x1c6, 0x1c7, 0x7, 0x63, 0x2, 0x2, 0x1c7, 0x1c8, + 0x7, 0x75, 0x2, 0x2, 0x1c8, 0x1c9, 0x7, 0x67, 0x2, 0x2, 0x1c9, 0x1ca, + 0x7, 0x49, 0x2, 0x2, 0x1ca, 0x1cb, 0x7, 0x6e, 0x2, 0x2, 0x1cb, 0x1cc, + 0x7, 0x7b, 0x2, 0x2, 0x1cc, 0x1cd, 0x7, 0x72, 0x2, 0x2, 0x1cd, 0x1ce, + 0x7, 0x6a, 0x2, 0x2, 0x1ce, 0x1cf, 0x7, 0x75, 0x2, 0x2, 0x1cf, 0x27, + 0x3, 0x2, 0x2, 0x2, 0x1d0, 0x1d1, 0x7, 0x4b, 0x2, 0x2, 0x1d1, 0x1d2, + 0x7, 0x69, 0x2, 0x2, 0x1d2, 0x1d3, 0x7, 0x70, 0x2, 0x2, 0x1d3, 0x1d4, + 0x7, 0x71, 0x2, 0x2, 0x1d4, 0x1d5, 0x7, 0x74, 0x2, 0x2, 0x1d5, 0x1d6, + 0x7, 0x67, 0x2, 0x2, 0x1d6, 0x1d7, 0x7, 0x4e, 0x2, 0x2, 0x1d7, 0x1d8, + 0x7, 0x6b, 0x2, 0x2, 0x1d8, 0x1d9, 0x7, 0x69, 0x2, 0x2, 0x1d9, 0x1da, + 0x7, 0x63, 0x2, 0x2, 0x1da, 0x1db, 0x7, 0x76, 0x2, 0x2, 0x1db, 0x1dc, + 0x7, 0x77, 0x2, 0x2, 0x1dc, 0x1dd, 0x7, 0x74, 0x2, 0x2, 0x1dd, 0x1de, + 0x7, 0x67, 0x2, 0x2, 0x1de, 0x1df, 0x7, 0x75, 0x2, 0x2, 0x1df, 0x29, + 0x3, 0x2, 0x2, 0x2, 0x1e0, 0x1e1, 0x7, 0x4b, 0x2, 0x2, 0x1e1, 0x1e2, + 0x7, 0x69, 0x2, 0x2, 0x1e2, 0x1e3, 0x7, 0x70, 0x2, 0x2, 0x1e3, 0x1e4, + 0x7, 0x71, 0x2, 0x2, 0x1e4, 0x1e5, 0x7, 0x74, 0x2, 0x2, 0x1e5, 0x1e6, + 0x7, 0x67, 0x2, 0x2, 0x1e6, 0x1e7, 0x7, 0x4f, 0x2, 0x2, 0x1e7, 0x1e8, + 0x7, 0x63, 0x2, 0x2, 0x1e8, 0x1e9, 0x7, 0x74, 0x2, 0x2, 0x1e9, 0x1ea, + 0x7, 0x6d, 0x2, 0x2, 0x1ea, 0x1eb, 0x7, 0x75, 0x2, 0x2, 0x1eb, 0x2b, + 0x3, 0x2, 0x2, 0x2, 0x1ec, 0x1ed, 0x7, 0x57, 0x2, 0x2, 0x1ed, 0x1ee, + 0x7, 0x75, 0x2, 0x2, 0x1ee, 0x1ef, 0x7, 0x67, 0x2, 0x2, 0x1ef, 0x1f0, + 0x7, 0x4f, 0x2, 0x2, 0x1f0, 0x1f1, 0x7, 0x63, 0x2, 0x2, 0x1f1, 0x1f2, + 0x7, 0x74, 0x2, 0x2, 0x1f2, 0x1f3, 0x7, 0x6d, 0x2, 0x2, 0x1f3, 0x1f4, + 0x7, 0x48, 0x2, 0x2, 0x1f4, 0x1f5, 0x7, 0x6b, 0x2, 0x2, 0x1f5, 0x1f6, + 0x7, 0x6e, 0x2, 0x2, 0x1f6, 0x1f7, 0x7, 0x76, 0x2, 0x2, 0x1f7, 0x1f8, + 0x7, 0x67, 0x2, 0x2, 0x1f8, 0x1f9, 0x7, 0x74, 0x2, 0x2, 0x1f9, 0x1fa, + 0x7, 0x6b, 0x2, 0x2, 0x1fa, 0x1fb, 0x7, 0x70, 0x2, 0x2, 0x1fb, 0x1fc, + 0x7, 0x69, 0x2, 0x2, 0x1fc, 0x1fd, 0x7, 0x55, 0x2, 0x2, 0x1fd, 0x1fe, + 0x7, 0x67, 0x2, 0x2, 0x1fe, 0x1ff, 0x7, 0x76, 0x2, 0x2, 0x1ff, 0x2d, + 0x3, 0x2, 0x2, 0x2, 0x200, 0x201, 0x7, 0x4f, 0x2, 0x2, 0x201, 0x202, + 0x7, 0x63, 0x2, 0x2, 0x202, 0x203, 0x7, 0x74, 0x2, 0x2, 0x203, 0x204, + 0x7, 0x6d, 0x2, 0x2, 0x204, 0x205, 0x7, 0x43, 0x2, 0x2, 0x205, 0x206, + 0x7, 0x76, 0x2, 0x2, 0x206, 0x207, 0x7, 0x76, 0x2, 0x2, 0x207, 0x208, + 0x7, 0x63, 0x2, 0x2, 0x208, 0x209, 0x7, 0x65, 0x2, 0x2, 0x209, 0x20a, + 0x7, 0x6a, 0x2, 0x2, 0x20a, 0x20b, 0x7, 0x6f, 0x2, 0x2, 0x20b, 0x20c, + 0x7, 0x67, 0x2, 0x2, 0x20c, 0x20d, 0x7, 0x70, 0x2, 0x2, 0x20d, 0x20e, + 0x7, 0x76, 0x2, 0x2, 0x20e, 0x20f, 0x7, 0x56, 0x2, 0x2, 0x20f, 0x210, + 0x7, 0x7b, 0x2, 0x2, 0x210, 0x211, 0x7, 0x72, 0x2, 0x2, 0x211, 0x212, + 0x7, 0x67, 0x2, 0x2, 0x212, 0x2f, 0x3, 0x2, 0x2, 0x2, 0x213, 0x214, + 0x7, 0x67, 0x2, 0x2, 0x214, 0x215, 0x7, 0x7a, 0x2, 0x2, 0x215, 0x216, + 0x7, 0x65, 0x2, 0x2, 0x216, 0x217, 0x7, 0x6e, 0x2, 0x2, 0x217, 0x218, + 0x7, 0x77, 0x2, 0x2, 0x218, 0x219, 0x7, 0x66, 0x2, 0x2, 0x219, 0x21a, + 0x7, 0x67, 0x2, 0x2, 0x21a, 0x21b, 0x7, 0x46, 0x2, 0x2, 0x21b, 0x21c, + 0x7, 0x48, 0x2, 0x2, 0x21c, 0x21d, 0x7, 0x4e, 0x2, 0x2, 0x21d, 0x21e, + 0x7, 0x56, 0x2, 0x2, 0x21e, 0x31, 0x3, 0x2, 0x2, 0x2, 0x21f, 0x220, + 0x7, 0x6b, 0x2, 0x2, 0x220, 0x221, 0x7, 0x70, 0x2, 0x2, 0x221, 0x222, + 0x7, 0x65, 0x2, 0x2, 0x222, 0x223, 0x7, 0x6e, 0x2, 0x2, 0x223, 0x224, + 0x7, 0x77, 0x2, 0x2, 0x224, 0x225, 0x7, 0x66, 0x2, 0x2, 0x225, 0x226, + 0x7, 0x67, 0x2, 0x2, 0x226, 0x227, 0x7, 0x46, 0x2, 0x2, 0x227, 0x228, + 0x7, 0x48, 0x2, 0x2, 0x228, 0x229, 0x7, 0x4e, 0x2, 0x2, 0x229, 0x22a, + 0x7, 0x56, 0x2, 0x2, 0x22a, 0x33, 0x3, 0x2, 0x2, 0x2, 0x22b, 0x22c, + 0x7, 0x67, 0x2, 0x2, 0x22c, 0x22d, 0x7, 0x7a, 0x2, 0x2, 0x22d, 0x22e, + 0x7, 0x65, 0x2, 0x2, 0x22e, 0x22f, 0x7, 0x6e, 0x2, 0x2, 0x22f, 0x230, + 0x7, 0x77, 0x2, 0x2, 0x230, 0x231, 0x7, 0x66, 0x2, 0x2, 0x231, 0x232, + 0x7, 0x67, 0x2, 0x2, 0x232, 0x233, 0x7, 0x61, 0x2, 0x2, 0x233, 0x234, + 0x7, 0x66, 0x2, 0x2, 0x234, 0x235, 0x7, 0x68, 0x2, 0x2, 0x235, 0x236, + 0x7, 0x6e, 0x2, 0x2, 0x236, 0x237, 0x7, 0x76, 0x2, 0x2, 0x237, 0x35, + 0x3, 0x2, 0x2, 0x2, 0x238, 0x239, 0x7, 0x6b, 0x2, 0x2, 0x239, 0x23a, + 0x7, 0x70, 0x2, 0x2, 0x23a, 0x23b, 0x7, 0x65, 0x2, 0x2, 0x23b, 0x23c, + 0x7, 0x6e, 0x2, 0x2, 0x23c, 0x23d, 0x7, 0x77, 0x2, 0x2, 0x23d, 0x23e, + 0x7, 0x66, 0x2, 0x2, 0x23e, 0x23f, 0x7, 0x67, 0x2, 0x2, 0x23f, 0x240, + 0x7, 0x61, 0x2, 0x2, 0x240, 0x241, 0x7, 0x66, 0x2, 0x2, 0x241, 0x242, + 0x7, 0x68, 0x2, 0x2, 0x242, 0x243, 0x7, 0x6e, 0x2, 0x2, 0x243, 0x244, + 0x7, 0x76, 0x2, 0x2, 0x244, 0x37, 0x3, 0x2, 0x2, 0x2, 0x245, 0x246, + 0x7, 0x77, 0x2, 0x2, 0x246, 0x247, 0x7, 0x75, 0x2, 0x2, 0x247, 0x248, + 0x7, 0x67, 0x2, 0x2, 0x248, 0x249, 0x7, 0x47, 0x2, 0x2, 0x249, 0x24a, + 0x7, 0x7a, 0x2, 0x2, 0x24a, 0x24b, 0x7, 0x76, 0x2, 0x2, 0x24b, 0x24c, + 0x7, 0x67, 0x2, 0x2, 0x24c, 0x24d, 0x7, 0x70, 0x2, 0x2, 0x24d, 0x24e, + 0x7, 0x75, 0x2, 0x2, 0x24e, 0x24f, 0x7, 0x6b, 0x2, 0x2, 0x24f, 0x250, + 0x7, 0x71, 0x2, 0x2, 0x250, 0x251, 0x7, 0x70, 0x2, 0x2, 0x251, 0x39, + 0x3, 0x2, 0x2, 0x2, 0x252, 0x253, 0x7, 0x3e, 0x2, 0x2, 0x253, 0x3b, + 0x3, 0x2, 0x2, 0x2, 0x254, 0x255, 0x7, 0x40, 0x2, 0x2, 0x255, 0x3d, + 0x3, 0x2, 0x2, 0x2, 0x256, 0x257, 0x7, 0x67, 0x2, 0x2, 0x257, 0x258, + 0x7, 0x70, 0x2, 0x2, 0x258, 0x259, 0x7, 0x77, 0x2, 0x2, 0x259, 0x25a, + 0x7, 0x6f, 0x2, 0x2, 0x25a, 0x25b, 0x7, 0x67, 0x2, 0x2, 0x25b, 0x25c, + 0x7, 0x74, 0x2, 0x2, 0x25c, 0x25d, 0x7, 0x63, 0x2, 0x2, 0x25d, 0x25e, + 0x7, 0x76, 0x2, 0x2, 0x25e, 0x25f, 0x7, 0x67, 0x2, 0x2, 0x25f, 0x3f, + 0x3, 0x2, 0x2, 0x2, 0x260, 0x261, 0x7, 0x67, 0x2, 0x2, 0x261, 0x262, + 0x7, 0x70, 0x2, 0x2, 0x262, 0x263, 0x7, 0x77, 0x2, 0x2, 0x263, 0x264, + 0x7, 0x6f, 0x2, 0x2, 0x264, 0x41, 0x3, 0x2, 0x2, 0x2, 0x265, 0x266, + 0x7, 0x67, 0x2, 0x2, 0x266, 0x267, 0x7, 0x7a, 0x2, 0x2, 0x267, 0x268, + 0x7, 0x65, 0x2, 0x2, 0x268, 0x269, 0x7, 0x67, 0x2, 0x2, 0x269, 0x26a, + 0x7, 0x72, 0x2, 0x2, 0x26a, 0x26b, 0x7, 0x76, 0x2, 0x2, 0x26b, 0x43, + 0x3, 0x2, 0x2, 0x2, 0x26c, 0x26d, 0x7, 0x6b, 0x2, 0x2, 0x26d, 0x26e, + 0x7, 0x69, 0x2, 0x2, 0x26e, 0x26f, 0x7, 0x70, 0x2, 0x2, 0x26f, 0x270, + 0x7, 0x71, 0x2, 0x2, 0x270, 0x271, 0x7, 0x74, 0x2, 0x2, 0x271, 0x272, + 0x7, 0x67, 0x2, 0x2, 0x272, 0x45, 0x3, 0x2, 0x2, 0x2, 0x273, 0x274, + 0x7, 0x75, 0x2, 0x2, 0x274, 0x275, 0x7, 0x77, 0x2, 0x2, 0x275, 0x276, + 0x7, 0x64, 0x2, 0x2, 0x276, 0x277, 0x7, 0x75, 0x2, 0x2, 0x277, 0x278, + 0x7, 0x76, 0x2, 0x2, 0x278, 0x279, 0x7, 0x6b, 0x2, 0x2, 0x279, 0x27a, + 0x7, 0x76, 0x2, 0x2, 0x27a, 0x27b, 0x7, 0x77, 0x2, 0x2, 0x27b, 0x27c, + 0x7, 0x76, 0x2, 0x2, 0x27c, 0x27d, 0x7, 0x67, 0x2, 0x2, 0x27d, 0x47, + 0x3, 0x2, 0x2, 0x2, 0x27e, 0x27f, 0x7, 0x75, 0x2, 0x2, 0x27f, 0x280, + 0x7, 0x77, 0x2, 0x2, 0x280, 0x281, 0x7, 0x64, 0x2, 0x2, 0x281, 0x49, + 0x3, 0x2, 0x2, 0x2, 0x282, 0x283, 0x7, 0x74, 0x2, 0x2, 0x283, 0x284, + 0x7, 0x67, 0x2, 0x2, 0x284, 0x285, 0x7, 0x78, 0x2, 0x2, 0x285, 0x286, + 0x7, 0x67, 0x2, 0x2, 0x286, 0x287, 0x7, 0x74, 0x2, 0x2, 0x287, 0x288, + 0x7, 0x75, 0x2, 0x2, 0x288, 0x289, 0x7, 0x67, 0x2, 0x2, 0x289, 0x28a, + 0x7, 0x75, 0x2, 0x2, 0x28a, 0x28b, 0x7, 0x77, 0x2, 0x2, 0x28b, 0x28c, + 0x7, 0x64, 0x2, 0x2, 0x28c, 0x4b, 0x3, 0x2, 0x2, 0x2, 0x28d, 0x28e, + 0x7, 0x74, 0x2, 0x2, 0x28e, 0x28f, 0x7, 0x75, 0x2, 0x2, 0x28f, 0x290, + 0x7, 0x77, 0x2, 0x2, 0x290, 0x291, 0x7, 0x64, 0x2, 0x2, 0x291, 0x4d, + 0x3, 0x2, 0x2, 0x2, 0x292, 0x293, 0x7, 0x64, 0x2, 0x2, 0x293, 0x294, + 0x7, 0x7b, 0x2, 0x2, 0x294, 0x4f, 0x3, 0x2, 0x2, 0x2, 0x295, 0x296, + 0x7, 0x68, 0x2, 0x2, 0x296, 0x297, 0x7, 0x74, 0x2, 0x2, 0x297, 0x298, + 0x7, 0x71, 0x2, 0x2, 0x298, 0x299, 0x7, 0x6f, 0x2, 0x2, 0x299, 0x51, + 0x3, 0x2, 0x2, 0x2, 0x29a, 0x29b, 0x7, 0x72, 0x2, 0x2, 0x29b, 0x29c, + 0x7, 0x71, 0x2, 0x2, 0x29c, 0x29d, 0x7, 0x75, 0x2, 0x2, 0x29d, 0x29e, + 0x7, 0x6b, 0x2, 0x2, 0x29e, 0x29f, 0x7, 0x76, 0x2, 0x2, 0x29f, 0x2a0, + 0x7, 0x6b, 0x2, 0x2, 0x2a0, 0x2a1, 0x7, 0x71, 0x2, 0x2, 0x2a1, 0x2a2, + 0x7, 0x70, 0x2, 0x2, 0x2a2, 0x53, 0x3, 0x2, 0x2, 0x2, 0x2a3, 0x2a4, + 0x7, 0x72, 0x2, 0x2, 0x2a4, 0x2a5, 0x7, 0x71, 0x2, 0x2, 0x2a5, 0x2a6, + 0x7, 0x75, 0x2, 0x2, 0x2a6, 0x55, 0x3, 0x2, 0x2, 0x2, 0x2a7, 0x2a8, + 0x7, 0x72, 0x2, 0x2, 0x2a8, 0x2a9, 0x7, 0x63, 0x2, 0x2, 0x2a9, 0x2aa, + 0x7, 0x74, 0x2, 0x2, 0x2aa, 0x2ab, 0x7, 0x63, 0x2, 0x2, 0x2ab, 0x2ac, + 0x7, 0x6f, 0x2, 0x2, 0x2ac, 0x2ad, 0x7, 0x67, 0x2, 0x2, 0x2ad, 0x2ae, + 0x7, 0x76, 0x2, 0x2, 0x2ae, 0x2af, 0x7, 0x67, 0x2, 0x2, 0x2af, 0x2b0, + 0x7, 0x74, 0x2, 0x2, 0x2b0, 0x2b1, 0x7, 0x75, 0x2, 0x2, 0x2b1, 0x57, + 0x3, 0x2, 0x2, 0x2, 0x2b2, 0x2b3, 0x7, 0x68, 0x2, 0x2, 0x2b3, 0x2b4, + 0x7, 0x67, 0x2, 0x2, 0x2b4, 0x2b5, 0x7, 0x63, 0x2, 0x2, 0x2b5, 0x2b6, + 0x7, 0x76, 0x2, 0x2, 0x2b6, 0x2b7, 0x7, 0x77, 0x2, 0x2, 0x2b7, 0x2b8, + 0x7, 0x74, 0x2, 0x2, 0x2b8, 0x2b9, 0x7, 0x67, 0x2, 0x2, 0x2b9, 0x2ba, + 0x7, 0x50, 0x2, 0x2, 0x2ba, 0x2bb, 0x7, 0x63, 0x2, 0x2, 0x2bb, 0x2bc, + 0x7, 0x6f, 0x2, 0x2, 0x2bc, 0x2bd, 0x7, 0x67, 0x2, 0x2, 0x2bd, 0x2be, + 0x7, 0x75, 0x2, 0x2, 0x2be, 0x59, 0x3, 0x2, 0x2, 0x2, 0x2bf, 0x2c0, + 0x7, 0x65, 0x2, 0x2, 0x2c0, 0x2c1, 0x7, 0x78, 0x2, 0x2, 0x2c1, 0x2c2, + 0x7, 0x52, 0x2, 0x2, 0x2c2, 0x2c3, 0x7, 0x63, 0x2, 0x2, 0x2c3, 0x2c4, + 0x7, 0x74, 0x2, 0x2, 0x2c4, 0x2c5, 0x7, 0x63, 0x2, 0x2, 0x2c5, 0x2c6, + 0x7, 0x6f, 0x2, 0x2, 0x2c6, 0x2c7, 0x7, 0x67, 0x2, 0x2, 0x2c7, 0x2c8, + 0x7, 0x76, 0x2, 0x2, 0x2c8, 0x2c9, 0x7, 0x67, 0x2, 0x2, 0x2c9, 0x2ca, + 0x7, 0x74, 0x2, 0x2, 0x2ca, 0x2cb, 0x7, 0x75, 0x2, 0x2, 0x2cb, 0x5b, + 0x3, 0x2, 0x2, 0x2, 0x2cc, 0x2cd, 0x7, 0x48, 0x2, 0x2, 0x2cd, 0x2ce, + 0x7, 0x67, 0x2, 0x2, 0x2ce, 0x2cf, 0x7, 0x63, 0x2, 0x2, 0x2cf, 0x2d0, + 0x7, 0x76, 0x2, 0x2, 0x2d0, 0x2d1, 0x7, 0x57, 0x2, 0x2, 0x2d1, 0x2d2, + 0x7, 0x4b, 0x2, 0x2, 0x2d2, 0x2d3, 0x7, 0x4e, 0x2, 0x2, 0x2d3, 0x2d4, + 0x7, 0x63, 0x2, 0x2, 0x2d4, 0x2d5, 0x7, 0x64, 0x2, 0x2, 0x2d5, 0x2d6, + 0x7, 0x67, 0x2, 0x2, 0x2d6, 0x2d7, 0x7, 0x6e, 0x2, 0x2, 0x2d7, 0x2d8, + 0x7, 0x50, 0x2, 0x2, 0x2d8, 0x2d9, 0x7, 0x63, 0x2, 0x2, 0x2d9, 0x2da, + 0x7, 0x6f, 0x2, 0x2, 0x2da, 0x2db, 0x7, 0x67, 0x2, 0x2, 0x2db, 0x2dc, + 0x7, 0x4b, 0x2, 0x2, 0x2dc, 0x2dd, 0x7, 0x46, 0x2, 0x2, 0x2dd, 0x5d, + 0x3, 0x2, 0x2, 0x2, 0x2de, 0x2df, 0x7, 0x48, 0x2, 0x2, 0x2df, 0x2e0, + 0x7, 0x67, 0x2, 0x2, 0x2e0, 0x2e1, 0x7, 0x63, 0x2, 0x2, 0x2e1, 0x2e2, + 0x7, 0x76, 0x2, 0x2, 0x2e2, 0x2e3, 0x7, 0x57, 0x2, 0x2, 0x2e3, 0x2e4, + 0x7, 0x4b, 0x2, 0x2, 0x2e4, 0x2e5, 0x7, 0x56, 0x2, 0x2, 0x2e5, 0x2e6, + 0x7, 0x71, 0x2, 0x2, 0x2e6, 0x2e7, 0x7, 0x71, 0x2, 0x2, 0x2e7, 0x2e8, + 0x7, 0x6e, 0x2, 0x2, 0x2e8, 0x2e9, 0x7, 0x76, 0x2, 0x2, 0x2e9, 0x2ea, + 0x7, 0x6b, 0x2, 0x2, 0x2ea, 0x2eb, 0x7, 0x72, 0x2, 0x2, 0x2eb, 0x2ec, + 0x7, 0x56, 0x2, 0x2, 0x2ec, 0x2ed, 0x7, 0x67, 0x2, 0x2, 0x2ed, 0x2ee, + 0x7, 0x7a, 0x2, 0x2, 0x2ee, 0x2ef, 0x7, 0x76, 0x2, 0x2, 0x2ef, 0x2f0, + 0x7, 0x50, 0x2, 0x2, 0x2f0, 0x2f1, 0x7, 0x63, 0x2, 0x2, 0x2f1, 0x2f2, + 0x7, 0x6f, 0x2, 0x2, 0x2f2, 0x2f3, 0x7, 0x67, 0x2, 0x2, 0x2f3, 0x2f4, + 0x7, 0x4b, 0x2, 0x2, 0x2f4, 0x2f5, 0x7, 0x46, 0x2, 0x2, 0x2f5, 0x5f, + 0x3, 0x2, 0x2, 0x2, 0x2f6, 0x2f7, 0x7, 0x55, 0x2, 0x2, 0x2f7, 0x2f8, + 0x7, 0x63, 0x2, 0x2, 0x2f8, 0x2f9, 0x7, 0x6f, 0x2, 0x2, 0x2f9, 0x2fa, + 0x7, 0x72, 0x2, 0x2, 0x2fa, 0x2fb, 0x7, 0x6e, 0x2, 0x2, 0x2fb, 0x2fc, + 0x7, 0x67, 0x2, 0x2, 0x2fc, 0x2fd, 0x7, 0x56, 0x2, 0x2, 0x2fd, 0x2fe, + 0x7, 0x67, 0x2, 0x2, 0x2fe, 0x2ff, 0x7, 0x7a, 0x2, 0x2, 0x2ff, 0x300, + 0x7, 0x76, 0x2, 0x2, 0x300, 0x301, 0x7, 0x50, 0x2, 0x2, 0x301, 0x302, + 0x7, 0x63, 0x2, 0x2, 0x302, 0x303, 0x7, 0x6f, 0x2, 0x2, 0x303, 0x304, + 0x7, 0x67, 0x2, 0x2, 0x304, 0x305, 0x7, 0x4b, 0x2, 0x2, 0x305, 0x306, + 0x7, 0x46, 0x2, 0x2, 0x306, 0x61, 0x3, 0x2, 0x2, 0x2, 0x307, 0x308, + 0x7, 0x52, 0x2, 0x2, 0x308, 0x309, 0x7, 0x63, 0x2, 0x2, 0x309, 0x30a, + 0x7, 0x74, 0x2, 0x2, 0x30a, 0x30b, 0x7, 0x63, 0x2, 0x2, 0x30b, 0x30c, + 0x7, 0x6f, 0x2, 0x2, 0x30c, 0x30d, 0x7, 0x57, 0x2, 0x2, 0x30d, 0x30e, + 0x7, 0x4b, 0x2, 0x2, 0x30e, 0x30f, 0x7, 0x4e, 0x2, 0x2, 0x30f, 0x310, + 0x7, 0x63, 0x2, 0x2, 0x310, 0x311, 0x7, 0x64, 0x2, 0x2, 0x311, 0x312, + 0x7, 0x67, 0x2, 0x2, 0x312, 0x313, 0x7, 0x6e, 0x2, 0x2, 0x313, 0x314, + 0x7, 0x50, 0x2, 0x2, 0x314, 0x315, 0x7, 0x63, 0x2, 0x2, 0x315, 0x316, + 0x7, 0x6f, 0x2, 0x2, 0x316, 0x317, 0x7, 0x67, 0x2, 0x2, 0x317, 0x318, + 0x7, 0x4b, 0x2, 0x2, 0x318, 0x319, 0x7, 0x46, 0x2, 0x2, 0x319, 0x63, + 0x3, 0x2, 0x2, 0x2, 0x31a, 0x31b, 0x7, 0x45, 0x2, 0x2, 0x31b, 0x31c, + 0x7, 0x6a, 0x2, 0x2, 0x31c, 0x31d, 0x7, 0x63, 0x2, 0x2, 0x31d, 0x31e, + 0x7, 0x74, 0x2, 0x2, 0x31e, 0x31f, 0x7, 0x63, 0x2, 0x2, 0x31f, 0x320, + 0x7, 0x65, 0x2, 0x2, 0x320, 0x321, 0x7, 0x76, 0x2, 0x2, 0x321, 0x322, + 0x7, 0x67, 0x2, 0x2, 0x322, 0x323, 0x7, 0x74, 0x2, 0x2, 0x323, 0x65, + 0x3, 0x2, 0x2, 0x2, 0x324, 0x325, 0x7, 0x75, 0x2, 0x2, 0x325, 0x326, + 0x7, 0x6b, 0x2, 0x2, 0x326, 0x327, 0x7, 0x7c, 0x2, 0x2, 0x327, 0x328, + 0x7, 0x67, 0x2, 0x2, 0x328, 0x329, 0x7, 0x6f, 0x2, 0x2, 0x329, 0x32a, + 0x7, 0x67, 0x2, 0x2, 0x32a, 0x32b, 0x7, 0x70, 0x2, 0x2, 0x32b, 0x32c, + 0x7, 0x77, 0x2, 0x2, 0x32c, 0x32d, 0x7, 0x70, 0x2, 0x2, 0x32d, 0x32e, + 0x7, 0x63, 0x2, 0x2, 0x32e, 0x32f, 0x7, 0x6f, 0x2, 0x2, 0x32f, 0x330, + 0x7, 0x67, 0x2, 0x2, 0x330, 0x67, 0x3, 0x2, 0x2, 0x2, 0x331, 0x332, + 0x7, 0x65, 0x2, 0x2, 0x332, 0x333, 0x7, 0x71, 0x2, 0x2, 0x333, 0x334, + 0x7, 0x70, 0x2, 0x2, 0x334, 0x335, 0x7, 0x76, 0x2, 0x2, 0x335, 0x336, + 0x7, 0x71, 0x2, 0x2, 0x336, 0x337, 0x7, 0x77, 0x2, 0x2, 0x337, 0x338, + 0x7, 0x74, 0x2, 0x2, 0x338, 0x339, 0x7, 0x72, 0x2, 0x2, 0x339, 0x33a, + 0x7, 0x71, 0x2, 0x2, 0x33a, 0x33b, 0x7, 0x6b, 0x2, 0x2, 0x33b, 0x33c, + 0x7, 0x70, 0x2, 0x2, 0x33c, 0x33d, 0x7, 0x76, 0x2, 0x2, 0x33d, 0x69, + 0x3, 0x2, 0x2, 0x2, 0x33e, 0x33f, 0x7, 0x63, 0x2, 0x2, 0x33f, 0x340, + 0x7, 0x70, 0x2, 0x2, 0x340, 0x341, 0x7, 0x65, 0x2, 0x2, 0x341, 0x342, + 0x7, 0x6a, 0x2, 0x2, 0x342, 0x343, 0x7, 0x71, 0x2, 0x2, 0x343, 0x344, + 0x7, 0x74, 0x2, 0x2, 0x344, 0x6b, 0x3, 0x2, 0x2, 0x2, 0x345, 0x346, + 0x7, 0x63, 0x2, 0x2, 0x346, 0x347, 0x7, 0x70, 0x2, 0x2, 0x347, 0x348, + 0x7, 0x65, 0x2, 0x2, 0x348, 0x349, 0x7, 0x6a, 0x2, 0x2, 0x349, 0x34a, + 0x7, 0x71, 0x2, 0x2, 0x34a, 0x34b, 0x7, 0x74, 0x2, 0x2, 0x34b, 0x34c, + 0x7, 0x46, 0x2, 0x2, 0x34c, 0x34d, 0x7, 0x67, 0x2, 0x2, 0x34d, 0x34e, + 0x7, 0x68, 0x2, 0x2, 0x34e, 0x6d, 0x3, 0x2, 0x2, 0x2, 0x34f, 0x350, + 0x7, 0x78, 0x2, 0x2, 0x350, 0x351, 0x7, 0x63, 0x2, 0x2, 0x351, 0x352, + 0x7, 0x6e, 0x2, 0x2, 0x352, 0x353, 0x7, 0x77, 0x2, 0x2, 0x353, 0x354, + 0x7, 0x67, 0x2, 0x2, 0x354, 0x355, 0x7, 0x54, 0x2, 0x2, 0x355, 0x356, + 0x7, 0x67, 0x2, 0x2, 0x356, 0x357, 0x7, 0x65, 0x2, 0x2, 0x357, 0x358, + 0x7, 0x71, 0x2, 0x2, 0x358, 0x359, 0x7, 0x74, 0x2, 0x2, 0x359, 0x35a, + 0x7, 0x66, 0x2, 0x2, 0x35a, 0x35b, 0x7, 0x46, 0x2, 0x2, 0x35b, 0x35c, + 0x7, 0x67, 0x2, 0x2, 0x35c, 0x35d, 0x7, 0x68, 0x2, 0x2, 0x35d, 0x6f, + 0x3, 0x2, 0x2, 0x2, 0x35e, 0x35f, 0x7, 0x6f, 0x2, 0x2, 0x35f, 0x360, + 0x7, 0x63, 0x2, 0x2, 0x360, 0x361, 0x7, 0x74, 0x2, 0x2, 0x361, 0x362, + 0x7, 0x6d, 0x2, 0x2, 0x362, 0x71, 0x3, 0x2, 0x2, 0x2, 0x363, 0x364, + 0x7, 0x6f, 0x2, 0x2, 0x364, 0x365, 0x7, 0x63, 0x2, 0x2, 0x365, 0x366, + 0x7, 0x74, 0x2, 0x2, 0x366, 0x367, 0x7, 0x6d, 0x2, 0x2, 0x367, 0x368, + 0x7, 0x45, 0x2, 0x2, 0x368, 0x369, 0x7, 0x6e, 0x2, 0x2, 0x369, 0x36a, + 0x7, 0x63, 0x2, 0x2, 0x36a, 0x36b, 0x7, 0x75, 0x2, 0x2, 0x36b, 0x36c, + 0x7, 0x75, 0x2, 0x2, 0x36c, 0x73, 0x3, 0x2, 0x2, 0x2, 0x36d, 0x36e, + 0x7, 0x65, 0x2, 0x2, 0x36e, 0x36f, 0x7, 0x77, 0x2, 0x2, 0x36f, 0x370, + 0x7, 0x74, 0x2, 0x2, 0x370, 0x371, 0x7, 0x75, 0x2, 0x2, 0x371, 0x372, + 0x7, 0x6b, 0x2, 0x2, 0x372, 0x373, 0x7, 0x78, 0x2, 0x2, 0x373, 0x374, + 0x7, 0x67, 0x2, 0x2, 0x374, 0x75, 0x3, 0x2, 0x2, 0x2, 0x375, 0x376, + 0x7, 0x64, 0x2, 0x2, 0x376, 0x377, 0x7, 0x63, 0x2, 0x2, 0x377, 0x378, + 0x7, 0x75, 0x2, 0x2, 0x378, 0x379, 0x7, 0x67, 0x2, 0x2, 0x379, 0x77, + 0x3, 0x2, 0x2, 0x2, 0x37a, 0x37b, 0x7, 0x6e, 0x2, 0x2, 0x37b, 0x37c, + 0x7, 0x6b, 0x2, 0x2, 0x37c, 0x37d, 0x7, 0x69, 0x2, 0x2, 0x37d, 0x37e, + 0x7, 0x63, 0x2, 0x2, 0x37e, 0x37f, 0x7, 0x76, 0x2, 0x2, 0x37f, 0x380, + 0x7, 0x77, 0x2, 0x2, 0x380, 0x381, 0x7, 0x74, 0x2, 0x2, 0x381, 0x382, + 0x7, 0x67, 0x2, 0x2, 0x382, 0x79, 0x3, 0x2, 0x2, 0x2, 0x383, 0x384, + 0x7, 0x6e, 0x2, 0x2, 0x384, 0x385, 0x7, 0x6b, 0x2, 0x2, 0x385, 0x386, + 0x7, 0x69, 0x2, 0x2, 0x386, 0x7b, 0x3, 0x2, 0x2, 0x2, 0x387, 0x388, + 0x7, 0x6e, 0x2, 0x2, 0x388, 0x389, 0x7, 0x6b, 0x2, 0x2, 0x389, 0x38a, + 0x7, 0x69, 0x2, 0x2, 0x38a, 0x38b, 0x7, 0x45, 0x2, 0x2, 0x38b, 0x38c, + 0x7, 0x71, 0x2, 0x2, 0x38c, 0x38d, 0x7, 0x6f, 0x2, 0x2, 0x38d, 0x38e, + 0x7, 0x72, 0x2, 0x2, 0x38e, 0x38f, 0x7, 0x71, 0x2, 0x2, 0x38f, 0x390, + 0x7, 0x70, 0x2, 0x2, 0x390, 0x391, 0x7, 0x67, 0x2, 0x2, 0x391, 0x392, + 0x7, 0x70, 0x2, 0x2, 0x392, 0x393, 0x7, 0x76, 0x2, 0x2, 0x393, 0x7d, + 0x3, 0x2, 0x2, 0x2, 0x394, 0x395, 0x7, 0x50, 0x2, 0x2, 0x395, 0x396, + 0x7, 0x57, 0x2, 0x2, 0x396, 0x397, 0x7, 0x4e, 0x2, 0x2, 0x397, 0x398, + 0x7, 0x4e, 0x2, 0x2, 0x398, 0x7f, 0x3, 0x2, 0x2, 0x2, 0x399, 0x39a, + 0x7, 0x44, 0x2, 0x2, 0x39a, 0x39b, 0x7, 0x43, 0x2, 0x2, 0x39b, 0x39c, + 0x7, 0x55, 0x2, 0x2, 0x39c, 0x39d, 0x7, 0x47, 0x2, 0x2, 0x39d, 0x81, + 0x3, 0x2, 0x2, 0x2, 0x39e, 0x39f, 0x7, 0x4a, 0x2, 0x2, 0x39f, 0x3a0, + 0x7, 0x71, 0x2, 0x2, 0x3a0, 0x3a1, 0x7, 0x74, 0x2, 0x2, 0x3a1, 0x3a2, + 0x7, 0x6b, 0x2, 0x2, 0x3a2, 0x3a3, 0x7, 0x7c, 0x2, 0x2, 0x3a3, 0x3a4, + 0x7, 0x43, 0x2, 0x2, 0x3a4, 0x3a5, 0x7, 0x7a, 0x2, 0x2, 0x3a5, 0x3a6, + 0x7, 0x6b, 0x2, 0x2, 0x3a6, 0x3a7, 0x7, 0x75, 0x2, 0x2, 0x3a7, 0x3a8, + 0x7, 0x30, 0x2, 0x2, 0x3a8, 0x3a9, 0x7, 0x44, 0x2, 0x2, 0x3a9, 0x3aa, + 0x7, 0x63, 0x2, 0x2, 0x3aa, 0x3ab, 0x7, 0x75, 0x2, 0x2, 0x3ab, 0x3ac, + 0x7, 0x67, 0x2, 0x2, 0x3ac, 0x3ad, 0x7, 0x56, 0x2, 0x2, 0x3ad, 0x3ae, + 0x7, 0x63, 0x2, 0x2, 0x3ae, 0x3af, 0x7, 0x69, 0x2, 0x2, 0x3af, 0x3b0, + 0x7, 0x4e, 0x2, 0x2, 0x3b0, 0x3b1, 0x7, 0x6b, 0x2, 0x2, 0x3b1, 0x3b2, + 0x7, 0x75, 0x2, 0x2, 0x3b2, 0x3b3, 0x7, 0x76, 0x2, 0x2, 0x3b3, 0x83, + 0x3, 0x2, 0x2, 0x2, 0x3b4, 0x3b5, 0x7, 0x58, 0x2, 0x2, 0x3b5, 0x3b6, + 0x7, 0x67, 0x2, 0x2, 0x3b6, 0x3b7, 0x7, 0x74, 0x2, 0x2, 0x3b7, 0x3b8, + 0x7, 0x76, 0x2, 0x2, 0x3b8, 0x3b9, 0x7, 0x43, 0x2, 0x2, 0x3b9, 0x3ba, + 0x7, 0x7a, 0x2, 0x2, 0x3ba, 0x3bb, 0x7, 0x6b, 0x2, 0x2, 0x3bb, 0x3bc, + 0x7, 0x75, 0x2, 0x2, 0x3bc, 0x3bd, 0x7, 0x30, 0x2, 0x2, 0x3bd, 0x3be, + 0x7, 0x44, 0x2, 0x2, 0x3be, 0x3bf, 0x7, 0x63, 0x2, 0x2, 0x3bf, 0x3c0, + 0x7, 0x75, 0x2, 0x2, 0x3c0, 0x3c1, 0x7, 0x67, 0x2, 0x2, 0x3c1, 0x3c2, + 0x7, 0x56, 0x2, 0x2, 0x3c2, 0x3c3, 0x7, 0x63, 0x2, 0x2, 0x3c3, 0x3c4, + 0x7, 0x69, 0x2, 0x2, 0x3c4, 0x3c5, 0x7, 0x4e, 0x2, 0x2, 0x3c5, 0x3c6, + 0x7, 0x6b, 0x2, 0x2, 0x3c6, 0x3c7, 0x7, 0x75, 0x2, 0x2, 0x3c7, 0x3c8, + 0x7, 0x76, 0x2, 0x2, 0x3c8, 0x85, 0x3, 0x2, 0x2, 0x2, 0x3c9, 0x3ca, + 0x7, 0x4a, 0x2, 0x2, 0x3ca, 0x3cb, 0x7, 0x71, 0x2, 0x2, 0x3cb, 0x3cc, + 0x7, 0x74, 0x2, 0x2, 0x3cc, 0x3cd, 0x7, 0x6b, 0x2, 0x2, 0x3cd, 0x3ce, + 0x7, 0x7c, 0x2, 0x2, 0x3ce, 0x3cf, 0x7, 0x43, 0x2, 0x2, 0x3cf, 0x3d0, + 0x7, 0x7a, 0x2, 0x2, 0x3d0, 0x3d1, 0x7, 0x6b, 0x2, 0x2, 0x3d1, 0x3d2, + 0x7, 0x75, 0x2, 0x2, 0x3d2, 0x3d3, 0x7, 0x30, 0x2, 0x2, 0x3d3, 0x3d4, + 0x7, 0x44, 0x2, 0x2, 0x3d4, 0x3d5, 0x7, 0x63, 0x2, 0x2, 0x3d5, 0x3d6, + 0x7, 0x75, 0x2, 0x2, 0x3d6, 0x3d7, 0x7, 0x67, 0x2, 0x2, 0x3d7, 0x3d8, + 0x7, 0x55, 0x2, 0x2, 0x3d8, 0x3d9, 0x7, 0x65, 0x2, 0x2, 0x3d9, 0x3da, + 0x7, 0x74, 0x2, 0x2, 0x3da, 0x3db, 0x7, 0x6b, 0x2, 0x2, 0x3db, 0x3dc, + 0x7, 0x72, 0x2, 0x2, 0x3dc, 0x3dd, 0x7, 0x76, 0x2, 0x2, 0x3dd, 0x3de, + 0x7, 0x4e, 0x2, 0x2, 0x3de, 0x3df, 0x7, 0x6b, 0x2, 0x2, 0x3df, 0x3e0, + 0x7, 0x75, 0x2, 0x2, 0x3e0, 0x3e1, 0x7, 0x76, 0x2, 0x2, 0x3e1, 0x87, + 0x3, 0x2, 0x2, 0x2, 0x3e2, 0x3e3, 0x7, 0x58, 0x2, 0x2, 0x3e3, 0x3e4, + 0x7, 0x67, 0x2, 0x2, 0x3e4, 0x3e5, 0x7, 0x74, 0x2, 0x2, 0x3e5, 0x3e6, + 0x7, 0x76, 0x2, 0x2, 0x3e6, 0x3e7, 0x7, 0x43, 0x2, 0x2, 0x3e7, 0x3e8, + 0x7, 0x7a, 0x2, 0x2, 0x3e8, 0x3e9, 0x7, 0x6b, 0x2, 0x2, 0x3e9, 0x3ea, + 0x7, 0x75, 0x2, 0x2, 0x3ea, 0x3eb, 0x7, 0x30, 0x2, 0x2, 0x3eb, 0x3ec, + 0x7, 0x44, 0x2, 0x2, 0x3ec, 0x3ed, 0x7, 0x63, 0x2, 0x2, 0x3ed, 0x3ee, + 0x7, 0x75, 0x2, 0x2, 0x3ee, 0x3ef, 0x7, 0x67, 0x2, 0x2, 0x3ef, 0x3f0, + 0x7, 0x55, 0x2, 0x2, 0x3f0, 0x3f1, 0x7, 0x65, 0x2, 0x2, 0x3f1, 0x3f2, + 0x7, 0x74, 0x2, 0x2, 0x3f2, 0x3f3, 0x7, 0x6b, 0x2, 0x2, 0x3f3, 0x3f4, + 0x7, 0x72, 0x2, 0x2, 0x3f4, 0x3f5, 0x7, 0x76, 0x2, 0x2, 0x3f5, 0x3f6, + 0x7, 0x4e, 0x2, 0x2, 0x3f6, 0x3f7, 0x7, 0x6b, 0x2, 0x2, 0x3f7, 0x3f8, + 0x7, 0x75, 0x2, 0x2, 0x3f8, 0x3f9, 0x7, 0x76, 0x2, 0x2, 0x3f9, 0x89, + 0x3, 0x2, 0x2, 0x2, 0x3fa, 0x3fb, 0x7, 0x49, 0x2, 0x2, 0x3fb, 0x3fc, + 0x7, 0x46, 0x2, 0x2, 0x3fc, 0x3fd, 0x7, 0x47, 0x2, 0x2, 0x3fd, 0x3fe, + 0x7, 0x48, 0x2, 0x2, 0x3fe, 0x8b, 0x3, 0x2, 0x2, 0x2, 0x3ff, 0x400, + 0x7, 0x49, 0x2, 0x2, 0x400, 0x401, 0x7, 0x6e, 0x2, 0x2, 0x401, 0x402, + 0x7, 0x7b, 0x2, 0x2, 0x402, 0x403, 0x7, 0x72, 0x2, 0x2, 0x403, 0x404, + 0x7, 0x6a, 0x2, 0x2, 0x404, 0x405, 0x7, 0x45, 0x2, 0x2, 0x405, 0x406, + 0x7, 0x6e, 0x2, 0x2, 0x406, 0x407, 0x7, 0x63, 0x2, 0x2, 0x407, 0x408, + 0x7, 0x75, 0x2, 0x2, 0x408, 0x409, 0x7, 0x75, 0x2, 0x2, 0x409, 0x40a, + 0x7, 0x46, 0x2, 0x2, 0x40a, 0x40b, 0x7, 0x67, 0x2, 0x2, 0x40b, 0x40c, + 0x7, 0x68, 0x2, 0x2, 0x40c, 0x8d, 0x3, 0x2, 0x2, 0x2, 0x40d, 0x40e, + 0x7, 0x43, 0x2, 0x2, 0x40e, 0x40f, 0x7, 0x76, 0x2, 0x2, 0x40f, 0x410, + 0x7, 0x76, 0x2, 0x2, 0x410, 0x411, 0x7, 0x63, 0x2, 0x2, 0x411, 0x412, + 0x7, 0x65, 0x2, 0x2, 0x412, 0x413, 0x7, 0x6a, 0x2, 0x2, 0x413, 0x8f, + 0x3, 0x2, 0x2, 0x2, 0x414, 0x415, 0x7, 0x4e, 0x2, 0x2, 0x415, 0x416, + 0x7, 0x6b, 0x2, 0x2, 0x416, 0x417, 0x7, 0x69, 0x2, 0x2, 0x417, 0x418, + 0x7, 0x63, 0x2, 0x2, 0x418, 0x419, 0x7, 0x76, 0x2, 0x2, 0x419, 0x41a, + 0x7, 0x77, 0x2, 0x2, 0x41a, 0x41b, 0x7, 0x74, 0x2, 0x2, 0x41b, 0x41c, + 0x7, 0x67, 0x2, 0x2, 0x41c, 0x41d, 0x7, 0x45, 0x2, 0x2, 0x41d, 0x41e, + 0x7, 0x63, 0x2, 0x2, 0x41e, 0x41f, 0x7, 0x74, 0x2, 0x2, 0x41f, 0x420, + 0x7, 0x67, 0x2, 0x2, 0x420, 0x421, 0x7, 0x76, 0x2, 0x2, 0x421, 0x422, + 0x7, 0x44, 0x2, 0x2, 0x422, 0x423, 0x7, 0x7b, 0x2, 0x2, 0x423, 0x424, + 0x7, 0x52, 0x2, 0x2, 0x424, 0x425, 0x7, 0x71, 0x2, 0x2, 0x425, 0x426, + 0x7, 0x75, 0x2, 0x2, 0x426, 0x91, 0x3, 0x2, 0x2, 0x2, 0x427, 0x428, + 0x7, 0x4e, 0x2, 0x2, 0x428, 0x429, 0x7, 0x6b, 0x2, 0x2, 0x429, 0x42a, + 0x7, 0x69, 0x2, 0x2, 0x42a, 0x42b, 0x7, 0x63, 0x2, 0x2, 0x42b, 0x42c, + 0x7, 0x76, 0x2, 0x2, 0x42c, 0x42d, 0x7, 0x77, 0x2, 0x2, 0x42d, 0x42e, + 0x7, 0x74, 0x2, 0x2, 0x42e, 0x42f, 0x7, 0x67, 0x2, 0x2, 0x42f, 0x430, + 0x7, 0x45, 0x2, 0x2, 0x430, 0x431, 0x7, 0x63, 0x2, 0x2, 0x431, 0x432, + 0x7, 0x74, 0x2, 0x2, 0x432, 0x433, 0x7, 0x67, 0x2, 0x2, 0x433, 0x434, + 0x7, 0x76, 0x2, 0x2, 0x434, 0x435, 0x7, 0x44, 0x2, 0x2, 0x435, 0x436, + 0x7, 0x7b, 0x2, 0x2, 0x436, 0x437, 0x7, 0x4b, 0x2, 0x2, 0x437, 0x438, + 0x7, 0x70, 0x2, 0x2, 0x438, 0x439, 0x7, 0x66, 0x2, 0x2, 0x439, 0x43a, + 0x7, 0x67, 0x2, 0x2, 0x43a, 0x43b, 0x7, 0x7a, 0x2, 0x2, 0x43b, 0x93, + 0x3, 0x2, 0x2, 0x2, 0x43c, 0x43d, 0x7, 0x6a, 0x2, 0x2, 0x43d, 0x43e, + 0x7, 0x67, 0x2, 0x2, 0x43e, 0x43f, 0x7, 0x63, 0x2, 0x2, 0x43f, 0x440, + 0x7, 0x66, 0x2, 0x2, 0x440, 0x95, 0x3, 0x2, 0x2, 0x2, 0x441, 0x442, + 0x7, 0x48, 0x2, 0x2, 0x442, 0x443, 0x7, 0x71, 0x2, 0x2, 0x443, 0x444, + 0x7, 0x70, 0x2, 0x2, 0x444, 0x445, 0x7, 0x76, 0x2, 0x2, 0x445, 0x446, + 0x7, 0x54, 0x2, 0x2, 0x446, 0x447, 0x7, 0x67, 0x2, 0x2, 0x447, 0x448, + 0x7, 0x78, 0x2, 0x2, 0x448, 0x449, 0x7, 0x6b, 0x2, 0x2, 0x449, 0x44a, + 0x7, 0x75, 0x2, 0x2, 0x44a, 0x44b, 0x7, 0x6b, 0x2, 0x2, 0x44b, 0x44c, + 0x7, 0x71, 0x2, 0x2, 0x44c, 0x44d, 0x7, 0x70, 0x2, 0x2, 0x44d, 0x97, + 0x3, 0x2, 0x2, 0x2, 0x44e, 0x44f, 0x7, 0x6a, 0x2, 0x2, 0x44f, 0x450, + 0x7, 0x6a, 0x2, 0x2, 0x450, 0x451, 0x7, 0x67, 0x2, 0x2, 0x451, 0x452, + 0x7, 0x63, 0x2, 0x2, 0x452, 0x99, 0x3, 0x2, 0x2, 0x2, 0x453, 0x454, + 0x7, 0x43, 0x2, 0x2, 0x454, 0x455, 0x7, 0x75, 0x2, 0x2, 0x455, 0x456, + 0x7, 0x65, 0x2, 0x2, 0x456, 0x457, 0x7, 0x67, 0x2, 0x2, 0x457, 0x458, + 0x7, 0x70, 0x2, 0x2, 0x458, 0x459, 0x7, 0x66, 0x2, 0x2, 0x459, 0x45a, + 0x7, 0x67, 0x2, 0x2, 0x45a, 0x45b, 0x7, 0x74, 0x2, 0x2, 0x45b, 0x9b, + 0x3, 0x2, 0x2, 0x2, 0x45c, 0x45d, 0x7, 0x46, 0x2, 0x2, 0x45d, 0x45e, + 0x7, 0x67, 0x2, 0x2, 0x45e, 0x45f, 0x7, 0x75, 0x2, 0x2, 0x45f, 0x460, + 0x7, 0x65, 0x2, 0x2, 0x460, 0x461, 0x7, 0x67, 0x2, 0x2, 0x461, 0x462, + 0x7, 0x70, 0x2, 0x2, 0x462, 0x463, 0x7, 0x66, 0x2, 0x2, 0x463, 0x464, + 0x7, 0x67, 0x2, 0x2, 0x464, 0x465, 0x7, 0x74, 0x2, 0x2, 0x465, 0x9d, + 0x3, 0x2, 0x2, 0x2, 0x466, 0x467, 0x7, 0x4e, 0x2, 0x2, 0x467, 0x468, + 0x7, 0x6b, 0x2, 0x2, 0x468, 0x469, 0x7, 0x70, 0x2, 0x2, 0x469, 0x46a, + 0x7, 0x67, 0x2, 0x2, 0x46a, 0x46b, 0x7, 0x49, 0x2, 0x2, 0x46b, 0x46c, + 0x7, 0x63, 0x2, 0x2, 0x46c, 0x46d, 0x7, 0x72, 0x2, 0x2, 0x46d, 0x9f, + 0x3, 0x2, 0x2, 0x2, 0x46e, 0x46f, 0x7, 0x45, 0x2, 0x2, 0x46f, 0x470, + 0x7, 0x63, 0x2, 0x2, 0x470, 0x471, 0x7, 0x74, 0x2, 0x2, 0x471, 0x472, + 0x7, 0x67, 0x2, 0x2, 0x472, 0x473, 0x7, 0x76, 0x2, 0x2, 0x473, 0x474, + 0x7, 0x51, 0x2, 0x2, 0x474, 0x475, 0x7, 0x68, 0x2, 0x2, 0x475, 0x476, + 0x7, 0x68, 0x2, 0x2, 0x476, 0x477, 0x7, 0x75, 0x2, 0x2, 0x477, 0x478, + 0x7, 0x67, 0x2, 0x2, 0x478, 0x479, 0x7, 0x76, 0x2, 0x2, 0x479, 0xa1, + 0x3, 0x2, 0x2, 0x2, 0x47a, 0x47b, 0x7, 0x70, 0x2, 0x2, 0x47b, 0x47c, + 0x7, 0x63, 0x2, 0x2, 0x47c, 0x47d, 0x7, 0x6f, 0x2, 0x2, 0x47d, 0x47e, + 0x7, 0x67, 0x2, 0x2, 0x47e, 0xa3, 0x3, 0x2, 0x2, 0x2, 0x47f, 0x480, + 0x7, 0x70, 0x2, 0x2, 0x480, 0x481, 0x7, 0x63, 0x2, 0x2, 0x481, 0x482, + 0x7, 0x6f, 0x2, 0x2, 0x482, 0x483, 0x7, 0x67, 0x2, 0x2, 0x483, 0x484, + 0x7, 0x6b, 0x2, 0x2, 0x484, 0x485, 0x7, 0x66, 0x2, 0x2, 0x485, 0xa5, + 0x3, 0x2, 0x2, 0x2, 0x486, 0x487, 0x7, 0x51, 0x2, 0x2, 0x487, 0x488, + 0x7, 0x55, 0x2, 0x2, 0x488, 0x489, 0x7, 0x31, 0x2, 0x2, 0x489, 0x48a, + 0x7, 0x34, 0x2, 0x2, 0x48a, 0xa7, 0x3, 0x2, 0x2, 0x2, 0x48b, 0x48c, + 0x7, 0x48, 0x2, 0x2, 0x48c, 0x48d, 0x7, 0x55, 0x2, 0x2, 0x48d, 0x48e, + 0x7, 0x56, 0x2, 0x2, 0x48e, 0x48f, 0x7, 0x7b, 0x2, 0x2, 0x48f, 0x490, + 0x7, 0x72, 0x2, 0x2, 0x490, 0x491, 0x7, 0x67, 0x2, 0x2, 0x491, 0xa9, + 0x3, 0x2, 0x2, 0x2, 0x492, 0x493, 0x7, 0x68, 0x2, 0x2, 0x493, 0x494, + 0x7, 0x75, 0x2, 0x2, 0x494, 0x495, 0x7, 0x56, 0x2, 0x2, 0x495, 0x496, + 0x7, 0x7b, 0x2, 0x2, 0x496, 0x497, 0x7, 0x72, 0x2, 0x2, 0x497, 0x498, + 0x7, 0x67, 0x2, 0x2, 0x498, 0xab, 0x3, 0x2, 0x2, 0x2, 0x499, 0x49a, + 0x7, 0x4e, 0x2, 0x2, 0x49a, 0x49b, 0x7, 0x71, 0x2, 0x2, 0x49b, 0x49c, + 0x7, 0x79, 0x2, 0x2, 0x49c, 0x49d, 0x7, 0x67, 0x2, 0x2, 0x49d, 0x49e, + 0x7, 0x74, 0x2, 0x2, 0x49e, 0x49f, 0x7, 0x51, 0x2, 0x2, 0x49f, 0x4a0, + 0x7, 0x72, 0x2, 0x2, 0x4a0, 0x4a1, 0x7, 0x55, 0x2, 0x2, 0x4a1, 0x4a2, + 0x7, 0x6b, 0x2, 0x2, 0x4a2, 0x4a3, 0x7, 0x7c, 0x2, 0x2, 0x4a3, 0x4a4, + 0x7, 0x67, 0x2, 0x2, 0x4a4, 0xad, 0x3, 0x2, 0x2, 0x2, 0x4a5, 0x4a6, + 0x7, 0x57, 0x2, 0x2, 0x4a6, 0x4a7, 0x7, 0x72, 0x2, 0x2, 0x4a7, 0x4a8, + 0x7, 0x72, 0x2, 0x2, 0x4a8, 0x4a9, 0x7, 0x67, 0x2, 0x2, 0x4a9, 0x4aa, + 0x7, 0x74, 0x2, 0x2, 0x4aa, 0x4ab, 0x7, 0x51, 0x2, 0x2, 0x4ab, 0x4ac, + 0x7, 0x72, 0x2, 0x2, 0x4ac, 0x4ad, 0x7, 0x55, 0x2, 0x2, 0x4ad, 0x4ae, + 0x7, 0x6b, 0x2, 0x2, 0x4ae, 0x4af, 0x7, 0x7c, 0x2, 0x2, 0x4af, 0x4b0, + 0x7, 0x67, 0x2, 0x2, 0x4b0, 0xaf, 0x3, 0x2, 0x2, 0x2, 0x4b1, 0x4b2, + 0x7, 0x52, 0x2, 0x2, 0x4b2, 0x4b3, 0x7, 0x63, 0x2, 0x2, 0x4b3, 0x4b4, + 0x7, 0x70, 0x2, 0x2, 0x4b4, 0x4b5, 0x7, 0x71, 0x2, 0x2, 0x4b5, 0x4b6, + 0x7, 0x75, 0x2, 0x2, 0x4b6, 0x4b7, 0x7, 0x67, 0x2, 0x2, 0x4b7, 0xb1, + 0x3, 0x2, 0x2, 0x2, 0x4b8, 0x4b9, 0x7, 0x56, 0x2, 0x2, 0x4b9, 0x4ba, + 0x7, 0x7b, 0x2, 0x2, 0x4ba, 0x4bb, 0x7, 0x72, 0x2, 0x2, 0x4bb, 0x4bc, + 0x7, 0x71, 0x2, 0x2, 0x4bc, 0x4bd, 0x7, 0x43, 0x2, 0x2, 0x4bd, 0x4be, + 0x7, 0x75, 0x2, 0x2, 0x4be, 0x4bf, 0x7, 0x65, 0x2, 0x2, 0x4bf, 0x4c0, + 0x7, 0x67, 0x2, 0x2, 0x4c0, 0x4c1, 0x7, 0x70, 0x2, 0x2, 0x4c1, 0x4c2, + 0x7, 0x66, 0x2, 0x2, 0x4c2, 0x4c3, 0x7, 0x67, 0x2, 0x2, 0x4c3, 0x4c4, + 0x7, 0x74, 0x2, 0x2, 0x4c4, 0xb3, 0x3, 0x2, 0x2, 0x2, 0x4c5, 0x4c6, + 0x7, 0x56, 0x2, 0x2, 0x4c6, 0x4c7, 0x7, 0x7b, 0x2, 0x2, 0x4c7, 0x4c8, + 0x7, 0x72, 0x2, 0x2, 0x4c8, 0x4c9, 0x7, 0x71, 0x2, 0x2, 0x4c9, 0x4ca, + 0x7, 0x46, 0x2, 0x2, 0x4ca, 0x4cb, 0x7, 0x67, 0x2, 0x2, 0x4cb, 0x4cc, + 0x7, 0x75, 0x2, 0x2, 0x4cc, 0x4cd, 0x7, 0x65, 0x2, 0x2, 0x4cd, 0x4ce, + 0x7, 0x67, 0x2, 0x2, 0x4ce, 0x4cf, 0x7, 0x70, 0x2, 0x2, 0x4cf, 0x4d0, + 0x7, 0x66, 0x2, 0x2, 0x4d0, 0x4d1, 0x7, 0x67, 0x2, 0x2, 0x4d1, 0x4d2, + 0x7, 0x74, 0x2, 0x2, 0x4d2, 0xb5, 0x3, 0x2, 0x2, 0x2, 0x4d3, 0x4d4, + 0x7, 0x56, 0x2, 0x2, 0x4d4, 0x4d5, 0x7, 0x7b, 0x2, 0x2, 0x4d5, 0x4d6, + 0x7, 0x72, 0x2, 0x2, 0x4d6, 0x4d7, 0x7, 0x71, 0x2, 0x2, 0x4d7, 0x4d8, + 0x7, 0x4e, 0x2, 0x2, 0x4d8, 0x4d9, 0x7, 0x6b, 0x2, 0x2, 0x4d9, 0x4da, + 0x7, 0x70, 0x2, 0x2, 0x4da, 0x4db, 0x7, 0x67, 0x2, 0x2, 0x4db, 0x4dc, + 0x7, 0x49, 0x2, 0x2, 0x4dc, 0x4dd, 0x7, 0x63, 0x2, 0x2, 0x4dd, 0x4de, + 0x7, 0x72, 0x2, 0x2, 0x4de, 0xb7, 0x3, 0x2, 0x2, 0x2, 0x4df, 0x4e0, + 0x7, 0x79, 0x2, 0x2, 0x4e0, 0x4e1, 0x7, 0x6b, 0x2, 0x2, 0x4e1, 0x4e2, + 0x7, 0x70, 0x2, 0x2, 0x4e2, 0x4e3, 0x7, 0x43, 0x2, 0x2, 0x4e3, 0x4e4, + 0x7, 0x75, 0x2, 0x2, 0x4e4, 0x4e5, 0x7, 0x65, 0x2, 0x2, 0x4e5, 0x4e6, + 0x7, 0x67, 0x2, 0x2, 0x4e6, 0x4e7, 0x7, 0x70, 0x2, 0x2, 0x4e7, 0x4e8, + 0x7, 0x76, 0x2, 0x2, 0x4e8, 0xb9, 0x3, 0x2, 0x2, 0x2, 0x4e9, 0x4ea, + 0x7, 0x79, 0x2, 0x2, 0x4ea, 0x4eb, 0x7, 0x6b, 0x2, 0x2, 0x4eb, 0x4ec, + 0x7, 0x70, 0x2, 0x2, 0x4ec, 0x4ed, 0x7, 0x46, 0x2, 0x2, 0x4ed, 0x4ee, + 0x7, 0x67, 0x2, 0x2, 0x4ee, 0x4ef, 0x7, 0x75, 0x2, 0x2, 0x4ef, 0x4f0, + 0x7, 0x65, 0x2, 0x2, 0x4f0, 0x4f1, 0x7, 0x67, 0x2, 0x2, 0x4f1, 0x4f2, + 0x7, 0x70, 0x2, 0x2, 0x4f2, 0x4f3, 0x7, 0x76, 0x2, 0x2, 0x4f3, 0xbb, + 0x3, 0x2, 0x2, 0x2, 0x4f4, 0x4f5, 0x7, 0x5a, 0x2, 0x2, 0x4f5, 0x4f6, + 0x7, 0x4a, 0x2, 0x2, 0x4f6, 0x4f7, 0x7, 0x67, 0x2, 0x2, 0x4f7, 0x4f8, + 0x7, 0x6b, 0x2, 0x2, 0x4f8, 0x4f9, 0x7, 0x69, 0x2, 0x2, 0x4f9, 0x4fa, + 0x7, 0x6a, 0x2, 0x2, 0x4fa, 0x4fb, 0x7, 0x76, 0x2, 0x2, 0x4fb, 0xbd, + 0x3, 0x2, 0x2, 0x2, 0x4fc, 0x4fd, 0x7, 0x45, 0x2, 0x2, 0x4fd, 0x4fe, + 0x7, 0x63, 0x2, 0x2, 0x4fe, 0x4ff, 0x7, 0x72, 0x2, 0x2, 0x4ff, 0x500, + 0x7, 0x4a, 0x2, 0x2, 0x500, 0x501, 0x7, 0x67, 0x2, 0x2, 0x501, 0x502, + 0x7, 0x6b, 0x2, 0x2, 0x502, 0x503, 0x7, 0x69, 0x2, 0x2, 0x503, 0x504, + 0x7, 0x6a, 0x2, 0x2, 0x504, 0x505, 0x7, 0x76, 0x2, 0x2, 0x505, 0xbf, + 0x3, 0x2, 0x2, 0x2, 0x506, 0x507, 0x7, 0x59, 0x2, 0x2, 0x507, 0x508, + 0x7, 0x67, 0x2, 0x2, 0x508, 0x509, 0x7, 0x6b, 0x2, 0x2, 0x509, 0x50a, + 0x7, 0x69, 0x2, 0x2, 0x50a, 0x50b, 0x7, 0x6a, 0x2, 0x2, 0x50b, 0x50c, + 0x7, 0x76, 0x2, 0x2, 0x50c, 0x50d, 0x7, 0x45, 0x2, 0x2, 0x50d, 0x50e, + 0x7, 0x6e, 0x2, 0x2, 0x50e, 0x50f, 0x7, 0x63, 0x2, 0x2, 0x50f, 0x510, + 0x7, 0x75, 0x2, 0x2, 0x510, 0x511, 0x7, 0x75, 0x2, 0x2, 0x511, 0xc1, + 0x3, 0x2, 0x2, 0x2, 0x512, 0x513, 0x7, 0x59, 0x2, 0x2, 0x513, 0x514, + 0x7, 0x6b, 0x2, 0x2, 0x514, 0x515, 0x7, 0x66, 0x2, 0x2, 0x515, 0x516, + 0x7, 0x76, 0x2, 0x2, 0x516, 0x517, 0x7, 0x6a, 0x2, 0x2, 0x517, 0x518, + 0x7, 0x45, 0x2, 0x2, 0x518, 0x519, 0x7, 0x6e, 0x2, 0x2, 0x519, 0x51a, + 0x7, 0x63, 0x2, 0x2, 0x51a, 0x51b, 0x7, 0x75, 0x2, 0x2, 0x51b, 0x51c, + 0x7, 0x75, 0x2, 0x2, 0x51c, 0xc3, 0x3, 0x2, 0x2, 0x2, 0x51d, 0x51e, + 0x7, 0x58, 0x2, 0x2, 0x51e, 0x51f, 0x7, 0x67, 0x2, 0x2, 0x51f, 0x520, + 0x7, 0x70, 0x2, 0x2, 0x520, 0x521, 0x7, 0x66, 0x2, 0x2, 0x521, 0x522, + 0x7, 0x71, 0x2, 0x2, 0x522, 0x523, 0x7, 0x74, 0x2, 0x2, 0x523, 0xc5, + 0x3, 0x2, 0x2, 0x2, 0x524, 0x525, 0x7, 0x57, 0x2, 0x2, 0x525, 0x526, + 0x7, 0x70, 0x2, 0x2, 0x526, 0x527, 0x7, 0x6b, 0x2, 0x2, 0x527, 0x528, + 0x7, 0x65, 0x2, 0x2, 0x528, 0x529, 0x7, 0x71, 0x2, 0x2, 0x529, 0x52a, + 0x7, 0x66, 0x2, 0x2, 0x52a, 0x52b, 0x7, 0x67, 0x2, 0x2, 0x52b, 0x52c, + 0x7, 0x54, 0x2, 0x2, 0x52c, 0x52d, 0x7, 0x63, 0x2, 0x2, 0x52d, 0x52e, + 0x7, 0x70, 0x2, 0x2, 0x52e, 0x52f, 0x7, 0x69, 0x2, 0x2, 0x52f, 0x530, + 0x7, 0x67, 0x2, 0x2, 0x530, 0xc7, 0x3, 0x2, 0x2, 0x2, 0x531, 0x532, + 0x7, 0x45, 0x2, 0x2, 0x532, 0x533, 0x7, 0x71, 0x2, 0x2, 0x533, 0x534, + 0x7, 0x66, 0x2, 0x2, 0x534, 0x535, 0x7, 0x67, 0x2, 0x2, 0x535, 0x536, + 0x7, 0x52, 0x2, 0x2, 0x536, 0x537, 0x7, 0x63, 0x2, 0x2, 0x537, 0x538, + 0x7, 0x69, 0x2, 0x2, 0x538, 0x539, 0x7, 0x67, 0x2, 0x2, 0x539, 0x53a, + 0x7, 0x54, 0x2, 0x2, 0x53a, 0x53b, 0x7, 0x63, 0x2, 0x2, 0x53b, 0x53c, + 0x7, 0x70, 0x2, 0x2, 0x53c, 0x53d, 0x7, 0x69, 0x2, 0x2, 0x53d, 0x53e, + 0x7, 0x67, 0x2, 0x2, 0x53e, 0xc9, 0x3, 0x2, 0x2, 0x2, 0x53f, 0x540, + 0x7, 0x48, 0x2, 0x2, 0x540, 0x541, 0x7, 0x63, 0x2, 0x2, 0x541, 0x542, + 0x7, 0x6f, 0x2, 0x2, 0x542, 0x543, 0x7, 0x6b, 0x2, 0x2, 0x543, 0x544, + 0x7, 0x6e, 0x2, 0x2, 0x544, 0x545, 0x7, 0x7b, 0x2, 0x2, 0x545, 0x546, + 0x7, 0x45, 0x2, 0x2, 0x546, 0x547, 0x7, 0x6e, 0x2, 0x2, 0x547, 0x548, + 0x7, 0x63, 0x2, 0x2, 0x548, 0x549, 0x7, 0x75, 0x2, 0x2, 0x549, 0x54a, + 0x7, 0x75, 0x2, 0x2, 0x54a, 0xcb, 0x3, 0x2, 0x2, 0x2, 0x54b, 0x54c, + 0x7, 0x55, 0x2, 0x2, 0x54c, 0x54d, 0x7, 0x56, 0x2, 0x2, 0x54d, 0x54e, + 0x7, 0x43, 0x2, 0x2, 0x54e, 0x54f, 0x7, 0x56, 0x2, 0x2, 0x54f, 0xcd, + 0x3, 0x2, 0x2, 0x2, 0x550, 0x551, 0x7, 0x47, 0x2, 0x2, 0x551, 0x552, + 0x7, 0x6e, 0x2, 0x2, 0x552, 0x553, 0x7, 0x6b, 0x2, 0x2, 0x553, 0x554, + 0x7, 0x66, 0x2, 0x2, 0x554, 0x555, 0x7, 0x67, 0x2, 0x2, 0x555, 0x556, + 0x7, 0x66, 0x2, 0x2, 0x556, 0x557, 0x7, 0x48, 0x2, 0x2, 0x557, 0x558, + 0x7, 0x63, 0x2, 0x2, 0x558, 0x559, 0x7, 0x6e, 0x2, 0x2, 0x559, 0x55a, + 0x7, 0x6e, 0x2, 0x2, 0x55a, 0x55b, 0x7, 0x64, 0x2, 0x2, 0x55b, 0x55c, + 0x7, 0x63, 0x2, 0x2, 0x55c, 0x55d, 0x7, 0x65, 0x2, 0x2, 0x55d, 0x55e, + 0x7, 0x6d, 0x2, 0x2, 0x55e, 0x55f, 0x7, 0x50, 0x2, 0x2, 0x55f, 0x560, + 0x7, 0x63, 0x2, 0x2, 0x560, 0x561, 0x7, 0x6f, 0x2, 0x2, 0x561, 0x562, + 0x7, 0x67, 0x2, 0x2, 0x562, 0xcf, 0x3, 0x2, 0x2, 0x2, 0x563, 0x564, + 0x7, 0x47, 0x2, 0x2, 0x564, 0x565, 0x7, 0x6e, 0x2, 0x2, 0x565, 0x566, + 0x7, 0x6b, 0x2, 0x2, 0x566, 0x567, 0x7, 0x66, 0x2, 0x2, 0x567, 0x568, + 0x7, 0x67, 0x2, 0x2, 0x568, 0x569, 0x7, 0x66, 0x2, 0x2, 0x569, 0x56a, + 0x7, 0x48, 0x2, 0x2, 0x56a, 0x56b, 0x7, 0x63, 0x2, 0x2, 0x56b, 0x56c, + 0x7, 0x6e, 0x2, 0x2, 0x56c, 0x56d, 0x7, 0x6e, 0x2, 0x2, 0x56d, 0x56e, + 0x7, 0x64, 0x2, 0x2, 0x56e, 0x56f, 0x7, 0x63, 0x2, 0x2, 0x56f, 0x570, + 0x7, 0x65, 0x2, 0x2, 0x570, 0x571, 0x7, 0x6d, 0x2, 0x2, 0x571, 0x572, + 0x7, 0x50, 0x2, 0x2, 0x572, 0x573, 0x7, 0x63, 0x2, 0x2, 0x573, 0x574, + 0x7, 0x6f, 0x2, 0x2, 0x574, 0x575, 0x7, 0x67, 0x2, 0x2, 0x575, 0x576, + 0x7, 0x4b, 0x2, 0x2, 0x576, 0x577, 0x7, 0x46, 0x2, 0x2, 0x577, 0xd1, + 0x3, 0x2, 0x2, 0x2, 0x578, 0x579, 0x7, 0x46, 0x2, 0x2, 0x579, 0x57a, + 0x7, 0x67, 0x2, 0x2, 0x57a, 0x57b, 0x7, 0x75, 0x2, 0x2, 0x57b, 0x57c, + 0x7, 0x6b, 0x2, 0x2, 0x57c, 0x57d, 0x7, 0x69, 0x2, 0x2, 0x57d, 0x57e, + 0x7, 0x70, 0x2, 0x2, 0x57e, 0x57f, 0x7, 0x43, 0x2, 0x2, 0x57f, 0x580, + 0x7, 0x7a, 0x2, 0x2, 0x580, 0x581, 0x7, 0x6b, 0x2, 0x2, 0x581, 0x582, + 0x7, 0x75, 0x2, 0x2, 0x582, 0xd3, 0x3, 0x2, 0x2, 0x2, 0x583, 0x584, + 0x7, 0x43, 0x2, 0x2, 0x584, 0x585, 0x7, 0x7a, 0x2, 0x2, 0x585, 0x586, + 0x7, 0x6b, 0x2, 0x2, 0x586, 0x587, 0x7, 0x75, 0x2, 0x2, 0x587, 0x588, + 0x7, 0x58, 0x2, 0x2, 0x588, 0x589, 0x7, 0x63, 0x2, 0x2, 0x589, 0x58a, + 0x7, 0x6e, 0x2, 0x2, 0x58a, 0x58b, 0x7, 0x77, 0x2, 0x2, 0x58b, 0x58c, + 0x7, 0x67, 0x2, 0x2, 0x58c, 0xd5, 0x3, 0x2, 0x2, 0x2, 0x58d, 0x58e, + 0x7, 0x68, 0x2, 0x2, 0x58e, 0x58f, 0x7, 0x6e, 0x2, 0x2, 0x58f, 0x590, + 0x7, 0x63, 0x2, 0x2, 0x590, 0x591, 0x7, 0x69, 0x2, 0x2, 0x591, 0xd7, + 0x3, 0x2, 0x2, 0x2, 0x592, 0x593, 0x7, 0x6e, 0x2, 0x2, 0x593, 0x594, + 0x7, 0x71, 0x2, 0x2, 0x594, 0x595, 0x7, 0x65, 0x2, 0x2, 0x595, 0x596, + 0x7, 0x63, 0x2, 0x2, 0x596, 0x597, 0x7, 0x76, 0x2, 0x2, 0x597, 0x598, + 0x7, 0x6b, 0x2, 0x2, 0x598, 0x599, 0x7, 0x71, 0x2, 0x2, 0x599, 0x59a, + 0x7, 0x70, 0x2, 0x2, 0x59a, 0xd9, 0x3, 0x2, 0x2, 0x2, 0x59b, 0x59c, + 0x7, 0x47, 0x2, 0x2, 0x59c, 0x59d, 0x7, 0x6e, 0x2, 0x2, 0x59d, 0x59e, + 0x7, 0x6b, 0x2, 0x2, 0x59e, 0x59f, 0x7, 0x66, 0x2, 0x2, 0x59f, 0x5a0, + 0x7, 0x63, 0x2, 0x2, 0x5a0, 0x5a1, 0x7, 0x64, 0x2, 0x2, 0x5a1, 0x5a2, + 0x7, 0x6e, 0x2, 0x2, 0x5a2, 0x5a3, 0x7, 0x67, 0x2, 0x2, 0x5a3, 0x5a4, + 0x7, 0x43, 0x2, 0x2, 0x5a4, 0x5a5, 0x7, 0x7a, 0x2, 0x2, 0x5a5, 0x5a6, + 0x7, 0x6b, 0x2, 0x2, 0x5a6, 0x5a7, 0x7, 0x75, 0x2, 0x2, 0x5a7, 0x5a8, + 0x7, 0x58, 0x2, 0x2, 0x5a8, 0x5a9, 0x7, 0x63, 0x2, 0x2, 0x5a9, 0x5aa, + 0x7, 0x6e, 0x2, 0x2, 0x5aa, 0x5ab, 0x7, 0x77, 0x2, 0x2, 0x5ab, 0x5ac, + 0x7, 0x67, 0x2, 0x2, 0x5ac, 0x5ad, 0x7, 0x50, 0x2, 0x2, 0x5ad, 0x5ae, + 0x7, 0x63, 0x2, 0x2, 0x5ae, 0x5af, 0x7, 0x6f, 0x2, 0x2, 0x5af, 0x5b0, + 0x7, 0x67, 0x2, 0x2, 0x5b0, 0xdb, 0x3, 0x2, 0x2, 0x2, 0x5b1, 0x5b2, + 0x7, 0x51, 0x2, 0x2, 0x5b2, 0x5b3, 0x7, 0x6e, 0x2, 0x2, 0x5b3, 0x5b4, + 0x7, 0x66, 0x2, 0x2, 0x5b4, 0x5b5, 0x7, 0x67, 0x2, 0x2, 0x5b5, 0x5b6, + 0x7, 0x74, 0x2, 0x2, 0x5b6, 0x5b7, 0x7, 0x55, 0x2, 0x2, 0x5b7, 0x5b8, + 0x7, 0x6b, 0x2, 0x2, 0x5b8, 0x5b9, 0x7, 0x64, 0x2, 0x2, 0x5b9, 0x5ba, + 0x7, 0x6e, 0x2, 0x2, 0x5ba, 0x5bb, 0x7, 0x6b, 0x2, 0x2, 0x5bb, 0x5bc, + 0x7, 0x70, 0x2, 0x2, 0x5bc, 0x5bd, 0x7, 0x69, 0x2, 0x2, 0x5bd, 0x5be, + 0x7, 0x48, 0x2, 0x2, 0x5be, 0x5bf, 0x7, 0x71, 0x2, 0x2, 0x5bf, 0x5c0, + 0x7, 0x70, 0x2, 0x2, 0x5c0, 0x5c1, 0x7, 0x76, 0x2, 0x2, 0x5c1, 0x5c2, + 0x7, 0x43, 0x2, 0x2, 0x5c2, 0x5c3, 0x7, 0x76, 0x2, 0x2, 0x5c3, 0x5c4, + 0x7, 0x76, 0x2, 0x2, 0x5c4, 0x5c5, 0x7, 0x74, 0x2, 0x2, 0x5c5, 0x5c6, + 0x7, 0x6b, 0x2, 0x2, 0x5c6, 0x5c7, 0x7, 0x64, 0x2, 0x2, 0x5c7, 0x5c8, + 0x7, 0x77, 0x2, 0x2, 0x5c8, 0x5c9, 0x7, 0x76, 0x2, 0x2, 0x5c9, 0x5ca, + 0x7, 0x67, 0x2, 0x2, 0x5ca, 0xdd, 0x3, 0x2, 0x2, 0x2, 0x5cb, 0x5cc, + 0x7, 0x78, 0x2, 0x2, 0x5cc, 0x5cd, 0x7, 0x6a, 0x2, 0x2, 0x5cd, 0x5ce, + 0x7, 0x67, 0x2, 0x2, 0x5ce, 0x5cf, 0x7, 0x63, 0x2, 0x2, 0x5cf, 0xdf, + 0x3, 0x2, 0x2, 0x2, 0x5d0, 0x5d1, 0x7, 0x58, 0x2, 0x2, 0x5d1, 0x5d2, + 0x7, 0x67, 0x2, 0x2, 0x5d2, 0x5d3, 0x7, 0x74, 0x2, 0x2, 0x5d3, 0x5d4, + 0x7, 0x76, 0x2, 0x2, 0x5d4, 0x5d5, 0x7, 0x56, 0x2, 0x2, 0x5d5, 0x5d6, + 0x7, 0x7b, 0x2, 0x2, 0x5d6, 0x5d7, 0x7, 0x72, 0x2, 0x2, 0x5d7, 0x5d8, + 0x7, 0x71, 0x2, 0x2, 0x5d8, 0x5d9, 0x7, 0x43, 0x2, 0x2, 0x5d9, 0x5da, + 0x7, 0x75, 0x2, 0x2, 0x5da, 0x5db, 0x7, 0x65, 0x2, 0x2, 0x5db, 0x5dc, + 0x7, 0x67, 0x2, 0x2, 0x5dc, 0x5dd, 0x7, 0x70, 0x2, 0x2, 0x5dd, 0x5de, + 0x7, 0x66, 0x2, 0x2, 0x5de, 0x5df, 0x7, 0x67, 0x2, 0x2, 0x5df, 0x5e0, + 0x7, 0x74, 0x2, 0x2, 0x5e0, 0xe1, 0x3, 0x2, 0x2, 0x2, 0x5e1, 0x5e2, + 0x7, 0x58, 0x2, 0x2, 0x5e2, 0x5e3, 0x7, 0x67, 0x2, 0x2, 0x5e3, 0x5e4, + 0x7, 0x74, 0x2, 0x2, 0x5e4, 0x5e5, 0x7, 0x76, 0x2, 0x2, 0x5e5, 0x5e6, + 0x7, 0x56, 0x2, 0x2, 0x5e6, 0x5e7, 0x7, 0x7b, 0x2, 0x2, 0x5e7, 0x5e8, + 0x7, 0x72, 0x2, 0x2, 0x5e8, 0x5e9, 0x7, 0x71, 0x2, 0x2, 0x5e9, 0x5ea, + 0x7, 0x46, 0x2, 0x2, 0x5ea, 0x5eb, 0x7, 0x67, 0x2, 0x2, 0x5eb, 0x5ec, + 0x7, 0x75, 0x2, 0x2, 0x5ec, 0x5ed, 0x7, 0x65, 0x2, 0x2, 0x5ed, 0x5ee, + 0x7, 0x67, 0x2, 0x2, 0x5ee, 0x5ef, 0x7, 0x70, 0x2, 0x2, 0x5ef, 0x5f0, + 0x7, 0x66, 0x2, 0x2, 0x5f0, 0x5f1, 0x7, 0x67, 0x2, 0x2, 0x5f1, 0x5f2, + 0x7, 0x74, 0x2, 0x2, 0x5f2, 0xe3, 0x3, 0x2, 0x2, 0x2, 0x5f3, 0x5f4, + 0x7, 0x58, 0x2, 0x2, 0x5f4, 0x5f5, 0x7, 0x67, 0x2, 0x2, 0x5f5, 0x5f6, + 0x7, 0x74, 0x2, 0x2, 0x5f6, 0x5f7, 0x7, 0x76, 0x2, 0x2, 0x5f7, 0x5f8, + 0x7, 0x56, 0x2, 0x2, 0x5f8, 0x5f9, 0x7, 0x7b, 0x2, 0x2, 0x5f9, 0x5fa, + 0x7, 0x72, 0x2, 0x2, 0x5fa, 0x5fb, 0x7, 0x71, 0x2, 0x2, 0x5fb, 0x5fc, + 0x7, 0x4e, 0x2, 0x2, 0x5fc, 0x5fd, 0x7, 0x6b, 0x2, 0x2, 0x5fd, 0x5fe, + 0x7, 0x70, 0x2, 0x2, 0x5fe, 0x5ff, 0x7, 0x67, 0x2, 0x2, 0x5ff, 0x600, + 0x7, 0x49, 0x2, 0x2, 0x600, 0x601, 0x7, 0x63, 0x2, 0x2, 0x601, 0x602, + 0x7, 0x72, 0x2, 0x2, 0x602, 0xe5, 0x3, 0x2, 0x2, 0x2, 0x603, 0x604, + 0x7, 0x78, 0x2, 0x2, 0x604, 0x605, 0x7, 0x6f, 0x2, 0x2, 0x605, 0x606, + 0x7, 0x76, 0x2, 0x2, 0x606, 0x607, 0x7, 0x7a, 0x2, 0x2, 0x607, 0xe7, + 0x3, 0x2, 0x2, 0x2, 0x608, 0x609, 0x7, 0x58, 0x2, 0x2, 0x609, 0x60a, + 0x7, 0x67, 0x2, 0x2, 0x60a, 0x60b, 0x7, 0x74, 0x2, 0x2, 0x60b, 0x60c, + 0x7, 0x76, 0x2, 0x2, 0x60c, 0x60d, 0x7, 0x51, 0x2, 0x2, 0x60d, 0x60e, + 0x7, 0x74, 0x2, 0x2, 0x60e, 0x60f, 0x7, 0x6b, 0x2, 0x2, 0x60f, 0x610, + 0x7, 0x69, 0x2, 0x2, 0x610, 0x611, 0x7, 0x6b, 0x2, 0x2, 0x611, 0x612, + 0x7, 0x70, 0x2, 0x2, 0x612, 0x613, 0x7, 0x5b, 0x2, 0x2, 0x613, 0xe9, + 0x3, 0x2, 0x2, 0x2, 0x614, 0x615, 0x7, 0x58, 0x2, 0x2, 0x615, 0x616, + 0x7, 0x67, 0x2, 0x2, 0x616, 0x617, 0x7, 0x74, 0x2, 0x2, 0x617, 0x618, + 0x7, 0x76, 0x2, 0x2, 0x618, 0x619, 0x7, 0x43, 0x2, 0x2, 0x619, 0x61a, + 0x7, 0x66, 0x2, 0x2, 0x61a, 0x61b, 0x7, 0x78, 0x2, 0x2, 0x61b, 0x61c, + 0x7, 0x63, 0x2, 0x2, 0x61c, 0x61d, 0x7, 0x70, 0x2, 0x2, 0x61d, 0x61e, + 0x7, 0x65, 0x2, 0x2, 0x61e, 0x61f, 0x7, 0x67, 0x2, 0x2, 0x61f, 0x620, + 0x7, 0x5b, 0x2, 0x2, 0x620, 0xeb, 0x3, 0x2, 0x2, 0x2, 0x621, 0x622, + 0x7, 0x7d, 0x2, 0x2, 0x622, 0xed, 0x3, 0x2, 0x2, 0x2, 0x623, 0x624, + 0x7, 0x7f, 0x2, 0x2, 0x624, 0xef, 0x3, 0x2, 0x2, 0x2, 0x625, 0x626, + 0x7, 0x5d, 0x2, 0x2, 0x626, 0xf1, 0x3, 0x2, 0x2, 0x2, 0x627, 0x628, + 0x7, 0x5f, 0x2, 0x2, 0x628, 0xf3, 0x3, 0x2, 0x2, 0x2, 0x629, 0x62a, + 0x7, 0x2f, 0x2, 0x2, 0x62a, 0xf5, 0x3, 0x2, 0x2, 0x2, 0x62b, 0x62c, + 0x7, 0x3d, 0x2, 0x2, 0x62c, 0xf7, 0x3, 0x2, 0x2, 0x2, 0x62d, 0x62e, + 0x7, 0x3f, 0x2, 0x2, 0x62e, 0xf9, 0x3, 0x2, 0x2, 0x2, 0x62f, 0x630, + 0x7, 0x29, 0x2, 0x2, 0x630, 0xfb, 0x3, 0x2, 0x2, 0x2, 0x631, 0x632, + 0x7, 0x2e, 0x2, 0x2, 0x632, 0xfd, 0x3, 0x2, 0x2, 0x2, 0x633, 0x634, + 0x7, 0x24, 0x2, 0x2, 0x634, 0x635, 0x3, 0x2, 0x2, 0x2, 0x635, 0x636, + 0x8, 0x7d, 0x5, 0x2, 0x636, 0xff, 0x3, 0x2, 0x2, 0x2, 0x637, 0x638, + 0x9, 0x4, 0x2, 0x2, 0x638, 0x101, 0x3, 0x2, 0x2, 0x2, 0x639, 0x63c, + 0x5, 0x100, 0x7e, 0x2, 0x63a, 0x63c, 0x9, 0x5, 0x2, 0x2, 0x63b, 0x639, + 0x3, 0x2, 0x2, 0x2, 0x63b, 0x63a, 0x3, 0x2, 0x2, 0x2, 0x63c, 0x103, + 0x3, 0x2, 0x2, 0x2, 0x63d, 0x640, 0x5, 0x102, 0x7f, 0x2, 0x63e, 0x640, + 0x7, 0x2f, 0x2, 0x2, 0x63f, 0x63d, 0x3, 0x2, 0x2, 0x2, 0x63f, 0x63e, + 0x3, 0x2, 0x2, 0x2, 0x640, 0x105, 0x3, 0x2, 0x2, 0x2, 0x641, 0x642, + 0x7, 0x42, 0x2, 0x2, 0x642, 0x646, 0x5, 0x100, 0x7e, 0x2, 0x643, + 0x645, 0x5, 0x104, 0x80, 0x2, 0x644, 0x643, 0x3, 0x2, 0x2, 0x2, 0x645, + 0x648, 0x3, 0x2, 0x2, 0x2, 0x646, 0x644, 0x3, 0x2, 0x2, 0x2, 0x646, + 0x647, 0x3, 0x2, 0x2, 0x2, 0x647, 0x107, 0x3, 0x2, 0x2, 0x2, 0x648, + 0x646, 0x3, 0x2, 0x2, 0x2, 0x649, 0x64b, 0x7, 0x5e, 0x2, 0x2, 0x64a, + 0x64c, 0x4, 0x32, 0x3b, 0x2, 0x64b, 0x64a, 0x3, 0x2, 0x2, 0x2, 0x64c, + 0x64d, 0x3, 0x2, 0x2, 0x2, 0x64d, 0x64b, 0x3, 0x2, 0x2, 0x2, 0x64d, + 0x64e, 0x3, 0x2, 0x2, 0x2, 0x64e, 0x109, 0x3, 0x2, 0x2, 0x2, 0x64f, + 0x652, 0x5, 0x104, 0x80, 0x2, 0x650, 0x652, 0x9, 0x6, 0x2, 0x2, 0x651, + 0x64f, 0x3, 0x2, 0x2, 0x2, 0x651, 0x650, 0x3, 0x2, 0x2, 0x2, 0x652, + 0x10b, 0x3, 0x2, 0x2, 0x2, 0x653, 0x654, 0x7, 0x5e, 0x2, 0x2, 0x654, + 0x658, 0x5, 0x100, 0x7e, 0x2, 0x655, 0x657, 0x5, 0x10a, 0x83, 0x2, + 0x656, 0x655, 0x3, 0x2, 0x2, 0x2, 0x657, 0x65a, 0x3, 0x2, 0x2, 0x2, + 0x658, 0x656, 0x3, 0x2, 0x2, 0x2, 0x658, 0x659, 0x3, 0x2, 0x2, 0x2, + 0x659, 0x10d, 0x3, 0x2, 0x2, 0x2, 0x65a, 0x658, 0x3, 0x2, 0x2, 0x2, + 0x65b, 0x65f, 0x5, 0x100, 0x7e, 0x2, 0x65c, 0x65e, 0x5, 0x102, 0x7f, + 0x2, 0x65d, 0x65c, 0x3, 0x2, 0x2, 0x2, 0x65e, 0x661, 0x3, 0x2, 0x2, + 0x2, 0x65f, 0x65d, 0x3, 0x2, 0x2, 0x2, 0x65f, 0x660, 0x3, 0x2, 0x2, + 0x2, 0x660, 0x10f, 0x3, 0x2, 0x2, 0x2, 0x661, 0x65f, 0x3, 0x2, 0x2, + 0x2, 0x662, 0x666, 0x5, 0x100, 0x7e, 0x2, 0x663, 0x665, 0x5, 0x10a, + 0x83, 0x2, 0x664, 0x663, 0x3, 0x2, 0x2, 0x2, 0x665, 0x668, 0x3, 0x2, + 0x2, 0x2, 0x666, 0x664, 0x3, 0x2, 0x2, 0x2, 0x666, 0x667, 0x3, 0x2, + 0x2, 0x2, 0x667, 0x111, 0x3, 0x2, 0x2, 0x2, 0x668, 0x666, 0x3, 0x2, + 0x2, 0x2, 0x669, 0x66b, 0x7, 0x2f, 0x2, 0x2, 0x66a, 0x669, 0x3, 0x2, + 0x2, 0x2, 0x66a, 0x66b, 0x3, 0x2, 0x2, 0x2, 0x66b, 0x66d, 0x3, 0x2, + 0x2, 0x2, 0x66c, 0x66e, 0x4, 0x32, 0x3b, 0x2, 0x66d, 0x66c, 0x3, + 0x2, 0x2, 0x2, 0x66e, 0x66f, 0x3, 0x2, 0x2, 0x2, 0x66f, 0x66d, 0x3, + 0x2, 0x2, 0x2, 0x66f, 0x670, 0x3, 0x2, 0x2, 0x2, 0x670, 0x671, 0x3, + 0x2, 0x2, 0x2, 0x671, 0x673, 0x7, 0x30, 0x2, 0x2, 0x672, 0x674, 0x4, + 0x32, 0x3b, 0x2, 0x673, 0x672, 0x3, 0x2, 0x2, 0x2, 0x674, 0x675, + 0x3, 0x2, 0x2, 0x2, 0x675, 0x673, 0x3, 0x2, 0x2, 0x2, 0x675, 0x676, + 0x3, 0x2, 0x2, 0x2, 0x676, 0x113, 0x3, 0x2, 0x2, 0x2, 0x677, 0x678, + 0x7, 0x32, 0x2, 0x2, 0x678, 0x679, 0x7, 0x7a, 0x2, 0x2, 0x679, 0x67b, + 0x3, 0x2, 0x2, 0x2, 0x67a, 0x67c, 0x9, 0x7, 0x2, 0x2, 0x67b, 0x67a, + 0x3, 0x2, 0x2, 0x2, 0x67c, 0x67d, 0x3, 0x2, 0x2, 0x2, 0x67d, 0x67b, + 0x3, 0x2, 0x2, 0x2, 0x67d, 0x67e, 0x3, 0x2, 0x2, 0x2, 0x67e, 0x115, + 0x3, 0x2, 0x2, 0x2, 0x67f, 0x681, 0x7, 0x32, 0x2, 0x2, 0x680, 0x682, + 0x4, 0x32, 0x39, 0x2, 0x681, 0x680, 0x3, 0x2, 0x2, 0x2, 0x682, 0x683, + 0x3, 0x2, 0x2, 0x2, 0x683, 0x681, 0x3, 0x2, 0x2, 0x2, 0x683, 0x684, + 0x3, 0x2, 0x2, 0x2, 0x684, 0x117, 0x3, 0x2, 0x2, 0x2, 0x685, 0x687, + 0x7, 0x2f, 0x2, 0x2, 0x686, 0x685, 0x3, 0x2, 0x2, 0x2, 0x686, 0x687, + 0x3, 0x2, 0x2, 0x2, 0x687, 0x690, 0x3, 0x2, 0x2, 0x2, 0x688, 0x68c, + 0x4, 0x33, 0x3b, 0x2, 0x689, 0x68b, 0x4, 0x32, 0x3b, 0x2, 0x68a, + 0x689, 0x3, 0x2, 0x2, 0x2, 0x68b, 0x68e, 0x3, 0x2, 0x2, 0x2, 0x68c, + 0x68a, 0x3, 0x2, 0x2, 0x2, 0x68c, 0x68d, 0x3, 0x2, 0x2, 0x2, 0x68d, + 0x691, 0x3, 0x2, 0x2, 0x2, 0x68e, 0x68c, 0x3, 0x2, 0x2, 0x2, 0x68f, + 0x691, 0x7, 0x32, 0x2, 0x2, 0x690, 0x688, 0x3, 0x2, 0x2, 0x2, 0x690, + 0x68f, 0x3, 0x2, 0x2, 0x2, 0x691, 0x119, 0x3, 0x2, 0x2, 0x2, 0x692, + 0x693, 0x9, 0x8, 0x2, 0x2, 0x693, 0x11b, 0x3, 0x2, 0x2, 0x2, 0x694, + 0x697, 0x5, 0x11a, 0x8b, 0x2, 0x695, 0x697, 0x9, 0x9, 0x2, 0x2, 0x696, + 0x694, 0x3, 0x2, 0x2, 0x2, 0x696, 0x695, 0x3, 0x2, 0x2, 0x2, 0x697, + 0x11d, 0x3, 0x2, 0x2, 0x2, 0x698, 0x69a, 0x5, 0x11a, 0x8b, 0x2, 0x699, + 0x69b, 0x5, 0x11c, 0x8c, 0x2, 0x69a, 0x699, 0x3, 0x2, 0x2, 0x2, 0x69a, + 0x69b, 0x3, 0x2, 0x2, 0x2, 0x69b, 0x11f, 0x3, 0x2, 0x2, 0x2, 0x69c, + 0x69e, 0x9, 0x3, 0x2, 0x2, 0x69d, 0x69c, 0x3, 0x2, 0x2, 0x2, 0x69e, + 0x69f, 0x3, 0x2, 0x2, 0x2, 0x69f, 0x69d, 0x3, 0x2, 0x2, 0x2, 0x69f, + 0x6a0, 0x3, 0x2, 0x2, 0x2, 0x6a0, 0x6a1, 0x3, 0x2, 0x2, 0x2, 0x6a1, + 0x6a2, 0x8, 0x8e, 0x3, 0x2, 0x6a2, 0x121, 0x3, 0x2, 0x2, 0x2, 0x6a3, + 0x6a7, 0x5, 0x11a, 0x8b, 0x2, 0x6a4, 0x6a6, 0x5, 0x11c, 0x8c, 0x2, + 0x6a5, 0x6a4, 0x3, 0x2, 0x2, 0x2, 0x6a6, 0x6a9, 0x3, 0x2, 0x2, 0x2, + 0x6a7, 0x6a5, 0x3, 0x2, 0x2, 0x2, 0x6a7, 0x6a8, 0x3, 0x2, 0x2, 0x2, + 0x6a8, 0x6aa, 0x3, 0x2, 0x2, 0x2, 0x6a9, 0x6a7, 0x3, 0x2, 0x2, 0x2, + 0x6aa, 0x6ab, 0x8, 0x8f, 0x6, 0x2, 0x6ab, 0x123, 0x3, 0x2, 0x2, 0x2, + 0x6ac, 0x6ad, 0x7, 0x7d, 0x2, 0x2, 0x6ad, 0x6ae, 0x3, 0x2, 0x2, 0x2, + 0x6ae, 0x6af, 0x8, 0x90, 0x7, 0x2, 0x6af, 0x125, 0x3, 0x2, 0x2, 0x2, + 0x6b0, 0x6b2, 0x7, 0xf, 0x2, 0x2, 0x6b1, 0x6b0, 0x3, 0x2, 0x2, 0x2, + 0x6b1, 0x6b2, 0x3, 0x2, 0x2, 0x2, 0x6b2, 0x6b3, 0x3, 0x2, 0x2, 0x2, + 0x6b3, 0x6b4, 0x7, 0xc, 0x2, 0x2, 0x6b4, 0x6b5, 0x7, 0x7f, 0x2, 0x2, + 0x6b5, 0x6b9, 0x3, 0x2, 0x2, 0x2, 0x6b6, 0x6b8, 0x9, 0xa, 0x2, 0x2, + 0x6b7, 0x6b6, 0x3, 0x2, 0x2, 0x2, 0x6b8, 0x6bb, 0x3, 0x2, 0x2, 0x2, + 0x6b9, 0x6b7, 0x3, 0x2, 0x2, 0x2, 0x6b9, 0x6ba, 0x3, 0x2, 0x2, 0x2, + 0x6ba, 0x6bc, 0x3, 0x2, 0x2, 0x2, 0x6bb, 0x6b9, 0x3, 0x2, 0x2, 0x2, + 0x6bc, 0x6c0, 0x5, 0x11a, 0x8b, 0x2, 0x6bd, 0x6bf, 0x5, 0x11c, 0x8c, + 0x2, 0x6be, 0x6bd, 0x3, 0x2, 0x2, 0x2, 0x6bf, 0x6c2, 0x3, 0x2, 0x2, + 0x2, 0x6c0, 0x6be, 0x3, 0x2, 0x2, 0x2, 0x6c0, 0x6c1, 0x3, 0x2, 0x2, + 0x2, 0x6c1, 0x6c6, 0x3, 0x2, 0x2, 0x2, 0x6c2, 0x6c0, 0x3, 0x2, 0x2, + 0x2, 0x6c3, 0x6c5, 0x9, 0xa, 0x2, 0x2, 0x6c4, 0x6c3, 0x3, 0x2, 0x2, + 0x2, 0x6c5, 0x6c8, 0x3, 0x2, 0x2, 0x2, 0x6c6, 0x6c4, 0x3, 0x2, 0x2, + 0x2, 0x6c6, 0x6c7, 0x3, 0x2, 0x2, 0x2, 0x6c7, 0x6c9, 0x3, 0x2, 0x2, + 0x2, 0x6c8, 0x6c6, 0x3, 0x2, 0x2, 0x2, 0x6c9, 0x6ca, 0x7, 0x3d, 0x2, + 0x2, 0x6ca, 0x6cb, 0x6, 0x91, 0x2, 0x2, 0x6cb, 0x6cc, 0x3, 0x2, 0x2, + 0x2, 0x6cc, 0x6cd, 0x8, 0x91, 0x8, 0x2, 0x6cd, 0x127, 0x3, 0x2, 0x2, + 0x2, 0x6ce, 0x6d0, 0x7, 0xf, 0x2, 0x2, 0x6cf, 0x6ce, 0x3, 0x2, 0x2, + 0x2, 0x6cf, 0x6d0, 0x3, 0x2, 0x2, 0x2, 0x6d0, 0x6d1, 0x3, 0x2, 0x2, + 0x2, 0x6d1, 0x6d5, 0x7, 0xc, 0x2, 0x2, 0x6d2, 0x6d4, 0xa, 0x2, 0x2, + 0x2, 0x6d3, 0x6d2, 0x3, 0x2, 0x2, 0x2, 0x6d4, 0x6d7, 0x3, 0x2, 0x2, + 0x2, 0x6d5, 0x6d3, 0x3, 0x2, 0x2, 0x2, 0x6d5, 0x6d6, 0x3, 0x2, 0x2, + 0x2, 0x6d6, 0x129, 0x3, 0x2, 0x2, 0x2, 0x6d7, 0x6d5, 0x3, 0x2, 0x2, + 0x2, 0x6d8, 0x6da, 0x9, 0x3, 0x2, 0x2, 0x6d9, 0x6d8, 0x3, 0x2, 0x2, + 0x2, 0x6da, 0x6db, 0x3, 0x2, 0x2, 0x2, 0x6db, 0x6d9, 0x3, 0x2, 0x2, + 0x2, 0x6db, 0x6dc, 0x3, 0x2, 0x2, 0x2, 0x6dc, 0x6dd, 0x3, 0x2, 0x2, + 0x2, 0x6dd, 0x6de, 0x8, 0x93, 0x3, 0x2, 0x6de, 0x12b, 0x3, 0x2, 0x2, + 0x2, 0x6df, 0x6e0, 0x7, 0x2a, 0x2, 0x2, 0x6e0, 0x6e1, 0x3, 0x2, 0x2, + 0x2, 0x6e1, 0x6e2, 0x8, 0x94, 0x9, 0x2, 0x6e2, 0x12d, 0x3, 0x2, 0x2, + 0x2, 0x6e3, 0x6e5, 0xa, 0xb, 0x2, 0x2, 0x6e4, 0x6e3, 0x3, 0x2, 0x2, + 0x2, 0x6e5, 0x6e6, 0x3, 0x2, 0x2, 0x2, 0x6e6, 0x6e4, 0x3, 0x2, 0x2, + 0x2, 0x6e6, 0x6e7, 0x3, 0x2, 0x2, 0x2, 0x6e7, 0x12f, 0x3, 0x2, 0x2, + 0x2, 0x6e8, 0x6e9, 0x7, 0x2b, 0x2, 0x2, 0x6e9, 0x6ea, 0x3, 0x2, 0x2, + 0x2, 0x6ea, 0x6eb, 0x8, 0x96, 0x8, 0x2, 0x6eb, 0x131, 0x3, 0x2, 0x2, + 0x2, 0x6ec, 0x6ee, 0xa, 0xc, 0x2, 0x2, 0x6ed, 0x6ec, 0x3, 0x2, 0x2, + 0x2, 0x6ee, 0x6f1, 0x3, 0x2, 0x2, 0x2, 0x6ef, 0x6ed, 0x3, 0x2, 0x2, + 0x2, 0x6ef, 0x6f0, 0x3, 0x2, 0x2, 0x2, 0x6f0, 0x133, 0x3, 0x2, 0x2, + 0x2, 0x6f1, 0x6ef, 0x3, 0x2, 0x2, 0x2, 0x6f2, 0x6f3, 0x7, 0x24, 0x2, + 0x2, 0x6f3, 0x6f4, 0x3, 0x2, 0x2, 0x2, 0x6f4, 0x6f5, 0x8, 0x98, 0x8, + 0x2, 0x6f5, 0x135, 0x3, 0x2, 0x2, 0x2, 0x27, 0x2, 0x3, 0x4, 0x5, + 0x6, 0x7, 0x14d, 0x155, 0x63b, 0x63f, 0x646, 0x64d, 0x651, 0x658, + 0x65f, 0x666, 0x66a, 0x66f, 0x675, 0x67d, 0x683, 0x686, 0x68c, 0x690, + 0x696, 0x69a, 0x69f, 0x6a7, 0x6b1, 0x6b9, 0x6c0, 0x6c6, 0x6cf, 0x6d5, + 0x6db, 0x6e6, 0x6ef, 0xa, 0x7, 0x3, 0x2, 0x8, 0x2, 0x2, 0x7, 0x5, + 0x2, 0x7, 0x7, 0x2, 0x3, 0x8f, 0x2, 0x4, 0x4, 0x2, 0x6, 0x2, 0x2, + 0x4, 0x6, 0x2, + }; + + _serializedATN.insert(_serializedATN.end(), serializedATNSegment0, + serializedATNSegment0 + sizeof(serializedATNSegment0) / sizeof(serializedATNSegment0[0])); + + + atn::ATNDeserializer deserializer; + _atn = deserializer.deserialize(_serializedATN); + + size_t count = _atn.getNumberOfDecisions(); + _decisionToDFA.reserve(count); + for (size_t i = 0; i < count; i++) { + _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); + } +} + +FeatLexer::Initializer FeatLexer::_init; diff --git a/c/makeotf/lib/hotconv/FeatLexer.g4 b/c/makeotf/lib/hotconv/FeatLexer.g4 new file mode 100644 index 000000000..98fb4ed60 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatLexer.g4 @@ -0,0 +1,44 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +lexer grammar FeatLexer; +import FeatLexerBase; + +@members { + std::string anon_tag; + + /* All the TSTART/TCHR characters are grouped together, so just + * look for the string and if its there verify that the characters + * on either side are from the appropriate set (in case there are + * "extra" characters). + */ + + bool verify_anon(const std::string &line) { + auto p = line.find(anon_tag); + if ( p == std::string::npos ) + return false; + --p; + if ( ! ( line[p] == ' ' || line[p] == '\t' || line[p] == '}' ) ) + return false; + p += anon_tag.size() + 1; + if ( ! ( line[p] == ' ' || line[p] == '\t' || line[p] == ';' ) ) + return false; + return true; + } +} + +ANON : 'anon' -> pushMode(Anon) ; +ANON_v : 'anonymous' -> pushMode(Anon) ; + +mode Anon; + +A_WHITESPACE : [ \t\r\n]+ -> skip ; +A_LABEL : TSTART TCHR* { anon_tag = getText(); } ; +A_LBRACE : '{' -> mode(AnonContent) ; + +mode AnonContent; + +A_CLOSE : '\r'? '\n}' [ \t]* TSTART TCHR* [ \t]* ';' { verify_anon(getText()) }? -> popMode ; +A_LINE : '\r'? '\n' ~[\r\n]* ; diff --git a/c/makeotf/lib/hotconv/FeatLexer.h b/c/makeotf/lib/hotconv/FeatLexer.h new file mode 100644 index 000000000..98193269d --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatLexer.h @@ -0,0 +1,117 @@ + +// Generated from FeatLexer.g4 by ANTLR 4.9.2 + +#pragma once + + +#include "antlr4-runtime.h" + + + + +class FeatLexer : public antlr4::Lexer { +public: + enum { + ANON = 1, ANON_v = 2, COMMENT = 3, WHITESPACE = 4, INCLUDE = 5, FEATURE = 6, + TABLE = 7, SCRIPT = 8, LANGUAGE = 9, LANGSYS = 10, SUBTABLE = 11, LOOKUP = 12, + LOOKUPFLAG = 13, NOTDEF = 14, RIGHT_TO_LEFT = 15, IGNORE_BASE_GLYPHS = 16, + IGNORE_LIGATURES = 17, IGNORE_MARKS = 18, USE_MARK_FILTERING_SET = 19, + MARK_ATTACHMENT_TYPE = 20, EXCLUDE_DFLT = 21, INCLUDE_DFLT = 22, EXCLUDE_dflt = 23, + INCLUDE_dflt = 24, USE_EXTENSION = 25, BEGINVALUE = 26, ENDVALUE = 27, + ENUMERATE = 28, ENUMERATE_v = 29, EXCEPT = 30, IGNORE = 31, SUBSTITUTE = 32, + SUBSTITUTE_v = 33, REVERSE = 34, REVERSE_v = 35, BY = 36, FROM = 37, + POSITION = 38, POSITION_v = 39, PARAMETERS = 40, FEATURE_NAMES = 41, + CV_PARAMETERS = 42, CV_UI_LABEL = 43, CV_TOOLTIP = 44, CV_SAMPLE_TEXT = 45, + CV_PARAM_LABEL = 46, CV_CHARACTER = 47, SIZEMENUNAME = 48, CONTOURPOINT = 49, + ANCHOR = 50, ANCHOR_DEF = 51, VALUE_RECORD_DEF = 52, MARK = 53, MARK_CLASS = 54, + CURSIVE = 55, MARKBASE = 56, MARKLIG = 57, MARKLIG_v = 58, LIG_COMPONENT = 59, + KNULL = 60, BASE = 61, HA_BTL = 62, VA_BTL = 63, HA_BSL = 64, VA_BSL = 65, + GDEF = 66, GLYPH_CLASS_DEF = 67, ATTACH = 68, LIG_CARET_BY_POS = 69, + LIG_CARET_BY_IDX = 70, HEAD = 71, FONT_REVISION = 72, HHEA = 73, ASCENDER = 74, + DESCENDER = 75, LINE_GAP = 76, CARET_OFFSET = 77, NAME = 78, NAMEID = 79, + OS_2 = 80, FS_TYPE = 81, FS_TYPE_v = 82, OS2_LOWER_OP_SIZE = 83, OS2_UPPER_OP_SIZE = 84, + PANOSE = 85, TYPO_ASCENDER = 86, TYPO_DESCENDER = 87, TYPO_LINE_GAP = 88, + WIN_ASCENT = 89, WIN_DESCENT = 90, X_HEIGHT = 91, CAP_HEIGHT = 92, WEIGHT_CLASS = 93, + WIDTH_CLASS = 94, VENDOR = 95, UNICODE_RANGE = 96, CODE_PAGE_RANGE = 97, + FAMILY_CLASS = 98, STAT = 99, ELIDED_FALLBACK_NAME = 100, ELIDED_FALLBACK_NAME_ID = 101, + DESIGN_AXIS = 102, AXIS_VALUE = 103, FLAG = 104, LOCATION = 105, AXIS_EAVN = 106, + AXIS_OSFA = 107, VHEA = 108, VERT_TYPO_ASCENDER = 109, VERT_TYPO_DESCENDER = 110, + VERT_TYPO_LINE_GAP = 111, VMTX = 112, VERT_ORIGIN_Y = 113, VERT_ADVANCE_Y = 114, + LCBRACE = 115, RCBRACE = 116, LBRACKET = 117, RBRACKET = 118, HYPHEN = 119, + SEMI = 120, EQUALS = 121, MARKER = 122, COMMA = 123, QUOTE = 124, GCLASS = 125, + CID = 126, ESCGNAME = 127, NAMELABEL = 128, EXTNAME = 129, POINTNUM = 130, + NUMEXT = 131, NUMOCT = 132, NUM = 133, CATCHTAG = 134, A_WHITESPACE = 135, + A_LABEL = 136, A_LBRACE = 137, A_CLOSE = 138, A_LINE = 139, I_WHITESPACE = 140, + I_RPAREN = 141, IFILE = 142, I_LPAREN = 143, STRVAL = 144, EQUOTE = 145 + }; + + enum { + Anon = 1, AnonContent = 2, Include = 3, Ifile = 4, String = 5 + }; + + explicit FeatLexer(antlr4::CharStream *input); + ~FeatLexer(); + + + std::string anon_tag; + + /* All the TSTART/TCHR characters are grouped together, so just + * look for the string and if its there verify that the characters + * on either side are from the appropriate set (in case there are + * "extra" characters). + */ + + bool verify_anon(const std::string &line) { + auto p = line.find(anon_tag); + if ( p == std::string::npos ) + return false; + --p; + if ( ! ( line[p] == ' ' || line[p] == '\t' || line[p] == '}' ) ) + return false; + p += anon_tag.size() + 1; + if ( ! ( line[p] == ' ' || line[p] == '\t' || line[p] == ';' ) ) + return false; + return true; + } + + virtual std::string getGrammarFileName() const override; + virtual const std::vector& getRuleNames() const override; + + virtual const std::vector& getChannelNames() const override; + virtual const std::vector& getModeNames() const override; + virtual const std::vector& getTokenNames() const override; // deprecated, use vocabulary instead + virtual antlr4::dfa::Vocabulary& getVocabulary() const override; + + virtual const std::vector getSerializedATN() const override; + virtual const antlr4::atn::ATN& getATN() const override; + + virtual void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override; + virtual bool sempred(antlr4::RuleContext *_localctx, size_t ruleIndex, size_t predicateIndex) override; + +private: + static std::vector _decisionToDFA; + static antlr4::atn::PredictionContextCache _sharedContextCache; + static std::vector _ruleNames; + static std::vector _tokenNames; + static std::vector _channelNames; + static std::vector _modeNames; + + static std::vector _literalNames; + static std::vector _symbolicNames; + static antlr4::dfa::Vocabulary _vocabulary; + static antlr4::atn::ATN _atn; + static std::vector _serializedATN; + + + // Individual action functions triggered by action() above. + void A_LABELAction(antlr4::RuleContext *context, size_t actionIndex); + + // Individual semantic predicate functions triggered by sempred() above. + bool A_CLOSESempred(antlr4::RuleContext *_localctx, size_t predicateIndex); + + struct Initializer { + Initializer(); + }; + static Initializer _init; +}; + diff --git a/c/makeotf/lib/hotconv/FeatLexer.interp b/c/makeotf/lib/hotconv/FeatLexer.interp new file mode 100644 index 000000000..7e7ec4603 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatLexer.interp @@ -0,0 +1,463 @@ +token literal names: +null +'anon' +'anonymous' +null +null +'include' +'feature' +'table' +'script' +'language' +'languagesystem' +'subtable' +'lookup' +'lookupflag' +'.notdef' +'RightToLeft' +'IgnoreBaseGlyphs' +'IgnoreLigatures' +'IgnoreMarks' +'UseMarkFilteringSet' +'MarkAttachmentType' +'excludeDFLT' +'includeDFLT' +'exclude_dflt' +'include_dflt' +'useExtension' +'<' +'>' +'enumerate' +'enum' +'except' +'ignore' +'substitute' +'sub' +'reversesub' +'rsub' +'by' +'from' +'position' +'pos' +'parameters' +'featureNames' +'cvParameters' +'FeatUILabelNameID' +'FeatUITooltipTextNameID' +'SampleTextNameID' +'ParamUILabelNameID' +'Character' +'sizemenuname' +'contourpoint' +'anchor' +'anchorDef' +'valueRecordDef' +'mark' +'markClass' +'cursive' +'base' +'ligature' +'lig' +'ligComponent' +'NULL' +'BASE' +'HorizAxis.BaseTagList' +'VertAxis.BaseTagList' +'HorizAxis.BaseScriptList' +'VertAxis.BaseScriptList' +'GDEF' +'GlyphClassDef' +'Attach' +'LigatureCaretByPos' +'LigatureCaretByIndex' +'head' +'FontRevision' +'hhea' +'Ascender' +'Descender' +'LineGap' +'CaretOffset' +'name' +'nameid' +'OS/2' +'FSType' +'fsType' +'LowerOpSize' +'UpperOpSize' +'Panose' +'TypoAscender' +'TypoDescender' +'TypoLineGap' +'winAscent' +'winDescent' +'XHeight' +'CapHeight' +'WeightClass' +'WidthClass' +'Vendor' +'UnicodeRange' +'CodePageRange' +'FamilyClass' +'STAT' +'ElidedFallbackName' +'ElidedFallbackNameID' +'DesignAxis' +'AxisValue' +'flag' +'location' +'ElidableAxisValueName' +'OlderSiblingFontAttribute' +'vhea' +'VertTypoAscender' +'VertTypoDescender' +'VertTypoLineGap' +'vmtx' +'VertOriginY' +'VertAdvanceY' +null +'}' +'[' +']' +'-' +';' +'=' +'\'' +',' +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +'(' +null +')' +null +null + +token symbolic names: +null +ANON +ANON_v +COMMENT +WHITESPACE +INCLUDE +FEATURE +TABLE +SCRIPT +LANGUAGE +LANGSYS +SUBTABLE +LOOKUP +LOOKUPFLAG +NOTDEF +RIGHT_TO_LEFT +IGNORE_BASE_GLYPHS +IGNORE_LIGATURES +IGNORE_MARKS +USE_MARK_FILTERING_SET +MARK_ATTACHMENT_TYPE +EXCLUDE_DFLT +INCLUDE_DFLT +EXCLUDE_dflt +INCLUDE_dflt +USE_EXTENSION +BEGINVALUE +ENDVALUE +ENUMERATE +ENUMERATE_v +EXCEPT +IGNORE +SUBSTITUTE +SUBSTITUTE_v +REVERSE +REVERSE_v +BY +FROM +POSITION +POSITION_v +PARAMETERS +FEATURE_NAMES +CV_PARAMETERS +CV_UI_LABEL +CV_TOOLTIP +CV_SAMPLE_TEXT +CV_PARAM_LABEL +CV_CHARACTER +SIZEMENUNAME +CONTOURPOINT +ANCHOR +ANCHOR_DEF +VALUE_RECORD_DEF +MARK +MARK_CLASS +CURSIVE +MARKBASE +MARKLIG +MARKLIG_v +LIG_COMPONENT +KNULL +BASE +HA_BTL +VA_BTL +HA_BSL +VA_BSL +GDEF +GLYPH_CLASS_DEF +ATTACH +LIG_CARET_BY_POS +LIG_CARET_BY_IDX +HEAD +FONT_REVISION +HHEA +ASCENDER +DESCENDER +LINE_GAP +CARET_OFFSET +NAME +NAMEID +OS_2 +FS_TYPE +FS_TYPE_v +OS2_LOWER_OP_SIZE +OS2_UPPER_OP_SIZE +PANOSE +TYPO_ASCENDER +TYPO_DESCENDER +TYPO_LINE_GAP +WIN_ASCENT +WIN_DESCENT +X_HEIGHT +CAP_HEIGHT +WEIGHT_CLASS +WIDTH_CLASS +VENDOR +UNICODE_RANGE +CODE_PAGE_RANGE +FAMILY_CLASS +STAT +ELIDED_FALLBACK_NAME +ELIDED_FALLBACK_NAME_ID +DESIGN_AXIS +AXIS_VALUE +FLAG +LOCATION +AXIS_EAVN +AXIS_OSFA +VHEA +VERT_TYPO_ASCENDER +VERT_TYPO_DESCENDER +VERT_TYPO_LINE_GAP +VMTX +VERT_ORIGIN_Y +VERT_ADVANCE_Y +LCBRACE +RCBRACE +LBRACKET +RBRACKET +HYPHEN +SEMI +EQUALS +MARKER +COMMA +QUOTE +GCLASS +CID +ESCGNAME +NAMELABEL +EXTNAME +POINTNUM +NUMEXT +NUMOCT +NUM +CATCHTAG +A_WHITESPACE +A_LABEL +A_LBRACE +A_CLOSE +A_LINE +I_WHITESPACE +I_RPAREN +IFILE +I_LPAREN +STRVAL +EQUOTE + +rule names: +ANON +ANON_v +COMMENT +WHITESPACE +INCLUDE +FEATURE +TABLE +SCRIPT +LANGUAGE +LANGSYS +SUBTABLE +LOOKUP +LOOKUPFLAG +NOTDEF +RIGHT_TO_LEFT +IGNORE_BASE_GLYPHS +IGNORE_LIGATURES +IGNORE_MARKS +USE_MARK_FILTERING_SET +MARK_ATTACHMENT_TYPE +EXCLUDE_DFLT +INCLUDE_DFLT +EXCLUDE_dflt +INCLUDE_dflt +USE_EXTENSION +BEGINVALUE +ENDVALUE +ENUMERATE +ENUMERATE_v +EXCEPT +IGNORE +SUBSTITUTE +SUBSTITUTE_v +REVERSE +REVERSE_v +BY +FROM +POSITION +POSITION_v +PARAMETERS +FEATURE_NAMES +CV_PARAMETERS +CV_UI_LABEL +CV_TOOLTIP +CV_SAMPLE_TEXT +CV_PARAM_LABEL +CV_CHARACTER +SIZEMENUNAME +CONTOURPOINT +ANCHOR +ANCHOR_DEF +VALUE_RECORD_DEF +MARK +MARK_CLASS +CURSIVE +MARKBASE +MARKLIG +MARKLIG_v +LIG_COMPONENT +KNULL +BASE +HA_BTL +VA_BTL +HA_BSL +VA_BSL +GDEF +GLYPH_CLASS_DEF +ATTACH +LIG_CARET_BY_POS +LIG_CARET_BY_IDX +HEAD +FONT_REVISION +HHEA +ASCENDER +DESCENDER +LINE_GAP +CARET_OFFSET +NAME +NAMEID +OS_2 +FS_TYPE +FS_TYPE_v +OS2_LOWER_OP_SIZE +OS2_UPPER_OP_SIZE +PANOSE +TYPO_ASCENDER +TYPO_DESCENDER +TYPO_LINE_GAP +WIN_ASCENT +WIN_DESCENT +X_HEIGHT +CAP_HEIGHT +WEIGHT_CLASS +WIDTH_CLASS +VENDOR +UNICODE_RANGE +CODE_PAGE_RANGE +FAMILY_CLASS +STAT +ELIDED_FALLBACK_NAME +ELIDED_FALLBACK_NAME_ID +DESIGN_AXIS +AXIS_VALUE +FLAG +LOCATION +AXIS_EAVN +AXIS_OSFA +VHEA +VERT_TYPO_ASCENDER +VERT_TYPO_DESCENDER +VERT_TYPO_LINE_GAP +VMTX +VERT_ORIGIN_Y +VERT_ADVANCE_Y +LCBRACE +RCBRACE +LBRACKET +RBRACKET +HYPHEN +SEMI +EQUALS +MARKER +COMMA +QUOTE +GNST +LCHR +GCCHR +GCLASS +CID +GNCHR +ESCGNAME +NAMELABEL +EXTNAME +POINTNUM +NUMEXT +NUMOCT +NUM +TSTART +TCHR +CATCHTAG +A_WHITESPACE +A_LABEL +A_LBRACE +A_CLOSE +A_LINE +I_WHITESPACE +I_RPAREN +IFILE +I_LPAREN +STRVAL +EQUOTE + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE +Anon +AnonContent +Include +Ifile +String + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 147, 1782, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 4, 118, 9, 118, 4, 119, 9, 119, 4, 120, 9, 120, 4, 121, 9, 121, 4, 122, 9, 122, 4, 123, 9, 123, 4, 124, 9, 124, 4, 125, 9, 125, 4, 126, 9, 126, 4, 127, 9, 127, 4, 128, 9, 128, 4, 129, 9, 129, 4, 130, 9, 130, 4, 131, 9, 131, 4, 132, 9, 132, 4, 133, 9, 133, 4, 134, 9, 134, 4, 135, 9, 135, 4, 136, 9, 136, 4, 137, 9, 137, 4, 138, 9, 138, 4, 139, 9, 139, 4, 140, 9, 140, 4, 141, 9, 141, 4, 142, 9, 142, 4, 143, 9, 143, 4, 144, 9, 144, 4, 145, 9, 145, 4, 146, 9, 146, 4, 147, 9, 147, 4, 148, 9, 148, 4, 149, 9, 149, 4, 150, 9, 150, 4, 151, 9, 151, 4, 152, 9, 152, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 7, 4, 332, 10, 4, 12, 4, 14, 4, 335, 11, 4, 3, 4, 3, 4, 3, 5, 6, 5, 340, 10, 5, 13, 5, 14, 5, 341, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 88, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 89, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 90, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 92, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 94, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 95, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 96, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 97, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 102, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 103, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 105, 3, 105, 3, 105, 3, 105, 3, 105, 3, 106, 3, 106, 3, 106, 3, 106, 3, 106, 3, 106, 3, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 107, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 108, 3, 109, 3, 109, 3, 109, 3, 109, 3, 109, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 110, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 112, 3, 113, 3, 113, 3, 113, 3, 113, 3, 113, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 114, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 115, 3, 116, 3, 116, 3, 117, 3, 117, 3, 118, 3, 118, 3, 119, 3, 119, 3, 120, 3, 120, 3, 121, 3, 121, 3, 122, 3, 122, 3, 123, 3, 123, 3, 124, 3, 124, 3, 125, 3, 125, 3, 125, 3, 125, 3, 126, 3, 126, 3, 127, 3, 127, 5, 127, 1596, 10, 127, 3, 128, 3, 128, 5, 128, 1600, 10, 128, 3, 129, 3, 129, 3, 129, 7, 129, 1605, 10, 129, 12, 129, 14, 129, 1608, 11, 129, 3, 130, 3, 130, 6, 130, 1612, 10, 130, 13, 130, 14, 130, 1613, 3, 131, 3, 131, 5, 131, 1618, 10, 131, 3, 132, 3, 132, 3, 132, 7, 132, 1623, 10, 132, 12, 132, 14, 132, 1626, 11, 132, 3, 133, 3, 133, 7, 133, 1630, 10, 133, 12, 133, 14, 133, 1633, 11, 133, 3, 134, 3, 134, 7, 134, 1637, 10, 134, 12, 134, 14, 134, 1640, 11, 134, 3, 135, 5, 135, 1643, 10, 135, 3, 135, 6, 135, 1646, 10, 135, 13, 135, 14, 135, 1647, 3, 135, 3, 135, 6, 135, 1652, 10, 135, 13, 135, 14, 135, 1653, 3, 136, 3, 136, 3, 136, 3, 136, 6, 136, 1660, 10, 136, 13, 136, 14, 136, 1661, 3, 137, 3, 137, 6, 137, 1666, 10, 137, 13, 137, 14, 137, 1667, 3, 138, 5, 138, 1671, 10, 138, 3, 138, 3, 138, 7, 138, 1675, 10, 138, 12, 138, 14, 138, 1678, 11, 138, 3, 138, 5, 138, 1681, 10, 138, 3, 139, 3, 139, 3, 140, 3, 140, 5, 140, 1687, 10, 140, 3, 141, 3, 141, 5, 141, 1691, 10, 141, 3, 142, 6, 142, 1694, 10, 142, 13, 142, 14, 142, 1695, 3, 142, 3, 142, 3, 143, 3, 143, 7, 143, 1702, 10, 143, 12, 143, 14, 143, 1705, 11, 143, 3, 143, 3, 143, 3, 144, 3, 144, 3, 144, 3, 144, 3, 145, 5, 145, 1714, 10, 145, 3, 145, 3, 145, 3, 145, 3, 145, 7, 145, 1720, 10, 145, 12, 145, 14, 145, 1723, 11, 145, 3, 145, 3, 145, 7, 145, 1727, 10, 145, 12, 145, 14, 145, 1730, 11, 145, 3, 145, 7, 145, 1733, 10, 145, 12, 145, 14, 145, 1736, 11, 145, 3, 145, 3, 145, 3, 145, 3, 145, 3, 145, 3, 146, 5, 146, 1744, 10, 146, 3, 146, 3, 146, 7, 146, 1748, 10, 146, 12, 146, 14, 146, 1751, 11, 146, 3, 147, 6, 147, 1754, 10, 147, 13, 147, 14, 147, 1755, 3, 147, 3, 147, 3, 148, 3, 148, 3, 148, 3, 148, 3, 149, 6, 149, 1765, 10, 149, 13, 149, 14, 149, 1766, 3, 150, 3, 150, 3, 150, 3, 150, 3, 151, 7, 151, 1774, 10, 151, 12, 151, 14, 151, 1777, 11, 151, 3, 152, 3, 152, 3, 152, 3, 152, 2, 2, 153, 8, 3, 10, 4, 12, 5, 14, 6, 16, 7, 18, 8, 20, 9, 22, 10, 24, 11, 26, 12, 28, 13, 30, 14, 32, 15, 34, 16, 36, 17, 38, 18, 40, 19, 42, 20, 44, 21, 46, 22, 48, 23, 50, 24, 52, 25, 54, 26, 56, 27, 58, 28, 60, 29, 62, 30, 64, 31, 66, 32, 68, 33, 70, 34, 72, 35, 74, 36, 76, 37, 78, 38, 80, 39, 82, 40, 84, 41, 86, 42, 88, 43, 90, 44, 92, 45, 94, 46, 96, 47, 98, 48, 100, 49, 102, 50, 104, 51, 106, 52, 108, 53, 110, 54, 112, 55, 114, 56, 116, 57, 118, 58, 120, 59, 122, 60, 124, 61, 126, 62, 128, 63, 130, 64, 132, 65, 134, 66, 136, 67, 138, 68, 140, 69, 142, 70, 144, 71, 146, 72, 148, 73, 150, 74, 152, 75, 154, 76, 156, 77, 158, 78, 160, 79, 162, 80, 164, 81, 166, 82, 168, 83, 170, 84, 172, 85, 174, 86, 176, 87, 178, 88, 180, 89, 182, 90, 184, 91, 186, 92, 188, 93, 190, 94, 192, 95, 194, 96, 196, 97, 198, 98, 200, 99, 202, 100, 204, 101, 206, 102, 208, 103, 210, 104, 212, 105, 214, 106, 216, 107, 218, 108, 220, 109, 222, 110, 224, 111, 226, 112, 228, 113, 230, 114, 232, 115, 234, 116, 236, 117, 238, 118, 240, 119, 242, 120, 244, 121, 246, 122, 248, 123, 250, 124, 252, 125, 254, 126, 256, 2, 258, 2, 260, 2, 262, 127, 264, 128, 266, 2, 268, 129, 270, 130, 272, 131, 274, 132, 276, 133, 278, 134, 280, 135, 282, 2, 284, 2, 286, 136, 288, 137, 290, 138, 292, 139, 294, 140, 296, 141, 298, 142, 300, 143, 302, 144, 304, 145, 306, 146, 308, 147, 8, 2, 3, 4, 5, 6, 7, 13, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 15, 15, 34, 34, 5, 2, 67, 92, 97, 97, 99, 124, 4, 2, 48, 48, 50, 59, 7, 2, 44, 45, 60, 60, 96, 96, 126, 126, 128, 128, 5, 2, 50, 59, 67, 72, 99, 104, 12, 2, 35, 35, 38, 40, 44, 45, 48, 48, 60, 60, 65, 65, 67, 92, 96, 124, 126, 126, 128, 128, 4, 2, 47, 47, 50, 59, 4, 2, 11, 11, 34, 34, 3, 2, 43, 43, 3, 2, 36, 36, 2, 1801, 2, 8, 3, 2, 2, 2, 2, 10, 3, 2, 2, 2, 2, 12, 3, 2, 2, 2, 2, 14, 3, 2, 2, 2, 2, 16, 3, 2, 2, 2, 2, 18, 3, 2, 2, 2, 2, 20, 3, 2, 2, 2, 2, 22, 3, 2, 2, 2, 2, 24, 3, 2, 2, 2, 2, 26, 3, 2, 2, 2, 2, 28, 3, 2, 2, 2, 2, 30, 3, 2, 2, 2, 2, 32, 3, 2, 2, 2, 2, 34, 3, 2, 2, 2, 2, 36, 3, 2, 2, 2, 2, 38, 3, 2, 2, 2, 2, 40, 3, 2, 2, 2, 2, 42, 3, 2, 2, 2, 2, 44, 3, 2, 2, 2, 2, 46, 3, 2, 2, 2, 2, 48, 3, 2, 2, 2, 2, 50, 3, 2, 2, 2, 2, 52, 3, 2, 2, 2, 2, 54, 3, 2, 2, 2, 2, 56, 3, 2, 2, 2, 2, 58, 3, 2, 2, 2, 2, 60, 3, 2, 2, 2, 2, 62, 3, 2, 2, 2, 2, 64, 3, 2, 2, 2, 2, 66, 3, 2, 2, 2, 2, 68, 3, 2, 2, 2, 2, 70, 3, 2, 2, 2, 2, 72, 3, 2, 2, 2, 2, 74, 3, 2, 2, 2, 2, 76, 3, 2, 2, 2, 2, 78, 3, 2, 2, 2, 2, 80, 3, 2, 2, 2, 2, 82, 3, 2, 2, 2, 2, 84, 3, 2, 2, 2, 2, 86, 3, 2, 2, 2, 2, 88, 3, 2, 2, 2, 2, 90, 3, 2, 2, 2, 2, 92, 3, 2, 2, 2, 2, 94, 3, 2, 2, 2, 2, 96, 3, 2, 2, 2, 2, 98, 3, 2, 2, 2, 2, 100, 3, 2, 2, 2, 2, 102, 3, 2, 2, 2, 2, 104, 3, 2, 2, 2, 2, 106, 3, 2, 2, 2, 2, 108, 3, 2, 2, 2, 2, 110, 3, 2, 2, 2, 2, 112, 3, 2, 2, 2, 2, 114, 3, 2, 2, 2, 2, 116, 3, 2, 2, 2, 2, 118, 3, 2, 2, 2, 2, 120, 3, 2, 2, 2, 2, 122, 3, 2, 2, 2, 2, 124, 3, 2, 2, 2, 2, 126, 3, 2, 2, 2, 2, 128, 3, 2, 2, 2, 2, 130, 3, 2, 2, 2, 2, 132, 3, 2, 2, 2, 2, 134, 3, 2, 2, 2, 2, 136, 3, 2, 2, 2, 2, 138, 3, 2, 2, 2, 2, 140, 3, 2, 2, 2, 2, 142, 3, 2, 2, 2, 2, 144, 3, 2, 2, 2, 2, 146, 3, 2, 2, 2, 2, 148, 3, 2, 2, 2, 2, 150, 3, 2, 2, 2, 2, 152, 3, 2, 2, 2, 2, 154, 3, 2, 2, 2, 2, 156, 3, 2, 2, 2, 2, 158, 3, 2, 2, 2, 2, 160, 3, 2, 2, 2, 2, 162, 3, 2, 2, 2, 2, 164, 3, 2, 2, 2, 2, 166, 3, 2, 2, 2, 2, 168, 3, 2, 2, 2, 2, 170, 3, 2, 2, 2, 2, 172, 3, 2, 2, 2, 2, 174, 3, 2, 2, 2, 2, 176, 3, 2, 2, 2, 2, 178, 3, 2, 2, 2, 2, 180, 3, 2, 2, 2, 2, 182, 3, 2, 2, 2, 2, 184, 3, 2, 2, 2, 2, 186, 3, 2, 2, 2, 2, 188, 3, 2, 2, 2, 2, 190, 3, 2, 2, 2, 2, 192, 3, 2, 2, 2, 2, 194, 3, 2, 2, 2, 2, 196, 3, 2, 2, 2, 2, 198, 3, 2, 2, 2, 2, 200, 3, 2, 2, 2, 2, 202, 3, 2, 2, 2, 2, 204, 3, 2, 2, 2, 2, 206, 3, 2, 2, 2, 2, 208, 3, 2, 2, 2, 2, 210, 3, 2, 2, 2, 2, 212, 3, 2, 2, 2, 2, 214, 3, 2, 2, 2, 2, 216, 3, 2, 2, 2, 2, 218, 3, 2, 2, 2, 2, 220, 3, 2, 2, 2, 2, 222, 3, 2, 2, 2, 2, 224, 3, 2, 2, 2, 2, 226, 3, 2, 2, 2, 2, 228, 3, 2, 2, 2, 2, 230, 3, 2, 2, 2, 2, 232, 3, 2, 2, 2, 2, 234, 3, 2, 2, 2, 2, 236, 3, 2, 2, 2, 2, 238, 3, 2, 2, 2, 2, 240, 3, 2, 2, 2, 2, 242, 3, 2, 2, 2, 2, 244, 3, 2, 2, 2, 2, 246, 3, 2, 2, 2, 2, 248, 3, 2, 2, 2, 2, 250, 3, 2, 2, 2, 2, 252, 3, 2, 2, 2, 2, 254, 3, 2, 2, 2, 2, 262, 3, 2, 2, 2, 2, 264, 3, 2, 2, 2, 2, 268, 3, 2, 2, 2, 2, 270, 3, 2, 2, 2, 2, 272, 3, 2, 2, 2, 2, 274, 3, 2, 2, 2, 2, 276, 3, 2, 2, 2, 2, 278, 3, 2, 2, 2, 2, 280, 3, 2, 2, 2, 2, 286, 3, 2, 2, 2, 3, 288, 3, 2, 2, 2, 3, 290, 3, 2, 2, 2, 3, 292, 3, 2, 2, 2, 4, 294, 3, 2, 2, 2, 4, 296, 3, 2, 2, 2, 5, 298, 3, 2, 2, 2, 5, 300, 3, 2, 2, 2, 6, 302, 3, 2, 2, 2, 6, 304, 3, 2, 2, 2, 7, 306, 3, 2, 2, 2, 7, 308, 3, 2, 2, 2, 8, 310, 3, 2, 2, 2, 10, 317, 3, 2, 2, 2, 12, 329, 3, 2, 2, 2, 14, 339, 3, 2, 2, 2, 16, 345, 3, 2, 2, 2, 18, 355, 3, 2, 2, 2, 20, 363, 3, 2, 2, 2, 22, 369, 3, 2, 2, 2, 24, 376, 3, 2, 2, 2, 26, 385, 3, 2, 2, 2, 28, 400, 3, 2, 2, 2, 30, 409, 3, 2, 2, 2, 32, 416, 3, 2, 2, 2, 34, 427, 3, 2, 2, 2, 36, 435, 3, 2, 2, 2, 38, 447, 3, 2, 2, 2, 40, 464, 3, 2, 2, 2, 42, 480, 3, 2, 2, 2, 44, 492, 3, 2, 2, 2, 46, 512, 3, 2, 2, 2, 48, 531, 3, 2, 2, 2, 50, 543, 3, 2, 2, 2, 52, 555, 3, 2, 2, 2, 54, 568, 3, 2, 2, 2, 56, 581, 3, 2, 2, 2, 58, 594, 3, 2, 2, 2, 60, 596, 3, 2, 2, 2, 62, 598, 3, 2, 2, 2, 64, 608, 3, 2, 2, 2, 66, 613, 3, 2, 2, 2, 68, 620, 3, 2, 2, 2, 70, 627, 3, 2, 2, 2, 72, 638, 3, 2, 2, 2, 74, 642, 3, 2, 2, 2, 76, 653, 3, 2, 2, 2, 78, 658, 3, 2, 2, 2, 80, 661, 3, 2, 2, 2, 82, 666, 3, 2, 2, 2, 84, 675, 3, 2, 2, 2, 86, 679, 3, 2, 2, 2, 88, 690, 3, 2, 2, 2, 90, 703, 3, 2, 2, 2, 92, 716, 3, 2, 2, 2, 94, 734, 3, 2, 2, 2, 96, 758, 3, 2, 2, 2, 98, 775, 3, 2, 2, 2, 100, 794, 3, 2, 2, 2, 102, 804, 3, 2, 2, 2, 104, 817, 3, 2, 2, 2, 106, 830, 3, 2, 2, 2, 108, 837, 3, 2, 2, 2, 110, 847, 3, 2, 2, 2, 112, 862, 3, 2, 2, 2, 114, 867, 3, 2, 2, 2, 116, 877, 3, 2, 2, 2, 118, 885, 3, 2, 2, 2, 120, 890, 3, 2, 2, 2, 122, 899, 3, 2, 2, 2, 124, 903, 3, 2, 2, 2, 126, 916, 3, 2, 2, 2, 128, 921, 3, 2, 2, 2, 130, 926, 3, 2, 2, 2, 132, 948, 3, 2, 2, 2, 134, 969, 3, 2, 2, 2, 136, 994, 3, 2, 2, 2, 138, 1018, 3, 2, 2, 2, 140, 1023, 3, 2, 2, 2, 142, 1037, 3, 2, 2, 2, 144, 1044, 3, 2, 2, 2, 146, 1063, 3, 2, 2, 2, 148, 1084, 3, 2, 2, 2, 150, 1089, 3, 2, 2, 2, 152, 1102, 3, 2, 2, 2, 154, 1107, 3, 2, 2, 2, 156, 1116, 3, 2, 2, 2, 158, 1126, 3, 2, 2, 2, 160, 1134, 3, 2, 2, 2, 162, 1146, 3, 2, 2, 2, 164, 1151, 3, 2, 2, 2, 166, 1158, 3, 2, 2, 2, 168, 1163, 3, 2, 2, 2, 170, 1170, 3, 2, 2, 2, 172, 1177, 3, 2, 2, 2, 174, 1189, 3, 2, 2, 2, 176, 1201, 3, 2, 2, 2, 178, 1208, 3, 2, 2, 2, 180, 1221, 3, 2, 2, 2, 182, 1235, 3, 2, 2, 2, 184, 1247, 3, 2, 2, 2, 186, 1257, 3, 2, 2, 2, 188, 1268, 3, 2, 2, 2, 190, 1276, 3, 2, 2, 2, 192, 1286, 3, 2, 2, 2, 194, 1298, 3, 2, 2, 2, 196, 1309, 3, 2, 2, 2, 198, 1316, 3, 2, 2, 2, 200, 1329, 3, 2, 2, 2, 202, 1343, 3, 2, 2, 2, 204, 1355, 3, 2, 2, 2, 206, 1360, 3, 2, 2, 2, 208, 1379, 3, 2, 2, 2, 210, 1400, 3, 2, 2, 2, 212, 1411, 3, 2, 2, 2, 214, 1421, 3, 2, 2, 2, 216, 1426, 3, 2, 2, 2, 218, 1435, 3, 2, 2, 2, 220, 1457, 3, 2, 2, 2, 222, 1483, 3, 2, 2, 2, 224, 1488, 3, 2, 2, 2, 226, 1505, 3, 2, 2, 2, 228, 1523, 3, 2, 2, 2, 230, 1539, 3, 2, 2, 2, 232, 1544, 3, 2, 2, 2, 234, 1556, 3, 2, 2, 2, 236, 1569, 3, 2, 2, 2, 238, 1571, 3, 2, 2, 2, 240, 1573, 3, 2, 2, 2, 242, 1575, 3, 2, 2, 2, 244, 1577, 3, 2, 2, 2, 246, 1579, 3, 2, 2, 2, 248, 1581, 3, 2, 2, 2, 250, 1583, 3, 2, 2, 2, 252, 1585, 3, 2, 2, 2, 254, 1587, 3, 2, 2, 2, 256, 1591, 3, 2, 2, 2, 258, 1595, 3, 2, 2, 2, 260, 1599, 3, 2, 2, 2, 262, 1601, 3, 2, 2, 2, 264, 1609, 3, 2, 2, 2, 266, 1617, 3, 2, 2, 2, 268, 1619, 3, 2, 2, 2, 270, 1627, 3, 2, 2, 2, 272, 1634, 3, 2, 2, 2, 274, 1642, 3, 2, 2, 2, 276, 1655, 3, 2, 2, 2, 278, 1663, 3, 2, 2, 2, 280, 1670, 3, 2, 2, 2, 282, 1682, 3, 2, 2, 2, 284, 1686, 3, 2, 2, 2, 286, 1688, 3, 2, 2, 2, 288, 1693, 3, 2, 2, 2, 290, 1699, 3, 2, 2, 2, 292, 1708, 3, 2, 2, 2, 294, 1713, 3, 2, 2, 2, 296, 1743, 3, 2, 2, 2, 298, 1753, 3, 2, 2, 2, 300, 1759, 3, 2, 2, 2, 302, 1764, 3, 2, 2, 2, 304, 1768, 3, 2, 2, 2, 306, 1775, 3, 2, 2, 2, 308, 1778, 3, 2, 2, 2, 310, 311, 7, 99, 2, 2, 311, 312, 7, 112, 2, 2, 312, 313, 7, 113, 2, 2, 313, 314, 7, 112, 2, 2, 314, 315, 3, 2, 2, 2, 315, 316, 8, 2, 2, 2, 316, 9, 3, 2, 2, 2, 317, 318, 7, 99, 2, 2, 318, 319, 7, 112, 2, 2, 319, 320, 7, 113, 2, 2, 320, 321, 7, 112, 2, 2, 321, 322, 7, 123, 2, 2, 322, 323, 7, 111, 2, 2, 323, 324, 7, 113, 2, 2, 324, 325, 7, 119, 2, 2, 325, 326, 7, 117, 2, 2, 326, 327, 3, 2, 2, 2, 327, 328, 8, 3, 2, 2, 328, 11, 3, 2, 2, 2, 329, 333, 7, 37, 2, 2, 330, 332, 10, 2, 2, 2, 331, 330, 3, 2, 2, 2, 332, 335, 3, 2, 2, 2, 333, 331, 3, 2, 2, 2, 333, 334, 3, 2, 2, 2, 334, 336, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 336, 337, 8, 4, 3, 2, 337, 13, 3, 2, 2, 2, 338, 340, 9, 3, 2, 2, 339, 338, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 339, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 8, 5, 3, 2, 344, 15, 3, 2, 2, 2, 345, 346, 7, 107, 2, 2, 346, 347, 7, 112, 2, 2, 347, 348, 7, 101, 2, 2, 348, 349, 7, 110, 2, 2, 349, 350, 7, 119, 2, 2, 350, 351, 7, 102, 2, 2, 351, 352, 7, 103, 2, 2, 352, 353, 3, 2, 2, 2, 353, 354, 8, 6, 4, 2, 354, 17, 3, 2, 2, 2, 355, 356, 7, 104, 2, 2, 356, 357, 7, 103, 2, 2, 357, 358, 7, 99, 2, 2, 358, 359, 7, 118, 2, 2, 359, 360, 7, 119, 2, 2, 360, 361, 7, 116, 2, 2, 361, 362, 7, 103, 2, 2, 362, 19, 3, 2, 2, 2, 363, 364, 7, 118, 2, 2, 364, 365, 7, 99, 2, 2, 365, 366, 7, 100, 2, 2, 366, 367, 7, 110, 2, 2, 367, 368, 7, 103, 2, 2, 368, 21, 3, 2, 2, 2, 369, 370, 7, 117, 2, 2, 370, 371, 7, 101, 2, 2, 371, 372, 7, 116, 2, 2, 372, 373, 7, 107, 2, 2, 373, 374, 7, 114, 2, 2, 374, 375, 7, 118, 2, 2, 375, 23, 3, 2, 2, 2, 376, 377, 7, 110, 2, 2, 377, 378, 7, 99, 2, 2, 378, 379, 7, 112, 2, 2, 379, 380, 7, 105, 2, 2, 380, 381, 7, 119, 2, 2, 381, 382, 7, 99, 2, 2, 382, 383, 7, 105, 2, 2, 383, 384, 7, 103, 2, 2, 384, 25, 3, 2, 2, 2, 385, 386, 7, 110, 2, 2, 386, 387, 7, 99, 2, 2, 387, 388, 7, 112, 2, 2, 388, 389, 7, 105, 2, 2, 389, 390, 7, 119, 2, 2, 390, 391, 7, 99, 2, 2, 391, 392, 7, 105, 2, 2, 392, 393, 7, 103, 2, 2, 393, 394, 7, 117, 2, 2, 394, 395, 7, 123, 2, 2, 395, 396, 7, 117, 2, 2, 396, 397, 7, 118, 2, 2, 397, 398, 7, 103, 2, 2, 398, 399, 7, 111, 2, 2, 399, 27, 3, 2, 2, 2, 400, 401, 7, 117, 2, 2, 401, 402, 7, 119, 2, 2, 402, 403, 7, 100, 2, 2, 403, 404, 7, 118, 2, 2, 404, 405, 7, 99, 2, 2, 405, 406, 7, 100, 2, 2, 406, 407, 7, 110, 2, 2, 407, 408, 7, 103, 2, 2, 408, 29, 3, 2, 2, 2, 409, 410, 7, 110, 2, 2, 410, 411, 7, 113, 2, 2, 411, 412, 7, 113, 2, 2, 412, 413, 7, 109, 2, 2, 413, 414, 7, 119, 2, 2, 414, 415, 7, 114, 2, 2, 415, 31, 3, 2, 2, 2, 416, 417, 7, 110, 2, 2, 417, 418, 7, 113, 2, 2, 418, 419, 7, 113, 2, 2, 419, 420, 7, 109, 2, 2, 420, 421, 7, 119, 2, 2, 421, 422, 7, 114, 2, 2, 422, 423, 7, 104, 2, 2, 423, 424, 7, 110, 2, 2, 424, 425, 7, 99, 2, 2, 425, 426, 7, 105, 2, 2, 426, 33, 3, 2, 2, 2, 427, 428, 7, 48, 2, 2, 428, 429, 7, 112, 2, 2, 429, 430, 7, 113, 2, 2, 430, 431, 7, 118, 2, 2, 431, 432, 7, 102, 2, 2, 432, 433, 7, 103, 2, 2, 433, 434, 7, 104, 2, 2, 434, 35, 3, 2, 2, 2, 435, 436, 7, 84, 2, 2, 436, 437, 7, 107, 2, 2, 437, 438, 7, 105, 2, 2, 438, 439, 7, 106, 2, 2, 439, 440, 7, 118, 2, 2, 440, 441, 7, 86, 2, 2, 441, 442, 7, 113, 2, 2, 442, 443, 7, 78, 2, 2, 443, 444, 7, 103, 2, 2, 444, 445, 7, 104, 2, 2, 445, 446, 7, 118, 2, 2, 446, 37, 3, 2, 2, 2, 447, 448, 7, 75, 2, 2, 448, 449, 7, 105, 2, 2, 449, 450, 7, 112, 2, 2, 450, 451, 7, 113, 2, 2, 451, 452, 7, 116, 2, 2, 452, 453, 7, 103, 2, 2, 453, 454, 7, 68, 2, 2, 454, 455, 7, 99, 2, 2, 455, 456, 7, 117, 2, 2, 456, 457, 7, 103, 2, 2, 457, 458, 7, 73, 2, 2, 458, 459, 7, 110, 2, 2, 459, 460, 7, 123, 2, 2, 460, 461, 7, 114, 2, 2, 461, 462, 7, 106, 2, 2, 462, 463, 7, 117, 2, 2, 463, 39, 3, 2, 2, 2, 464, 465, 7, 75, 2, 2, 465, 466, 7, 105, 2, 2, 466, 467, 7, 112, 2, 2, 467, 468, 7, 113, 2, 2, 468, 469, 7, 116, 2, 2, 469, 470, 7, 103, 2, 2, 470, 471, 7, 78, 2, 2, 471, 472, 7, 107, 2, 2, 472, 473, 7, 105, 2, 2, 473, 474, 7, 99, 2, 2, 474, 475, 7, 118, 2, 2, 475, 476, 7, 119, 2, 2, 476, 477, 7, 116, 2, 2, 477, 478, 7, 103, 2, 2, 478, 479, 7, 117, 2, 2, 479, 41, 3, 2, 2, 2, 480, 481, 7, 75, 2, 2, 481, 482, 7, 105, 2, 2, 482, 483, 7, 112, 2, 2, 483, 484, 7, 113, 2, 2, 484, 485, 7, 116, 2, 2, 485, 486, 7, 103, 2, 2, 486, 487, 7, 79, 2, 2, 487, 488, 7, 99, 2, 2, 488, 489, 7, 116, 2, 2, 489, 490, 7, 109, 2, 2, 490, 491, 7, 117, 2, 2, 491, 43, 3, 2, 2, 2, 492, 493, 7, 87, 2, 2, 493, 494, 7, 117, 2, 2, 494, 495, 7, 103, 2, 2, 495, 496, 7, 79, 2, 2, 496, 497, 7, 99, 2, 2, 497, 498, 7, 116, 2, 2, 498, 499, 7, 109, 2, 2, 499, 500, 7, 72, 2, 2, 500, 501, 7, 107, 2, 2, 501, 502, 7, 110, 2, 2, 502, 503, 7, 118, 2, 2, 503, 504, 7, 103, 2, 2, 504, 505, 7, 116, 2, 2, 505, 506, 7, 107, 2, 2, 506, 507, 7, 112, 2, 2, 507, 508, 7, 105, 2, 2, 508, 509, 7, 85, 2, 2, 509, 510, 7, 103, 2, 2, 510, 511, 7, 118, 2, 2, 511, 45, 3, 2, 2, 2, 512, 513, 7, 79, 2, 2, 513, 514, 7, 99, 2, 2, 514, 515, 7, 116, 2, 2, 515, 516, 7, 109, 2, 2, 516, 517, 7, 67, 2, 2, 517, 518, 7, 118, 2, 2, 518, 519, 7, 118, 2, 2, 519, 520, 7, 99, 2, 2, 520, 521, 7, 101, 2, 2, 521, 522, 7, 106, 2, 2, 522, 523, 7, 111, 2, 2, 523, 524, 7, 103, 2, 2, 524, 525, 7, 112, 2, 2, 525, 526, 7, 118, 2, 2, 526, 527, 7, 86, 2, 2, 527, 528, 7, 123, 2, 2, 528, 529, 7, 114, 2, 2, 529, 530, 7, 103, 2, 2, 530, 47, 3, 2, 2, 2, 531, 532, 7, 103, 2, 2, 532, 533, 7, 122, 2, 2, 533, 534, 7, 101, 2, 2, 534, 535, 7, 110, 2, 2, 535, 536, 7, 119, 2, 2, 536, 537, 7, 102, 2, 2, 537, 538, 7, 103, 2, 2, 538, 539, 7, 70, 2, 2, 539, 540, 7, 72, 2, 2, 540, 541, 7, 78, 2, 2, 541, 542, 7, 86, 2, 2, 542, 49, 3, 2, 2, 2, 543, 544, 7, 107, 2, 2, 544, 545, 7, 112, 2, 2, 545, 546, 7, 101, 2, 2, 546, 547, 7, 110, 2, 2, 547, 548, 7, 119, 2, 2, 548, 549, 7, 102, 2, 2, 549, 550, 7, 103, 2, 2, 550, 551, 7, 70, 2, 2, 551, 552, 7, 72, 2, 2, 552, 553, 7, 78, 2, 2, 553, 554, 7, 86, 2, 2, 554, 51, 3, 2, 2, 2, 555, 556, 7, 103, 2, 2, 556, 557, 7, 122, 2, 2, 557, 558, 7, 101, 2, 2, 558, 559, 7, 110, 2, 2, 559, 560, 7, 119, 2, 2, 560, 561, 7, 102, 2, 2, 561, 562, 7, 103, 2, 2, 562, 563, 7, 97, 2, 2, 563, 564, 7, 102, 2, 2, 564, 565, 7, 104, 2, 2, 565, 566, 7, 110, 2, 2, 566, 567, 7, 118, 2, 2, 567, 53, 3, 2, 2, 2, 568, 569, 7, 107, 2, 2, 569, 570, 7, 112, 2, 2, 570, 571, 7, 101, 2, 2, 571, 572, 7, 110, 2, 2, 572, 573, 7, 119, 2, 2, 573, 574, 7, 102, 2, 2, 574, 575, 7, 103, 2, 2, 575, 576, 7, 97, 2, 2, 576, 577, 7, 102, 2, 2, 577, 578, 7, 104, 2, 2, 578, 579, 7, 110, 2, 2, 579, 580, 7, 118, 2, 2, 580, 55, 3, 2, 2, 2, 581, 582, 7, 119, 2, 2, 582, 583, 7, 117, 2, 2, 583, 584, 7, 103, 2, 2, 584, 585, 7, 71, 2, 2, 585, 586, 7, 122, 2, 2, 586, 587, 7, 118, 2, 2, 587, 588, 7, 103, 2, 2, 588, 589, 7, 112, 2, 2, 589, 590, 7, 117, 2, 2, 590, 591, 7, 107, 2, 2, 591, 592, 7, 113, 2, 2, 592, 593, 7, 112, 2, 2, 593, 57, 3, 2, 2, 2, 594, 595, 7, 62, 2, 2, 595, 59, 3, 2, 2, 2, 596, 597, 7, 64, 2, 2, 597, 61, 3, 2, 2, 2, 598, 599, 7, 103, 2, 2, 599, 600, 7, 112, 2, 2, 600, 601, 7, 119, 2, 2, 601, 602, 7, 111, 2, 2, 602, 603, 7, 103, 2, 2, 603, 604, 7, 116, 2, 2, 604, 605, 7, 99, 2, 2, 605, 606, 7, 118, 2, 2, 606, 607, 7, 103, 2, 2, 607, 63, 3, 2, 2, 2, 608, 609, 7, 103, 2, 2, 609, 610, 7, 112, 2, 2, 610, 611, 7, 119, 2, 2, 611, 612, 7, 111, 2, 2, 612, 65, 3, 2, 2, 2, 613, 614, 7, 103, 2, 2, 614, 615, 7, 122, 2, 2, 615, 616, 7, 101, 2, 2, 616, 617, 7, 103, 2, 2, 617, 618, 7, 114, 2, 2, 618, 619, 7, 118, 2, 2, 619, 67, 3, 2, 2, 2, 620, 621, 7, 107, 2, 2, 621, 622, 7, 105, 2, 2, 622, 623, 7, 112, 2, 2, 623, 624, 7, 113, 2, 2, 624, 625, 7, 116, 2, 2, 625, 626, 7, 103, 2, 2, 626, 69, 3, 2, 2, 2, 627, 628, 7, 117, 2, 2, 628, 629, 7, 119, 2, 2, 629, 630, 7, 100, 2, 2, 630, 631, 7, 117, 2, 2, 631, 632, 7, 118, 2, 2, 632, 633, 7, 107, 2, 2, 633, 634, 7, 118, 2, 2, 634, 635, 7, 119, 2, 2, 635, 636, 7, 118, 2, 2, 636, 637, 7, 103, 2, 2, 637, 71, 3, 2, 2, 2, 638, 639, 7, 117, 2, 2, 639, 640, 7, 119, 2, 2, 640, 641, 7, 100, 2, 2, 641, 73, 3, 2, 2, 2, 642, 643, 7, 116, 2, 2, 643, 644, 7, 103, 2, 2, 644, 645, 7, 120, 2, 2, 645, 646, 7, 103, 2, 2, 646, 647, 7, 116, 2, 2, 647, 648, 7, 117, 2, 2, 648, 649, 7, 103, 2, 2, 649, 650, 7, 117, 2, 2, 650, 651, 7, 119, 2, 2, 651, 652, 7, 100, 2, 2, 652, 75, 3, 2, 2, 2, 653, 654, 7, 116, 2, 2, 654, 655, 7, 117, 2, 2, 655, 656, 7, 119, 2, 2, 656, 657, 7, 100, 2, 2, 657, 77, 3, 2, 2, 2, 658, 659, 7, 100, 2, 2, 659, 660, 7, 123, 2, 2, 660, 79, 3, 2, 2, 2, 661, 662, 7, 104, 2, 2, 662, 663, 7, 116, 2, 2, 663, 664, 7, 113, 2, 2, 664, 665, 7, 111, 2, 2, 665, 81, 3, 2, 2, 2, 666, 667, 7, 114, 2, 2, 667, 668, 7, 113, 2, 2, 668, 669, 7, 117, 2, 2, 669, 670, 7, 107, 2, 2, 670, 671, 7, 118, 2, 2, 671, 672, 7, 107, 2, 2, 672, 673, 7, 113, 2, 2, 673, 674, 7, 112, 2, 2, 674, 83, 3, 2, 2, 2, 675, 676, 7, 114, 2, 2, 676, 677, 7, 113, 2, 2, 677, 678, 7, 117, 2, 2, 678, 85, 3, 2, 2, 2, 679, 680, 7, 114, 2, 2, 680, 681, 7, 99, 2, 2, 681, 682, 7, 116, 2, 2, 682, 683, 7, 99, 2, 2, 683, 684, 7, 111, 2, 2, 684, 685, 7, 103, 2, 2, 685, 686, 7, 118, 2, 2, 686, 687, 7, 103, 2, 2, 687, 688, 7, 116, 2, 2, 688, 689, 7, 117, 2, 2, 689, 87, 3, 2, 2, 2, 690, 691, 7, 104, 2, 2, 691, 692, 7, 103, 2, 2, 692, 693, 7, 99, 2, 2, 693, 694, 7, 118, 2, 2, 694, 695, 7, 119, 2, 2, 695, 696, 7, 116, 2, 2, 696, 697, 7, 103, 2, 2, 697, 698, 7, 80, 2, 2, 698, 699, 7, 99, 2, 2, 699, 700, 7, 111, 2, 2, 700, 701, 7, 103, 2, 2, 701, 702, 7, 117, 2, 2, 702, 89, 3, 2, 2, 2, 703, 704, 7, 101, 2, 2, 704, 705, 7, 120, 2, 2, 705, 706, 7, 82, 2, 2, 706, 707, 7, 99, 2, 2, 707, 708, 7, 116, 2, 2, 708, 709, 7, 99, 2, 2, 709, 710, 7, 111, 2, 2, 710, 711, 7, 103, 2, 2, 711, 712, 7, 118, 2, 2, 712, 713, 7, 103, 2, 2, 713, 714, 7, 116, 2, 2, 714, 715, 7, 117, 2, 2, 715, 91, 3, 2, 2, 2, 716, 717, 7, 72, 2, 2, 717, 718, 7, 103, 2, 2, 718, 719, 7, 99, 2, 2, 719, 720, 7, 118, 2, 2, 720, 721, 7, 87, 2, 2, 721, 722, 7, 75, 2, 2, 722, 723, 7, 78, 2, 2, 723, 724, 7, 99, 2, 2, 724, 725, 7, 100, 2, 2, 725, 726, 7, 103, 2, 2, 726, 727, 7, 110, 2, 2, 727, 728, 7, 80, 2, 2, 728, 729, 7, 99, 2, 2, 729, 730, 7, 111, 2, 2, 730, 731, 7, 103, 2, 2, 731, 732, 7, 75, 2, 2, 732, 733, 7, 70, 2, 2, 733, 93, 3, 2, 2, 2, 734, 735, 7, 72, 2, 2, 735, 736, 7, 103, 2, 2, 736, 737, 7, 99, 2, 2, 737, 738, 7, 118, 2, 2, 738, 739, 7, 87, 2, 2, 739, 740, 7, 75, 2, 2, 740, 741, 7, 86, 2, 2, 741, 742, 7, 113, 2, 2, 742, 743, 7, 113, 2, 2, 743, 744, 7, 110, 2, 2, 744, 745, 7, 118, 2, 2, 745, 746, 7, 107, 2, 2, 746, 747, 7, 114, 2, 2, 747, 748, 7, 86, 2, 2, 748, 749, 7, 103, 2, 2, 749, 750, 7, 122, 2, 2, 750, 751, 7, 118, 2, 2, 751, 752, 7, 80, 2, 2, 752, 753, 7, 99, 2, 2, 753, 754, 7, 111, 2, 2, 754, 755, 7, 103, 2, 2, 755, 756, 7, 75, 2, 2, 756, 757, 7, 70, 2, 2, 757, 95, 3, 2, 2, 2, 758, 759, 7, 85, 2, 2, 759, 760, 7, 99, 2, 2, 760, 761, 7, 111, 2, 2, 761, 762, 7, 114, 2, 2, 762, 763, 7, 110, 2, 2, 763, 764, 7, 103, 2, 2, 764, 765, 7, 86, 2, 2, 765, 766, 7, 103, 2, 2, 766, 767, 7, 122, 2, 2, 767, 768, 7, 118, 2, 2, 768, 769, 7, 80, 2, 2, 769, 770, 7, 99, 2, 2, 770, 771, 7, 111, 2, 2, 771, 772, 7, 103, 2, 2, 772, 773, 7, 75, 2, 2, 773, 774, 7, 70, 2, 2, 774, 97, 3, 2, 2, 2, 775, 776, 7, 82, 2, 2, 776, 777, 7, 99, 2, 2, 777, 778, 7, 116, 2, 2, 778, 779, 7, 99, 2, 2, 779, 780, 7, 111, 2, 2, 780, 781, 7, 87, 2, 2, 781, 782, 7, 75, 2, 2, 782, 783, 7, 78, 2, 2, 783, 784, 7, 99, 2, 2, 784, 785, 7, 100, 2, 2, 785, 786, 7, 103, 2, 2, 786, 787, 7, 110, 2, 2, 787, 788, 7, 80, 2, 2, 788, 789, 7, 99, 2, 2, 789, 790, 7, 111, 2, 2, 790, 791, 7, 103, 2, 2, 791, 792, 7, 75, 2, 2, 792, 793, 7, 70, 2, 2, 793, 99, 3, 2, 2, 2, 794, 795, 7, 69, 2, 2, 795, 796, 7, 106, 2, 2, 796, 797, 7, 99, 2, 2, 797, 798, 7, 116, 2, 2, 798, 799, 7, 99, 2, 2, 799, 800, 7, 101, 2, 2, 800, 801, 7, 118, 2, 2, 801, 802, 7, 103, 2, 2, 802, 803, 7, 116, 2, 2, 803, 101, 3, 2, 2, 2, 804, 805, 7, 117, 2, 2, 805, 806, 7, 107, 2, 2, 806, 807, 7, 124, 2, 2, 807, 808, 7, 103, 2, 2, 808, 809, 7, 111, 2, 2, 809, 810, 7, 103, 2, 2, 810, 811, 7, 112, 2, 2, 811, 812, 7, 119, 2, 2, 812, 813, 7, 112, 2, 2, 813, 814, 7, 99, 2, 2, 814, 815, 7, 111, 2, 2, 815, 816, 7, 103, 2, 2, 816, 103, 3, 2, 2, 2, 817, 818, 7, 101, 2, 2, 818, 819, 7, 113, 2, 2, 819, 820, 7, 112, 2, 2, 820, 821, 7, 118, 2, 2, 821, 822, 7, 113, 2, 2, 822, 823, 7, 119, 2, 2, 823, 824, 7, 116, 2, 2, 824, 825, 7, 114, 2, 2, 825, 826, 7, 113, 2, 2, 826, 827, 7, 107, 2, 2, 827, 828, 7, 112, 2, 2, 828, 829, 7, 118, 2, 2, 829, 105, 3, 2, 2, 2, 830, 831, 7, 99, 2, 2, 831, 832, 7, 112, 2, 2, 832, 833, 7, 101, 2, 2, 833, 834, 7, 106, 2, 2, 834, 835, 7, 113, 2, 2, 835, 836, 7, 116, 2, 2, 836, 107, 3, 2, 2, 2, 837, 838, 7, 99, 2, 2, 838, 839, 7, 112, 2, 2, 839, 840, 7, 101, 2, 2, 840, 841, 7, 106, 2, 2, 841, 842, 7, 113, 2, 2, 842, 843, 7, 116, 2, 2, 843, 844, 7, 70, 2, 2, 844, 845, 7, 103, 2, 2, 845, 846, 7, 104, 2, 2, 846, 109, 3, 2, 2, 2, 847, 848, 7, 120, 2, 2, 848, 849, 7, 99, 2, 2, 849, 850, 7, 110, 2, 2, 850, 851, 7, 119, 2, 2, 851, 852, 7, 103, 2, 2, 852, 853, 7, 84, 2, 2, 853, 854, 7, 103, 2, 2, 854, 855, 7, 101, 2, 2, 855, 856, 7, 113, 2, 2, 856, 857, 7, 116, 2, 2, 857, 858, 7, 102, 2, 2, 858, 859, 7, 70, 2, 2, 859, 860, 7, 103, 2, 2, 860, 861, 7, 104, 2, 2, 861, 111, 3, 2, 2, 2, 862, 863, 7, 111, 2, 2, 863, 864, 7, 99, 2, 2, 864, 865, 7, 116, 2, 2, 865, 866, 7, 109, 2, 2, 866, 113, 3, 2, 2, 2, 867, 868, 7, 111, 2, 2, 868, 869, 7, 99, 2, 2, 869, 870, 7, 116, 2, 2, 870, 871, 7, 109, 2, 2, 871, 872, 7, 69, 2, 2, 872, 873, 7, 110, 2, 2, 873, 874, 7, 99, 2, 2, 874, 875, 7, 117, 2, 2, 875, 876, 7, 117, 2, 2, 876, 115, 3, 2, 2, 2, 877, 878, 7, 101, 2, 2, 878, 879, 7, 119, 2, 2, 879, 880, 7, 116, 2, 2, 880, 881, 7, 117, 2, 2, 881, 882, 7, 107, 2, 2, 882, 883, 7, 120, 2, 2, 883, 884, 7, 103, 2, 2, 884, 117, 3, 2, 2, 2, 885, 886, 7, 100, 2, 2, 886, 887, 7, 99, 2, 2, 887, 888, 7, 117, 2, 2, 888, 889, 7, 103, 2, 2, 889, 119, 3, 2, 2, 2, 890, 891, 7, 110, 2, 2, 891, 892, 7, 107, 2, 2, 892, 893, 7, 105, 2, 2, 893, 894, 7, 99, 2, 2, 894, 895, 7, 118, 2, 2, 895, 896, 7, 119, 2, 2, 896, 897, 7, 116, 2, 2, 897, 898, 7, 103, 2, 2, 898, 121, 3, 2, 2, 2, 899, 900, 7, 110, 2, 2, 900, 901, 7, 107, 2, 2, 901, 902, 7, 105, 2, 2, 902, 123, 3, 2, 2, 2, 903, 904, 7, 110, 2, 2, 904, 905, 7, 107, 2, 2, 905, 906, 7, 105, 2, 2, 906, 907, 7, 69, 2, 2, 907, 908, 7, 113, 2, 2, 908, 909, 7, 111, 2, 2, 909, 910, 7, 114, 2, 2, 910, 911, 7, 113, 2, 2, 911, 912, 7, 112, 2, 2, 912, 913, 7, 103, 2, 2, 913, 914, 7, 112, 2, 2, 914, 915, 7, 118, 2, 2, 915, 125, 3, 2, 2, 2, 916, 917, 7, 80, 2, 2, 917, 918, 7, 87, 2, 2, 918, 919, 7, 78, 2, 2, 919, 920, 7, 78, 2, 2, 920, 127, 3, 2, 2, 2, 921, 922, 7, 68, 2, 2, 922, 923, 7, 67, 2, 2, 923, 924, 7, 85, 2, 2, 924, 925, 7, 71, 2, 2, 925, 129, 3, 2, 2, 2, 926, 927, 7, 74, 2, 2, 927, 928, 7, 113, 2, 2, 928, 929, 7, 116, 2, 2, 929, 930, 7, 107, 2, 2, 930, 931, 7, 124, 2, 2, 931, 932, 7, 67, 2, 2, 932, 933, 7, 122, 2, 2, 933, 934, 7, 107, 2, 2, 934, 935, 7, 117, 2, 2, 935, 936, 7, 48, 2, 2, 936, 937, 7, 68, 2, 2, 937, 938, 7, 99, 2, 2, 938, 939, 7, 117, 2, 2, 939, 940, 7, 103, 2, 2, 940, 941, 7, 86, 2, 2, 941, 942, 7, 99, 2, 2, 942, 943, 7, 105, 2, 2, 943, 944, 7, 78, 2, 2, 944, 945, 7, 107, 2, 2, 945, 946, 7, 117, 2, 2, 946, 947, 7, 118, 2, 2, 947, 131, 3, 2, 2, 2, 948, 949, 7, 88, 2, 2, 949, 950, 7, 103, 2, 2, 950, 951, 7, 116, 2, 2, 951, 952, 7, 118, 2, 2, 952, 953, 7, 67, 2, 2, 953, 954, 7, 122, 2, 2, 954, 955, 7, 107, 2, 2, 955, 956, 7, 117, 2, 2, 956, 957, 7, 48, 2, 2, 957, 958, 7, 68, 2, 2, 958, 959, 7, 99, 2, 2, 959, 960, 7, 117, 2, 2, 960, 961, 7, 103, 2, 2, 961, 962, 7, 86, 2, 2, 962, 963, 7, 99, 2, 2, 963, 964, 7, 105, 2, 2, 964, 965, 7, 78, 2, 2, 965, 966, 7, 107, 2, 2, 966, 967, 7, 117, 2, 2, 967, 968, 7, 118, 2, 2, 968, 133, 3, 2, 2, 2, 969, 970, 7, 74, 2, 2, 970, 971, 7, 113, 2, 2, 971, 972, 7, 116, 2, 2, 972, 973, 7, 107, 2, 2, 973, 974, 7, 124, 2, 2, 974, 975, 7, 67, 2, 2, 975, 976, 7, 122, 2, 2, 976, 977, 7, 107, 2, 2, 977, 978, 7, 117, 2, 2, 978, 979, 7, 48, 2, 2, 979, 980, 7, 68, 2, 2, 980, 981, 7, 99, 2, 2, 981, 982, 7, 117, 2, 2, 982, 983, 7, 103, 2, 2, 983, 984, 7, 85, 2, 2, 984, 985, 7, 101, 2, 2, 985, 986, 7, 116, 2, 2, 986, 987, 7, 107, 2, 2, 987, 988, 7, 114, 2, 2, 988, 989, 7, 118, 2, 2, 989, 990, 7, 78, 2, 2, 990, 991, 7, 107, 2, 2, 991, 992, 7, 117, 2, 2, 992, 993, 7, 118, 2, 2, 993, 135, 3, 2, 2, 2, 994, 995, 7, 88, 2, 2, 995, 996, 7, 103, 2, 2, 996, 997, 7, 116, 2, 2, 997, 998, 7, 118, 2, 2, 998, 999, 7, 67, 2, 2, 999, 1000, 7, 122, 2, 2, 1000, 1001, 7, 107, 2, 2, 1001, 1002, 7, 117, 2, 2, 1002, 1003, 7, 48, 2, 2, 1003, 1004, 7, 68, 2, 2, 1004, 1005, 7, 99, 2, 2, 1005, 1006, 7, 117, 2, 2, 1006, 1007, 7, 103, 2, 2, 1007, 1008, 7, 85, 2, 2, 1008, 1009, 7, 101, 2, 2, 1009, 1010, 7, 116, 2, 2, 1010, 1011, 7, 107, 2, 2, 1011, 1012, 7, 114, 2, 2, 1012, 1013, 7, 118, 2, 2, 1013, 1014, 7, 78, 2, 2, 1014, 1015, 7, 107, 2, 2, 1015, 1016, 7, 117, 2, 2, 1016, 1017, 7, 118, 2, 2, 1017, 137, 3, 2, 2, 2, 1018, 1019, 7, 73, 2, 2, 1019, 1020, 7, 70, 2, 2, 1020, 1021, 7, 71, 2, 2, 1021, 1022, 7, 72, 2, 2, 1022, 139, 3, 2, 2, 2, 1023, 1024, 7, 73, 2, 2, 1024, 1025, 7, 110, 2, 2, 1025, 1026, 7, 123, 2, 2, 1026, 1027, 7, 114, 2, 2, 1027, 1028, 7, 106, 2, 2, 1028, 1029, 7, 69, 2, 2, 1029, 1030, 7, 110, 2, 2, 1030, 1031, 7, 99, 2, 2, 1031, 1032, 7, 117, 2, 2, 1032, 1033, 7, 117, 2, 2, 1033, 1034, 7, 70, 2, 2, 1034, 1035, 7, 103, 2, 2, 1035, 1036, 7, 104, 2, 2, 1036, 141, 3, 2, 2, 2, 1037, 1038, 7, 67, 2, 2, 1038, 1039, 7, 118, 2, 2, 1039, 1040, 7, 118, 2, 2, 1040, 1041, 7, 99, 2, 2, 1041, 1042, 7, 101, 2, 2, 1042, 1043, 7, 106, 2, 2, 1043, 143, 3, 2, 2, 2, 1044, 1045, 7, 78, 2, 2, 1045, 1046, 7, 107, 2, 2, 1046, 1047, 7, 105, 2, 2, 1047, 1048, 7, 99, 2, 2, 1048, 1049, 7, 118, 2, 2, 1049, 1050, 7, 119, 2, 2, 1050, 1051, 7, 116, 2, 2, 1051, 1052, 7, 103, 2, 2, 1052, 1053, 7, 69, 2, 2, 1053, 1054, 7, 99, 2, 2, 1054, 1055, 7, 116, 2, 2, 1055, 1056, 7, 103, 2, 2, 1056, 1057, 7, 118, 2, 2, 1057, 1058, 7, 68, 2, 2, 1058, 1059, 7, 123, 2, 2, 1059, 1060, 7, 82, 2, 2, 1060, 1061, 7, 113, 2, 2, 1061, 1062, 7, 117, 2, 2, 1062, 145, 3, 2, 2, 2, 1063, 1064, 7, 78, 2, 2, 1064, 1065, 7, 107, 2, 2, 1065, 1066, 7, 105, 2, 2, 1066, 1067, 7, 99, 2, 2, 1067, 1068, 7, 118, 2, 2, 1068, 1069, 7, 119, 2, 2, 1069, 1070, 7, 116, 2, 2, 1070, 1071, 7, 103, 2, 2, 1071, 1072, 7, 69, 2, 2, 1072, 1073, 7, 99, 2, 2, 1073, 1074, 7, 116, 2, 2, 1074, 1075, 7, 103, 2, 2, 1075, 1076, 7, 118, 2, 2, 1076, 1077, 7, 68, 2, 2, 1077, 1078, 7, 123, 2, 2, 1078, 1079, 7, 75, 2, 2, 1079, 1080, 7, 112, 2, 2, 1080, 1081, 7, 102, 2, 2, 1081, 1082, 7, 103, 2, 2, 1082, 1083, 7, 122, 2, 2, 1083, 147, 3, 2, 2, 2, 1084, 1085, 7, 106, 2, 2, 1085, 1086, 7, 103, 2, 2, 1086, 1087, 7, 99, 2, 2, 1087, 1088, 7, 102, 2, 2, 1088, 149, 3, 2, 2, 2, 1089, 1090, 7, 72, 2, 2, 1090, 1091, 7, 113, 2, 2, 1091, 1092, 7, 112, 2, 2, 1092, 1093, 7, 118, 2, 2, 1093, 1094, 7, 84, 2, 2, 1094, 1095, 7, 103, 2, 2, 1095, 1096, 7, 120, 2, 2, 1096, 1097, 7, 107, 2, 2, 1097, 1098, 7, 117, 2, 2, 1098, 1099, 7, 107, 2, 2, 1099, 1100, 7, 113, 2, 2, 1100, 1101, 7, 112, 2, 2, 1101, 151, 3, 2, 2, 2, 1102, 1103, 7, 106, 2, 2, 1103, 1104, 7, 106, 2, 2, 1104, 1105, 7, 103, 2, 2, 1105, 1106, 7, 99, 2, 2, 1106, 153, 3, 2, 2, 2, 1107, 1108, 7, 67, 2, 2, 1108, 1109, 7, 117, 2, 2, 1109, 1110, 7, 101, 2, 2, 1110, 1111, 7, 103, 2, 2, 1111, 1112, 7, 112, 2, 2, 1112, 1113, 7, 102, 2, 2, 1113, 1114, 7, 103, 2, 2, 1114, 1115, 7, 116, 2, 2, 1115, 155, 3, 2, 2, 2, 1116, 1117, 7, 70, 2, 2, 1117, 1118, 7, 103, 2, 2, 1118, 1119, 7, 117, 2, 2, 1119, 1120, 7, 101, 2, 2, 1120, 1121, 7, 103, 2, 2, 1121, 1122, 7, 112, 2, 2, 1122, 1123, 7, 102, 2, 2, 1123, 1124, 7, 103, 2, 2, 1124, 1125, 7, 116, 2, 2, 1125, 157, 3, 2, 2, 2, 1126, 1127, 7, 78, 2, 2, 1127, 1128, 7, 107, 2, 2, 1128, 1129, 7, 112, 2, 2, 1129, 1130, 7, 103, 2, 2, 1130, 1131, 7, 73, 2, 2, 1131, 1132, 7, 99, 2, 2, 1132, 1133, 7, 114, 2, 2, 1133, 159, 3, 2, 2, 2, 1134, 1135, 7, 69, 2, 2, 1135, 1136, 7, 99, 2, 2, 1136, 1137, 7, 116, 2, 2, 1137, 1138, 7, 103, 2, 2, 1138, 1139, 7, 118, 2, 2, 1139, 1140, 7, 81, 2, 2, 1140, 1141, 7, 104, 2, 2, 1141, 1142, 7, 104, 2, 2, 1142, 1143, 7, 117, 2, 2, 1143, 1144, 7, 103, 2, 2, 1144, 1145, 7, 118, 2, 2, 1145, 161, 3, 2, 2, 2, 1146, 1147, 7, 112, 2, 2, 1147, 1148, 7, 99, 2, 2, 1148, 1149, 7, 111, 2, 2, 1149, 1150, 7, 103, 2, 2, 1150, 163, 3, 2, 2, 2, 1151, 1152, 7, 112, 2, 2, 1152, 1153, 7, 99, 2, 2, 1153, 1154, 7, 111, 2, 2, 1154, 1155, 7, 103, 2, 2, 1155, 1156, 7, 107, 2, 2, 1156, 1157, 7, 102, 2, 2, 1157, 165, 3, 2, 2, 2, 1158, 1159, 7, 81, 2, 2, 1159, 1160, 7, 85, 2, 2, 1160, 1161, 7, 49, 2, 2, 1161, 1162, 7, 52, 2, 2, 1162, 167, 3, 2, 2, 2, 1163, 1164, 7, 72, 2, 2, 1164, 1165, 7, 85, 2, 2, 1165, 1166, 7, 86, 2, 2, 1166, 1167, 7, 123, 2, 2, 1167, 1168, 7, 114, 2, 2, 1168, 1169, 7, 103, 2, 2, 1169, 169, 3, 2, 2, 2, 1170, 1171, 7, 104, 2, 2, 1171, 1172, 7, 117, 2, 2, 1172, 1173, 7, 86, 2, 2, 1173, 1174, 7, 123, 2, 2, 1174, 1175, 7, 114, 2, 2, 1175, 1176, 7, 103, 2, 2, 1176, 171, 3, 2, 2, 2, 1177, 1178, 7, 78, 2, 2, 1178, 1179, 7, 113, 2, 2, 1179, 1180, 7, 121, 2, 2, 1180, 1181, 7, 103, 2, 2, 1181, 1182, 7, 116, 2, 2, 1182, 1183, 7, 81, 2, 2, 1183, 1184, 7, 114, 2, 2, 1184, 1185, 7, 85, 2, 2, 1185, 1186, 7, 107, 2, 2, 1186, 1187, 7, 124, 2, 2, 1187, 1188, 7, 103, 2, 2, 1188, 173, 3, 2, 2, 2, 1189, 1190, 7, 87, 2, 2, 1190, 1191, 7, 114, 2, 2, 1191, 1192, 7, 114, 2, 2, 1192, 1193, 7, 103, 2, 2, 1193, 1194, 7, 116, 2, 2, 1194, 1195, 7, 81, 2, 2, 1195, 1196, 7, 114, 2, 2, 1196, 1197, 7, 85, 2, 2, 1197, 1198, 7, 107, 2, 2, 1198, 1199, 7, 124, 2, 2, 1199, 1200, 7, 103, 2, 2, 1200, 175, 3, 2, 2, 2, 1201, 1202, 7, 82, 2, 2, 1202, 1203, 7, 99, 2, 2, 1203, 1204, 7, 112, 2, 2, 1204, 1205, 7, 113, 2, 2, 1205, 1206, 7, 117, 2, 2, 1206, 1207, 7, 103, 2, 2, 1207, 177, 3, 2, 2, 2, 1208, 1209, 7, 86, 2, 2, 1209, 1210, 7, 123, 2, 2, 1210, 1211, 7, 114, 2, 2, 1211, 1212, 7, 113, 2, 2, 1212, 1213, 7, 67, 2, 2, 1213, 1214, 7, 117, 2, 2, 1214, 1215, 7, 101, 2, 2, 1215, 1216, 7, 103, 2, 2, 1216, 1217, 7, 112, 2, 2, 1217, 1218, 7, 102, 2, 2, 1218, 1219, 7, 103, 2, 2, 1219, 1220, 7, 116, 2, 2, 1220, 179, 3, 2, 2, 2, 1221, 1222, 7, 86, 2, 2, 1222, 1223, 7, 123, 2, 2, 1223, 1224, 7, 114, 2, 2, 1224, 1225, 7, 113, 2, 2, 1225, 1226, 7, 70, 2, 2, 1226, 1227, 7, 103, 2, 2, 1227, 1228, 7, 117, 2, 2, 1228, 1229, 7, 101, 2, 2, 1229, 1230, 7, 103, 2, 2, 1230, 1231, 7, 112, 2, 2, 1231, 1232, 7, 102, 2, 2, 1232, 1233, 7, 103, 2, 2, 1233, 1234, 7, 116, 2, 2, 1234, 181, 3, 2, 2, 2, 1235, 1236, 7, 86, 2, 2, 1236, 1237, 7, 123, 2, 2, 1237, 1238, 7, 114, 2, 2, 1238, 1239, 7, 113, 2, 2, 1239, 1240, 7, 78, 2, 2, 1240, 1241, 7, 107, 2, 2, 1241, 1242, 7, 112, 2, 2, 1242, 1243, 7, 103, 2, 2, 1243, 1244, 7, 73, 2, 2, 1244, 1245, 7, 99, 2, 2, 1245, 1246, 7, 114, 2, 2, 1246, 183, 3, 2, 2, 2, 1247, 1248, 7, 121, 2, 2, 1248, 1249, 7, 107, 2, 2, 1249, 1250, 7, 112, 2, 2, 1250, 1251, 7, 67, 2, 2, 1251, 1252, 7, 117, 2, 2, 1252, 1253, 7, 101, 2, 2, 1253, 1254, 7, 103, 2, 2, 1254, 1255, 7, 112, 2, 2, 1255, 1256, 7, 118, 2, 2, 1256, 185, 3, 2, 2, 2, 1257, 1258, 7, 121, 2, 2, 1258, 1259, 7, 107, 2, 2, 1259, 1260, 7, 112, 2, 2, 1260, 1261, 7, 70, 2, 2, 1261, 1262, 7, 103, 2, 2, 1262, 1263, 7, 117, 2, 2, 1263, 1264, 7, 101, 2, 2, 1264, 1265, 7, 103, 2, 2, 1265, 1266, 7, 112, 2, 2, 1266, 1267, 7, 118, 2, 2, 1267, 187, 3, 2, 2, 2, 1268, 1269, 7, 90, 2, 2, 1269, 1270, 7, 74, 2, 2, 1270, 1271, 7, 103, 2, 2, 1271, 1272, 7, 107, 2, 2, 1272, 1273, 7, 105, 2, 2, 1273, 1274, 7, 106, 2, 2, 1274, 1275, 7, 118, 2, 2, 1275, 189, 3, 2, 2, 2, 1276, 1277, 7, 69, 2, 2, 1277, 1278, 7, 99, 2, 2, 1278, 1279, 7, 114, 2, 2, 1279, 1280, 7, 74, 2, 2, 1280, 1281, 7, 103, 2, 2, 1281, 1282, 7, 107, 2, 2, 1282, 1283, 7, 105, 2, 2, 1283, 1284, 7, 106, 2, 2, 1284, 1285, 7, 118, 2, 2, 1285, 191, 3, 2, 2, 2, 1286, 1287, 7, 89, 2, 2, 1287, 1288, 7, 103, 2, 2, 1288, 1289, 7, 107, 2, 2, 1289, 1290, 7, 105, 2, 2, 1290, 1291, 7, 106, 2, 2, 1291, 1292, 7, 118, 2, 2, 1292, 1293, 7, 69, 2, 2, 1293, 1294, 7, 110, 2, 2, 1294, 1295, 7, 99, 2, 2, 1295, 1296, 7, 117, 2, 2, 1296, 1297, 7, 117, 2, 2, 1297, 193, 3, 2, 2, 2, 1298, 1299, 7, 89, 2, 2, 1299, 1300, 7, 107, 2, 2, 1300, 1301, 7, 102, 2, 2, 1301, 1302, 7, 118, 2, 2, 1302, 1303, 7, 106, 2, 2, 1303, 1304, 7, 69, 2, 2, 1304, 1305, 7, 110, 2, 2, 1305, 1306, 7, 99, 2, 2, 1306, 1307, 7, 117, 2, 2, 1307, 1308, 7, 117, 2, 2, 1308, 195, 3, 2, 2, 2, 1309, 1310, 7, 88, 2, 2, 1310, 1311, 7, 103, 2, 2, 1311, 1312, 7, 112, 2, 2, 1312, 1313, 7, 102, 2, 2, 1313, 1314, 7, 113, 2, 2, 1314, 1315, 7, 116, 2, 2, 1315, 197, 3, 2, 2, 2, 1316, 1317, 7, 87, 2, 2, 1317, 1318, 7, 112, 2, 2, 1318, 1319, 7, 107, 2, 2, 1319, 1320, 7, 101, 2, 2, 1320, 1321, 7, 113, 2, 2, 1321, 1322, 7, 102, 2, 2, 1322, 1323, 7, 103, 2, 2, 1323, 1324, 7, 84, 2, 2, 1324, 1325, 7, 99, 2, 2, 1325, 1326, 7, 112, 2, 2, 1326, 1327, 7, 105, 2, 2, 1327, 1328, 7, 103, 2, 2, 1328, 199, 3, 2, 2, 2, 1329, 1330, 7, 69, 2, 2, 1330, 1331, 7, 113, 2, 2, 1331, 1332, 7, 102, 2, 2, 1332, 1333, 7, 103, 2, 2, 1333, 1334, 7, 82, 2, 2, 1334, 1335, 7, 99, 2, 2, 1335, 1336, 7, 105, 2, 2, 1336, 1337, 7, 103, 2, 2, 1337, 1338, 7, 84, 2, 2, 1338, 1339, 7, 99, 2, 2, 1339, 1340, 7, 112, 2, 2, 1340, 1341, 7, 105, 2, 2, 1341, 1342, 7, 103, 2, 2, 1342, 201, 3, 2, 2, 2, 1343, 1344, 7, 72, 2, 2, 1344, 1345, 7, 99, 2, 2, 1345, 1346, 7, 111, 2, 2, 1346, 1347, 7, 107, 2, 2, 1347, 1348, 7, 110, 2, 2, 1348, 1349, 7, 123, 2, 2, 1349, 1350, 7, 69, 2, 2, 1350, 1351, 7, 110, 2, 2, 1351, 1352, 7, 99, 2, 2, 1352, 1353, 7, 117, 2, 2, 1353, 1354, 7, 117, 2, 2, 1354, 203, 3, 2, 2, 2, 1355, 1356, 7, 85, 2, 2, 1356, 1357, 7, 86, 2, 2, 1357, 1358, 7, 67, 2, 2, 1358, 1359, 7, 86, 2, 2, 1359, 205, 3, 2, 2, 2, 1360, 1361, 7, 71, 2, 2, 1361, 1362, 7, 110, 2, 2, 1362, 1363, 7, 107, 2, 2, 1363, 1364, 7, 102, 2, 2, 1364, 1365, 7, 103, 2, 2, 1365, 1366, 7, 102, 2, 2, 1366, 1367, 7, 72, 2, 2, 1367, 1368, 7, 99, 2, 2, 1368, 1369, 7, 110, 2, 2, 1369, 1370, 7, 110, 2, 2, 1370, 1371, 7, 100, 2, 2, 1371, 1372, 7, 99, 2, 2, 1372, 1373, 7, 101, 2, 2, 1373, 1374, 7, 109, 2, 2, 1374, 1375, 7, 80, 2, 2, 1375, 1376, 7, 99, 2, 2, 1376, 1377, 7, 111, 2, 2, 1377, 1378, 7, 103, 2, 2, 1378, 207, 3, 2, 2, 2, 1379, 1380, 7, 71, 2, 2, 1380, 1381, 7, 110, 2, 2, 1381, 1382, 7, 107, 2, 2, 1382, 1383, 7, 102, 2, 2, 1383, 1384, 7, 103, 2, 2, 1384, 1385, 7, 102, 2, 2, 1385, 1386, 7, 72, 2, 2, 1386, 1387, 7, 99, 2, 2, 1387, 1388, 7, 110, 2, 2, 1388, 1389, 7, 110, 2, 2, 1389, 1390, 7, 100, 2, 2, 1390, 1391, 7, 99, 2, 2, 1391, 1392, 7, 101, 2, 2, 1392, 1393, 7, 109, 2, 2, 1393, 1394, 7, 80, 2, 2, 1394, 1395, 7, 99, 2, 2, 1395, 1396, 7, 111, 2, 2, 1396, 1397, 7, 103, 2, 2, 1397, 1398, 7, 75, 2, 2, 1398, 1399, 7, 70, 2, 2, 1399, 209, 3, 2, 2, 2, 1400, 1401, 7, 70, 2, 2, 1401, 1402, 7, 103, 2, 2, 1402, 1403, 7, 117, 2, 2, 1403, 1404, 7, 107, 2, 2, 1404, 1405, 7, 105, 2, 2, 1405, 1406, 7, 112, 2, 2, 1406, 1407, 7, 67, 2, 2, 1407, 1408, 7, 122, 2, 2, 1408, 1409, 7, 107, 2, 2, 1409, 1410, 7, 117, 2, 2, 1410, 211, 3, 2, 2, 2, 1411, 1412, 7, 67, 2, 2, 1412, 1413, 7, 122, 2, 2, 1413, 1414, 7, 107, 2, 2, 1414, 1415, 7, 117, 2, 2, 1415, 1416, 7, 88, 2, 2, 1416, 1417, 7, 99, 2, 2, 1417, 1418, 7, 110, 2, 2, 1418, 1419, 7, 119, 2, 2, 1419, 1420, 7, 103, 2, 2, 1420, 213, 3, 2, 2, 2, 1421, 1422, 7, 104, 2, 2, 1422, 1423, 7, 110, 2, 2, 1423, 1424, 7, 99, 2, 2, 1424, 1425, 7, 105, 2, 2, 1425, 215, 3, 2, 2, 2, 1426, 1427, 7, 110, 2, 2, 1427, 1428, 7, 113, 2, 2, 1428, 1429, 7, 101, 2, 2, 1429, 1430, 7, 99, 2, 2, 1430, 1431, 7, 118, 2, 2, 1431, 1432, 7, 107, 2, 2, 1432, 1433, 7, 113, 2, 2, 1433, 1434, 7, 112, 2, 2, 1434, 217, 3, 2, 2, 2, 1435, 1436, 7, 71, 2, 2, 1436, 1437, 7, 110, 2, 2, 1437, 1438, 7, 107, 2, 2, 1438, 1439, 7, 102, 2, 2, 1439, 1440, 7, 99, 2, 2, 1440, 1441, 7, 100, 2, 2, 1441, 1442, 7, 110, 2, 2, 1442, 1443, 7, 103, 2, 2, 1443, 1444, 7, 67, 2, 2, 1444, 1445, 7, 122, 2, 2, 1445, 1446, 7, 107, 2, 2, 1446, 1447, 7, 117, 2, 2, 1447, 1448, 7, 88, 2, 2, 1448, 1449, 7, 99, 2, 2, 1449, 1450, 7, 110, 2, 2, 1450, 1451, 7, 119, 2, 2, 1451, 1452, 7, 103, 2, 2, 1452, 1453, 7, 80, 2, 2, 1453, 1454, 7, 99, 2, 2, 1454, 1455, 7, 111, 2, 2, 1455, 1456, 7, 103, 2, 2, 1456, 219, 3, 2, 2, 2, 1457, 1458, 7, 81, 2, 2, 1458, 1459, 7, 110, 2, 2, 1459, 1460, 7, 102, 2, 2, 1460, 1461, 7, 103, 2, 2, 1461, 1462, 7, 116, 2, 2, 1462, 1463, 7, 85, 2, 2, 1463, 1464, 7, 107, 2, 2, 1464, 1465, 7, 100, 2, 2, 1465, 1466, 7, 110, 2, 2, 1466, 1467, 7, 107, 2, 2, 1467, 1468, 7, 112, 2, 2, 1468, 1469, 7, 105, 2, 2, 1469, 1470, 7, 72, 2, 2, 1470, 1471, 7, 113, 2, 2, 1471, 1472, 7, 112, 2, 2, 1472, 1473, 7, 118, 2, 2, 1473, 1474, 7, 67, 2, 2, 1474, 1475, 7, 118, 2, 2, 1475, 1476, 7, 118, 2, 2, 1476, 1477, 7, 116, 2, 2, 1477, 1478, 7, 107, 2, 2, 1478, 1479, 7, 100, 2, 2, 1479, 1480, 7, 119, 2, 2, 1480, 1481, 7, 118, 2, 2, 1481, 1482, 7, 103, 2, 2, 1482, 221, 3, 2, 2, 2, 1483, 1484, 7, 120, 2, 2, 1484, 1485, 7, 106, 2, 2, 1485, 1486, 7, 103, 2, 2, 1486, 1487, 7, 99, 2, 2, 1487, 223, 3, 2, 2, 2, 1488, 1489, 7, 88, 2, 2, 1489, 1490, 7, 103, 2, 2, 1490, 1491, 7, 116, 2, 2, 1491, 1492, 7, 118, 2, 2, 1492, 1493, 7, 86, 2, 2, 1493, 1494, 7, 123, 2, 2, 1494, 1495, 7, 114, 2, 2, 1495, 1496, 7, 113, 2, 2, 1496, 1497, 7, 67, 2, 2, 1497, 1498, 7, 117, 2, 2, 1498, 1499, 7, 101, 2, 2, 1499, 1500, 7, 103, 2, 2, 1500, 1501, 7, 112, 2, 2, 1501, 1502, 7, 102, 2, 2, 1502, 1503, 7, 103, 2, 2, 1503, 1504, 7, 116, 2, 2, 1504, 225, 3, 2, 2, 2, 1505, 1506, 7, 88, 2, 2, 1506, 1507, 7, 103, 2, 2, 1507, 1508, 7, 116, 2, 2, 1508, 1509, 7, 118, 2, 2, 1509, 1510, 7, 86, 2, 2, 1510, 1511, 7, 123, 2, 2, 1511, 1512, 7, 114, 2, 2, 1512, 1513, 7, 113, 2, 2, 1513, 1514, 7, 70, 2, 2, 1514, 1515, 7, 103, 2, 2, 1515, 1516, 7, 117, 2, 2, 1516, 1517, 7, 101, 2, 2, 1517, 1518, 7, 103, 2, 2, 1518, 1519, 7, 112, 2, 2, 1519, 1520, 7, 102, 2, 2, 1520, 1521, 7, 103, 2, 2, 1521, 1522, 7, 116, 2, 2, 1522, 227, 3, 2, 2, 2, 1523, 1524, 7, 88, 2, 2, 1524, 1525, 7, 103, 2, 2, 1525, 1526, 7, 116, 2, 2, 1526, 1527, 7, 118, 2, 2, 1527, 1528, 7, 86, 2, 2, 1528, 1529, 7, 123, 2, 2, 1529, 1530, 7, 114, 2, 2, 1530, 1531, 7, 113, 2, 2, 1531, 1532, 7, 78, 2, 2, 1532, 1533, 7, 107, 2, 2, 1533, 1534, 7, 112, 2, 2, 1534, 1535, 7, 103, 2, 2, 1535, 1536, 7, 73, 2, 2, 1536, 1537, 7, 99, 2, 2, 1537, 1538, 7, 114, 2, 2, 1538, 229, 3, 2, 2, 2, 1539, 1540, 7, 120, 2, 2, 1540, 1541, 7, 111, 2, 2, 1541, 1542, 7, 118, 2, 2, 1542, 1543, 7, 122, 2, 2, 1543, 231, 3, 2, 2, 2, 1544, 1545, 7, 88, 2, 2, 1545, 1546, 7, 103, 2, 2, 1546, 1547, 7, 116, 2, 2, 1547, 1548, 7, 118, 2, 2, 1548, 1549, 7, 81, 2, 2, 1549, 1550, 7, 116, 2, 2, 1550, 1551, 7, 107, 2, 2, 1551, 1552, 7, 105, 2, 2, 1552, 1553, 7, 107, 2, 2, 1553, 1554, 7, 112, 2, 2, 1554, 1555, 7, 91, 2, 2, 1555, 233, 3, 2, 2, 2, 1556, 1557, 7, 88, 2, 2, 1557, 1558, 7, 103, 2, 2, 1558, 1559, 7, 116, 2, 2, 1559, 1560, 7, 118, 2, 2, 1560, 1561, 7, 67, 2, 2, 1561, 1562, 7, 102, 2, 2, 1562, 1563, 7, 120, 2, 2, 1563, 1564, 7, 99, 2, 2, 1564, 1565, 7, 112, 2, 2, 1565, 1566, 7, 101, 2, 2, 1566, 1567, 7, 103, 2, 2, 1567, 1568, 7, 91, 2, 2, 1568, 235, 3, 2, 2, 2, 1569, 1570, 7, 125, 2, 2, 1570, 237, 3, 2, 2, 2, 1571, 1572, 7, 127, 2, 2, 1572, 239, 3, 2, 2, 2, 1573, 1574, 7, 93, 2, 2, 1574, 241, 3, 2, 2, 2, 1575, 1576, 7, 95, 2, 2, 1576, 243, 3, 2, 2, 2, 1577, 1578, 7, 47, 2, 2, 1578, 245, 3, 2, 2, 2, 1579, 1580, 7, 61, 2, 2, 1580, 247, 3, 2, 2, 2, 1581, 1582, 7, 63, 2, 2, 1582, 249, 3, 2, 2, 2, 1583, 1584, 7, 41, 2, 2, 1584, 251, 3, 2, 2, 2, 1585, 1586, 7, 46, 2, 2, 1586, 253, 3, 2, 2, 2, 1587, 1588, 7, 36, 2, 2, 1588, 1589, 3, 2, 2, 2, 1589, 1590, 8, 125, 5, 2, 1590, 255, 3, 2, 2, 2, 1591, 1592, 9, 4, 2, 2, 1592, 257, 3, 2, 2, 2, 1593, 1596, 5, 256, 126, 2, 1594, 1596, 9, 5, 2, 2, 1595, 1593, 3, 2, 2, 2, 1595, 1594, 3, 2, 2, 2, 1596, 259, 3, 2, 2, 2, 1597, 1600, 5, 258, 127, 2, 1598, 1600, 7, 47, 2, 2, 1599, 1597, 3, 2, 2, 2, 1599, 1598, 3, 2, 2, 2, 1600, 261, 3, 2, 2, 2, 1601, 1602, 7, 66, 2, 2, 1602, 1606, 5, 256, 126, 2, 1603, 1605, 5, 260, 128, 2, 1604, 1603, 3, 2, 2, 2, 1605, 1608, 3, 2, 2, 2, 1606, 1604, 3, 2, 2, 2, 1606, 1607, 3, 2, 2, 2, 1607, 263, 3, 2, 2, 2, 1608, 1606, 3, 2, 2, 2, 1609, 1611, 7, 94, 2, 2, 1610, 1612, 4, 50, 59, 2, 1611, 1610, 3, 2, 2, 2, 1612, 1613, 3, 2, 2, 2, 1613, 1611, 3, 2, 2, 2, 1613, 1614, 3, 2, 2, 2, 1614, 265, 3, 2, 2, 2, 1615, 1618, 5, 260, 128, 2, 1616, 1618, 9, 6, 2, 2, 1617, 1615, 3, 2, 2, 2, 1617, 1616, 3, 2, 2, 2, 1618, 267, 3, 2, 2, 2, 1619, 1620, 7, 94, 2, 2, 1620, 1624, 5, 256, 126, 2, 1621, 1623, 5, 266, 131, 2, 1622, 1621, 3, 2, 2, 2, 1623, 1626, 3, 2, 2, 2, 1624, 1622, 3, 2, 2, 2, 1624, 1625, 3, 2, 2, 2, 1625, 269, 3, 2, 2, 2, 1626, 1624, 3, 2, 2, 2, 1627, 1631, 5, 256, 126, 2, 1628, 1630, 5, 258, 127, 2, 1629, 1628, 3, 2, 2, 2, 1630, 1633, 3, 2, 2, 2, 1631, 1629, 3, 2, 2, 2, 1631, 1632, 3, 2, 2, 2, 1632, 271, 3, 2, 2, 2, 1633, 1631, 3, 2, 2, 2, 1634, 1638, 5, 256, 126, 2, 1635, 1637, 5, 266, 131, 2, 1636, 1635, 3, 2, 2, 2, 1637, 1640, 3, 2, 2, 2, 1638, 1636, 3, 2, 2, 2, 1638, 1639, 3, 2, 2, 2, 1639, 273, 3, 2, 2, 2, 1640, 1638, 3, 2, 2, 2, 1641, 1643, 7, 47, 2, 2, 1642, 1641, 3, 2, 2, 2, 1642, 1643, 3, 2, 2, 2, 1643, 1645, 3, 2, 2, 2, 1644, 1646, 4, 50, 59, 2, 1645, 1644, 3, 2, 2, 2, 1646, 1647, 3, 2, 2, 2, 1647, 1645, 3, 2, 2, 2, 1647, 1648, 3, 2, 2, 2, 1648, 1649, 3, 2, 2, 2, 1649, 1651, 7, 48, 2, 2, 1650, 1652, 4, 50, 59, 2, 1651, 1650, 3, 2, 2, 2, 1652, 1653, 3, 2, 2, 2, 1653, 1651, 3, 2, 2, 2, 1653, 1654, 3, 2, 2, 2, 1654, 275, 3, 2, 2, 2, 1655, 1656, 7, 50, 2, 2, 1656, 1657, 7, 122, 2, 2, 1657, 1659, 3, 2, 2, 2, 1658, 1660, 9, 7, 2, 2, 1659, 1658, 3, 2, 2, 2, 1660, 1661, 3, 2, 2, 2, 1661, 1659, 3, 2, 2, 2, 1661, 1662, 3, 2, 2, 2, 1662, 277, 3, 2, 2, 2, 1663, 1665, 7, 50, 2, 2, 1664, 1666, 4, 50, 57, 2, 1665, 1664, 3, 2, 2, 2, 1666, 1667, 3, 2, 2, 2, 1667, 1665, 3, 2, 2, 2, 1667, 1668, 3, 2, 2, 2, 1668, 279, 3, 2, 2, 2, 1669, 1671, 7, 47, 2, 2, 1670, 1669, 3, 2, 2, 2, 1670, 1671, 3, 2, 2, 2, 1671, 1680, 3, 2, 2, 2, 1672, 1676, 4, 51, 59, 2, 1673, 1675, 4, 50, 59, 2, 1674, 1673, 3, 2, 2, 2, 1675, 1678, 3, 2, 2, 2, 1676, 1674, 3, 2, 2, 2, 1676, 1677, 3, 2, 2, 2, 1677, 1681, 3, 2, 2, 2, 1678, 1676, 3, 2, 2, 2, 1679, 1681, 7, 50, 2, 2, 1680, 1672, 3, 2, 2, 2, 1680, 1679, 3, 2, 2, 2, 1681, 281, 3, 2, 2, 2, 1682, 1683, 9, 8, 2, 2, 1683, 283, 3, 2, 2, 2, 1684, 1687, 5, 282, 139, 2, 1685, 1687, 9, 9, 2, 2, 1686, 1684, 3, 2, 2, 2, 1686, 1685, 3, 2, 2, 2, 1687, 285, 3, 2, 2, 2, 1688, 1690, 5, 282, 139, 2, 1689, 1691, 5, 284, 140, 2, 1690, 1689, 3, 2, 2, 2, 1690, 1691, 3, 2, 2, 2, 1691, 287, 3, 2, 2, 2, 1692, 1694, 9, 3, 2, 2, 1693, 1692, 3, 2, 2, 2, 1694, 1695, 3, 2, 2, 2, 1695, 1693, 3, 2, 2, 2, 1695, 1696, 3, 2, 2, 2, 1696, 1697, 3, 2, 2, 2, 1697, 1698, 8, 142, 3, 2, 1698, 289, 3, 2, 2, 2, 1699, 1703, 5, 282, 139, 2, 1700, 1702, 5, 284, 140, 2, 1701, 1700, 3, 2, 2, 2, 1702, 1705, 3, 2, 2, 2, 1703, 1701, 3, 2, 2, 2, 1703, 1704, 3, 2, 2, 2, 1704, 1706, 3, 2, 2, 2, 1705, 1703, 3, 2, 2, 2, 1706, 1707, 8, 143, 6, 2, 1707, 291, 3, 2, 2, 2, 1708, 1709, 7, 125, 2, 2, 1709, 1710, 3, 2, 2, 2, 1710, 1711, 8, 144, 7, 2, 1711, 293, 3, 2, 2, 2, 1712, 1714, 7, 15, 2, 2, 1713, 1712, 3, 2, 2, 2, 1713, 1714, 3, 2, 2, 2, 1714, 1715, 3, 2, 2, 2, 1715, 1716, 7, 12, 2, 2, 1716, 1717, 7, 127, 2, 2, 1717, 1721, 3, 2, 2, 2, 1718, 1720, 9, 10, 2, 2, 1719, 1718, 3, 2, 2, 2, 1720, 1723, 3, 2, 2, 2, 1721, 1719, 3, 2, 2, 2, 1721, 1722, 3, 2, 2, 2, 1722, 1724, 3, 2, 2, 2, 1723, 1721, 3, 2, 2, 2, 1724, 1728, 5, 282, 139, 2, 1725, 1727, 5, 284, 140, 2, 1726, 1725, 3, 2, 2, 2, 1727, 1730, 3, 2, 2, 2, 1728, 1726, 3, 2, 2, 2, 1728, 1729, 3, 2, 2, 2, 1729, 1734, 3, 2, 2, 2, 1730, 1728, 3, 2, 2, 2, 1731, 1733, 9, 10, 2, 2, 1732, 1731, 3, 2, 2, 2, 1733, 1736, 3, 2, 2, 2, 1734, 1732, 3, 2, 2, 2, 1734, 1735, 3, 2, 2, 2, 1735, 1737, 3, 2, 2, 2, 1736, 1734, 3, 2, 2, 2, 1737, 1738, 7, 61, 2, 2, 1738, 1739, 6, 145, 2, 2, 1739, 1740, 3, 2, 2, 2, 1740, 1741, 8, 145, 8, 2, 1741, 295, 3, 2, 2, 2, 1742, 1744, 7, 15, 2, 2, 1743, 1742, 3, 2, 2, 2, 1743, 1744, 3, 2, 2, 2, 1744, 1745, 3, 2, 2, 2, 1745, 1749, 7, 12, 2, 2, 1746, 1748, 10, 2, 2, 2, 1747, 1746, 3, 2, 2, 2, 1748, 1751, 3, 2, 2, 2, 1749, 1747, 3, 2, 2, 2, 1749, 1750, 3, 2, 2, 2, 1750, 297, 3, 2, 2, 2, 1751, 1749, 3, 2, 2, 2, 1752, 1754, 9, 3, 2, 2, 1753, 1752, 3, 2, 2, 2, 1754, 1755, 3, 2, 2, 2, 1755, 1753, 3, 2, 2, 2, 1755, 1756, 3, 2, 2, 2, 1756, 1757, 3, 2, 2, 2, 1757, 1758, 8, 147, 3, 2, 1758, 299, 3, 2, 2, 2, 1759, 1760, 7, 42, 2, 2, 1760, 1761, 3, 2, 2, 2, 1761, 1762, 8, 148, 9, 2, 1762, 301, 3, 2, 2, 2, 1763, 1765, 10, 11, 2, 2, 1764, 1763, 3, 2, 2, 2, 1765, 1766, 3, 2, 2, 2, 1766, 1764, 3, 2, 2, 2, 1766, 1767, 3, 2, 2, 2, 1767, 303, 3, 2, 2, 2, 1768, 1769, 7, 43, 2, 2, 1769, 1770, 3, 2, 2, 2, 1770, 1771, 8, 150, 8, 2, 1771, 305, 3, 2, 2, 2, 1772, 1774, 10, 12, 2, 2, 1773, 1772, 3, 2, 2, 2, 1774, 1777, 3, 2, 2, 2, 1775, 1773, 3, 2, 2, 2, 1775, 1776, 3, 2, 2, 2, 1776, 307, 3, 2, 2, 2, 1777, 1775, 3, 2, 2, 2, 1778, 1779, 7, 36, 2, 2, 1779, 1780, 3, 2, 2, 2, 1780, 1781, 8, 152, 8, 2, 1781, 309, 3, 2, 2, 2, 39, 2, 3, 4, 5, 6, 7, 333, 341, 1595, 1599, 1606, 1613, 1617, 1624, 1631, 1638, 1642, 1647, 1653, 1661, 1667, 1670, 1676, 1680, 1686, 1690, 1695, 1703, 1713, 1721, 1728, 1734, 1743, 1749, 1755, 1766, 1775, 10, 7, 3, 2, 8, 2, 2, 7, 5, 2, 7, 7, 2, 3, 143, 2, 4, 4, 2, 6, 2, 2, 4, 6, 2] \ No newline at end of file diff --git a/c/makeotf/lib/hotconv/FeatLexer.tokens b/c/makeotf/lib/hotconv/FeatLexer.tokens new file mode 100644 index 000000000..b2e38d4b5 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatLexer.tokens @@ -0,0 +1,267 @@ +ANON=1 +ANON_v=2 +COMMENT=3 +WHITESPACE=4 +INCLUDE=5 +FEATURE=6 +TABLE=7 +SCRIPT=8 +LANGUAGE=9 +LANGSYS=10 +SUBTABLE=11 +LOOKUP=12 +LOOKUPFLAG=13 +NOTDEF=14 +RIGHT_TO_LEFT=15 +IGNORE_BASE_GLYPHS=16 +IGNORE_LIGATURES=17 +IGNORE_MARKS=18 +USE_MARK_FILTERING_SET=19 +MARK_ATTACHMENT_TYPE=20 +EXCLUDE_DFLT=21 +INCLUDE_DFLT=22 +EXCLUDE_dflt=23 +INCLUDE_dflt=24 +USE_EXTENSION=25 +BEGINVALUE=26 +ENDVALUE=27 +ENUMERATE=28 +ENUMERATE_v=29 +EXCEPT=30 +IGNORE=31 +SUBSTITUTE=32 +SUBSTITUTE_v=33 +REVERSE=34 +REVERSE_v=35 +BY=36 +FROM=37 +POSITION=38 +POSITION_v=39 +PARAMETERS=40 +FEATURE_NAMES=41 +CV_PARAMETERS=42 +CV_UI_LABEL=43 +CV_TOOLTIP=44 +CV_SAMPLE_TEXT=45 +CV_PARAM_LABEL=46 +CV_CHARACTER=47 +SIZEMENUNAME=48 +CONTOURPOINT=49 +ANCHOR=50 +ANCHOR_DEF=51 +VALUE_RECORD_DEF=52 +MARK=53 +MARK_CLASS=54 +CURSIVE=55 +MARKBASE=56 +MARKLIG=57 +MARKLIG_v=58 +LIG_COMPONENT=59 +KNULL=60 +BASE=61 +HA_BTL=62 +VA_BTL=63 +HA_BSL=64 +VA_BSL=65 +GDEF=66 +GLYPH_CLASS_DEF=67 +ATTACH=68 +LIG_CARET_BY_POS=69 +LIG_CARET_BY_IDX=70 +HEAD=71 +FONT_REVISION=72 +HHEA=73 +ASCENDER=74 +DESCENDER=75 +LINE_GAP=76 +CARET_OFFSET=77 +NAME=78 +NAMEID=79 +OS_2=80 +FS_TYPE=81 +FS_TYPE_v=82 +OS2_LOWER_OP_SIZE=83 +OS2_UPPER_OP_SIZE=84 +PANOSE=85 +TYPO_ASCENDER=86 +TYPO_DESCENDER=87 +TYPO_LINE_GAP=88 +WIN_ASCENT=89 +WIN_DESCENT=90 +X_HEIGHT=91 +CAP_HEIGHT=92 +WEIGHT_CLASS=93 +WIDTH_CLASS=94 +VENDOR=95 +UNICODE_RANGE=96 +CODE_PAGE_RANGE=97 +FAMILY_CLASS=98 +STAT=99 +ELIDED_FALLBACK_NAME=100 +ELIDED_FALLBACK_NAME_ID=101 +DESIGN_AXIS=102 +AXIS_VALUE=103 +FLAG=104 +LOCATION=105 +AXIS_EAVN=106 +AXIS_OSFA=107 +VHEA=108 +VERT_TYPO_ASCENDER=109 +VERT_TYPO_DESCENDER=110 +VERT_TYPO_LINE_GAP=111 +VMTX=112 +VERT_ORIGIN_Y=113 +VERT_ADVANCE_Y=114 +LCBRACE=115 +RCBRACE=116 +LBRACKET=117 +RBRACKET=118 +HYPHEN=119 +SEMI=120 +EQUALS=121 +MARKER=122 +COMMA=123 +QUOTE=124 +GCLASS=125 +CID=126 +ESCGNAME=127 +NAMELABEL=128 +EXTNAME=129 +POINTNUM=130 +NUMEXT=131 +NUMOCT=132 +NUM=133 +CATCHTAG=134 +A_WHITESPACE=135 +A_LABEL=136 +A_LBRACE=137 +A_CLOSE=138 +A_LINE=139 +I_WHITESPACE=140 +I_RPAREN=141 +IFILE=142 +I_LPAREN=143 +STRVAL=144 +EQUOTE=145 +'anon'=1 +'anonymous'=2 +'include'=5 +'feature'=6 +'table'=7 +'script'=8 +'language'=9 +'languagesystem'=10 +'subtable'=11 +'lookup'=12 +'lookupflag'=13 +'.notdef'=14 +'RightToLeft'=15 +'IgnoreBaseGlyphs'=16 +'IgnoreLigatures'=17 +'IgnoreMarks'=18 +'UseMarkFilteringSet'=19 +'MarkAttachmentType'=20 +'excludeDFLT'=21 +'includeDFLT'=22 +'exclude_dflt'=23 +'include_dflt'=24 +'useExtension'=25 +'<'=26 +'>'=27 +'enumerate'=28 +'enum'=29 +'except'=30 +'ignore'=31 +'substitute'=32 +'sub'=33 +'reversesub'=34 +'rsub'=35 +'by'=36 +'from'=37 +'position'=38 +'pos'=39 +'parameters'=40 +'featureNames'=41 +'cvParameters'=42 +'FeatUILabelNameID'=43 +'FeatUITooltipTextNameID'=44 +'SampleTextNameID'=45 +'ParamUILabelNameID'=46 +'Character'=47 +'sizemenuname'=48 +'contourpoint'=49 +'anchor'=50 +'anchorDef'=51 +'valueRecordDef'=52 +'mark'=53 +'markClass'=54 +'cursive'=55 +'base'=56 +'ligature'=57 +'lig'=58 +'ligComponent'=59 +'NULL'=60 +'BASE'=61 +'HorizAxis.BaseTagList'=62 +'VertAxis.BaseTagList'=63 +'HorizAxis.BaseScriptList'=64 +'VertAxis.BaseScriptList'=65 +'GDEF'=66 +'GlyphClassDef'=67 +'Attach'=68 +'LigatureCaretByPos'=69 +'LigatureCaretByIndex'=70 +'head'=71 +'FontRevision'=72 +'hhea'=73 +'Ascender'=74 +'Descender'=75 +'LineGap'=76 +'CaretOffset'=77 +'name'=78 +'nameid'=79 +'OS/2'=80 +'FSType'=81 +'fsType'=82 +'LowerOpSize'=83 +'UpperOpSize'=84 +'Panose'=85 +'TypoAscender'=86 +'TypoDescender'=87 +'TypoLineGap'=88 +'winAscent'=89 +'winDescent'=90 +'XHeight'=91 +'CapHeight'=92 +'WeightClass'=93 +'WidthClass'=94 +'Vendor'=95 +'UnicodeRange'=96 +'CodePageRange'=97 +'FamilyClass'=98 +'STAT'=99 +'ElidedFallbackName'=100 +'ElidedFallbackNameID'=101 +'DesignAxis'=102 +'AxisValue'=103 +'flag'=104 +'location'=105 +'ElidableAxisValueName'=106 +'OlderSiblingFontAttribute'=107 +'vhea'=108 +'VertTypoAscender'=109 +'VertTypoDescender'=110 +'VertTypoLineGap'=111 +'vmtx'=112 +'VertOriginY'=113 +'VertAdvanceY'=114 +'}'=116 +'['=117 +']'=118 +'-'=119 +';'=120 +'='=121 +'\''=122 +','=123 +'('=141 +')'=143 diff --git a/c/makeotf/lib/hotconv/FeatLexerBase.g4 b/c/makeotf/lib/hotconv/FeatLexerBase.g4 new file mode 100644 index 000000000..5f8645e76 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatLexerBase.g4 @@ -0,0 +1,184 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +// -------------------------- Feature file tokens --------------------------- + +lexer grammar FeatLexerBase; + +COMMENT : '#' ~[\r\n]* -> skip ; +WHITESPACE : [ \t\r\n]+ -> skip ; + +INCLUDE : 'include' -> pushMode(Include) ; +FEATURE : 'feature' ; +TABLE : 'table' ; +SCRIPT : 'script' ; +LANGUAGE : 'language' ; +LANGSYS : 'languagesystem' ; +SUBTABLE : 'subtable'; +LOOKUP : 'lookup' ; +LOOKUPFLAG : 'lookupflag' ; +NOTDEF : '.notdef' ; + +RIGHT_TO_LEFT : 'RightToLeft' ; +IGNORE_BASE_GLYPHS : 'IgnoreBaseGlyphs' ; +IGNORE_LIGATURES : 'IgnoreLigatures' ; +IGNORE_MARKS : 'IgnoreMarks' ; +USE_MARK_FILTERING_SET : 'UseMarkFilteringSet' ; +MARK_ATTACHMENT_TYPE : 'MarkAttachmentType' ; + +ANON : 'anon' ; +ANON_v : 'anonymous' ; + +EXCLUDE_DFLT : 'excludeDFLT' ; +INCLUDE_DFLT : 'includeDFLT' ; +EXCLUDE_dflt : 'exclude_dflt' ; +INCLUDE_dflt : 'include_dflt' ; + +USE_EXTENSION : 'useExtension' ; +BEGINVALUE : '<' ; +ENDVALUE : '>' ; +ENUMERATE : 'enumerate' ; +ENUMERATE_v : 'enum' ; +EXCEPT : 'except' ; +IGNORE : 'ignore' ; +SUBSTITUTE : 'substitute' ; +SUBSTITUTE_v : 'sub' ; +REVERSE : 'reversesub' ; +REVERSE_v : 'rsub' ; +BY : 'by' ; +FROM : 'from' ; +POSITION : 'position' ; +POSITION_v : 'pos'; +PARAMETERS : 'parameters' ; +FEATURE_NAMES : 'featureNames' ; +CV_PARAMETERS : 'cvParameters' ; +CV_UI_LABEL : 'FeatUILabelNameID' ; +CV_TOOLTIP : 'FeatUITooltipTextNameID' ; +CV_SAMPLE_TEXT : 'SampleTextNameID' ; +CV_PARAM_LABEL : 'ParamUILabelNameID' ; +CV_CHARACTER : 'Character' ; +SIZEMENUNAME : 'sizemenuname' ; +CONTOURPOINT : 'contourpoint' ; +ANCHOR : 'anchor' ; +ANCHOR_DEF : 'anchorDef' ; +VALUE_RECORD_DEF : 'valueRecordDef' ; +MARK : 'mark'; +MARK_CLASS : 'markClass' ; +CURSIVE : 'cursive' ; +MARKBASE : 'base' ; +MARKLIG : 'ligature' ; +MARKLIG_v : 'lig' ; +LIG_COMPONENT : 'ligComponent' ; + +KNULL : 'NULL' ; + +BASE : 'BASE' ; +HA_BTL : 'HorizAxis.BaseTagList' ; +VA_BTL : 'VertAxis.BaseTagList' ; +HA_BSL : 'HorizAxis.BaseScriptList' ; +VA_BSL : 'VertAxis.BaseScriptList' ; + +GDEF : 'GDEF' ; +GLYPH_CLASS_DEF : 'GlyphClassDef' ; +ATTACH : 'Attach' ; +LIG_CARET_BY_POS : 'LigatureCaretByPos' ; +LIG_CARET_BY_IDX : 'LigatureCaretByIndex' ; + +HEAD : 'head' ; +FONT_REVISION : 'FontRevision' ; + +HHEA : 'hhea' ; +ASCENDER : 'Ascender' ; +DESCENDER : 'Descender' ; +LINE_GAP : 'LineGap' ; + +CARET_OFFSET : 'CaretOffset' ; + +NAME : 'name' ; +NAMEID : 'nameid' ; + +OS_2 : 'OS/2' ; +FS_TYPE : 'FSType' ; +FS_TYPE_v : 'fsType' ; +OS2_LOWER_OP_SIZE : 'LowerOpSize' ; +OS2_UPPER_OP_SIZE : 'UpperOpSize' ; +PANOSE : 'Panose' ; +TYPO_ASCENDER : 'TypoAscender' ; +TYPO_DESCENDER : 'TypoDescender' ; +TYPO_LINE_GAP : 'TypoLineGap' ; +WIN_ASCENT : 'winAscent' ; +WIN_DESCENT : 'winDescent' ; +X_HEIGHT : 'XHeight' ; +CAP_HEIGHT : 'CapHeight' ; +WEIGHT_CLASS : 'WeightClass' ; +WIDTH_CLASS : 'WidthClass' ; +VENDOR : 'Vendor' ; +UNICODE_RANGE : 'UnicodeRange' ; +CODE_PAGE_RANGE : 'CodePageRange' ; +FAMILY_CLASS : 'FamilyClass' ; + +STAT : 'STAT' ; +ELIDED_FALLBACK_NAME : 'ElidedFallbackName' ; +ELIDED_FALLBACK_NAME_ID : 'ElidedFallbackNameID' ; +DESIGN_AXIS : 'DesignAxis' ; +AXIS_VALUE : 'AxisValue'; +FLAG : 'flag' ; +LOCATION : 'location'; +AXIS_EAVN : 'ElidableAxisValueName'; +AXIS_OSFA : 'OlderSiblingFontAttribute'; + +VHEA : 'vhea' ; +VERT_TYPO_ASCENDER : 'VertTypoAscender' ; +VERT_TYPO_DESCENDER : 'VertTypoDescender' ; +VERT_TYPO_LINE_GAP : 'VertTypoLineGap' ; + +VMTX : 'vmtx' ; +VERT_ORIGIN_Y : 'VertOriginY' ; +VERT_ADVANCE_Y : 'VertAdvanceY' ; + +LCBRACE : '{' ; +RCBRACE : '}' ; +LBRACKET : '[' ; +RBRACKET : ']' ; +HYPHEN : '-' ; +SEMI : ';' ; +EQUALS : '=' ; +MARKER : '\'' ; +COMMA : ',' ; +QUOTE : '"' -> pushMode(String) ; + +fragment GNST : 'A' .. 'Z' | 'a' .. 'z' | '_' ; +fragment LCHR : GNST | '0' .. '9' | '.' ; +fragment GCCHR : LCHR | '-' ; +GCLASS : '@' GNST GCCHR* ; + +CID : '\\' ( '0' .. '9' )+ ; +fragment GNCHR : GCCHR | '+' | '*' | ':' | '~' | '^' | '|' ; +ESCGNAME : '\\' GNST GNCHR* ; +NAMELABEL : GNST LCHR* ; +EXTNAME : GNST GNCHR* ; +POINTNUM : '-'? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ; +NUMEXT : '0x' ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )+ ; +NUMOCT : '0' ( '0' .. '7' )+ ; +NUM : '-'? ( '1' .. '9' ( '0' .. '9' )* | '0' ) ; +fragment TSTART : '!' | '$' | '%' | '&' | '*' | '+' | '.' | ':' | '?' | + 'A' .. 'Z' | '^' .. 'z' | '|' | '~' ; +fragment TCHR : TSTART | '0' .. '9' | '-' ; +CATCHTAG : TSTART TCHR? ; + +mode Include; + +I_WHITESPACE : [ \t\r\n]+ -> skip ; +I_RPAREN : '(' -> mode(Ifile) ; + +mode Ifile; + +IFILE : ~')'+ ; +I_LPAREN : ')' -> popMode ; + +mode String; + +STRVAL : ~'"'* ; +EQUOTE : '"' -> popMode ; diff --git a/c/makeotf/lib/hotconv/FeatParser.cpp b/c/makeotf/lib/hotconv/FeatParser.cpp new file mode 100644 index 000000000..bb8a7fc00 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParser.cpp @@ -0,0 +1,10920 @@ + +// Generated from FeatParser.g4 by ANTLR 4.9.2 + + +#include "FeatParserVisitor.h" + +#include "FeatParser.h" + + +using namespace antlrcpp; +using namespace antlr4; + +FeatParser::FeatParser(TokenStream *input) : Parser(input) { + _interpreter = new atn::ParserATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); +} + +FeatParser::~FeatParser() { + delete _interpreter; +} + +std::string FeatParser::getGrammarFileName() const { + return "FeatParser.g4"; +} + +const std::vector& FeatParser::getRuleNames() const { + return _ruleNames; +} + +dfa::Vocabulary& FeatParser::getVocabulary() const { + return _vocabulary; +} + + +//----------------- FileContext ------------------------------------------------------------------ + +FeatParser::FileContext::FileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::FileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::FileContext::topLevelStatement() { + return getRuleContexts(); +} + +FeatParser::TopLevelStatementContext* FeatParser::FileContext::topLevelStatement(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::FileContext::featureBlock() { + return getRuleContexts(); +} + +FeatParser::FeatureBlockContext* FeatParser::FileContext::featureBlock(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::FileContext::tableBlock() { + return getRuleContexts(); +} + +FeatParser::TableBlockContext* FeatParser::FileContext::tableBlock(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::FileContext::anonBlock() { + return getRuleContexts(); +} + +FeatParser::AnonBlockContext* FeatParser::FileContext::anonBlock(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::FileContext::lookupBlockTopLevel() { + return getRuleContexts(); +} + +FeatParser::LookupBlockTopLevelContext* FeatParser::FileContext::lookupBlockTopLevel(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::FileContext::getRuleIndex() const { + return FeatParser::RuleFile; +} + + +antlrcpp::Any FeatParser::FileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FileContext* FeatParser::file() { + FileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 0, FeatParser::RuleFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(229); + _errHandler->sync(this); + _la = _input->LA(1); + while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::ANON) + | (1ULL << FeatParser::ANON_v) + | (1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::FEATURE) + | (1ULL << FeatParser::TABLE) + | (1ULL << FeatParser::LANGSYS) + | (1ULL << FeatParser::LOOKUP) + | (1ULL << FeatParser::ANCHOR_DEF) + | (1ULL << FeatParser::VALUE_RECORD_DEF) + | (1ULL << FeatParser::MARK_CLASS))) != 0) || _la == FeatParser::GCLASS) { + setState(227); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::INCLUDE: + case FeatParser::LANGSYS: + case FeatParser::ANCHOR_DEF: + case FeatParser::VALUE_RECORD_DEF: + case FeatParser::MARK_CLASS: + case FeatParser::GCLASS: { + setState(222); + topLevelStatement(); + break; + } + + case FeatParser::FEATURE: { + setState(223); + featureBlock(); + break; + } + + case FeatParser::TABLE: { + setState(224); + tableBlock(); + break; + } + + case FeatParser::ANON: + case FeatParser::ANON_v: { + setState(225); + anonBlock(); + break; + } + + case FeatParser::LOOKUP: { + setState(226); + lookupBlockTopLevel(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(231); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(232); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- TopLevelStatementContext ------------------------------------------------------------------ + +FeatParser::TopLevelStatementContext::TopLevelStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::TopLevelStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::IncludeContext* FeatParser::TopLevelStatementContext::include() { + return getRuleContext(0); +} + +FeatParser::GlyphClassAssignContext* FeatParser::TopLevelStatementContext::glyphClassAssign() { + return getRuleContext(0); +} + +FeatParser::LangsysAssignContext* FeatParser::TopLevelStatementContext::langsysAssign() { + return getRuleContext(0); +} + +FeatParser::Mark_statementContext* FeatParser::TopLevelStatementContext::mark_statement() { + return getRuleContext(0); +} + +FeatParser::AnchorDefContext* FeatParser::TopLevelStatementContext::anchorDef() { + return getRuleContext(0); +} + +FeatParser::ValueRecordDefContext* FeatParser::TopLevelStatementContext::valueRecordDef() { + return getRuleContext(0); +} + + +size_t FeatParser::TopLevelStatementContext::getRuleIndex() const { + return FeatParser::RuleTopLevelStatement; +} + + +antlrcpp::Any FeatParser::TopLevelStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTopLevelStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::TopLevelStatementContext* FeatParser::topLevelStatement() { + TopLevelStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 2, FeatParser::RuleTopLevelStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(240); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::INCLUDE: { + setState(234); + include(); + break; + } + + case FeatParser::GCLASS: { + setState(235); + glyphClassAssign(); + break; + } + + case FeatParser::LANGSYS: { + setState(236); + langsysAssign(); + break; + } + + case FeatParser::MARK_CLASS: { + setState(237); + mark_statement(); + break; + } + + case FeatParser::ANCHOR_DEF: { + setState(238); + anchorDef(); + break; + } + + case FeatParser::VALUE_RECORD_DEF: { + setState(239); + valueRecordDef(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(242); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- IncludeContext ------------------------------------------------------------------ + +FeatParser::IncludeContext::IncludeContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::IncludeContext::INCLUDE() { + return getToken(FeatParser::INCLUDE, 0); +} + +tree::TerminalNode* FeatParser::IncludeContext::I_RPAREN() { + return getToken(FeatParser::I_RPAREN, 0); +} + +tree::TerminalNode* FeatParser::IncludeContext::IFILE() { + return getToken(FeatParser::IFILE, 0); +} + +tree::TerminalNode* FeatParser::IncludeContext::I_LPAREN() { + return getToken(FeatParser::I_LPAREN, 0); +} + + +size_t FeatParser::IncludeContext::getRuleIndex() const { + return FeatParser::RuleInclude; +} + + +antlrcpp::Any FeatParser::IncludeContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitInclude(this); + else + return visitor->visitChildren(this); +} + +FeatParser::IncludeContext* FeatParser::include() { + IncludeContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 4, FeatParser::RuleInclude); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(244); + match(FeatParser::INCLUDE); + setState(245); + match(FeatParser::I_RPAREN); + setState(246); + match(FeatParser::IFILE); + setState(247); + match(FeatParser::I_LPAREN); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GlyphClassAssignContext ------------------------------------------------------------------ + +FeatParser::GlyphClassAssignContext::GlyphClassAssignContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GlyphClassAssignContext::GCLASS() { + return getToken(FeatParser::GCLASS, 0); +} + +tree::TerminalNode* FeatParser::GlyphClassAssignContext::EQUALS() { + return getToken(FeatParser::EQUALS, 0); +} + +FeatParser::GlyphClassContext* FeatParser::GlyphClassAssignContext::glyphClass() { + return getRuleContext(0); +} + + +size_t FeatParser::GlyphClassAssignContext::getRuleIndex() const { + return FeatParser::RuleGlyphClassAssign; +} + + +antlrcpp::Any FeatParser::GlyphClassAssignContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGlyphClassAssign(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GlyphClassAssignContext* FeatParser::glyphClassAssign() { + GlyphClassAssignContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 6, FeatParser::RuleGlyphClassAssign); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(249); + match(FeatParser::GCLASS); + setState(250); + match(FeatParser::EQUALS); + setState(251); + glyphClass(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LangsysAssignContext ------------------------------------------------------------------ + +FeatParser::LangsysAssignContext::LangsysAssignContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LangsysAssignContext::LANGSYS() { + return getToken(FeatParser::LANGSYS, 0); +} + +std::vector FeatParser::LangsysAssignContext::tag() { + return getRuleContexts(); +} + +FeatParser::TagContext* FeatParser::LangsysAssignContext::tag(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::LangsysAssignContext::getRuleIndex() const { + return FeatParser::RuleLangsysAssign; +} + + +antlrcpp::Any FeatParser::LangsysAssignContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLangsysAssign(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LangsysAssignContext* FeatParser::langsysAssign() { + LangsysAssignContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 8, FeatParser::RuleLangsysAssign); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(253); + match(FeatParser::LANGSYS); + setState(254); + dynamic_cast(_localctx)->script = tag(); + setState(255); + dynamic_cast(_localctx)->lang = tag(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Mark_statementContext ------------------------------------------------------------------ + +FeatParser::Mark_statementContext::Mark_statementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::Mark_statementContext::MARK_CLASS() { + return getToken(FeatParser::MARK_CLASS, 0); +} + +FeatParser::AnchorContext* FeatParser::Mark_statementContext::anchor() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::Mark_statementContext::GCLASS() { + return getToken(FeatParser::GCLASS, 0); +} + +FeatParser::GlyphContext* FeatParser::Mark_statementContext::glyph() { + return getRuleContext(0); +} + +FeatParser::GlyphClassContext* FeatParser::Mark_statementContext::glyphClass() { + return getRuleContext(0); +} + + +size_t FeatParser::Mark_statementContext::getRuleIndex() const { + return FeatParser::RuleMark_statement; +} + + +antlrcpp::Any FeatParser::Mark_statementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitMark_statement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Mark_statementContext* FeatParser::mark_statement() { + Mark_statementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 10, FeatParser::RuleMark_statement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(257); + match(FeatParser::MARK_CLASS); + setState(260); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NOTDEF: + case FeatParser::CID: + case FeatParser::ESCGNAME: + case FeatParser::NAMELABEL: + case FeatParser::EXTNAME: { + setState(258); + glyph(); + break; + } + + case FeatParser::LBRACKET: + case FeatParser::GCLASS: { + setState(259); + glyphClass(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(262); + anchor(); + setState(263); + match(FeatParser::GCLASS); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AnchorDefContext ------------------------------------------------------------------ + +FeatParser::AnchorDefContext::AnchorDefContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AnchorDefContext::ANCHOR_DEF() { + return getToken(FeatParser::ANCHOR_DEF, 0); +} + +std::vector FeatParser::AnchorDefContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::AnchorDefContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + +FeatParser::LabelContext* FeatParser::AnchorDefContext::label() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::AnchorDefContext::CONTOURPOINT() { + return getToken(FeatParser::CONTOURPOINT, 0); +} + + +size_t FeatParser::AnchorDefContext::getRuleIndex() const { + return FeatParser::RuleAnchorDef; +} + + +antlrcpp::Any FeatParser::AnchorDefContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAnchorDef(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AnchorDefContext* FeatParser::anchorDef() { + AnchorDefContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 12, FeatParser::RuleAnchorDef); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(265); + match(FeatParser::ANCHOR_DEF); + setState(266); + dynamic_cast(_localctx)->xval = match(FeatParser::NUM); + setState(267); + dynamic_cast(_localctx)->yval = match(FeatParser::NUM); + setState(270); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::CONTOURPOINT) { + setState(268); + match(FeatParser::CONTOURPOINT); + setState(269); + dynamic_cast(_localctx)->cp = match(FeatParser::NUM); + } + setState(272); + dynamic_cast(_localctx)->name = label(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ValueRecordDefContext ------------------------------------------------------------------ + +FeatParser::ValueRecordDefContext::ValueRecordDefContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ValueRecordDefContext::VALUE_RECORD_DEF() { + return getToken(FeatParser::VALUE_RECORD_DEF, 0); +} + +FeatParser::ValueLiteralContext* FeatParser::ValueRecordDefContext::valueLiteral() { + return getRuleContext(0); +} + +FeatParser::LabelContext* FeatParser::ValueRecordDefContext::label() { + return getRuleContext(0); +} + + +size_t FeatParser::ValueRecordDefContext::getRuleIndex() const { + return FeatParser::RuleValueRecordDef; +} + + +antlrcpp::Any FeatParser::ValueRecordDefContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitValueRecordDef(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ValueRecordDefContext* FeatParser::valueRecordDef() { + ValueRecordDefContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 14, FeatParser::RuleValueRecordDef); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(274); + match(FeatParser::VALUE_RECORD_DEF); + setState(275); + valueLiteral(); + setState(276); + label(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FeatureBlockContext ------------------------------------------------------------------ + +FeatParser::FeatureBlockContext::FeatureBlockContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::FeatureBlockContext::FEATURE() { + return getToken(FeatParser::FEATURE, 0); +} + +tree::TerminalNode* FeatParser::FeatureBlockContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::FeatureBlockContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::FeatureBlockContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::FeatureBlockContext::tag() { + return getRuleContexts(); +} + +FeatParser::TagContext* FeatParser::FeatureBlockContext::tag(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::FeatureBlockContext::USE_EXTENSION() { + return getToken(FeatParser::USE_EXTENSION, 0); +} + +std::vector FeatParser::FeatureBlockContext::featureStatement() { + return getRuleContexts(); +} + +FeatParser::FeatureStatementContext* FeatParser::FeatureBlockContext::featureStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::FeatureBlockContext::getRuleIndex() const { + return FeatParser::RuleFeatureBlock; +} + + +antlrcpp::Any FeatParser::FeatureBlockContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFeatureBlock(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FeatureBlockContext* FeatParser::featureBlock() { + FeatureBlockContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 16, FeatParser::RuleFeatureBlock); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(278); + match(FeatParser::FEATURE); + setState(279); + dynamic_cast(_localctx)->starttag = tag(); + setState(281); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::USE_EXTENSION) { + setState(280); + match(FeatParser::USE_EXTENSION); + } + setState(283); + match(FeatParser::LCBRACE); + setState(285); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(284); + featureStatement(); + setState(287); + _errHandler->sync(this); + _la = _input->LA(1); + } while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::FEATURE) + | (1ULL << FeatParser::SCRIPT) + | (1ULL << FeatParser::LANGUAGE) + | (1ULL << FeatParser::SUBTABLE) + | (1ULL << FeatParser::LOOKUP) + | (1ULL << FeatParser::LOOKUPFLAG) + | (1ULL << FeatParser::ENUMERATE) + | (1ULL << FeatParser::ENUMERATE_v) + | (1ULL << FeatParser::EXCEPT) + | (1ULL << FeatParser::IGNORE) + | (1ULL << FeatParser::SUBSTITUTE) + | (1ULL << FeatParser::SUBSTITUTE_v) + | (1ULL << FeatParser::REVERSE) + | (1ULL << FeatParser::REVERSE_v) + | (1ULL << FeatParser::POSITION) + | (1ULL << FeatParser::POSITION_v) + | (1ULL << FeatParser::PARAMETERS) + | (1ULL << FeatParser::FEATURE_NAMES) + | (1ULL << FeatParser::CV_PARAMETERS) + | (1ULL << FeatParser::SIZEMENUNAME) + | (1ULL << FeatParser::MARK_CLASS))) != 0) || _la == FeatParser::GCLASS); + setState(289); + match(FeatParser::RCBRACE); + setState(290); + dynamic_cast(_localctx)->endtag = tag(); + setState(291); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- TableBlockContext ------------------------------------------------------------------ + +FeatParser::TableBlockContext::TableBlockContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::TableBlockContext::TABLE() { + return getToken(FeatParser::TABLE, 0); +} + +FeatParser::Table_BASEContext* FeatParser::TableBlockContext::table_BASE() { + return getRuleContext(0); +} + +FeatParser::Table_GDEFContext* FeatParser::TableBlockContext::table_GDEF() { + return getRuleContext(0); +} + +FeatParser::Table_headContext* FeatParser::TableBlockContext::table_head() { + return getRuleContext(0); +} + +FeatParser::Table_hheaContext* FeatParser::TableBlockContext::table_hhea() { + return getRuleContext(0); +} + +FeatParser::Table_vheaContext* FeatParser::TableBlockContext::table_vhea() { + return getRuleContext(0); +} + +FeatParser::Table_nameContext* FeatParser::TableBlockContext::table_name() { + return getRuleContext(0); +} + +FeatParser::Table_OS_2Context* FeatParser::TableBlockContext::table_OS_2() { + return getRuleContext(0); +} + +FeatParser::Table_STATContext* FeatParser::TableBlockContext::table_STAT() { + return getRuleContext(0); +} + +FeatParser::Table_vmtxContext* FeatParser::TableBlockContext::table_vmtx() { + return getRuleContext(0); +} + + +size_t FeatParser::TableBlockContext::getRuleIndex() const { + return FeatParser::RuleTableBlock; +} + + +antlrcpp::Any FeatParser::TableBlockContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTableBlock(this); + else + return visitor->visitChildren(this); +} + +FeatParser::TableBlockContext* FeatParser::tableBlock() { + TableBlockContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 18, FeatParser::RuleTableBlock); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(293); + match(FeatParser::TABLE); + setState(303); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::BASE: { + setState(294); + table_BASE(); + break; + } + + case FeatParser::GDEF: { + setState(295); + table_GDEF(); + break; + } + + case FeatParser::HEAD: { + setState(296); + table_head(); + break; + } + + case FeatParser::HHEA: { + setState(297); + table_hhea(); + break; + } + + case FeatParser::VHEA: { + setState(298); + table_vhea(); + break; + } + + case FeatParser::NAME: { + setState(299); + table_name(); + break; + } + + case FeatParser::OS_2: { + setState(300); + table_OS_2(); + break; + } + + case FeatParser::STAT: { + setState(301); + table_STAT(); + break; + } + + case FeatParser::VMTX: { + setState(302); + table_vmtx(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AnonBlockContext ------------------------------------------------------------------ + +FeatParser::AnonBlockContext::AnonBlockContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::AnontokContext* FeatParser::AnonBlockContext::anontok() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::AnonBlockContext::A_LABEL() { + return getToken(FeatParser::A_LABEL, 0); +} + +tree::TerminalNode* FeatParser::AnonBlockContext::A_LBRACE() { + return getToken(FeatParser::A_LBRACE, 0); +} + +tree::TerminalNode* FeatParser::AnonBlockContext::A_CLOSE() { + return getToken(FeatParser::A_CLOSE, 0); +} + +std::vector FeatParser::AnonBlockContext::A_LINE() { + return getTokens(FeatParser::A_LINE); +} + +tree::TerminalNode* FeatParser::AnonBlockContext::A_LINE(size_t i) { + return getToken(FeatParser::A_LINE, i); +} + + +size_t FeatParser::AnonBlockContext::getRuleIndex() const { + return FeatParser::RuleAnonBlock; +} + + +antlrcpp::Any FeatParser::AnonBlockContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAnonBlock(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AnonBlockContext* FeatParser::anonBlock() { + AnonBlockContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 20, FeatParser::RuleAnonBlock); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(305); + anontok(); + setState(306); + match(FeatParser::A_LABEL); + setState(307); + match(FeatParser::A_LBRACE); + setState(311); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::A_LINE) { + setState(308); + match(FeatParser::A_LINE); + setState(313); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(314); + match(FeatParser::A_CLOSE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LookupBlockTopLevelContext ------------------------------------------------------------------ + +FeatParser::LookupBlockTopLevelContext::LookupBlockTopLevelContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LookupBlockTopLevelContext::LOOKUP() { + return getToken(FeatParser::LOOKUP, 0); +} + +tree::TerminalNode* FeatParser::LookupBlockTopLevelContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::LookupBlockTopLevelContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::LookupBlockTopLevelContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::LookupBlockTopLevelContext::label() { + return getRuleContexts(); +} + +FeatParser::LabelContext* FeatParser::LookupBlockTopLevelContext::label(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::LookupBlockTopLevelContext::USE_EXTENSION() { + return getToken(FeatParser::USE_EXTENSION, 0); +} + +std::vector FeatParser::LookupBlockTopLevelContext::statement() { + return getRuleContexts(); +} + +FeatParser::StatementContext* FeatParser::LookupBlockTopLevelContext::statement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::LookupBlockTopLevelContext::getRuleIndex() const { + return FeatParser::RuleLookupBlockTopLevel; +} + + +antlrcpp::Any FeatParser::LookupBlockTopLevelContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLookupBlockTopLevel(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LookupBlockTopLevelContext* FeatParser::lookupBlockTopLevel() { + LookupBlockTopLevelContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 22, FeatParser::RuleLookupBlockTopLevel); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(316); + match(FeatParser::LOOKUP); + setState(317); + dynamic_cast(_localctx)->startlabel = label(); + setState(319); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::USE_EXTENSION) { + setState(318); + match(FeatParser::USE_EXTENSION); + } + setState(321); + match(FeatParser::LCBRACE); + setState(323); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(322); + statement(); + setState(325); + _errHandler->sync(this); + _la = _input->LA(1); + } while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::FEATURE) + | (1ULL << FeatParser::SCRIPT) + | (1ULL << FeatParser::LANGUAGE) + | (1ULL << FeatParser::SUBTABLE) + | (1ULL << FeatParser::LOOKUPFLAG) + | (1ULL << FeatParser::ENUMERATE) + | (1ULL << FeatParser::ENUMERATE_v) + | (1ULL << FeatParser::EXCEPT) + | (1ULL << FeatParser::IGNORE) + | (1ULL << FeatParser::SUBSTITUTE) + | (1ULL << FeatParser::SUBSTITUTE_v) + | (1ULL << FeatParser::REVERSE) + | (1ULL << FeatParser::REVERSE_v) + | (1ULL << FeatParser::POSITION) + | (1ULL << FeatParser::POSITION_v) + | (1ULL << FeatParser::PARAMETERS) + | (1ULL << FeatParser::FEATURE_NAMES) + | (1ULL << FeatParser::SIZEMENUNAME) + | (1ULL << FeatParser::MARK_CLASS))) != 0) || _la == FeatParser::GCLASS); + setState(327); + match(FeatParser::RCBRACE); + setState(328); + dynamic_cast(_localctx)->endlabel = label(); + setState(329); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FeatureStatementContext ------------------------------------------------------------------ + +FeatParser::FeatureStatementContext::FeatureStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::StatementContext* FeatParser::FeatureStatementContext::statement() { + return getRuleContext(0); +} + +FeatParser::LookupBlockOrUseContext* FeatParser::FeatureStatementContext::lookupBlockOrUse() { + return getRuleContext(0); +} + +FeatParser::CvParameterBlockContext* FeatParser::FeatureStatementContext::cvParameterBlock() { + return getRuleContext(0); +} + + +size_t FeatParser::FeatureStatementContext::getRuleIndex() const { + return FeatParser::RuleFeatureStatement; +} + + +antlrcpp::Any FeatParser::FeatureStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFeatureStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FeatureStatementContext* FeatParser::featureStatement() { + FeatureStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 24, FeatParser::RuleFeatureStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(334); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::INCLUDE: + case FeatParser::FEATURE: + case FeatParser::SCRIPT: + case FeatParser::LANGUAGE: + case FeatParser::SUBTABLE: + case FeatParser::LOOKUPFLAG: + case FeatParser::ENUMERATE: + case FeatParser::ENUMERATE_v: + case FeatParser::EXCEPT: + case FeatParser::IGNORE: + case FeatParser::SUBSTITUTE: + case FeatParser::SUBSTITUTE_v: + case FeatParser::REVERSE: + case FeatParser::REVERSE_v: + case FeatParser::POSITION: + case FeatParser::POSITION_v: + case FeatParser::PARAMETERS: + case FeatParser::FEATURE_NAMES: + case FeatParser::SIZEMENUNAME: + case FeatParser::MARK_CLASS: + case FeatParser::GCLASS: { + enterOuterAlt(_localctx, 1); + setState(331); + statement(); + break; + } + + case FeatParser::LOOKUP: { + enterOuterAlt(_localctx, 2); + setState(332); + lookupBlockOrUse(); + break; + } + + case FeatParser::CV_PARAMETERS: { + enterOuterAlt(_localctx, 3); + setState(333); + cvParameterBlock(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LookupBlockOrUseContext ------------------------------------------------------------------ + +FeatParser::LookupBlockOrUseContext::LookupBlockOrUseContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LookupBlockOrUseContext::LOOKUP() { + return getToken(FeatParser::LOOKUP, 0); +} + +tree::TerminalNode* FeatParser::LookupBlockOrUseContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::LookupBlockOrUseContext::label() { + return getRuleContexts(); +} + +FeatParser::LabelContext* FeatParser::LookupBlockOrUseContext::label(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::LookupBlockOrUseContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::LookupBlockOrUseContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::LookupBlockOrUseContext::USE_EXTENSION() { + return getToken(FeatParser::USE_EXTENSION, 0); +} + +std::vector FeatParser::LookupBlockOrUseContext::statement() { + return getRuleContexts(); +} + +FeatParser::StatementContext* FeatParser::LookupBlockOrUseContext::statement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::LookupBlockOrUseContext::getRuleIndex() const { + return FeatParser::RuleLookupBlockOrUse; +} + + +antlrcpp::Any FeatParser::LookupBlockOrUseContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLookupBlockOrUse(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LookupBlockOrUseContext* FeatParser::lookupBlockOrUse() { + LookupBlockOrUseContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 26, FeatParser::RuleLookupBlockOrUse); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(336); + match(FeatParser::LOOKUP); + setState(337); + dynamic_cast(_localctx)->startlabel = label(); + setState(350); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::USE_EXTENSION || _la == FeatParser::LCBRACE) { + setState(339); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::USE_EXTENSION) { + setState(338); + match(FeatParser::USE_EXTENSION); + } + setState(341); + match(FeatParser::LCBRACE); + setState(343); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(342); + statement(); + setState(345); + _errHandler->sync(this); + _la = _input->LA(1); + } while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::FEATURE) + | (1ULL << FeatParser::SCRIPT) + | (1ULL << FeatParser::LANGUAGE) + | (1ULL << FeatParser::SUBTABLE) + | (1ULL << FeatParser::LOOKUPFLAG) + | (1ULL << FeatParser::ENUMERATE) + | (1ULL << FeatParser::ENUMERATE_v) + | (1ULL << FeatParser::EXCEPT) + | (1ULL << FeatParser::IGNORE) + | (1ULL << FeatParser::SUBSTITUTE) + | (1ULL << FeatParser::SUBSTITUTE_v) + | (1ULL << FeatParser::REVERSE) + | (1ULL << FeatParser::REVERSE_v) + | (1ULL << FeatParser::POSITION) + | (1ULL << FeatParser::POSITION_v) + | (1ULL << FeatParser::PARAMETERS) + | (1ULL << FeatParser::FEATURE_NAMES) + | (1ULL << FeatParser::SIZEMENUNAME) + | (1ULL << FeatParser::MARK_CLASS))) != 0) || _la == FeatParser::GCLASS); + setState(347); + match(FeatParser::RCBRACE); + setState(348); + dynamic_cast(_localctx)->endlabel = label(); + } + setState(352); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CvParameterBlockContext ------------------------------------------------------------------ + +FeatParser::CvParameterBlockContext::CvParameterBlockContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::CvParameterBlockContext::CV_PARAMETERS() { + return getToken(FeatParser::CV_PARAMETERS, 0); +} + +tree::TerminalNode* FeatParser::CvParameterBlockContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::CvParameterBlockContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::CvParameterBlockContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::CvParameterBlockContext::cvParameterStatement() { + return getRuleContexts(); +} + +FeatParser::CvParameterStatementContext* FeatParser::CvParameterBlockContext::cvParameterStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::CvParameterBlockContext::getRuleIndex() const { + return FeatParser::RuleCvParameterBlock; +} + + +antlrcpp::Any FeatParser::CvParameterBlockContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCvParameterBlock(this); + else + return visitor->visitChildren(this); +} + +FeatParser::CvParameterBlockContext* FeatParser::cvParameterBlock() { + CvParameterBlockContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 28, FeatParser::RuleCvParameterBlock); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(354); + match(FeatParser::CV_PARAMETERS); + setState(355); + match(FeatParser::LCBRACE); + setState(359); + _errHandler->sync(this); + _la = _input->LA(1); + while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::CV_UI_LABEL) + | (1ULL << FeatParser::CV_TOOLTIP) + | (1ULL << FeatParser::CV_SAMPLE_TEXT) + | (1ULL << FeatParser::CV_PARAM_LABEL) + | (1ULL << FeatParser::CV_CHARACTER))) != 0)) { + setState(356); + cvParameterStatement(); + setState(361); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(362); + match(FeatParser::RCBRACE); + setState(363); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CvParameterStatementContext ------------------------------------------------------------------ + +FeatParser::CvParameterStatementContext::CvParameterStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::CvParameterStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::CvParameterContext* FeatParser::CvParameterStatementContext::cvParameter() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::CvParameterStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::CvParameterStatementContext::getRuleIndex() const { + return FeatParser::RuleCvParameterStatement; +} + + +antlrcpp::Any FeatParser::CvParameterStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCvParameterStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::CvParameterStatementContext* FeatParser::cvParameterStatement() { + CvParameterStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 30, FeatParser::RuleCvParameterStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(367); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::CV_UI_LABEL: + case FeatParser::CV_TOOLTIP: + case FeatParser::CV_SAMPLE_TEXT: + case FeatParser::CV_PARAM_LABEL: + case FeatParser::CV_CHARACTER: { + setState(365); + cvParameter(); + break; + } + + case FeatParser::INCLUDE: { + setState(366); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(369); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CvParameterContext ------------------------------------------------------------------ + +FeatParser::CvParameterContext::CvParameterContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::CvParameterContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::CvParameterContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::CvParameterContext::CV_UI_LABEL() { + return getToken(FeatParser::CV_UI_LABEL, 0); +} + +tree::TerminalNode* FeatParser::CvParameterContext::CV_TOOLTIP() { + return getToken(FeatParser::CV_TOOLTIP, 0); +} + +tree::TerminalNode* FeatParser::CvParameterContext::CV_SAMPLE_TEXT() { + return getToken(FeatParser::CV_SAMPLE_TEXT, 0); +} + +tree::TerminalNode* FeatParser::CvParameterContext::CV_PARAM_LABEL() { + return getToken(FeatParser::CV_PARAM_LABEL, 0); +} + +std::vector FeatParser::CvParameterContext::nameEntryStatement() { + return getRuleContexts(); +} + +FeatParser::NameEntryStatementContext* FeatParser::CvParameterContext::nameEntryStatement(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::CvParameterContext::CV_CHARACTER() { + return getToken(FeatParser::CV_CHARACTER, 0); +} + +FeatParser::GenNumContext* FeatParser::CvParameterContext::genNum() { + return getRuleContext(0); +} + + +size_t FeatParser::CvParameterContext::getRuleIndex() const { + return FeatParser::RuleCvParameter; +} + + +antlrcpp::Any FeatParser::CvParameterContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCvParameter(this); + else + return visitor->visitChildren(this); +} + +FeatParser::CvParameterContext* FeatParser::cvParameter() { + CvParameterContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 32, FeatParser::RuleCvParameter); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(382); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::CV_UI_LABEL: + case FeatParser::CV_TOOLTIP: + case FeatParser::CV_SAMPLE_TEXT: + case FeatParser::CV_PARAM_LABEL: { + enterOuterAlt(_localctx, 1); + setState(371); + _la = _input->LA(1); + if (!((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::CV_UI_LABEL) + | (1ULL << FeatParser::CV_TOOLTIP) + | (1ULL << FeatParser::CV_SAMPLE_TEXT) + | (1ULL << FeatParser::CV_PARAM_LABEL))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(372); + match(FeatParser::LCBRACE); + setState(374); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(373); + nameEntryStatement(); + setState(376); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::NAME); + setState(378); + match(FeatParser::RCBRACE); + break; + } + + case FeatParser::CV_CHARACTER: { + enterOuterAlt(_localctx, 2); + setState(380); + match(FeatParser::CV_CHARACTER); + setState(381); + genNum(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- StatementContext ------------------------------------------------------------------ + +FeatParser::StatementContext::StatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::StatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::FeatureUseContext* FeatParser::StatementContext::featureUse() { + return getRuleContext(0); +} + +FeatParser::ScriptAssignContext* FeatParser::StatementContext::scriptAssign() { + return getRuleContext(0); +} + +FeatParser::LangAssignContext* FeatParser::StatementContext::langAssign() { + return getRuleContext(0); +} + +FeatParser::LookupflagAssignContext* FeatParser::StatementContext::lookupflagAssign() { + return getRuleContext(0); +} + +FeatParser::GlyphClassAssignContext* FeatParser::StatementContext::glyphClassAssign() { + return getRuleContext(0); +} + +FeatParser::IgnoreSubOrPosContext* FeatParser::StatementContext::ignoreSubOrPos() { + return getRuleContext(0); +} + +FeatParser::SubstituteContext* FeatParser::StatementContext::substitute() { + return getRuleContext(0); +} + +FeatParser::Mark_statementContext* FeatParser::StatementContext::mark_statement() { + return getRuleContext(0); +} + +FeatParser::PositionContext* FeatParser::StatementContext::position() { + return getRuleContext(0); +} + +FeatParser::ParametersContext* FeatParser::StatementContext::parameters() { + return getRuleContext(0); +} + +FeatParser::SizemenunameContext* FeatParser::StatementContext::sizemenuname() { + return getRuleContext(0); +} + +FeatParser::FeatureNamesContext* FeatParser::StatementContext::featureNames() { + return getRuleContext(0); +} + +FeatParser::SubtableContext* FeatParser::StatementContext::subtable() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::StatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::StatementContext::getRuleIndex() const { + return FeatParser::RuleStatement; +} + + +antlrcpp::Any FeatParser::StatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::StatementContext* FeatParser::statement() { + StatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 34, FeatParser::RuleStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(398); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::FEATURE: { + setState(384); + featureUse(); + break; + } + + case FeatParser::SCRIPT: { + setState(385); + scriptAssign(); + break; + } + + case FeatParser::LANGUAGE: { + setState(386); + langAssign(); + break; + } + + case FeatParser::LOOKUPFLAG: { + setState(387); + lookupflagAssign(); + break; + } + + case FeatParser::GCLASS: { + setState(388); + glyphClassAssign(); + break; + } + + case FeatParser::IGNORE: { + setState(389); + ignoreSubOrPos(); + break; + } + + case FeatParser::EXCEPT: + case FeatParser::SUBSTITUTE: + case FeatParser::SUBSTITUTE_v: + case FeatParser::REVERSE: + case FeatParser::REVERSE_v: { + setState(390); + substitute(); + break; + } + + case FeatParser::MARK_CLASS: { + setState(391); + mark_statement(); + break; + } + + case FeatParser::ENUMERATE: + case FeatParser::ENUMERATE_v: + case FeatParser::POSITION: + case FeatParser::POSITION_v: { + setState(392); + position(); + break; + } + + case FeatParser::PARAMETERS: { + setState(393); + parameters(); + break; + } + + case FeatParser::SIZEMENUNAME: { + setState(394); + sizemenuname(); + break; + } + + case FeatParser::FEATURE_NAMES: { + setState(395); + featureNames(); + break; + } + + case FeatParser::SUBTABLE: { + setState(396); + subtable(); + break; + } + + case FeatParser::INCLUDE: { + setState(397); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(400); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FeatureUseContext ------------------------------------------------------------------ + +FeatParser::FeatureUseContext::FeatureUseContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::FeatureUseContext::FEATURE() { + return getToken(FeatParser::FEATURE, 0); +} + +FeatParser::TagContext* FeatParser::FeatureUseContext::tag() { + return getRuleContext(0); +} + + +size_t FeatParser::FeatureUseContext::getRuleIndex() const { + return FeatParser::RuleFeatureUse; +} + + +antlrcpp::Any FeatParser::FeatureUseContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFeatureUse(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FeatureUseContext* FeatParser::featureUse() { + FeatureUseContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 36, FeatParser::RuleFeatureUse); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(402); + match(FeatParser::FEATURE); + setState(403); + tag(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ScriptAssignContext ------------------------------------------------------------------ + +FeatParser::ScriptAssignContext::ScriptAssignContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ScriptAssignContext::SCRIPT() { + return getToken(FeatParser::SCRIPT, 0); +} + +FeatParser::TagContext* FeatParser::ScriptAssignContext::tag() { + return getRuleContext(0); +} + + +size_t FeatParser::ScriptAssignContext::getRuleIndex() const { + return FeatParser::RuleScriptAssign; +} + + +antlrcpp::Any FeatParser::ScriptAssignContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitScriptAssign(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ScriptAssignContext* FeatParser::scriptAssign() { + ScriptAssignContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 38, FeatParser::RuleScriptAssign); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(405); + match(FeatParser::SCRIPT); + setState(406); + tag(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LangAssignContext ------------------------------------------------------------------ + +FeatParser::LangAssignContext::LangAssignContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LangAssignContext::LANGUAGE() { + return getToken(FeatParser::LANGUAGE, 0); +} + +FeatParser::TagContext* FeatParser::LangAssignContext::tag() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::LangAssignContext::EXCLUDE_DFLT() { + return getToken(FeatParser::EXCLUDE_DFLT, 0); +} + +tree::TerminalNode* FeatParser::LangAssignContext::INCLUDE_DFLT() { + return getToken(FeatParser::INCLUDE_DFLT, 0); +} + +tree::TerminalNode* FeatParser::LangAssignContext::EXCLUDE_dflt() { + return getToken(FeatParser::EXCLUDE_dflt, 0); +} + +tree::TerminalNode* FeatParser::LangAssignContext::INCLUDE_dflt() { + return getToken(FeatParser::INCLUDE_dflt, 0); +} + + +size_t FeatParser::LangAssignContext::getRuleIndex() const { + return FeatParser::RuleLangAssign; +} + + +antlrcpp::Any FeatParser::LangAssignContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLangAssign(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LangAssignContext* FeatParser::langAssign() { + LangAssignContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 40, FeatParser::RuleLangAssign); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(408); + match(FeatParser::LANGUAGE); + setState(409); + tag(); + setState(411); + _errHandler->sync(this); + + _la = _input->LA(1); + if ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::EXCLUDE_DFLT) + | (1ULL << FeatParser::INCLUDE_DFLT) + | (1ULL << FeatParser::EXCLUDE_dflt) + | (1ULL << FeatParser::INCLUDE_dflt))) != 0)) { + setState(410); + _la = _input->LA(1); + if (!((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::EXCLUDE_DFLT) + | (1ULL << FeatParser::INCLUDE_DFLT) + | (1ULL << FeatParser::EXCLUDE_dflt) + | (1ULL << FeatParser::INCLUDE_dflt))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LookupflagAssignContext ------------------------------------------------------------------ + +FeatParser::LookupflagAssignContext::LookupflagAssignContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LookupflagAssignContext::LOOKUPFLAG() { + return getToken(FeatParser::LOOKUPFLAG, 0); +} + +tree::TerminalNode* FeatParser::LookupflagAssignContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + +std::vector FeatParser::LookupflagAssignContext::lookupflagElement() { + return getRuleContexts(); +} + +FeatParser::LookupflagElementContext* FeatParser::LookupflagAssignContext::lookupflagElement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::LookupflagAssignContext::getRuleIndex() const { + return FeatParser::RuleLookupflagAssign; +} + + +antlrcpp::Any FeatParser::LookupflagAssignContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLookupflagAssign(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LookupflagAssignContext* FeatParser::lookupflagAssign() { + LookupflagAssignContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 42, FeatParser::RuleLookupflagAssign); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(413); + match(FeatParser::LOOKUPFLAG); + setState(420); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NUM: { + setState(414); + match(FeatParser::NUM); + break; + } + + case FeatParser::RIGHT_TO_LEFT: + case FeatParser::IGNORE_BASE_GLYPHS: + case FeatParser::IGNORE_LIGATURES: + case FeatParser::IGNORE_MARKS: + case FeatParser::USE_MARK_FILTERING_SET: + case FeatParser::MARK_ATTACHMENT_TYPE: { + setState(416); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(415); + lookupflagElement(); + setState(418); + _errHandler->sync(this); + _la = _input->LA(1); + } while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::RIGHT_TO_LEFT) + | (1ULL << FeatParser::IGNORE_BASE_GLYPHS) + | (1ULL << FeatParser::IGNORE_LIGATURES) + | (1ULL << FeatParser::IGNORE_MARKS) + | (1ULL << FeatParser::USE_MARK_FILTERING_SET) + | (1ULL << FeatParser::MARK_ATTACHMENT_TYPE))) != 0)); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LookupflagElementContext ------------------------------------------------------------------ + +FeatParser::LookupflagElementContext::LookupflagElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LookupflagElementContext::RIGHT_TO_LEFT() { + return getToken(FeatParser::RIGHT_TO_LEFT, 0); +} + +tree::TerminalNode* FeatParser::LookupflagElementContext::IGNORE_BASE_GLYPHS() { + return getToken(FeatParser::IGNORE_BASE_GLYPHS, 0); +} + +tree::TerminalNode* FeatParser::LookupflagElementContext::IGNORE_LIGATURES() { + return getToken(FeatParser::IGNORE_LIGATURES, 0); +} + +tree::TerminalNode* FeatParser::LookupflagElementContext::IGNORE_MARKS() { + return getToken(FeatParser::IGNORE_MARKS, 0); +} + +tree::TerminalNode* FeatParser::LookupflagElementContext::MARK_ATTACHMENT_TYPE() { + return getToken(FeatParser::MARK_ATTACHMENT_TYPE, 0); +} + +FeatParser::GlyphClassContext* FeatParser::LookupflagElementContext::glyphClass() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::LookupflagElementContext::USE_MARK_FILTERING_SET() { + return getToken(FeatParser::USE_MARK_FILTERING_SET, 0); +} + + +size_t FeatParser::LookupflagElementContext::getRuleIndex() const { + return FeatParser::RuleLookupflagElement; +} + + +antlrcpp::Any FeatParser::LookupflagElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLookupflagElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LookupflagElementContext* FeatParser::lookupflagElement() { + LookupflagElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 44, FeatParser::RuleLookupflagElement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(430); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::RIGHT_TO_LEFT: { + enterOuterAlt(_localctx, 1); + setState(422); + match(FeatParser::RIGHT_TO_LEFT); + break; + } + + case FeatParser::IGNORE_BASE_GLYPHS: { + enterOuterAlt(_localctx, 2); + setState(423); + match(FeatParser::IGNORE_BASE_GLYPHS); + break; + } + + case FeatParser::IGNORE_LIGATURES: { + enterOuterAlt(_localctx, 3); + setState(424); + match(FeatParser::IGNORE_LIGATURES); + break; + } + + case FeatParser::IGNORE_MARKS: { + enterOuterAlt(_localctx, 4); + setState(425); + match(FeatParser::IGNORE_MARKS); + break; + } + + case FeatParser::MARK_ATTACHMENT_TYPE: { + enterOuterAlt(_localctx, 5); + setState(426); + match(FeatParser::MARK_ATTACHMENT_TYPE); + setState(427); + glyphClass(); + break; + } + + case FeatParser::USE_MARK_FILTERING_SET: { + enterOuterAlt(_localctx, 6); + setState(428); + match(FeatParser::USE_MARK_FILTERING_SET); + setState(429); + glyphClass(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- IgnoreSubOrPosContext ------------------------------------------------------------------ + +FeatParser::IgnoreSubOrPosContext::IgnoreSubOrPosContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::IgnoreSubOrPosContext::IGNORE() { + return getToken(FeatParser::IGNORE, 0); +} + +std::vector FeatParser::IgnoreSubOrPosContext::lookupPattern() { + return getRuleContexts(); +} + +FeatParser::LookupPatternContext* FeatParser::IgnoreSubOrPosContext::lookupPattern(size_t i) { + return getRuleContext(i); +} + +FeatParser::SubtokContext* FeatParser::IgnoreSubOrPosContext::subtok() { + return getRuleContext(0); +} + +FeatParser::RevtokContext* FeatParser::IgnoreSubOrPosContext::revtok() { + return getRuleContext(0); +} + +FeatParser::PostokContext* FeatParser::IgnoreSubOrPosContext::postok() { + return getRuleContext(0); +} + +std::vector FeatParser::IgnoreSubOrPosContext::COMMA() { + return getTokens(FeatParser::COMMA); +} + +tree::TerminalNode* FeatParser::IgnoreSubOrPosContext::COMMA(size_t i) { + return getToken(FeatParser::COMMA, i); +} + + +size_t FeatParser::IgnoreSubOrPosContext::getRuleIndex() const { + return FeatParser::RuleIgnoreSubOrPos; +} + + +antlrcpp::Any FeatParser::IgnoreSubOrPosContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitIgnoreSubOrPos(this); + else + return visitor->visitChildren(this); +} + +FeatParser::IgnoreSubOrPosContext* FeatParser::ignoreSubOrPos() { + IgnoreSubOrPosContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 46, FeatParser::RuleIgnoreSubOrPos); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(432); + match(FeatParser::IGNORE); + setState(436); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::SUBSTITUTE: + case FeatParser::SUBSTITUTE_v: { + setState(433); + subtok(); + break; + } + + case FeatParser::REVERSE: + case FeatParser::REVERSE_v: { + setState(434); + revtok(); + break; + } + + case FeatParser::POSITION: + case FeatParser::POSITION_v: { + setState(435); + postok(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(438); + lookupPattern(); + setState(443); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::COMMA) { + setState(439); + match(FeatParser::COMMA); + setState(440); + lookupPattern(); + setState(445); + _errHandler->sync(this); + _la = _input->LA(1); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SubstituteContext ------------------------------------------------------------------ + +FeatParser::SubstituteContext::SubstituteContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::RevtokContext* FeatParser::SubstituteContext::revtok() { + return getRuleContext(0); +} + +FeatParser::SubtokContext* FeatParser::SubstituteContext::subtok() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::SubstituteContext::EXCEPT() { + return getToken(FeatParser::EXCEPT, 0); +} + +std::vector FeatParser::SubstituteContext::lookupPattern() { + return getRuleContexts(); +} + +FeatParser::LookupPatternContext* FeatParser::SubstituteContext::lookupPattern(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::SubstituteContext::BY() { + return getToken(FeatParser::BY, 0); +} + +std::vector FeatParser::SubstituteContext::COMMA() { + return getTokens(FeatParser::COMMA); +} + +tree::TerminalNode* FeatParser::SubstituteContext::COMMA(size_t i) { + return getToken(FeatParser::COMMA, i); +} + +tree::TerminalNode* FeatParser::SubstituteContext::FROM() { + return getToken(FeatParser::FROM, 0); +} + +tree::TerminalNode* FeatParser::SubstituteContext::KNULL() { + return getToken(FeatParser::KNULL, 0); +} + + +size_t FeatParser::SubstituteContext::getRuleIndex() const { + return FeatParser::RuleSubstitute; +} + + +antlrcpp::Any FeatParser::SubstituteContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSubstitute(this); + else + return visitor->visitChildren(this); +} + +FeatParser::SubstituteContext* FeatParser::substitute() { + SubstituteContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 48, FeatParser::RuleSubstitute); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(455); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::EXCEPT) { + setState(446); + match(FeatParser::EXCEPT); + setState(447); + lookupPattern(); + setState(452); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::COMMA) { + setState(448); + match(FeatParser::COMMA); + setState(449); + lookupPattern(); + setState(454); + _errHandler->sync(this); + _la = _input->LA(1); + } + } + setState(475); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::REVERSE: + case FeatParser::REVERSE_v: { + setState(457); + revtok(); + setState(458); + dynamic_cast(_localctx)->startpat = lookupPattern(); + setState(464); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::BY) { + setState(459); + match(FeatParser::BY); + setState(462); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::KNULL: { + setState(460); + match(FeatParser::KNULL); + break; + } + + case FeatParser::NOTDEF: + case FeatParser::LBRACKET: + case FeatParser::GCLASS: + case FeatParser::CID: + case FeatParser::ESCGNAME: + case FeatParser::NAMELABEL: + case FeatParser::EXTNAME: { + setState(461); + dynamic_cast(_localctx)->endpat = lookupPattern(); + break; + } + + default: + throw NoViableAltException(this); + } + } + break; + } + + case FeatParser::SUBSTITUTE: + case FeatParser::SUBSTITUTE_v: { + setState(466); + subtok(); + setState(467); + dynamic_cast(_localctx)->startpat = lookupPattern(); + setState(473); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::BY + + || _la == FeatParser::FROM) { + setState(468); + _la = _input->LA(1); + if (!(_la == FeatParser::BY + + || _la == FeatParser::FROM)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(471); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::KNULL: { + setState(469); + match(FeatParser::KNULL); + break; + } + + case FeatParser::NOTDEF: + case FeatParser::LBRACKET: + case FeatParser::GCLASS: + case FeatParser::CID: + case FeatParser::ESCGNAME: + case FeatParser::NAMELABEL: + case FeatParser::EXTNAME: { + setState(470); + dynamic_cast(_localctx)->endpat = lookupPattern(); + break; + } + + default: + throw NoViableAltException(this); + } + } + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PositionContext ------------------------------------------------------------------ + +FeatParser::PositionContext::PositionContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::PostokContext* FeatParser::PositionContext::postok() { + return getRuleContext(0); +} + +FeatParser::EnumtokContext* FeatParser::PositionContext::enumtok() { + return getRuleContext(0); +} + +std::vector FeatParser::PositionContext::pattern() { + return getRuleContexts(); +} + +FeatParser::PatternContext* FeatParser::PositionContext::pattern(size_t i) { + return getRuleContext(i); +} + +FeatParser::ValueRecordContext* FeatParser::PositionContext::valueRecord() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::PositionContext::CURSIVE() { + return getToken(FeatParser::CURSIVE, 0); +} + +FeatParser::CursiveElementContext* FeatParser::PositionContext::cursiveElement() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::PositionContext::MARKBASE() { + return getToken(FeatParser::MARKBASE, 0); +} + +FeatParser::MarkligtokContext* FeatParser::PositionContext::markligtok() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::PositionContext::MARK() { + return getToken(FeatParser::MARK, 0); +} + +std::vector FeatParser::PositionContext::valuePattern() { + return getRuleContexts(); +} + +FeatParser::ValuePatternContext* FeatParser::PositionContext::valuePattern(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::PositionContext::LOOKUP() { + return getTokens(FeatParser::LOOKUP); +} + +tree::TerminalNode* FeatParser::PositionContext::LOOKUP(size_t i) { + return getToken(FeatParser::LOOKUP, i); +} + +std::vector FeatParser::PositionContext::label() { + return getRuleContexts(); +} + +FeatParser::LabelContext* FeatParser::PositionContext::label(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::PositionContext::lookupPatternElement() { + return getRuleContexts(); +} + +FeatParser::LookupPatternElementContext* FeatParser::PositionContext::lookupPatternElement(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::PositionContext::baseToMarkElement() { + return getRuleContexts(); +} + +FeatParser::BaseToMarkElementContext* FeatParser::PositionContext::baseToMarkElement(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::PositionContext::ligatureMarkElement() { + return getRuleContexts(); +} + +FeatParser::LigatureMarkElementContext* FeatParser::PositionContext::ligatureMarkElement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::PositionContext::getRuleIndex() const { + return FeatParser::RulePosition; +} + + +antlrcpp::Any FeatParser::PositionContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPosition(this); + else + return visitor->visitChildren(this); +} + +FeatParser::PositionContext* FeatParser::position() { + PositionContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 50, FeatParser::RulePosition); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(478); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::ENUMERATE + + || _la == FeatParser::ENUMERATE_v) { + setState(477); + enumtok(); + } + setState(480); + postok(); + setState(482); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(481); + dynamic_cast(_localctx)->startpat = pattern(); + } + setState(538); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::BEGINVALUE: + case FeatParser::NUM: { + setState(484); + valueRecord(); + setState(488); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(485); + valuePattern(); + setState(490); + _errHandler->sync(this); + _la = _input->LA(1); + } + break; + } + + case FeatParser::LOOKUP: { + setState(493); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(491); + match(FeatParser::LOOKUP); + setState(492); + label(); + setState(495); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::LOOKUP); + setState(500); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(497); + lookupPatternElement(); + setState(502); + _errHandler->sync(this); + _la = _input->LA(1); + } + break; + } + + case FeatParser::CURSIVE: { + setState(503); + match(FeatParser::CURSIVE); + setState(504); + cursiveElement(); + setState(506); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(505); + dynamic_cast(_localctx)->endpat = pattern(); + } + break; + } + + case FeatParser::MARKBASE: { + setState(508); + match(FeatParser::MARKBASE); + setState(509); + dynamic_cast(_localctx)->midpat = pattern(); + setState(511); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(510); + baseToMarkElement(); + setState(513); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::BEGINVALUE); + setState(516); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(515); + dynamic_cast(_localctx)->endpat = pattern(); + } + break; + } + + case FeatParser::MARKLIG: + case FeatParser::MARKLIG_v: { + setState(518); + markligtok(); + setState(519); + dynamic_cast(_localctx)->midpat = pattern(); + setState(521); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(520); + ligatureMarkElement(); + setState(523); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::BEGINVALUE); + setState(526); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(525); + dynamic_cast(_localctx)->endpat = pattern(); + } + break; + } + + case FeatParser::MARK: { + setState(528); + match(FeatParser::MARK); + setState(529); + dynamic_cast(_localctx)->midpat = pattern(); + setState(531); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(530); + baseToMarkElement(); + setState(533); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::BEGINVALUE); + setState(536); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)) { + setState(535); + dynamic_cast(_localctx)->endpat = pattern(); + } + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ValuePatternContext ------------------------------------------------------------------ + +FeatParser::ValuePatternContext::ValuePatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::PatternElementContext* FeatParser::ValuePatternContext::patternElement() { + return getRuleContext(0); +} + +FeatParser::ValueRecordContext* FeatParser::ValuePatternContext::valueRecord() { + return getRuleContext(0); +} + + +size_t FeatParser::ValuePatternContext::getRuleIndex() const { + return FeatParser::RuleValuePattern; +} + + +antlrcpp::Any FeatParser::ValuePatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitValuePattern(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ValuePatternContext* FeatParser::valuePattern() { + ValuePatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 52, FeatParser::RuleValuePattern); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(540); + patternElement(); + setState(542); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::BEGINVALUE || _la == FeatParser::NUM) { + setState(541); + valueRecord(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ValueRecordContext ------------------------------------------------------------------ + +FeatParser::ValueRecordContext::ValueRecordContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ValueRecordContext::BEGINVALUE() { + return getToken(FeatParser::BEGINVALUE, 0); +} + +tree::TerminalNode* FeatParser::ValueRecordContext::ENDVALUE() { + return getToken(FeatParser::ENDVALUE, 0); +} + +FeatParser::LabelContext* FeatParser::ValueRecordContext::label() { + return getRuleContext(0); +} + +FeatParser::ValueLiteralContext* FeatParser::ValueRecordContext::valueLiteral() { + return getRuleContext(0); +} + + +size_t FeatParser::ValueRecordContext::getRuleIndex() const { + return FeatParser::RuleValueRecord; +} + + +antlrcpp::Any FeatParser::ValueRecordContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitValueRecord(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ValueRecordContext* FeatParser::valueRecord() { + ValueRecordContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 54, FeatParser::RuleValueRecord); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(549); + _errHandler->sync(this); + switch (getInterpreter()->adaptivePredict(_input, 47, _ctx)) { + case 1: { + enterOuterAlt(_localctx, 1); + setState(544); + match(FeatParser::BEGINVALUE); + setState(545); + dynamic_cast(_localctx)->valuename = label(); + setState(546); + match(FeatParser::ENDVALUE); + break; + } + + case 2: { + enterOuterAlt(_localctx, 2); + setState(548); + valueLiteral(); + break; + } + + default: + break; + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ValueLiteralContext ------------------------------------------------------------------ + +FeatParser::ValueLiteralContext::ValueLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ValueLiteralContext::BEGINVALUE() { + return getToken(FeatParser::BEGINVALUE, 0); +} + +std::vector FeatParser::ValueLiteralContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::ValueLiteralContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + +tree::TerminalNode* FeatParser::ValueLiteralContext::ENDVALUE() { + return getToken(FeatParser::ENDVALUE, 0); +} + + +size_t FeatParser::ValueLiteralContext::getRuleIndex() const { + return FeatParser::RuleValueLiteral; +} + + +antlrcpp::Any FeatParser::ValueLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitValueLiteral(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ValueLiteralContext* FeatParser::valueLiteral() { + ValueLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 56, FeatParser::RuleValueLiteral); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(558); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::BEGINVALUE: { + enterOuterAlt(_localctx, 1); + setState(551); + match(FeatParser::BEGINVALUE); + setState(552); + match(FeatParser::NUM); + setState(553); + match(FeatParser::NUM); + setState(554); + match(FeatParser::NUM); + setState(555); + match(FeatParser::NUM); + setState(556); + match(FeatParser::ENDVALUE); + break; + } + + case FeatParser::NUM: { + enterOuterAlt(_localctx, 2); + setState(557); + match(FeatParser::NUM); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CursiveElementContext ------------------------------------------------------------------ + +FeatParser::CursiveElementContext::CursiveElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::PatternElementContext* FeatParser::CursiveElementContext::patternElement() { + return getRuleContext(0); +} + +std::vector FeatParser::CursiveElementContext::anchor() { + return getRuleContexts(); +} + +FeatParser::AnchorContext* FeatParser::CursiveElementContext::anchor(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::CursiveElementContext::getRuleIndex() const { + return FeatParser::RuleCursiveElement; +} + + +antlrcpp::Any FeatParser::CursiveElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCursiveElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::CursiveElementContext* FeatParser::cursiveElement() { + CursiveElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 58, FeatParser::RuleCursiveElement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(560); + patternElement(); + setState(561); + anchor(); + setState(562); + anchor(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- BaseToMarkElementContext ------------------------------------------------------------------ + +FeatParser::BaseToMarkElementContext::BaseToMarkElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::AnchorContext* FeatParser::BaseToMarkElementContext::anchor() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::BaseToMarkElementContext::MARK() { + return getToken(FeatParser::MARK, 0); +} + +tree::TerminalNode* FeatParser::BaseToMarkElementContext::GCLASS() { + return getToken(FeatParser::GCLASS, 0); +} + +tree::TerminalNode* FeatParser::BaseToMarkElementContext::MARKER() { + return getToken(FeatParser::MARKER, 0); +} + + +size_t FeatParser::BaseToMarkElementContext::getRuleIndex() const { + return FeatParser::RuleBaseToMarkElement; +} + + +antlrcpp::Any FeatParser::BaseToMarkElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitBaseToMarkElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::BaseToMarkElementContext* FeatParser::baseToMarkElement() { + BaseToMarkElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 60, FeatParser::RuleBaseToMarkElement); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(564); + anchor(); + setState(565); + match(FeatParser::MARK); + setState(566); + match(FeatParser::GCLASS); + setState(568); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::MARKER) { + setState(567); + match(FeatParser::MARKER); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LigatureMarkElementContext ------------------------------------------------------------------ + +FeatParser::LigatureMarkElementContext::LigatureMarkElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::AnchorContext* FeatParser::LigatureMarkElementContext::anchor() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::LigatureMarkElementContext::MARK() { + return getToken(FeatParser::MARK, 0); +} + +tree::TerminalNode* FeatParser::LigatureMarkElementContext::GCLASS() { + return getToken(FeatParser::GCLASS, 0); +} + +tree::TerminalNode* FeatParser::LigatureMarkElementContext::LIG_COMPONENT() { + return getToken(FeatParser::LIG_COMPONENT, 0); +} + +tree::TerminalNode* FeatParser::LigatureMarkElementContext::MARKER() { + return getToken(FeatParser::MARKER, 0); +} + + +size_t FeatParser::LigatureMarkElementContext::getRuleIndex() const { + return FeatParser::RuleLigatureMarkElement; +} + + +antlrcpp::Any FeatParser::LigatureMarkElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLigatureMarkElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LigatureMarkElementContext* FeatParser::ligatureMarkElement() { + LigatureMarkElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 62, FeatParser::RuleLigatureMarkElement); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(570); + anchor(); + setState(573); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::MARK) { + setState(571); + match(FeatParser::MARK); + setState(572); + match(FeatParser::GCLASS); + } + setState(576); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::LIG_COMPONENT) { + setState(575); + match(FeatParser::LIG_COMPONENT); + } + setState(579); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::MARKER) { + setState(578); + match(FeatParser::MARKER); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ParametersContext ------------------------------------------------------------------ + +FeatParser::ParametersContext::ParametersContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ParametersContext::PARAMETERS() { + return getToken(FeatParser::PARAMETERS, 0); +} + +std::vector FeatParser::ParametersContext::fixedNum() { + return getRuleContexts(); +} + +FeatParser::FixedNumContext* FeatParser::ParametersContext::fixedNum(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::ParametersContext::getRuleIndex() const { + return FeatParser::RuleParameters; +} + + +antlrcpp::Any FeatParser::ParametersContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitParameters(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ParametersContext* FeatParser::parameters() { + ParametersContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 64, FeatParser::RuleParameters); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(581); + match(FeatParser::PARAMETERS); + setState(583); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(582); + fixedNum(); + setState(585); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::POINTNUM + + || _la == FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SizemenunameContext ------------------------------------------------------------------ + +FeatParser::SizemenunameContext::SizemenunameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::SizemenunameContext::SIZEMENUNAME() { + return getToken(FeatParser::SIZEMENUNAME, 0); +} + +tree::TerminalNode* FeatParser::SizemenunameContext::QUOTE() { + return getToken(FeatParser::QUOTE, 0); +} + +tree::TerminalNode* FeatParser::SizemenunameContext::STRVAL() { + return getToken(FeatParser::STRVAL, 0); +} + +tree::TerminalNode* FeatParser::SizemenunameContext::EQUOTE() { + return getToken(FeatParser::EQUOTE, 0); +} + +std::vector FeatParser::SizemenunameContext::genNum() { + return getRuleContexts(); +} + +FeatParser::GenNumContext* FeatParser::SizemenunameContext::genNum(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::SizemenunameContext::getRuleIndex() const { + return FeatParser::RuleSizemenuname; +} + + +antlrcpp::Any FeatParser::SizemenunameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSizemenuname(this); + else + return visitor->visitChildren(this); +} + +FeatParser::SizemenunameContext* FeatParser::sizemenuname() { + SizemenunameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 66, FeatParser::RuleSizemenuname); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(587); + match(FeatParser::SIZEMENUNAME); + setState(594); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0)) { + setState(588); + genNum(); + setState(592); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0)) { + setState(589); + genNum(); + setState(590); + genNum(); + } + } + setState(596); + match(FeatParser::QUOTE); + setState(597); + match(FeatParser::STRVAL); + setState(598); + match(FeatParser::EQUOTE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FeatureNamesContext ------------------------------------------------------------------ + +FeatParser::FeatureNamesContext::FeatureNamesContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::FeatureNamesContext::FEATURE_NAMES() { + return getToken(FeatParser::FEATURE_NAMES, 0); +} + +tree::TerminalNode* FeatParser::FeatureNamesContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::FeatureNamesContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +std::vector FeatParser::FeatureNamesContext::nameEntryStatement() { + return getRuleContexts(); +} + +FeatParser::NameEntryStatementContext* FeatParser::FeatureNamesContext::nameEntryStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::FeatureNamesContext::getRuleIndex() const { + return FeatParser::RuleFeatureNames; +} + + +antlrcpp::Any FeatParser::FeatureNamesContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFeatureNames(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FeatureNamesContext* FeatParser::featureNames() { + FeatureNamesContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 68, FeatParser::RuleFeatureNames); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(600); + match(FeatParser::FEATURE_NAMES); + setState(601); + match(FeatParser::LCBRACE); + setState(603); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(602); + nameEntryStatement(); + setState(605); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::NAME); + setState(607); + match(FeatParser::RCBRACE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SubtableContext ------------------------------------------------------------------ + +FeatParser::SubtableContext::SubtableContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::SubtableContext::SUBTABLE() { + return getToken(FeatParser::SUBTABLE, 0); +} + + +size_t FeatParser::SubtableContext::getRuleIndex() const { + return FeatParser::RuleSubtable; +} + + +antlrcpp::Any FeatParser::SubtableContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSubtable(this); + else + return visitor->visitChildren(this); +} + +FeatParser::SubtableContext* FeatParser::subtable() { + SubtableContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 70, FeatParser::RuleSubtable); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(609); + match(FeatParser::SUBTABLE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_BASEContext ------------------------------------------------------------------ + +FeatParser::Table_BASEContext::Table_BASEContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_BASEContext::BASE() { + return getTokens(FeatParser::BASE); +} + +tree::TerminalNode* FeatParser::Table_BASEContext::BASE(size_t i) { + return getToken(FeatParser::BASE, i); +} + +tree::TerminalNode* FeatParser::Table_BASEContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_BASEContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_BASEContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_BASEContext::baseStatement() { + return getRuleContexts(); +} + +FeatParser::BaseStatementContext* FeatParser::Table_BASEContext::baseStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_BASEContext::getRuleIndex() const { + return FeatParser::RuleTable_BASE; +} + + +antlrcpp::Any FeatParser::Table_BASEContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_BASE(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_BASEContext* FeatParser::table_BASE() { + Table_BASEContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 72, FeatParser::RuleTable_BASE); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(611); + match(FeatParser::BASE); + setState(612); + match(FeatParser::LCBRACE); + setState(614); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(613); + baseStatement(); + setState(616); + _errHandler->sync(this); + _la = _input->LA(1); + } while (((((_la - 5) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 5)) & ((1ULL << (FeatParser::INCLUDE - 5)) + | (1ULL << (FeatParser::HA_BTL - 5)) + | (1ULL << (FeatParser::VA_BTL - 5)) + | (1ULL << (FeatParser::HA_BSL - 5)) + | (1ULL << (FeatParser::VA_BSL - 5)))) != 0)); + setState(618); + match(FeatParser::RCBRACE); + setState(619); + match(FeatParser::BASE); + setState(620); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- BaseStatementContext ------------------------------------------------------------------ + +FeatParser::BaseStatementContext::BaseStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::BaseStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::AxisTagsContext* FeatParser::BaseStatementContext::axisTags() { + return getRuleContext(0); +} + +FeatParser::AxisScriptsContext* FeatParser::BaseStatementContext::axisScripts() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::BaseStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::BaseStatementContext::getRuleIndex() const { + return FeatParser::RuleBaseStatement; +} + + +antlrcpp::Any FeatParser::BaseStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitBaseStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::BaseStatementContext* FeatParser::baseStatement() { + BaseStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 74, FeatParser::RuleBaseStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(625); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::HA_BTL: + case FeatParser::VA_BTL: { + setState(622); + axisTags(); + break; + } + + case FeatParser::HA_BSL: + case FeatParser::VA_BSL: { + setState(623); + axisScripts(); + break; + } + + case FeatParser::INCLUDE: { + setState(624); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(627); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisTagsContext ------------------------------------------------------------------ + +FeatParser::AxisTagsContext::AxisTagsContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AxisTagsContext::HA_BTL() { + return getToken(FeatParser::HA_BTL, 0); +} + +tree::TerminalNode* FeatParser::AxisTagsContext::VA_BTL() { + return getToken(FeatParser::VA_BTL, 0); +} + +std::vector FeatParser::AxisTagsContext::tag() { + return getRuleContexts(); +} + +FeatParser::TagContext* FeatParser::AxisTagsContext::tag(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::AxisTagsContext::getRuleIndex() const { + return FeatParser::RuleAxisTags; +} + + +antlrcpp::Any FeatParser::AxisTagsContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisTags(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisTagsContext* FeatParser::axisTags() { + AxisTagsContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 76, FeatParser::RuleAxisTags); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(629); + _la = _input->LA(1); + if (!(_la == FeatParser::HA_BTL + + || _la == FeatParser::VA_BTL)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(631); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(630); + tag(); + setState(633); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::MARK || ((((_la - 128) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 128)) & ((1ULL << (FeatParser::NAMELABEL - 128)) + | (1ULL << (FeatParser::EXTNAME - 128)) + | (1ULL << (FeatParser::CATCHTAG - 128)))) != 0)); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisScriptsContext ------------------------------------------------------------------ + +FeatParser::AxisScriptsContext::AxisScriptsContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::AxisScriptsContext::baseScript() { + return getRuleContexts(); +} + +FeatParser::BaseScriptContext* FeatParser::AxisScriptsContext::baseScript(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::AxisScriptsContext::HA_BSL() { + return getToken(FeatParser::HA_BSL, 0); +} + +tree::TerminalNode* FeatParser::AxisScriptsContext::VA_BSL() { + return getToken(FeatParser::VA_BSL, 0); +} + +std::vector FeatParser::AxisScriptsContext::COMMA() { + return getTokens(FeatParser::COMMA); +} + +tree::TerminalNode* FeatParser::AxisScriptsContext::COMMA(size_t i) { + return getToken(FeatParser::COMMA, i); +} + + +size_t FeatParser::AxisScriptsContext::getRuleIndex() const { + return FeatParser::RuleAxisScripts; +} + + +antlrcpp::Any FeatParser::AxisScriptsContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisScripts(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisScriptsContext* FeatParser::axisScripts() { + AxisScriptsContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 78, FeatParser::RuleAxisScripts); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(635); + _la = _input->LA(1); + if (!(_la == FeatParser::HA_BSL + + || _la == FeatParser::VA_BSL)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(636); + baseScript(); + setState(641); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::COMMA) { + setState(637); + match(FeatParser::COMMA); + setState(638); + baseScript(); + setState(643); + _errHandler->sync(this); + _la = _input->LA(1); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- BaseScriptContext ------------------------------------------------------------------ + +FeatParser::BaseScriptContext::BaseScriptContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::BaseScriptContext::tag() { + return getRuleContexts(); +} + +FeatParser::TagContext* FeatParser::BaseScriptContext::tag(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::BaseScriptContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::BaseScriptContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + + +size_t FeatParser::BaseScriptContext::getRuleIndex() const { + return FeatParser::RuleBaseScript; +} + + +antlrcpp::Any FeatParser::BaseScriptContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitBaseScript(this); + else + return visitor->visitChildren(this); +} + +FeatParser::BaseScriptContext* FeatParser::baseScript() { + BaseScriptContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 80, FeatParser::RuleBaseScript); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(644); + dynamic_cast(_localctx)->script = tag(); + setState(645); + dynamic_cast(_localctx)->db = tag(); + setState(647); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(646); + match(FeatParser::NUM); + setState(649); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_GDEFContext ------------------------------------------------------------------ + +FeatParser::Table_GDEFContext::Table_GDEFContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_GDEFContext::GDEF() { + return getTokens(FeatParser::GDEF); +} + +tree::TerminalNode* FeatParser::Table_GDEFContext::GDEF(size_t i) { + return getToken(FeatParser::GDEF, i); +} + +tree::TerminalNode* FeatParser::Table_GDEFContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_GDEFContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_GDEFContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_GDEFContext::gdefStatement() { + return getRuleContexts(); +} + +FeatParser::GdefStatementContext* FeatParser::Table_GDEFContext::gdefStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_GDEFContext::getRuleIndex() const { + return FeatParser::RuleTable_GDEF; +} + + +antlrcpp::Any FeatParser::Table_GDEFContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_GDEF(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_GDEFContext* FeatParser::table_GDEF() { + Table_GDEFContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 82, FeatParser::RuleTable_GDEF); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(651); + match(FeatParser::GDEF); + setState(652); + match(FeatParser::LCBRACE); + setState(654); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(653); + gdefStatement(); + setState(656); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || ((((_la - 67) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 67)) & ((1ULL << (FeatParser::GLYPH_CLASS_DEF - 67)) + | (1ULL << (FeatParser::ATTACH - 67)) + | (1ULL << (FeatParser::LIG_CARET_BY_POS - 67)) + | (1ULL << (FeatParser::LIG_CARET_BY_IDX - 67)))) != 0)); + setState(658); + match(FeatParser::RCBRACE); + setState(659); + match(FeatParser::GDEF); + setState(660); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GdefStatementContext ------------------------------------------------------------------ + +FeatParser::GdefStatementContext::GdefStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GdefStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::GdefGlyphClassContext* FeatParser::GdefStatementContext::gdefGlyphClass() { + return getRuleContext(0); +} + +FeatParser::GdefAttachContext* FeatParser::GdefStatementContext::gdefAttach() { + return getRuleContext(0); +} + +FeatParser::GdefLigCaretPosContext* FeatParser::GdefStatementContext::gdefLigCaretPos() { + return getRuleContext(0); +} + +FeatParser::GdefLigCaretIndexContext* FeatParser::GdefStatementContext::gdefLigCaretIndex() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::GdefStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::GdefStatementContext::getRuleIndex() const { + return FeatParser::RuleGdefStatement; +} + + +antlrcpp::Any FeatParser::GdefStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGdefStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GdefStatementContext* FeatParser::gdefStatement() { + GdefStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 84, FeatParser::RuleGdefStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(667); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::GLYPH_CLASS_DEF: { + setState(662); + gdefGlyphClass(); + break; + } + + case FeatParser::ATTACH: { + setState(663); + gdefAttach(); + break; + } + + case FeatParser::LIG_CARET_BY_POS: { + setState(664); + gdefLigCaretPos(); + break; + } + + case FeatParser::LIG_CARET_BY_IDX: { + setState(665); + gdefLigCaretIndex(); + break; + } + + case FeatParser::INCLUDE: { + setState(666); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(669); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GdefGlyphClassContext ------------------------------------------------------------------ + +FeatParser::GdefGlyphClassContext::GdefGlyphClassContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GdefGlyphClassContext::GLYPH_CLASS_DEF() { + return getToken(FeatParser::GLYPH_CLASS_DEF, 0); +} + +std::vector FeatParser::GdefGlyphClassContext::glyphClassOptional() { + return getRuleContexts(); +} + +FeatParser::GlyphClassOptionalContext* FeatParser::GdefGlyphClassContext::glyphClassOptional(size_t i) { + return getRuleContext(i); +} + +std::vector FeatParser::GdefGlyphClassContext::COMMA() { + return getTokens(FeatParser::COMMA); +} + +tree::TerminalNode* FeatParser::GdefGlyphClassContext::COMMA(size_t i) { + return getToken(FeatParser::COMMA, i); +} + + +size_t FeatParser::GdefGlyphClassContext::getRuleIndex() const { + return FeatParser::RuleGdefGlyphClass; +} + + +antlrcpp::Any FeatParser::GdefGlyphClassContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGdefGlyphClass(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GdefGlyphClassContext* FeatParser::gdefGlyphClass() { + GdefGlyphClassContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 86, FeatParser::RuleGdefGlyphClass); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(671); + match(FeatParser::GLYPH_CLASS_DEF); + setState(672); + glyphClassOptional(); + setState(673); + match(FeatParser::COMMA); + setState(674); + glyphClassOptional(); + setState(675); + match(FeatParser::COMMA); + setState(676); + glyphClassOptional(); + setState(677); + match(FeatParser::COMMA); + setState(678); + glyphClassOptional(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GdefAttachContext ------------------------------------------------------------------ + +FeatParser::GdefAttachContext::GdefAttachContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GdefAttachContext::ATTACH() { + return getToken(FeatParser::ATTACH, 0); +} + +FeatParser::LookupPatternContext* FeatParser::GdefAttachContext::lookupPattern() { + return getRuleContext(0); +} + +std::vector FeatParser::GdefAttachContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::GdefAttachContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + + +size_t FeatParser::GdefAttachContext::getRuleIndex() const { + return FeatParser::RuleGdefAttach; +} + + +antlrcpp::Any FeatParser::GdefAttachContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGdefAttach(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GdefAttachContext* FeatParser::gdefAttach() { + GdefAttachContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 88, FeatParser::RuleGdefAttach); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(680); + match(FeatParser::ATTACH); + setState(681); + lookupPattern(); + setState(683); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(682); + match(FeatParser::NUM); + setState(685); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GdefLigCaretPosContext ------------------------------------------------------------------ + +FeatParser::GdefLigCaretPosContext::GdefLigCaretPosContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GdefLigCaretPosContext::LIG_CARET_BY_POS() { + return getToken(FeatParser::LIG_CARET_BY_POS, 0); +} + +FeatParser::LookupPatternContext* FeatParser::GdefLigCaretPosContext::lookupPattern() { + return getRuleContext(0); +} + +std::vector FeatParser::GdefLigCaretPosContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::GdefLigCaretPosContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + + +size_t FeatParser::GdefLigCaretPosContext::getRuleIndex() const { + return FeatParser::RuleGdefLigCaretPos; +} + + +antlrcpp::Any FeatParser::GdefLigCaretPosContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGdefLigCaretPos(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GdefLigCaretPosContext* FeatParser::gdefLigCaretPos() { + GdefLigCaretPosContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 90, FeatParser::RuleGdefLigCaretPos); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(687); + match(FeatParser::LIG_CARET_BY_POS); + setState(688); + lookupPattern(); + setState(690); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(689); + match(FeatParser::NUM); + setState(692); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GdefLigCaretIndexContext ------------------------------------------------------------------ + +FeatParser::GdefLigCaretIndexContext::GdefLigCaretIndexContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GdefLigCaretIndexContext::LIG_CARET_BY_IDX() { + return getToken(FeatParser::LIG_CARET_BY_IDX, 0); +} + +FeatParser::LookupPatternContext* FeatParser::GdefLigCaretIndexContext::lookupPattern() { + return getRuleContext(0); +} + +std::vector FeatParser::GdefLigCaretIndexContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::GdefLigCaretIndexContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + + +size_t FeatParser::GdefLigCaretIndexContext::getRuleIndex() const { + return FeatParser::RuleGdefLigCaretIndex; +} + + +antlrcpp::Any FeatParser::GdefLigCaretIndexContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGdefLigCaretIndex(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GdefLigCaretIndexContext* FeatParser::gdefLigCaretIndex() { + GdefLigCaretIndexContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 92, FeatParser::RuleGdefLigCaretIndex); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(694); + match(FeatParser::LIG_CARET_BY_IDX); + setState(695); + lookupPattern(); + setState(697); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(696); + match(FeatParser::NUM); + setState(699); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_headContext ------------------------------------------------------------------ + +FeatParser::Table_headContext::Table_headContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_headContext::HEAD() { + return getTokens(FeatParser::HEAD); +} + +tree::TerminalNode* FeatParser::Table_headContext::HEAD(size_t i) { + return getToken(FeatParser::HEAD, i); +} + +tree::TerminalNode* FeatParser::Table_headContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_headContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_headContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_headContext::headStatement() { + return getRuleContexts(); +} + +FeatParser::HeadStatementContext* FeatParser::Table_headContext::headStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_headContext::getRuleIndex() const { + return FeatParser::RuleTable_head; +} + + +antlrcpp::Any FeatParser::Table_headContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_head(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_headContext* FeatParser::table_head() { + Table_headContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 94, FeatParser::RuleTable_head); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(701); + match(FeatParser::HEAD); + setState(702); + match(FeatParser::LCBRACE); + setState(704); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(703); + headStatement(); + setState(706); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::FONT_REVISION); + setState(708); + match(FeatParser::RCBRACE); + setState(709); + match(FeatParser::HEAD); + setState(710); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- HeadStatementContext ------------------------------------------------------------------ + +FeatParser::HeadStatementContext::HeadStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::HeadStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::HeadContext* FeatParser::HeadStatementContext::head() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::HeadStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::HeadStatementContext::getRuleIndex() const { + return FeatParser::RuleHeadStatement; +} + + +antlrcpp::Any FeatParser::HeadStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitHeadStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::HeadStatementContext* FeatParser::headStatement() { + HeadStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 96, FeatParser::RuleHeadStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(714); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::FONT_REVISION: { + setState(712); + head(); + break; + } + + case FeatParser::INCLUDE: { + setState(713); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(716); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- HeadContext ------------------------------------------------------------------ + +FeatParser::HeadContext::HeadContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::HeadContext::FONT_REVISION() { + return getToken(FeatParser::FONT_REVISION, 0); +} + +tree::TerminalNode* FeatParser::HeadContext::POINTNUM() { + return getToken(FeatParser::POINTNUM, 0); +} + + +size_t FeatParser::HeadContext::getRuleIndex() const { + return FeatParser::RuleHead; +} + + +antlrcpp::Any FeatParser::HeadContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitHead(this); + else + return visitor->visitChildren(this); +} + +FeatParser::HeadContext* FeatParser::head() { + HeadContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 98, FeatParser::RuleHead); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(718); + match(FeatParser::FONT_REVISION); + setState(719); + match(FeatParser::POINTNUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_hheaContext ------------------------------------------------------------------ + +FeatParser::Table_hheaContext::Table_hheaContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_hheaContext::HHEA() { + return getTokens(FeatParser::HHEA); +} + +tree::TerminalNode* FeatParser::Table_hheaContext::HHEA(size_t i) { + return getToken(FeatParser::HHEA, i); +} + +tree::TerminalNode* FeatParser::Table_hheaContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_hheaContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_hheaContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_hheaContext::hheaStatement() { + return getRuleContexts(); +} + +FeatParser::HheaStatementContext* FeatParser::Table_hheaContext::hheaStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_hheaContext::getRuleIndex() const { + return FeatParser::RuleTable_hhea; +} + + +antlrcpp::Any FeatParser::Table_hheaContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_hhea(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_hheaContext* FeatParser::table_hhea() { + Table_hheaContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 100, FeatParser::RuleTable_hhea); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(721); + match(FeatParser::HHEA); + setState(722); + match(FeatParser::LCBRACE); + setState(726); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 74) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 74)) & ((1ULL << (FeatParser::ASCENDER - 74)) + | (1ULL << (FeatParser::DESCENDER - 74)) + | (1ULL << (FeatParser::LINE_GAP - 74)) + | (1ULL << (FeatParser::CARET_OFFSET - 74)))) != 0)) { + setState(723); + hheaStatement(); + setState(728); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(729); + match(FeatParser::RCBRACE); + setState(730); + match(FeatParser::HHEA); + setState(731); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- HheaStatementContext ------------------------------------------------------------------ + +FeatParser::HheaStatementContext::HheaStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::HheaStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::HheaContext* FeatParser::HheaStatementContext::hhea() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::HheaStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::HheaStatementContext::getRuleIndex() const { + return FeatParser::RuleHheaStatement; +} + + +antlrcpp::Any FeatParser::HheaStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitHheaStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::HheaStatementContext* FeatParser::hheaStatement() { + HheaStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 102, FeatParser::RuleHheaStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(735); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::ASCENDER: + case FeatParser::DESCENDER: + case FeatParser::LINE_GAP: + case FeatParser::CARET_OFFSET: { + setState(733); + hhea(); + break; + } + + case FeatParser::INCLUDE: { + setState(734); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(737); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- HheaContext ------------------------------------------------------------------ + +FeatParser::HheaContext::HheaContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::HheaContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + +tree::TerminalNode* FeatParser::HheaContext::CARET_OFFSET() { + return getToken(FeatParser::CARET_OFFSET, 0); +} + +tree::TerminalNode* FeatParser::HheaContext::ASCENDER() { + return getToken(FeatParser::ASCENDER, 0); +} + +tree::TerminalNode* FeatParser::HheaContext::DESCENDER() { + return getToken(FeatParser::DESCENDER, 0); +} + +tree::TerminalNode* FeatParser::HheaContext::LINE_GAP() { + return getToken(FeatParser::LINE_GAP, 0); +} + + +size_t FeatParser::HheaContext::getRuleIndex() const { + return FeatParser::RuleHhea; +} + + +antlrcpp::Any FeatParser::HheaContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitHhea(this); + else + return visitor->visitChildren(this); +} + +FeatParser::HheaContext* FeatParser::hhea() { + HheaContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 104, FeatParser::RuleHhea); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(739); + _la = _input->LA(1); + if (!(((((_la - 74) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 74)) & ((1ULL << (FeatParser::ASCENDER - 74)) + | (1ULL << (FeatParser::DESCENDER - 74)) + | (1ULL << (FeatParser::LINE_GAP - 74)) + | (1ULL << (FeatParser::CARET_OFFSET - 74)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(740); + match(FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_vheaContext ------------------------------------------------------------------ + +FeatParser::Table_vheaContext::Table_vheaContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_vheaContext::VHEA() { + return getTokens(FeatParser::VHEA); +} + +tree::TerminalNode* FeatParser::Table_vheaContext::VHEA(size_t i) { + return getToken(FeatParser::VHEA, i); +} + +tree::TerminalNode* FeatParser::Table_vheaContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_vheaContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_vheaContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_vheaContext::vheaStatement() { + return getRuleContexts(); +} + +FeatParser::VheaStatementContext* FeatParser::Table_vheaContext::vheaStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_vheaContext::getRuleIndex() const { + return FeatParser::RuleTable_vhea; +} + + +antlrcpp::Any FeatParser::Table_vheaContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_vhea(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_vheaContext* FeatParser::table_vhea() { + Table_vheaContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 106, FeatParser::RuleTable_vhea); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(742); + match(FeatParser::VHEA); + setState(743); + match(FeatParser::LCBRACE); + setState(747); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 109) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 109)) & ((1ULL << (FeatParser::VERT_TYPO_ASCENDER - 109)) + | (1ULL << (FeatParser::VERT_TYPO_DESCENDER - 109)) + | (1ULL << (FeatParser::VERT_TYPO_LINE_GAP - 109)))) != 0)) { + setState(744); + vheaStatement(); + setState(749); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(750); + match(FeatParser::RCBRACE); + setState(751); + match(FeatParser::VHEA); + setState(752); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VheaStatementContext ------------------------------------------------------------------ + +FeatParser::VheaStatementContext::VheaStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::VheaStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::VheaContext* FeatParser::VheaStatementContext::vhea() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::VheaStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::VheaStatementContext::getRuleIndex() const { + return FeatParser::RuleVheaStatement; +} + + +antlrcpp::Any FeatParser::VheaStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVheaStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::VheaStatementContext* FeatParser::vheaStatement() { + VheaStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 108, FeatParser::RuleVheaStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(756); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::VERT_TYPO_ASCENDER: + case FeatParser::VERT_TYPO_DESCENDER: + case FeatParser::VERT_TYPO_LINE_GAP: { + setState(754); + vhea(); + break; + } + + case FeatParser::INCLUDE: { + setState(755); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(758); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VheaContext ------------------------------------------------------------------ + +FeatParser::VheaContext::VheaContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::VheaContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + +tree::TerminalNode* FeatParser::VheaContext::VERT_TYPO_ASCENDER() { + return getToken(FeatParser::VERT_TYPO_ASCENDER, 0); +} + +tree::TerminalNode* FeatParser::VheaContext::VERT_TYPO_DESCENDER() { + return getToken(FeatParser::VERT_TYPO_DESCENDER, 0); +} + +tree::TerminalNode* FeatParser::VheaContext::VERT_TYPO_LINE_GAP() { + return getToken(FeatParser::VERT_TYPO_LINE_GAP, 0); +} + + +size_t FeatParser::VheaContext::getRuleIndex() const { + return FeatParser::RuleVhea; +} + + +antlrcpp::Any FeatParser::VheaContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVhea(this); + else + return visitor->visitChildren(this); +} + +FeatParser::VheaContext* FeatParser::vhea() { + VheaContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 110, FeatParser::RuleVhea); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(760); + _la = _input->LA(1); + if (!(((((_la - 109) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 109)) & ((1ULL << (FeatParser::VERT_TYPO_ASCENDER - 109)) + | (1ULL << (FeatParser::VERT_TYPO_DESCENDER - 109)) + | (1ULL << (FeatParser::VERT_TYPO_LINE_GAP - 109)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(761); + match(FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_nameContext ------------------------------------------------------------------ + +FeatParser::Table_nameContext::Table_nameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_nameContext::NAME() { + return getTokens(FeatParser::NAME); +} + +tree::TerminalNode* FeatParser::Table_nameContext::NAME(size_t i) { + return getToken(FeatParser::NAME, i); +} + +tree::TerminalNode* FeatParser::Table_nameContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_nameContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_nameContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_nameContext::nameStatement() { + return getRuleContexts(); +} + +FeatParser::NameStatementContext* FeatParser::Table_nameContext::nameStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_nameContext::getRuleIndex() const { + return FeatParser::RuleTable_name; +} + + +antlrcpp::Any FeatParser::Table_nameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_name(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_nameContext* FeatParser::table_name() { + Table_nameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 112, FeatParser::RuleTable_name); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(763); + match(FeatParser::NAME); + setState(764); + match(FeatParser::LCBRACE); + setState(766); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(765); + nameStatement(); + setState(768); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::NAMEID); + setState(770); + match(FeatParser::RCBRACE); + setState(771); + match(FeatParser::NAME); + setState(772); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NameStatementContext ------------------------------------------------------------------ + +FeatParser::NameStatementContext::NameStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::NameStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::NameIDContext* FeatParser::NameStatementContext::nameID() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::NameStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::NameStatementContext::getRuleIndex() const { + return FeatParser::RuleNameStatement; +} + + +antlrcpp::Any FeatParser::NameStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNameStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::NameStatementContext* FeatParser::nameStatement() { + NameStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 114, FeatParser::RuleNameStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(776); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NAMEID: { + setState(774); + nameID(); + break; + } + + case FeatParser::INCLUDE: { + setState(775); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(778); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NameIDContext ------------------------------------------------------------------ + +FeatParser::NameIDContext::NameIDContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::NameIDContext::NAMEID() { + return getToken(FeatParser::NAMEID, 0); +} + +tree::TerminalNode* FeatParser::NameIDContext::QUOTE() { + return getToken(FeatParser::QUOTE, 0); +} + +tree::TerminalNode* FeatParser::NameIDContext::STRVAL() { + return getToken(FeatParser::STRVAL, 0); +} + +tree::TerminalNode* FeatParser::NameIDContext::EQUOTE() { + return getToken(FeatParser::EQUOTE, 0); +} + +std::vector FeatParser::NameIDContext::genNum() { + return getRuleContexts(); +} + +FeatParser::GenNumContext* FeatParser::NameIDContext::genNum(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::NameIDContext::getRuleIndex() const { + return FeatParser::RuleNameID; +} + + +antlrcpp::Any FeatParser::NameIDContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNameID(this); + else + return visitor->visitChildren(this); +} + +FeatParser::NameIDContext* FeatParser::nameID() { + NameIDContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 116, FeatParser::RuleNameID); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(780); + match(FeatParser::NAMEID); + setState(781); + dynamic_cast(_localctx)->id = genNum(); + setState(788); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0)) { + setState(782); + dynamic_cast(_localctx)->plat = genNum(); + setState(786); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0)) { + setState(783); + dynamic_cast(_localctx)->spec = genNum(); + setState(784); + dynamic_cast(_localctx)->lang = genNum(); + } + } + setState(790); + match(FeatParser::QUOTE); + setState(791); + match(FeatParser::STRVAL); + setState(792); + match(FeatParser::EQUOTE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_OS_2Context ------------------------------------------------------------------ + +FeatParser::Table_OS_2Context::Table_OS_2Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_OS_2Context::OS_2() { + return getTokens(FeatParser::OS_2); +} + +tree::TerminalNode* FeatParser::Table_OS_2Context::OS_2(size_t i) { + return getToken(FeatParser::OS_2, i); +} + +tree::TerminalNode* FeatParser::Table_OS_2Context::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_OS_2Context::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_OS_2Context::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_OS_2Context::os_2Statement() { + return getRuleContexts(); +} + +FeatParser::Os_2StatementContext* FeatParser::Table_OS_2Context::os_2Statement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_OS_2Context::getRuleIndex() const { + return FeatParser::RuleTable_OS_2; +} + + +antlrcpp::Any FeatParser::Table_OS_2Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_OS_2(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_OS_2Context* FeatParser::table_OS_2() { + Table_OS_2Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 118, FeatParser::RuleTable_OS_2); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(794); + match(FeatParser::OS_2); + setState(795); + match(FeatParser::LCBRACE); + setState(797); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(796); + os_2Statement(); + setState(799); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || ((((_la - 81) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 81)) & ((1ULL << (FeatParser::FS_TYPE - 81)) + | (1ULL << (FeatParser::FS_TYPE_v - 81)) + | (1ULL << (FeatParser::OS2_LOWER_OP_SIZE - 81)) + | (1ULL << (FeatParser::OS2_UPPER_OP_SIZE - 81)) + | (1ULL << (FeatParser::PANOSE - 81)) + | (1ULL << (FeatParser::TYPO_ASCENDER - 81)) + | (1ULL << (FeatParser::TYPO_DESCENDER - 81)) + | (1ULL << (FeatParser::TYPO_LINE_GAP - 81)) + | (1ULL << (FeatParser::WIN_ASCENT - 81)) + | (1ULL << (FeatParser::WIN_DESCENT - 81)) + | (1ULL << (FeatParser::X_HEIGHT - 81)) + | (1ULL << (FeatParser::CAP_HEIGHT - 81)) + | (1ULL << (FeatParser::WEIGHT_CLASS - 81)) + | (1ULL << (FeatParser::WIDTH_CLASS - 81)) + | (1ULL << (FeatParser::VENDOR - 81)) + | (1ULL << (FeatParser::UNICODE_RANGE - 81)) + | (1ULL << (FeatParser::CODE_PAGE_RANGE - 81)) + | (1ULL << (FeatParser::FAMILY_CLASS - 81)))) != 0)); + setState(801); + match(FeatParser::RCBRACE); + setState(802); + match(FeatParser::OS_2); + setState(803); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Os_2StatementContext ------------------------------------------------------------------ + +FeatParser::Os_2StatementContext::Os_2StatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::Os_2StatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::Os_2Context* FeatParser::Os_2StatementContext::os_2() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::Os_2StatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::Os_2StatementContext::getRuleIndex() const { + return FeatParser::RuleOs_2Statement; +} + + +antlrcpp::Any FeatParser::Os_2StatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitOs_2Statement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Os_2StatementContext* FeatParser::os_2Statement() { + Os_2StatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 120, FeatParser::RuleOs_2Statement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(807); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::FS_TYPE: + case FeatParser::FS_TYPE_v: + case FeatParser::OS2_LOWER_OP_SIZE: + case FeatParser::OS2_UPPER_OP_SIZE: + case FeatParser::PANOSE: + case FeatParser::TYPO_ASCENDER: + case FeatParser::TYPO_DESCENDER: + case FeatParser::TYPO_LINE_GAP: + case FeatParser::WIN_ASCENT: + case FeatParser::WIN_DESCENT: + case FeatParser::X_HEIGHT: + case FeatParser::CAP_HEIGHT: + case FeatParser::WEIGHT_CLASS: + case FeatParser::WIDTH_CLASS: + case FeatParser::VENDOR: + case FeatParser::UNICODE_RANGE: + case FeatParser::CODE_PAGE_RANGE: + case FeatParser::FAMILY_CLASS: { + setState(805); + os_2(); + break; + } + + case FeatParser::INCLUDE: { + setState(806); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(809); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Os_2Context ------------------------------------------------------------------ + +FeatParser::Os_2Context::Os_2Context(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::Os_2Context::TYPO_ASCENDER() { + return getToken(FeatParser::TYPO_ASCENDER, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::TYPO_DESCENDER() { + return getToken(FeatParser::TYPO_DESCENDER, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::TYPO_LINE_GAP() { + return getToken(FeatParser::TYPO_LINE_GAP, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::WIN_ASCENT() { + return getToken(FeatParser::WIN_ASCENT, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::WIN_DESCENT() { + return getToken(FeatParser::WIN_DESCENT, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::X_HEIGHT() { + return getToken(FeatParser::X_HEIGHT, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::CAP_HEIGHT() { + return getToken(FeatParser::CAP_HEIGHT, 0); +} + +std::vector FeatParser::Os_2Context::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::Os_2Context::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + +tree::TerminalNode* FeatParser::Os_2Context::FS_TYPE() { + return getToken(FeatParser::FS_TYPE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::FS_TYPE_v() { + return getToken(FeatParser::FS_TYPE_v, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::WEIGHT_CLASS() { + return getToken(FeatParser::WEIGHT_CLASS, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::WIDTH_CLASS() { + return getToken(FeatParser::WIDTH_CLASS, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::OS2_LOWER_OP_SIZE() { + return getToken(FeatParser::OS2_LOWER_OP_SIZE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::OS2_UPPER_OP_SIZE() { + return getToken(FeatParser::OS2_UPPER_OP_SIZE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::FAMILY_CLASS() { + return getToken(FeatParser::FAMILY_CLASS, 0); +} + +FeatParser::GenNumContext* FeatParser::Os_2Context::genNum() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::Os_2Context::VENDOR() { + return getToken(FeatParser::VENDOR, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::QUOTE() { + return getToken(FeatParser::QUOTE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::STRVAL() { + return getToken(FeatParser::STRVAL, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::EQUOTE() { + return getToken(FeatParser::EQUOTE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::PANOSE() { + return getToken(FeatParser::PANOSE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::UNICODE_RANGE() { + return getToken(FeatParser::UNICODE_RANGE, 0); +} + +tree::TerminalNode* FeatParser::Os_2Context::CODE_PAGE_RANGE() { + return getToken(FeatParser::CODE_PAGE_RANGE, 0); +} + + +size_t FeatParser::Os_2Context::getRuleIndex() const { + return FeatParser::RuleOs_2; +} + + +antlrcpp::Any FeatParser::Os_2Context::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitOs_2(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Os_2Context* FeatParser::os_2() { + Os_2Context *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 122, FeatParser::RuleOs_2); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(838); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::TYPO_ASCENDER: + case FeatParser::TYPO_DESCENDER: + case FeatParser::TYPO_LINE_GAP: + case FeatParser::WIN_ASCENT: + case FeatParser::WIN_DESCENT: + case FeatParser::X_HEIGHT: + case FeatParser::CAP_HEIGHT: { + enterOuterAlt(_localctx, 1); + setState(811); + _la = _input->LA(1); + if (!(((((_la - 86) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 86)) & ((1ULL << (FeatParser::TYPO_ASCENDER - 86)) + | (1ULL << (FeatParser::TYPO_DESCENDER - 86)) + | (1ULL << (FeatParser::TYPO_LINE_GAP - 86)) + | (1ULL << (FeatParser::WIN_ASCENT - 86)) + | (1ULL << (FeatParser::WIN_DESCENT - 86)) + | (1ULL << (FeatParser::X_HEIGHT - 86)) + | (1ULL << (FeatParser::CAP_HEIGHT - 86)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(812); + dynamic_cast(_localctx)->num = match(FeatParser::NUM); + break; + } + + case FeatParser::FS_TYPE: + case FeatParser::FS_TYPE_v: + case FeatParser::OS2_LOWER_OP_SIZE: + case FeatParser::OS2_UPPER_OP_SIZE: + case FeatParser::WEIGHT_CLASS: + case FeatParser::WIDTH_CLASS: { + enterOuterAlt(_localctx, 2); + setState(813); + _la = _input->LA(1); + if (!(((((_la - 81) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 81)) & ((1ULL << (FeatParser::FS_TYPE - 81)) + | (1ULL << (FeatParser::FS_TYPE_v - 81)) + | (1ULL << (FeatParser::OS2_LOWER_OP_SIZE - 81)) + | (1ULL << (FeatParser::OS2_UPPER_OP_SIZE - 81)) + | (1ULL << (FeatParser::WEIGHT_CLASS - 81)) + | (1ULL << (FeatParser::WIDTH_CLASS - 81)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(814); + dynamic_cast(_localctx)->unum = match(FeatParser::NUM); + break; + } + + case FeatParser::FAMILY_CLASS: { + enterOuterAlt(_localctx, 3); + setState(815); + match(FeatParser::FAMILY_CLASS); + setState(816); + dynamic_cast(_localctx)->gnum = genNum(); + break; + } + + case FeatParser::VENDOR: { + enterOuterAlt(_localctx, 4); + setState(817); + match(FeatParser::VENDOR); + setState(818); + match(FeatParser::QUOTE); + setState(819); + match(FeatParser::STRVAL); + setState(820); + match(FeatParser::EQUOTE); + break; + } + + case FeatParser::PANOSE: { + enterOuterAlt(_localctx, 5); + setState(821); + match(FeatParser::PANOSE); + setState(822); + match(FeatParser::NUM); + setState(823); + match(FeatParser::NUM); + setState(824); + match(FeatParser::NUM); + setState(825); + match(FeatParser::NUM); + setState(826); + match(FeatParser::NUM); + setState(827); + match(FeatParser::NUM); + setState(828); + match(FeatParser::NUM); + setState(829); + match(FeatParser::NUM); + setState(830); + match(FeatParser::NUM); + setState(831); + match(FeatParser::NUM); + break; + } + + case FeatParser::UNICODE_RANGE: + case FeatParser::CODE_PAGE_RANGE: { + enterOuterAlt(_localctx, 6); + setState(832); + _la = _input->LA(1); + if (!(_la == FeatParser::UNICODE_RANGE + + || _la == FeatParser::CODE_PAGE_RANGE)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(834); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(833); + match(FeatParser::NUM); + setState(836); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NUM); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_STATContext ------------------------------------------------------------------ + +FeatParser::Table_STATContext::Table_STATContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_STATContext::STAT() { + return getTokens(FeatParser::STAT); +} + +tree::TerminalNode* FeatParser::Table_STATContext::STAT(size_t i) { + return getToken(FeatParser::STAT, i); +} + +tree::TerminalNode* FeatParser::Table_STATContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_STATContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_STATContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_STATContext::statStatement() { + return getRuleContexts(); +} + +FeatParser::StatStatementContext* FeatParser::Table_STATContext::statStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_STATContext::getRuleIndex() const { + return FeatParser::RuleTable_STAT; +} + + +antlrcpp::Any FeatParser::Table_STATContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_STAT(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_STATContext* FeatParser::table_STAT() { + Table_STATContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 124, FeatParser::RuleTable_STAT); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(840); + match(FeatParser::STAT); + setState(841); + match(FeatParser::LCBRACE); + setState(843); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(842); + statStatement(); + setState(845); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || ((((_la - 100) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 100)) & ((1ULL << (FeatParser::ELIDED_FALLBACK_NAME - 100)) + | (1ULL << (FeatParser::ELIDED_FALLBACK_NAME_ID - 100)) + | (1ULL << (FeatParser::DESIGN_AXIS - 100)) + | (1ULL << (FeatParser::AXIS_VALUE - 100)))) != 0)); + setState(847); + match(FeatParser::RCBRACE); + setState(848); + match(FeatParser::STAT); + setState(849); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- StatStatementContext ------------------------------------------------------------------ + +FeatParser::StatStatementContext::StatStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::StatStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::DesignAxisContext* FeatParser::StatStatementContext::designAxis() { + return getRuleContext(0); +} + +FeatParser::AxisValueContext* FeatParser::StatStatementContext::axisValue() { + return getRuleContext(0); +} + +FeatParser::ElidedFallbackNameContext* FeatParser::StatStatementContext::elidedFallbackName() { + return getRuleContext(0); +} + +FeatParser::ElidedFallbackNameIDContext* FeatParser::StatStatementContext::elidedFallbackNameID() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::StatStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::StatStatementContext::getRuleIndex() const { + return FeatParser::RuleStatStatement; +} + + +antlrcpp::Any FeatParser::StatStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitStatStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::StatStatementContext* FeatParser::statStatement() { + StatStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 126, FeatParser::RuleStatStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(856); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::DESIGN_AXIS: { + setState(851); + designAxis(); + break; + } + + case FeatParser::AXIS_VALUE: { + setState(852); + axisValue(); + break; + } + + case FeatParser::ELIDED_FALLBACK_NAME: { + setState(853); + elidedFallbackName(); + break; + } + + case FeatParser::ELIDED_FALLBACK_NAME_ID: { + setState(854); + elidedFallbackNameID(); + break; + } + + case FeatParser::INCLUDE: { + setState(855); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(858); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- DesignAxisContext ------------------------------------------------------------------ + +FeatParser::DesignAxisContext::DesignAxisContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::DesignAxisContext::DESIGN_AXIS() { + return getToken(FeatParser::DESIGN_AXIS, 0); +} + +FeatParser::TagContext* FeatParser::DesignAxisContext::tag() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::DesignAxisContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + +tree::TerminalNode* FeatParser::DesignAxisContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::DesignAxisContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +std::vector FeatParser::DesignAxisContext::nameEntryStatement() { + return getRuleContexts(); +} + +FeatParser::NameEntryStatementContext* FeatParser::DesignAxisContext::nameEntryStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::DesignAxisContext::getRuleIndex() const { + return FeatParser::RuleDesignAxis; +} + + +antlrcpp::Any FeatParser::DesignAxisContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitDesignAxis(this); + else + return visitor->visitChildren(this); +} + +FeatParser::DesignAxisContext* FeatParser::designAxis() { + DesignAxisContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 128, FeatParser::RuleDesignAxis); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(860); + match(FeatParser::DESIGN_AXIS); + setState(861); + tag(); + setState(862); + match(FeatParser::NUM); + setState(863); + match(FeatParser::LCBRACE); + setState(865); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(864); + nameEntryStatement(); + setState(867); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::NAME); + setState(869); + match(FeatParser::RCBRACE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisValueContext ------------------------------------------------------------------ + +FeatParser::AxisValueContext::AxisValueContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AxisValueContext::AXIS_VALUE() { + return getToken(FeatParser::AXIS_VALUE, 0); +} + +tree::TerminalNode* FeatParser::AxisValueContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::AxisValueContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +std::vector FeatParser::AxisValueContext::axisValueStatement() { + return getRuleContexts(); +} + +FeatParser::AxisValueStatementContext* FeatParser::AxisValueContext::axisValueStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::AxisValueContext::getRuleIndex() const { + return FeatParser::RuleAxisValue; +} + + +antlrcpp::Any FeatParser::AxisValueContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisValue(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisValueContext* FeatParser::axisValue() { + AxisValueContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 130, FeatParser::RuleAxisValue); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(871); + match(FeatParser::AXIS_VALUE); + setState(872); + match(FeatParser::LCBRACE); + setState(874); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(873); + axisValueStatement(); + setState(876); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || ((((_la - 78) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 78)) & ((1ULL << (FeatParser::NAME - 78)) + | (1ULL << (FeatParser::FLAG - 78)) + | (1ULL << (FeatParser::LOCATION - 78)))) != 0)); + setState(878); + match(FeatParser::RCBRACE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisValueStatementContext ------------------------------------------------------------------ + +FeatParser::AxisValueStatementContext::AxisValueStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AxisValueStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::NameEntryContext* FeatParser::AxisValueStatementContext::nameEntry() { + return getRuleContext(0); +} + +FeatParser::AxisValueLocationContext* FeatParser::AxisValueStatementContext::axisValueLocation() { + return getRuleContext(0); +} + +FeatParser::AxisValueFlagsContext* FeatParser::AxisValueStatementContext::axisValueFlags() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::AxisValueStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::AxisValueStatementContext::getRuleIndex() const { + return FeatParser::RuleAxisValueStatement; +} + + +antlrcpp::Any FeatParser::AxisValueStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisValueStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisValueStatementContext* FeatParser::axisValueStatement() { + AxisValueStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 132, FeatParser::RuleAxisValueStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(884); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NAME: { + setState(880); + nameEntry(); + break; + } + + case FeatParser::LOCATION: { + setState(881); + axisValueLocation(); + break; + } + + case FeatParser::FLAG: { + setState(882); + axisValueFlags(); + break; + } + + case FeatParser::INCLUDE: { + setState(883); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(886); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisValueLocationContext ------------------------------------------------------------------ + +FeatParser::AxisValueLocationContext::AxisValueLocationContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AxisValueLocationContext::LOCATION() { + return getToken(FeatParser::LOCATION, 0); +} + +FeatParser::TagContext* FeatParser::AxisValueLocationContext::tag() { + return getRuleContext(0); +} + +std::vector FeatParser::AxisValueLocationContext::fixedNum() { + return getRuleContexts(); +} + +FeatParser::FixedNumContext* FeatParser::AxisValueLocationContext::fixedNum(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::AxisValueLocationContext::getRuleIndex() const { + return FeatParser::RuleAxisValueLocation; +} + + +antlrcpp::Any FeatParser::AxisValueLocationContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisValueLocation(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisValueLocationContext* FeatParser::axisValueLocation() { + AxisValueLocationContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 134, FeatParser::RuleAxisValueLocation); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(888); + match(FeatParser::LOCATION); + setState(889); + tag(); + setState(890); + fixedNum(); + setState(895); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::POINTNUM + + || _la == FeatParser::NUM) { + setState(891); + fixedNum(); + setState(893); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::POINTNUM + + || _la == FeatParser::NUM) { + setState(892); + fixedNum(); + } + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisValueFlagsContext ------------------------------------------------------------------ + +FeatParser::AxisValueFlagsContext::AxisValueFlagsContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AxisValueFlagsContext::FLAG() { + return getToken(FeatParser::FLAG, 0); +} + +std::vector FeatParser::AxisValueFlagsContext::AXIS_OSFA() { + return getTokens(FeatParser::AXIS_OSFA); +} + +tree::TerminalNode* FeatParser::AxisValueFlagsContext::AXIS_OSFA(size_t i) { + return getToken(FeatParser::AXIS_OSFA, i); +} + +std::vector FeatParser::AxisValueFlagsContext::AXIS_EAVN() { + return getTokens(FeatParser::AXIS_EAVN); +} + +tree::TerminalNode* FeatParser::AxisValueFlagsContext::AXIS_EAVN(size_t i) { + return getToken(FeatParser::AXIS_EAVN, i); +} + + +size_t FeatParser::AxisValueFlagsContext::getRuleIndex() const { + return FeatParser::RuleAxisValueFlags; +} + + +antlrcpp::Any FeatParser::AxisValueFlagsContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisValueFlags(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisValueFlagsContext* FeatParser::axisValueFlags() { + AxisValueFlagsContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 136, FeatParser::RuleAxisValueFlags); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(897); + match(FeatParser::FLAG); + setState(899); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(898); + _la = _input->LA(1); + if (!(_la == FeatParser::AXIS_EAVN + + || _la == FeatParser::AXIS_OSFA)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(901); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::AXIS_EAVN + + || _la == FeatParser::AXIS_OSFA); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ElidedFallbackNameContext ------------------------------------------------------------------ + +FeatParser::ElidedFallbackNameContext::ElidedFallbackNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ElidedFallbackNameContext::ELIDED_FALLBACK_NAME() { + return getToken(FeatParser::ELIDED_FALLBACK_NAME, 0); +} + +tree::TerminalNode* FeatParser::ElidedFallbackNameContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::ElidedFallbackNameContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +std::vector FeatParser::ElidedFallbackNameContext::nameEntryStatement() { + return getRuleContexts(); +} + +FeatParser::NameEntryStatementContext* FeatParser::ElidedFallbackNameContext::nameEntryStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::ElidedFallbackNameContext::getRuleIndex() const { + return FeatParser::RuleElidedFallbackName; +} + + +antlrcpp::Any FeatParser::ElidedFallbackNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitElidedFallbackName(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ElidedFallbackNameContext* FeatParser::elidedFallbackName() { + ElidedFallbackNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 138, FeatParser::RuleElidedFallbackName); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(903); + match(FeatParser::ELIDED_FALLBACK_NAME); + setState(904); + match(FeatParser::LCBRACE); + setState(906); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(905); + nameEntryStatement(); + setState(908); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::NAME); + setState(910); + match(FeatParser::RCBRACE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NameEntryStatementContext ------------------------------------------------------------------ + +FeatParser::NameEntryStatementContext::NameEntryStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::NameEntryStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::NameEntryContext* FeatParser::NameEntryStatementContext::nameEntry() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::NameEntryStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::NameEntryStatementContext::getRuleIndex() const { + return FeatParser::RuleNameEntryStatement; +} + + +antlrcpp::Any FeatParser::NameEntryStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNameEntryStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::NameEntryStatementContext* FeatParser::nameEntryStatement() { + NameEntryStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 140, FeatParser::RuleNameEntryStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(914); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NAME: { + setState(912); + nameEntry(); + break; + } + + case FeatParser::INCLUDE: { + setState(913); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(916); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- ElidedFallbackNameIDContext ------------------------------------------------------------------ + +FeatParser::ElidedFallbackNameIDContext::ElidedFallbackNameIDContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::ElidedFallbackNameIDContext::ELIDED_FALLBACK_NAME_ID() { + return getToken(FeatParser::ELIDED_FALLBACK_NAME_ID, 0); +} + +FeatParser::GenNumContext* FeatParser::ElidedFallbackNameIDContext::genNum() { + return getRuleContext(0); +} + + +size_t FeatParser::ElidedFallbackNameIDContext::getRuleIndex() const { + return FeatParser::RuleElidedFallbackNameID; +} + + +antlrcpp::Any FeatParser::ElidedFallbackNameIDContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitElidedFallbackNameID(this); + else + return visitor->visitChildren(this); +} + +FeatParser::ElidedFallbackNameIDContext* FeatParser::elidedFallbackNameID() { + ElidedFallbackNameIDContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 142, FeatParser::RuleElidedFallbackNameID); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(918); + match(FeatParser::ELIDED_FALLBACK_NAME_ID); + setState(919); + genNum(); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NameEntryContext ------------------------------------------------------------------ + +FeatParser::NameEntryContext::NameEntryContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::NameEntryContext::NAME() { + return getToken(FeatParser::NAME, 0); +} + +tree::TerminalNode* FeatParser::NameEntryContext::QUOTE() { + return getToken(FeatParser::QUOTE, 0); +} + +tree::TerminalNode* FeatParser::NameEntryContext::STRVAL() { + return getToken(FeatParser::STRVAL, 0); +} + +tree::TerminalNode* FeatParser::NameEntryContext::EQUOTE() { + return getToken(FeatParser::EQUOTE, 0); +} + +std::vector FeatParser::NameEntryContext::genNum() { + return getRuleContexts(); +} + +FeatParser::GenNumContext* FeatParser::NameEntryContext::genNum(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::NameEntryContext::getRuleIndex() const { + return FeatParser::RuleNameEntry; +} + + +antlrcpp::Any FeatParser::NameEntryContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNameEntry(this); + else + return visitor->visitChildren(this); +} + +FeatParser::NameEntryContext* FeatParser::nameEntry() { + NameEntryContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 144, FeatParser::RuleNameEntry); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(921); + match(FeatParser::NAME); + setState(928); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0)) { + setState(922); + genNum(); + setState(926); + _errHandler->sync(this); + + _la = _input->LA(1); + if (((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0)) { + setState(923); + genNum(); + setState(924); + genNum(); + } + } + setState(930); + match(FeatParser::QUOTE); + setState(931); + match(FeatParser::STRVAL); + setState(932); + match(FeatParser::EQUOTE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Table_vmtxContext ------------------------------------------------------------------ + +FeatParser::Table_vmtxContext::Table_vmtxContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::Table_vmtxContext::VMTX() { + return getTokens(FeatParser::VMTX); +} + +tree::TerminalNode* FeatParser::Table_vmtxContext::VMTX(size_t i) { + return getToken(FeatParser::VMTX, i); +} + +tree::TerminalNode* FeatParser::Table_vmtxContext::LCBRACE() { + return getToken(FeatParser::LCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_vmtxContext::RCBRACE() { + return getToken(FeatParser::RCBRACE, 0); +} + +tree::TerminalNode* FeatParser::Table_vmtxContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +std::vector FeatParser::Table_vmtxContext::vmtxStatement() { + return getRuleContexts(); +} + +FeatParser::VmtxStatementContext* FeatParser::Table_vmtxContext::vmtxStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Table_vmtxContext::getRuleIndex() const { + return FeatParser::RuleTable_vmtx; +} + + +antlrcpp::Any FeatParser::Table_vmtxContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTable_vmtx(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Table_vmtxContext* FeatParser::table_vmtx() { + Table_vmtxContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 146, FeatParser::RuleTable_vmtx); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(934); + match(FeatParser::VMTX); + setState(935); + match(FeatParser::LCBRACE); + setState(937); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(936); + vmtxStatement(); + setState(939); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::INCLUDE || _la == FeatParser::VERT_ORIGIN_Y + + || _la == FeatParser::VERT_ADVANCE_Y); + setState(941); + match(FeatParser::RCBRACE); + setState(942); + match(FeatParser::VMTX); + setState(943); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VmtxStatementContext ------------------------------------------------------------------ + +FeatParser::VmtxStatementContext::VmtxStatementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::VmtxStatementContext::SEMI() { + return getToken(FeatParser::SEMI, 0); +} + +FeatParser::VmtxContext* FeatParser::VmtxStatementContext::vmtx() { + return getRuleContext(0); +} + +FeatParser::IncludeContext* FeatParser::VmtxStatementContext::include() { + return getRuleContext(0); +} + + +size_t FeatParser::VmtxStatementContext::getRuleIndex() const { + return FeatParser::RuleVmtxStatement; +} + + +antlrcpp::Any FeatParser::VmtxStatementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVmtxStatement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::VmtxStatementContext* FeatParser::vmtxStatement() { + VmtxStatementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 148, FeatParser::RuleVmtxStatement); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(947); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::VERT_ORIGIN_Y: + case FeatParser::VERT_ADVANCE_Y: { + setState(945); + vmtx(); + break; + } + + case FeatParser::INCLUDE: { + setState(946); + include(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(949); + match(FeatParser::SEMI); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VmtxContext ------------------------------------------------------------------ + +FeatParser::VmtxContext::VmtxContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::GlyphContext* FeatParser::VmtxContext::glyph() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::VmtxContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + +tree::TerminalNode* FeatParser::VmtxContext::VERT_ORIGIN_Y() { + return getToken(FeatParser::VERT_ORIGIN_Y, 0); +} + +tree::TerminalNode* FeatParser::VmtxContext::VERT_ADVANCE_Y() { + return getToken(FeatParser::VERT_ADVANCE_Y, 0); +} + + +size_t FeatParser::VmtxContext::getRuleIndex() const { + return FeatParser::RuleVmtx; +} + + +antlrcpp::Any FeatParser::VmtxContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVmtx(this); + else + return visitor->visitChildren(this); +} + +FeatParser::VmtxContext* FeatParser::vmtx() { + VmtxContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 150, FeatParser::RuleVmtx); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(951); + _la = _input->LA(1); + if (!(_la == FeatParser::VERT_ORIGIN_Y + + || _la == FeatParser::VERT_ADVANCE_Y)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + setState(952); + glyph(); + setState(953); + match(FeatParser::NUM); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AnchorContext ------------------------------------------------------------------ + +FeatParser::AnchorContext::AnchorContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AnchorContext::BEGINVALUE() { + return getToken(FeatParser::BEGINVALUE, 0); +} + +tree::TerminalNode* FeatParser::AnchorContext::ANCHOR() { + return getToken(FeatParser::ANCHOR, 0); +} + +tree::TerminalNode* FeatParser::AnchorContext::ENDVALUE() { + return getToken(FeatParser::ENDVALUE, 0); +} + +tree::TerminalNode* FeatParser::AnchorContext::KNULL() { + return getToken(FeatParser::KNULL, 0); +} + +FeatParser::LabelContext* FeatParser::AnchorContext::label() { + return getRuleContext(0); +} + +std::vector FeatParser::AnchorContext::NUM() { + return getTokens(FeatParser::NUM); +} + +tree::TerminalNode* FeatParser::AnchorContext::NUM(size_t i) { + return getToken(FeatParser::NUM, i); +} + +tree::TerminalNode* FeatParser::AnchorContext::CONTOURPOINT() { + return getToken(FeatParser::CONTOURPOINT, 0); +} + + +size_t FeatParser::AnchorContext::getRuleIndex() const { + return FeatParser::RuleAnchor; +} + + +antlrcpp::Any FeatParser::AnchorContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAnchor(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AnchorContext* FeatParser::anchor() { + AnchorContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 152, FeatParser::RuleAnchor); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(955); + match(FeatParser::BEGINVALUE); + setState(956); + match(FeatParser::ANCHOR); + setState(965); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NUM: { + setState(957); + dynamic_cast(_localctx)->xval = match(FeatParser::NUM); + setState(958); + dynamic_cast(_localctx)->yval = match(FeatParser::NUM); + setState(961); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::CONTOURPOINT) { + setState(959); + match(FeatParser::CONTOURPOINT); + setState(960); + dynamic_cast(_localctx)->cp = match(FeatParser::NUM); + } + break; + } + + case FeatParser::KNULL: { + setState(963); + match(FeatParser::KNULL); + break; + } + + case FeatParser::NAMELABEL: { + setState(964); + dynamic_cast(_localctx)->name = label(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(967); + match(FeatParser::ENDVALUE); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LookupPatternContext ------------------------------------------------------------------ + +FeatParser::LookupPatternContext::LookupPatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::LookupPatternContext::lookupPatternElement() { + return getRuleContexts(); +} + +FeatParser::LookupPatternElementContext* FeatParser::LookupPatternContext::lookupPatternElement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::LookupPatternContext::getRuleIndex() const { + return FeatParser::RuleLookupPattern; +} + + +antlrcpp::Any FeatParser::LookupPatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLookupPattern(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LookupPatternContext* FeatParser::lookupPattern() { + LookupPatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 154, FeatParser::RuleLookupPattern); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(970); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(969); + lookupPatternElement(); + setState(972); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LookupPatternElementContext ------------------------------------------------------------------ + +FeatParser::LookupPatternElementContext::LookupPatternElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::PatternElementContext* FeatParser::LookupPatternElementContext::patternElement() { + return getRuleContext(0); +} + +std::vector FeatParser::LookupPatternElementContext::LOOKUP() { + return getTokens(FeatParser::LOOKUP); +} + +tree::TerminalNode* FeatParser::LookupPatternElementContext::LOOKUP(size_t i) { + return getToken(FeatParser::LOOKUP, i); +} + +std::vector FeatParser::LookupPatternElementContext::label() { + return getRuleContexts(); +} + +FeatParser::LabelContext* FeatParser::LookupPatternElementContext::label(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::LookupPatternElementContext::getRuleIndex() const { + return FeatParser::RuleLookupPatternElement; +} + + +antlrcpp::Any FeatParser::LookupPatternElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLookupPatternElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LookupPatternElementContext* FeatParser::lookupPatternElement() { + LookupPatternElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 156, FeatParser::RuleLookupPatternElement); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(974); + patternElement(); + setState(979); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::LOOKUP) { + setState(975); + match(FeatParser::LOOKUP); + setState(976); + label(); + setState(981); + _errHandler->sync(this); + _la = _input->LA(1); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PatternContext ------------------------------------------------------------------ + +FeatParser::PatternContext::PatternContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::PatternContext::patternElement() { + return getRuleContexts(); +} + +FeatParser::PatternElementContext* FeatParser::PatternContext::patternElement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::PatternContext::getRuleIndex() const { + return FeatParser::RulePattern; +} + + +antlrcpp::Any FeatParser::PatternContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPattern(this); + else + return visitor->visitChildren(this); +} + +FeatParser::PatternContext* FeatParser::pattern() { + PatternContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 158, FeatParser::RulePattern); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(983); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(982); + patternElement(); + setState(985); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NOTDEF || ((((_la - 117) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 117)) & ((1ULL << (FeatParser::LBRACKET - 117)) + | (1ULL << (FeatParser::GCLASS - 117)) + | (1ULL << (FeatParser::CID - 117)) + | (1ULL << (FeatParser::ESCGNAME - 117)) + | (1ULL << (FeatParser::NAMELABEL - 117)) + | (1ULL << (FeatParser::EXTNAME - 117)))) != 0)); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PatternElementContext ------------------------------------------------------------------ + +FeatParser::PatternElementContext::PatternElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::GlyphClassContext* FeatParser::PatternElementContext::glyphClass() { + return getRuleContext(0); +} + +FeatParser::GlyphContext* FeatParser::PatternElementContext::glyph() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::PatternElementContext::MARKER() { + return getToken(FeatParser::MARKER, 0); +} + + +size_t FeatParser::PatternElementContext::getRuleIndex() const { + return FeatParser::RulePatternElement; +} + + +antlrcpp::Any FeatParser::PatternElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPatternElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::PatternElementContext* FeatParser::patternElement() { + PatternElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 160, FeatParser::RulePatternElement); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(989); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::LBRACKET: + case FeatParser::GCLASS: { + setState(987); + glyphClass(); + break; + } + + case FeatParser::NOTDEF: + case FeatParser::CID: + case FeatParser::ESCGNAME: + case FeatParser::NAMELABEL: + case FeatParser::EXTNAME: { + setState(988); + glyph(); + break; + } + + default: + throw NoViableAltException(this); + } + setState(992); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::MARKER) { + setState(991); + match(FeatParser::MARKER); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GlyphClassOptionalContext ------------------------------------------------------------------ + +FeatParser::GlyphClassOptionalContext::GlyphClassOptionalContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::GlyphClassContext* FeatParser::GlyphClassOptionalContext::glyphClass() { + return getRuleContext(0); +} + + +size_t FeatParser::GlyphClassOptionalContext::getRuleIndex() const { + return FeatParser::RuleGlyphClassOptional; +} + + +antlrcpp::Any FeatParser::GlyphClassOptionalContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGlyphClassOptional(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GlyphClassOptionalContext* FeatParser::glyphClassOptional() { + GlyphClassOptionalContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 162, FeatParser::RuleGlyphClassOptional); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(995); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::LBRACKET + + || _la == FeatParser::GCLASS) { + setState(994); + glyphClass(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GlyphClassContext ------------------------------------------------------------------ + +FeatParser::GlyphClassContext::GlyphClassContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GlyphClassContext::GCLASS() { + return getToken(FeatParser::GCLASS, 0); +} + +FeatParser::GcLiteralContext* FeatParser::GlyphClassContext::gcLiteral() { + return getRuleContext(0); +} + + +size_t FeatParser::GlyphClassContext::getRuleIndex() const { + return FeatParser::RuleGlyphClass; +} + + +antlrcpp::Any FeatParser::GlyphClassContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGlyphClass(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GlyphClassContext* FeatParser::glyphClass() { + GlyphClassContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 164, FeatParser::RuleGlyphClass); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(999); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::GCLASS: { + enterOuterAlt(_localctx, 1); + setState(997); + match(FeatParser::GCLASS); + break; + } + + case FeatParser::LBRACKET: { + enterOuterAlt(_localctx, 2); + setState(998); + gcLiteral(); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GcLiteralContext ------------------------------------------------------------------ + +FeatParser::GcLiteralContext::GcLiteralContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GcLiteralContext::LBRACKET() { + return getToken(FeatParser::LBRACKET, 0); +} + +tree::TerminalNode* FeatParser::GcLiteralContext::RBRACKET() { + return getToken(FeatParser::RBRACKET, 0); +} + +std::vector FeatParser::GcLiteralContext::gcLiteralElement() { + return getRuleContexts(); +} + +FeatParser::GcLiteralElementContext* FeatParser::GcLiteralContext::gcLiteralElement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::GcLiteralContext::getRuleIndex() const { + return FeatParser::RuleGcLiteral; +} + + +antlrcpp::Any FeatParser::GcLiteralContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGcLiteral(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GcLiteralContext* FeatParser::gcLiteral() { + GcLiteralContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 166, FeatParser::RuleGcLiteral); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1001); + match(FeatParser::LBRACKET); + setState(1003); + _errHandler->sync(this); + _la = _input->LA(1); + do { + setState(1002); + gcLiteralElement(); + setState(1005); + _errHandler->sync(this); + _la = _input->LA(1); + } while (_la == FeatParser::NOTDEF || ((((_la - 125) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 125)) & ((1ULL << (FeatParser::GCLASS - 125)) + | (1ULL << (FeatParser::CID - 125)) + | (1ULL << (FeatParser::ESCGNAME - 125)) + | (1ULL << (FeatParser::NAMELABEL - 125)) + | (1ULL << (FeatParser::EXTNAME - 125)))) != 0)); + setState(1007); + match(FeatParser::RBRACKET); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GcLiteralElementContext ------------------------------------------------------------------ + +FeatParser::GcLiteralElementContext::GcLiteralElementContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +std::vector FeatParser::GcLiteralElementContext::glyph() { + return getRuleContexts(); +} + +FeatParser::GlyphContext* FeatParser::GcLiteralElementContext::glyph(size_t i) { + return getRuleContext(i); +} + +tree::TerminalNode* FeatParser::GcLiteralElementContext::HYPHEN() { + return getToken(FeatParser::HYPHEN, 0); +} + +tree::TerminalNode* FeatParser::GcLiteralElementContext::GCLASS() { + return getToken(FeatParser::GCLASS, 0); +} + + +size_t FeatParser::GcLiteralElementContext::getRuleIndex() const { + return FeatParser::RuleGcLiteralElement; +} + + +antlrcpp::Any FeatParser::GcLiteralElementContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGcLiteralElement(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GcLiteralElementContext* FeatParser::gcLiteralElement() { + GcLiteralElementContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 168, FeatParser::RuleGcLiteralElement); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(1015); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NOTDEF: + case FeatParser::CID: + case FeatParser::ESCGNAME: + case FeatParser::NAMELABEL: + case FeatParser::EXTNAME: { + enterOuterAlt(_localctx, 1); + setState(1009); + dynamic_cast(_localctx)->startg = glyph(); + setState(1012); + _errHandler->sync(this); + + _la = _input->LA(1); + if (_la == FeatParser::HYPHEN) { + setState(1010); + match(FeatParser::HYPHEN); + setState(1011); + dynamic_cast(_localctx)->endg = glyph(); + } + break; + } + + case FeatParser::GCLASS: { + enterOuterAlt(_localctx, 2); + setState(1014); + match(FeatParser::GCLASS); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GlyphContext ------------------------------------------------------------------ + +FeatParser::GlyphContext::GlyphContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +FeatParser::GlyphNameContext* FeatParser::GlyphContext::glyphName() { + return getRuleContext(0); +} + +tree::TerminalNode* FeatParser::GlyphContext::CID() { + return getToken(FeatParser::CID, 0); +} + + +size_t FeatParser::GlyphContext::getRuleIndex() const { + return FeatParser::RuleGlyph; +} + + +antlrcpp::Any FeatParser::GlyphContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGlyph(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GlyphContext* FeatParser::glyph() { + GlyphContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 170, FeatParser::RuleGlyph); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + setState(1019); + _errHandler->sync(this); + switch (_input->LA(1)) { + case FeatParser::NOTDEF: + case FeatParser::ESCGNAME: + case FeatParser::NAMELABEL: + case FeatParser::EXTNAME: { + enterOuterAlt(_localctx, 1); + setState(1017); + glyphName(); + break; + } + + case FeatParser::CID: { + enterOuterAlt(_localctx, 2); + setState(1018); + match(FeatParser::CID); + break; + } + + default: + throw NoViableAltException(this); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GlyphNameContext ------------------------------------------------------------------ + +FeatParser::GlyphNameContext::GlyphNameContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GlyphNameContext::ESCGNAME() { + return getToken(FeatParser::ESCGNAME, 0); +} + +tree::TerminalNode* FeatParser::GlyphNameContext::NAMELABEL() { + return getToken(FeatParser::NAMELABEL, 0); +} + +tree::TerminalNode* FeatParser::GlyphNameContext::EXTNAME() { + return getToken(FeatParser::EXTNAME, 0); +} + +tree::TerminalNode* FeatParser::GlyphNameContext::NOTDEF() { + return getToken(FeatParser::NOTDEF, 0); +} + + +size_t FeatParser::GlyphNameContext::getRuleIndex() const { + return FeatParser::RuleGlyphName; +} + + +antlrcpp::Any FeatParser::GlyphNameContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGlyphName(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GlyphNameContext* FeatParser::glyphName() { + GlyphNameContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 172, FeatParser::RuleGlyphName); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1021); + _la = _input->LA(1); + if (!(_la == FeatParser::NOTDEF || ((((_la - 127) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 127)) & ((1ULL << (FeatParser::ESCGNAME - 127)) + | (1ULL << (FeatParser::NAMELABEL - 127)) + | (1ULL << (FeatParser::EXTNAME - 127)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- LabelContext ------------------------------------------------------------------ + +FeatParser::LabelContext::LabelContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::LabelContext::NAMELABEL() { + return getToken(FeatParser::NAMELABEL, 0); +} + + +size_t FeatParser::LabelContext::getRuleIndex() const { + return FeatParser::RuleLabel; +} + + +antlrcpp::Any FeatParser::LabelContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitLabel(this); + else + return visitor->visitChildren(this); +} + +FeatParser::LabelContext* FeatParser::label() { + LabelContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 174, FeatParser::RuleLabel); + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1023); + match(FeatParser::NAMELABEL); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- TagContext ------------------------------------------------------------------ + +FeatParser::TagContext::TagContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::TagContext::NAMELABEL() { + return getToken(FeatParser::NAMELABEL, 0); +} + +tree::TerminalNode* FeatParser::TagContext::EXTNAME() { + return getToken(FeatParser::EXTNAME, 0); +} + +tree::TerminalNode* FeatParser::TagContext::CATCHTAG() { + return getToken(FeatParser::CATCHTAG, 0); +} + +tree::TerminalNode* FeatParser::TagContext::MARK() { + return getToken(FeatParser::MARK, 0); +} + + +size_t FeatParser::TagContext::getRuleIndex() const { + return FeatParser::RuleTag; +} + + +antlrcpp::Any FeatParser::TagContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitTag(this); + else + return visitor->visitChildren(this); +} + +FeatParser::TagContext* FeatParser::tag() { + TagContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 176, FeatParser::RuleTag); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1025); + _la = _input->LA(1); + if (!(_la == FeatParser::MARK || ((((_la - 128) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 128)) & ((1ULL << (FeatParser::NAMELABEL - 128)) + | (1ULL << (FeatParser::EXTNAME - 128)) + | (1ULL << (FeatParser::CATCHTAG - 128)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FixedNumContext ------------------------------------------------------------------ + +FeatParser::FixedNumContext::FixedNumContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::FixedNumContext::POINTNUM() { + return getToken(FeatParser::POINTNUM, 0); +} + +tree::TerminalNode* FeatParser::FixedNumContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + + +size_t FeatParser::FixedNumContext::getRuleIndex() const { + return FeatParser::RuleFixedNum; +} + + +antlrcpp::Any FeatParser::FixedNumContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFixedNum(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FixedNumContext* FeatParser::fixedNum() { + FixedNumContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 178, FeatParser::RuleFixedNum); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1027); + _la = _input->LA(1); + if (!(_la == FeatParser::POINTNUM + + || _la == FeatParser::NUM)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GenNumContext ------------------------------------------------------------------ + +FeatParser::GenNumContext::GenNumContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GenNumContext::NUM() { + return getToken(FeatParser::NUM, 0); +} + +tree::TerminalNode* FeatParser::GenNumContext::NUMOCT() { + return getToken(FeatParser::NUMOCT, 0); +} + +tree::TerminalNode* FeatParser::GenNumContext::NUMEXT() { + return getToken(FeatParser::NUMEXT, 0); +} + + +size_t FeatParser::GenNumContext::getRuleIndex() const { + return FeatParser::RuleGenNum; +} + + +antlrcpp::Any FeatParser::GenNumContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGenNum(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GenNumContext* FeatParser::genNum() { + GenNumContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 180, FeatParser::RuleGenNum); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1029); + _la = _input->LA(1); + if (!(((((_la - 131) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 131)) & ((1ULL << (FeatParser::NUMEXT - 131)) + | (1ULL << (FeatParser::NUMOCT - 131)) + | (1ULL << (FeatParser::NUM - 131)))) != 0))) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- FeatureFileContext ------------------------------------------------------------------ + +FeatParser::FeatureFileContext::FeatureFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::FeatureFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::FeatureFileContext::featureStatement() { + return getRuleContexts(); +} + +FeatParser::FeatureStatementContext* FeatParser::FeatureFileContext::featureStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::FeatureFileContext::getRuleIndex() const { + return FeatParser::RuleFeatureFile; +} + + +antlrcpp::Any FeatParser::FeatureFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitFeatureFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::FeatureFileContext* FeatParser::featureFile() { + FeatureFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 182, FeatParser::RuleFeatureFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1034); + _errHandler->sync(this); + _la = _input->LA(1); + while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::FEATURE) + | (1ULL << FeatParser::SCRIPT) + | (1ULL << FeatParser::LANGUAGE) + | (1ULL << FeatParser::SUBTABLE) + | (1ULL << FeatParser::LOOKUP) + | (1ULL << FeatParser::LOOKUPFLAG) + | (1ULL << FeatParser::ENUMERATE) + | (1ULL << FeatParser::ENUMERATE_v) + | (1ULL << FeatParser::EXCEPT) + | (1ULL << FeatParser::IGNORE) + | (1ULL << FeatParser::SUBSTITUTE) + | (1ULL << FeatParser::SUBSTITUTE_v) + | (1ULL << FeatParser::REVERSE) + | (1ULL << FeatParser::REVERSE_v) + | (1ULL << FeatParser::POSITION) + | (1ULL << FeatParser::POSITION_v) + | (1ULL << FeatParser::PARAMETERS) + | (1ULL << FeatParser::FEATURE_NAMES) + | (1ULL << FeatParser::CV_PARAMETERS) + | (1ULL << FeatParser::SIZEMENUNAME) + | (1ULL << FeatParser::MARK_CLASS))) != 0) || _la == FeatParser::GCLASS) { + setState(1031); + featureStatement(); + setState(1036); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1037); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- StatementFileContext ------------------------------------------------------------------ + +FeatParser::StatementFileContext::StatementFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::StatementFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::StatementFileContext::statement() { + return getRuleContexts(); +} + +FeatParser::StatementContext* FeatParser::StatementFileContext::statement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::StatementFileContext::getRuleIndex() const { + return FeatParser::RuleStatementFile; +} + + +antlrcpp::Any FeatParser::StatementFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitStatementFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::StatementFileContext* FeatParser::statementFile() { + StatementFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 184, FeatParser::RuleStatementFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1042); + _errHandler->sync(this); + _la = _input->LA(1); + while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::FEATURE) + | (1ULL << FeatParser::SCRIPT) + | (1ULL << FeatParser::LANGUAGE) + | (1ULL << FeatParser::SUBTABLE) + | (1ULL << FeatParser::LOOKUPFLAG) + | (1ULL << FeatParser::ENUMERATE) + | (1ULL << FeatParser::ENUMERATE_v) + | (1ULL << FeatParser::EXCEPT) + | (1ULL << FeatParser::IGNORE) + | (1ULL << FeatParser::SUBSTITUTE) + | (1ULL << FeatParser::SUBSTITUTE_v) + | (1ULL << FeatParser::REVERSE) + | (1ULL << FeatParser::REVERSE_v) + | (1ULL << FeatParser::POSITION) + | (1ULL << FeatParser::POSITION_v) + | (1ULL << FeatParser::PARAMETERS) + | (1ULL << FeatParser::FEATURE_NAMES) + | (1ULL << FeatParser::SIZEMENUNAME) + | (1ULL << FeatParser::MARK_CLASS))) != 0) || _la == FeatParser::GCLASS) { + setState(1039); + statement(); + setState(1044); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1045); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- CvStatementFileContext ------------------------------------------------------------------ + +FeatParser::CvStatementFileContext::CvStatementFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::CvStatementFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::CvStatementFileContext::cvParameterStatement() { + return getRuleContexts(); +} + +FeatParser::CvParameterStatementContext* FeatParser::CvStatementFileContext::cvParameterStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::CvStatementFileContext::getRuleIndex() const { + return FeatParser::RuleCvStatementFile; +} + + +antlrcpp::Any FeatParser::CvStatementFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitCvStatementFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::CvStatementFileContext* FeatParser::cvStatementFile() { + CvStatementFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 186, FeatParser::RuleCvStatementFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1050); + _errHandler->sync(this); + _la = _input->LA(1); + while ((((_la & ~ 0x3fULL) == 0) && + ((1ULL << _la) & ((1ULL << FeatParser::INCLUDE) + | (1ULL << FeatParser::CV_UI_LABEL) + | (1ULL << FeatParser::CV_TOOLTIP) + | (1ULL << FeatParser::CV_SAMPLE_TEXT) + | (1ULL << FeatParser::CV_PARAM_LABEL) + | (1ULL << FeatParser::CV_CHARACTER))) != 0)) { + setState(1047); + cvParameterStatement(); + setState(1052); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1053); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- BaseFileContext ------------------------------------------------------------------ + +FeatParser::BaseFileContext::BaseFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::BaseFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::BaseFileContext::baseStatement() { + return getRuleContexts(); +} + +FeatParser::BaseStatementContext* FeatParser::BaseFileContext::baseStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::BaseFileContext::getRuleIndex() const { + return FeatParser::RuleBaseFile; +} + + +antlrcpp::Any FeatParser::BaseFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitBaseFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::BaseFileContext* FeatParser::baseFile() { + BaseFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 188, FeatParser::RuleBaseFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1058); + _errHandler->sync(this); + _la = _input->LA(1); + while (((((_la - 5) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 5)) & ((1ULL << (FeatParser::INCLUDE - 5)) + | (1ULL << (FeatParser::HA_BTL - 5)) + | (1ULL << (FeatParser::VA_BTL - 5)) + | (1ULL << (FeatParser::HA_BSL - 5)) + | (1ULL << (FeatParser::VA_BSL - 5)))) != 0)) { + setState(1055); + baseStatement(); + setState(1060); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1061); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- HeadFileContext ------------------------------------------------------------------ + +FeatParser::HeadFileContext::HeadFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::HeadFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::HeadFileContext::headStatement() { + return getRuleContexts(); +} + +FeatParser::HeadStatementContext* FeatParser::HeadFileContext::headStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::HeadFileContext::getRuleIndex() const { + return FeatParser::RuleHeadFile; +} + + +antlrcpp::Any FeatParser::HeadFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitHeadFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::HeadFileContext* FeatParser::headFile() { + HeadFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 190, FeatParser::RuleHeadFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1066); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || _la == FeatParser::FONT_REVISION) { + setState(1063); + headStatement(); + setState(1068); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1069); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- HheaFileContext ------------------------------------------------------------------ + +FeatParser::HheaFileContext::HheaFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::HheaFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::HheaFileContext::hheaStatement() { + return getRuleContexts(); +} + +FeatParser::HheaStatementContext* FeatParser::HheaFileContext::hheaStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::HheaFileContext::getRuleIndex() const { + return FeatParser::RuleHheaFile; +} + + +antlrcpp::Any FeatParser::HheaFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitHheaFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::HheaFileContext* FeatParser::hheaFile() { + HheaFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 192, FeatParser::RuleHheaFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1074); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 74) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 74)) & ((1ULL << (FeatParser::ASCENDER - 74)) + | (1ULL << (FeatParser::DESCENDER - 74)) + | (1ULL << (FeatParser::LINE_GAP - 74)) + | (1ULL << (FeatParser::CARET_OFFSET - 74)))) != 0)) { + setState(1071); + hheaStatement(); + setState(1076); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1077); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VheaFileContext ------------------------------------------------------------------ + +FeatParser::VheaFileContext::VheaFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::VheaFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::VheaFileContext::vheaStatement() { + return getRuleContexts(); +} + +FeatParser::VheaStatementContext* FeatParser::VheaFileContext::vheaStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::VheaFileContext::getRuleIndex() const { + return FeatParser::RuleVheaFile; +} + + +antlrcpp::Any FeatParser::VheaFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVheaFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::VheaFileContext* FeatParser::vheaFile() { + VheaFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 194, FeatParser::RuleVheaFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1082); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 109) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 109)) & ((1ULL << (FeatParser::VERT_TYPO_ASCENDER - 109)) + | (1ULL << (FeatParser::VERT_TYPO_DESCENDER - 109)) + | (1ULL << (FeatParser::VERT_TYPO_LINE_GAP - 109)))) != 0)) { + setState(1079); + vheaStatement(); + setState(1084); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1085); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- GdefFileContext ------------------------------------------------------------------ + +FeatParser::GdefFileContext::GdefFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::GdefFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::GdefFileContext::gdefStatement() { + return getRuleContexts(); +} + +FeatParser::GdefStatementContext* FeatParser::GdefFileContext::gdefStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::GdefFileContext::getRuleIndex() const { + return FeatParser::RuleGdefFile; +} + + +antlrcpp::Any FeatParser::GdefFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitGdefFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::GdefFileContext* FeatParser::gdefFile() { + GdefFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 196, FeatParser::RuleGdefFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1090); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 67) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 67)) & ((1ULL << (FeatParser::GLYPH_CLASS_DEF - 67)) + | (1ULL << (FeatParser::ATTACH - 67)) + | (1ULL << (FeatParser::LIG_CARET_BY_POS - 67)) + | (1ULL << (FeatParser::LIG_CARET_BY_IDX - 67)))) != 0)) { + setState(1087); + gdefStatement(); + setState(1092); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1093); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NameFileContext ------------------------------------------------------------------ + +FeatParser::NameFileContext::NameFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::NameFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::NameFileContext::nameStatement() { + return getRuleContexts(); +} + +FeatParser::NameStatementContext* FeatParser::NameFileContext::nameStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::NameFileContext::getRuleIndex() const { + return FeatParser::RuleNameFile; +} + + +antlrcpp::Any FeatParser::NameFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNameFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::NameFileContext* FeatParser::nameFile() { + NameFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 198, FeatParser::RuleNameFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1098); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || _la == FeatParser::NAMEID) { + setState(1095); + nameStatement(); + setState(1100); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1101); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- VmtxFileContext ------------------------------------------------------------------ + +FeatParser::VmtxFileContext::VmtxFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::VmtxFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::VmtxFileContext::vmtxStatement() { + return getRuleContexts(); +} + +FeatParser::VmtxStatementContext* FeatParser::VmtxFileContext::vmtxStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::VmtxFileContext::getRuleIndex() const { + return FeatParser::RuleVmtxFile; +} + + +antlrcpp::Any FeatParser::VmtxFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitVmtxFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::VmtxFileContext* FeatParser::vmtxFile() { + VmtxFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 200, FeatParser::RuleVmtxFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1106); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || _la == FeatParser::VERT_ORIGIN_Y + + || _la == FeatParser::VERT_ADVANCE_Y) { + setState(1103); + vmtxStatement(); + setState(1108); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1109); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- Os_2FileContext ------------------------------------------------------------------ + +FeatParser::Os_2FileContext::Os_2FileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::Os_2FileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::Os_2FileContext::os_2Statement() { + return getRuleContexts(); +} + +FeatParser::Os_2StatementContext* FeatParser::Os_2FileContext::os_2Statement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::Os_2FileContext::getRuleIndex() const { + return FeatParser::RuleOs_2File; +} + + +antlrcpp::Any FeatParser::Os_2FileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitOs_2File(this); + else + return visitor->visitChildren(this); +} + +FeatParser::Os_2FileContext* FeatParser::os_2File() { + Os_2FileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 202, FeatParser::RuleOs_2File); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1114); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 81) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 81)) & ((1ULL << (FeatParser::FS_TYPE - 81)) + | (1ULL << (FeatParser::FS_TYPE_v - 81)) + | (1ULL << (FeatParser::OS2_LOWER_OP_SIZE - 81)) + | (1ULL << (FeatParser::OS2_UPPER_OP_SIZE - 81)) + | (1ULL << (FeatParser::PANOSE - 81)) + | (1ULL << (FeatParser::TYPO_ASCENDER - 81)) + | (1ULL << (FeatParser::TYPO_DESCENDER - 81)) + | (1ULL << (FeatParser::TYPO_LINE_GAP - 81)) + | (1ULL << (FeatParser::WIN_ASCENT - 81)) + | (1ULL << (FeatParser::WIN_DESCENT - 81)) + | (1ULL << (FeatParser::X_HEIGHT - 81)) + | (1ULL << (FeatParser::CAP_HEIGHT - 81)) + | (1ULL << (FeatParser::WEIGHT_CLASS - 81)) + | (1ULL << (FeatParser::WIDTH_CLASS - 81)) + | (1ULL << (FeatParser::VENDOR - 81)) + | (1ULL << (FeatParser::UNICODE_RANGE - 81)) + | (1ULL << (FeatParser::CODE_PAGE_RANGE - 81)) + | (1ULL << (FeatParser::FAMILY_CLASS - 81)))) != 0)) { + setState(1111); + os_2Statement(); + setState(1116); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1117); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- StatFileContext ------------------------------------------------------------------ + +FeatParser::StatFileContext::StatFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::StatFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::StatFileContext::statStatement() { + return getRuleContexts(); +} + +FeatParser::StatStatementContext* FeatParser::StatFileContext::statStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::StatFileContext::getRuleIndex() const { + return FeatParser::RuleStatFile; +} + + +antlrcpp::Any FeatParser::StatFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitStatFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::StatFileContext* FeatParser::statFile() { + StatFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 204, FeatParser::RuleStatFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1122); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 100) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 100)) & ((1ULL << (FeatParser::ELIDED_FALLBACK_NAME - 100)) + | (1ULL << (FeatParser::ELIDED_FALLBACK_NAME_ID - 100)) + | (1ULL << (FeatParser::DESIGN_AXIS - 100)) + | (1ULL << (FeatParser::AXIS_VALUE - 100)))) != 0)) { + setState(1119); + statStatement(); + setState(1124); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1125); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AxisValueFileContext ------------------------------------------------------------------ + +FeatParser::AxisValueFileContext::AxisValueFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AxisValueFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::AxisValueFileContext::axisValueStatement() { + return getRuleContexts(); +} + +FeatParser::AxisValueStatementContext* FeatParser::AxisValueFileContext::axisValueStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::AxisValueFileContext::getRuleIndex() const { + return FeatParser::RuleAxisValueFile; +} + + +antlrcpp::Any FeatParser::AxisValueFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAxisValueFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AxisValueFileContext* FeatParser::axisValueFile() { + AxisValueFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 206, FeatParser::RuleAxisValueFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1130); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || ((((_la - 78) & ~ 0x3fULL) == 0) && + ((1ULL << (_la - 78)) & ((1ULL << (FeatParser::NAME - 78)) + | (1ULL << (FeatParser::FLAG - 78)) + | (1ULL << (FeatParser::LOCATION - 78)))) != 0)) { + setState(1127); + axisValueStatement(); + setState(1132); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1133); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- NameEntryFileContext ------------------------------------------------------------------ + +FeatParser::NameEntryFileContext::NameEntryFileContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::NameEntryFileContext::EOF() { + return getToken(FeatParser::EOF, 0); +} + +std::vector FeatParser::NameEntryFileContext::nameEntryStatement() { + return getRuleContexts(); +} + +FeatParser::NameEntryStatementContext* FeatParser::NameEntryFileContext::nameEntryStatement(size_t i) { + return getRuleContext(i); +} + + +size_t FeatParser::NameEntryFileContext::getRuleIndex() const { + return FeatParser::RuleNameEntryFile; +} + + +antlrcpp::Any FeatParser::NameEntryFileContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitNameEntryFile(this); + else + return visitor->visitChildren(this); +} + +FeatParser::NameEntryFileContext* FeatParser::nameEntryFile() { + NameEntryFileContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 208, FeatParser::RuleNameEntryFile); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1138); + _errHandler->sync(this); + _la = _input->LA(1); + while (_la == FeatParser::INCLUDE || _la == FeatParser::NAME) { + setState(1135); + nameEntryStatement(); + setState(1140); + _errHandler->sync(this); + _la = _input->LA(1); + } + setState(1141); + match(FeatParser::EOF); + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- SubtokContext ------------------------------------------------------------------ + +FeatParser::SubtokContext::SubtokContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::SubtokContext::SUBSTITUTE() { + return getToken(FeatParser::SUBSTITUTE, 0); +} + +tree::TerminalNode* FeatParser::SubtokContext::SUBSTITUTE_v() { + return getToken(FeatParser::SUBSTITUTE_v, 0); +} + + +size_t FeatParser::SubtokContext::getRuleIndex() const { + return FeatParser::RuleSubtok; +} + + +antlrcpp::Any FeatParser::SubtokContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitSubtok(this); + else + return visitor->visitChildren(this); +} + +FeatParser::SubtokContext* FeatParser::subtok() { + SubtokContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 210, FeatParser::RuleSubtok); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1143); + _la = _input->LA(1); + if (!(_la == FeatParser::SUBSTITUTE + + || _la == FeatParser::SUBSTITUTE_v)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- RevtokContext ------------------------------------------------------------------ + +FeatParser::RevtokContext::RevtokContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::RevtokContext::REVERSE() { + return getToken(FeatParser::REVERSE, 0); +} + +tree::TerminalNode* FeatParser::RevtokContext::REVERSE_v() { + return getToken(FeatParser::REVERSE_v, 0); +} + + +size_t FeatParser::RevtokContext::getRuleIndex() const { + return FeatParser::RuleRevtok; +} + + +antlrcpp::Any FeatParser::RevtokContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitRevtok(this); + else + return visitor->visitChildren(this); +} + +FeatParser::RevtokContext* FeatParser::revtok() { + RevtokContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 212, FeatParser::RuleRevtok); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1145); + _la = _input->LA(1); + if (!(_la == FeatParser::REVERSE + + || _la == FeatParser::REVERSE_v)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- AnontokContext ------------------------------------------------------------------ + +FeatParser::AnontokContext::AnontokContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::AnontokContext::ANON() { + return getToken(FeatParser::ANON, 0); +} + +tree::TerminalNode* FeatParser::AnontokContext::ANON_v() { + return getToken(FeatParser::ANON_v, 0); +} + + +size_t FeatParser::AnontokContext::getRuleIndex() const { + return FeatParser::RuleAnontok; +} + + +antlrcpp::Any FeatParser::AnontokContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitAnontok(this); + else + return visitor->visitChildren(this); +} + +FeatParser::AnontokContext* FeatParser::anontok() { + AnontokContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 214, FeatParser::RuleAnontok); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1147); + _la = _input->LA(1); + if (!(_la == FeatParser::ANON + + || _la == FeatParser::ANON_v)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- EnumtokContext ------------------------------------------------------------------ + +FeatParser::EnumtokContext::EnumtokContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::EnumtokContext::ENUMERATE() { + return getToken(FeatParser::ENUMERATE, 0); +} + +tree::TerminalNode* FeatParser::EnumtokContext::ENUMERATE_v() { + return getToken(FeatParser::ENUMERATE_v, 0); +} + + +size_t FeatParser::EnumtokContext::getRuleIndex() const { + return FeatParser::RuleEnumtok; +} + + +antlrcpp::Any FeatParser::EnumtokContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitEnumtok(this); + else + return visitor->visitChildren(this); +} + +FeatParser::EnumtokContext* FeatParser::enumtok() { + EnumtokContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 216, FeatParser::RuleEnumtok); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1149); + _la = _input->LA(1); + if (!(_la == FeatParser::ENUMERATE + + || _la == FeatParser::ENUMERATE_v)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- PostokContext ------------------------------------------------------------------ + +FeatParser::PostokContext::PostokContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::PostokContext::POSITION() { + return getToken(FeatParser::POSITION, 0); +} + +tree::TerminalNode* FeatParser::PostokContext::POSITION_v() { + return getToken(FeatParser::POSITION_v, 0); +} + + +size_t FeatParser::PostokContext::getRuleIndex() const { + return FeatParser::RulePostok; +} + + +antlrcpp::Any FeatParser::PostokContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitPostok(this); + else + return visitor->visitChildren(this); +} + +FeatParser::PostokContext* FeatParser::postok() { + PostokContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 218, FeatParser::RulePostok); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1151); + _la = _input->LA(1); + if (!(_la == FeatParser::POSITION + + || _la == FeatParser::POSITION_v)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +//----------------- MarkligtokContext ------------------------------------------------------------------ + +FeatParser::MarkligtokContext::MarkligtokContext(ParserRuleContext *parent, size_t invokingState) + : ParserRuleContext(parent, invokingState) { +} + +tree::TerminalNode* FeatParser::MarkligtokContext::MARKLIG() { + return getToken(FeatParser::MARKLIG, 0); +} + +tree::TerminalNode* FeatParser::MarkligtokContext::MARKLIG_v() { + return getToken(FeatParser::MARKLIG_v, 0); +} + + +size_t FeatParser::MarkligtokContext::getRuleIndex() const { + return FeatParser::RuleMarkligtok; +} + + +antlrcpp::Any FeatParser::MarkligtokContext::accept(tree::ParseTreeVisitor *visitor) { + if (auto parserVisitor = dynamic_cast(visitor)) + return parserVisitor->visitMarkligtok(this); + else + return visitor->visitChildren(this); +} + +FeatParser::MarkligtokContext* FeatParser::markligtok() { + MarkligtokContext *_localctx = _tracker.createInstance(_ctx, getState()); + enterRule(_localctx, 220, FeatParser::RuleMarkligtok); + size_t _la = 0; + +#if __cplusplus > 201703L + auto onExit = finally([=, this] { +#else + auto onExit = finally([=] { +#endif + exitRule(); + }); + try { + enterOuterAlt(_localctx, 1); + setState(1153); + _la = _input->LA(1); + if (!(_la == FeatParser::MARKLIG + + || _la == FeatParser::MARKLIG_v)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } + + } + catch (RecognitionException &e) { + _errHandler->reportError(this, e); + _localctx->exception = std::current_exception(); + _errHandler->recover(this, _localctx->exception); + } + + return _localctx; +} + +// Static vars and initialization. +std::vector FeatParser::_decisionToDFA; +atn::PredictionContextCache FeatParser::_sharedContextCache; + +// We own the ATN which in turn owns the ATN states. +atn::ATN FeatParser::_atn; +std::vector FeatParser::_serializedATN; + +std::vector FeatParser::_ruleNames = { + "file", "topLevelStatement", "include", "glyphClassAssign", "langsysAssign", + "mark_statement", "anchorDef", "valueRecordDef", "featureBlock", "tableBlock", + "anonBlock", "lookupBlockTopLevel", "featureStatement", "lookupBlockOrUse", + "cvParameterBlock", "cvParameterStatement", "cvParameter", "statement", + "featureUse", "scriptAssign", "langAssign", "lookupflagAssign", "lookupflagElement", + "ignoreSubOrPos", "substitute", "position", "valuePattern", "valueRecord", + "valueLiteral", "cursiveElement", "baseToMarkElement", "ligatureMarkElement", + "parameters", "sizemenuname", "featureNames", "subtable", "table_BASE", + "baseStatement", "axisTags", "axisScripts", "baseScript", "table_GDEF", + "gdefStatement", "gdefGlyphClass", "gdefAttach", "gdefLigCaretPos", "gdefLigCaretIndex", + "table_head", "headStatement", "head", "table_hhea", "hheaStatement", + "hhea", "table_vhea", "vheaStatement", "vhea", "table_name", "nameStatement", + "nameID", "table_OS_2", "os_2Statement", "os_2", "table_STAT", "statStatement", + "designAxis", "axisValue", "axisValueStatement", "axisValueLocation", + "axisValueFlags", "elidedFallbackName", "nameEntryStatement", "elidedFallbackNameID", + "nameEntry", "table_vmtx", "vmtxStatement", "vmtx", "anchor", "lookupPattern", + "lookupPatternElement", "pattern", "patternElement", "glyphClassOptional", + "glyphClass", "gcLiteral", "gcLiteralElement", "glyph", "glyphName", "label", + "tag", "fixedNum", "genNum", "featureFile", "statementFile", "cvStatementFile", + "baseFile", "headFile", "hheaFile", "vheaFile", "gdefFile", "nameFile", + "vmtxFile", "os_2File", "statFile", "axisValueFile", "nameEntryFile", + "subtok", "revtok", "anontok", "enumtok", "postok", "markligtok" +}; + +std::vector FeatParser::_literalNames = { + "", "'anon'", "'anonymous'", "", "", "'include'", "'feature'", "'table'", + "'script'", "'language'", "'languagesystem'", "'subtable'", "'lookup'", + "'lookupflag'", "'.notdef'", "'RightToLeft'", "'IgnoreBaseGlyphs'", "'IgnoreLigatures'", + "'IgnoreMarks'", "'UseMarkFilteringSet'", "'MarkAttachmentType'", "'excludeDFLT'", + "'includeDFLT'", "'exclude_dflt'", "'include_dflt'", "'useExtension'", + "'<'", "'>'", "'enumerate'", "'enum'", "'except'", "'ignore'", "'substitute'", + "'sub'", "'reversesub'", "'rsub'", "'by'", "'from'", "'position'", "'pos'", + "'parameters'", "'featureNames'", "'cvParameters'", "'FeatUILabelNameID'", + "'FeatUITooltipTextNameID'", "'SampleTextNameID'", "'ParamUILabelNameID'", + "'Character'", "'sizemenuname'", "'contourpoint'", "'anchor'", "'anchorDef'", + "'valueRecordDef'", "'mark'", "'markClass'", "'cursive'", "'base'", "'ligature'", + "'lig'", "'ligComponent'", "'NULL'", "'BASE'", "'HorizAxis.BaseTagList'", + "'VertAxis.BaseTagList'", "'HorizAxis.BaseScriptList'", "'VertAxis.BaseScriptList'", + "'GDEF'", "'GlyphClassDef'", "'Attach'", "'LigatureCaretByPos'", "'LigatureCaretByIndex'", + "'head'", "'FontRevision'", "'hhea'", "'Ascender'", "'Descender'", "'LineGap'", + "'CaretOffset'", "'name'", "'nameid'", "'OS/2'", "'FSType'", "'fsType'", + "'LowerOpSize'", "'UpperOpSize'", "'Panose'", "'TypoAscender'", "'TypoDescender'", + "'TypoLineGap'", "'winAscent'", "'winDescent'", "'XHeight'", "'CapHeight'", + "'WeightClass'", "'WidthClass'", "'Vendor'", "'UnicodeRange'", "'CodePageRange'", + "'FamilyClass'", "'STAT'", "'ElidedFallbackName'", "'ElidedFallbackNameID'", + "'DesignAxis'", "'AxisValue'", "'flag'", "'location'", "'ElidableAxisValueName'", + "'OlderSiblingFontAttribute'", "'vhea'", "'VertTypoAscender'", "'VertTypoDescender'", + "'VertTypoLineGap'", "'vmtx'", "'VertOriginY'", "'VertAdvanceY'", "", + "'}'", "'['", "']'", "'-'", "';'", "'='", "'''", "','", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "'('", "", "')'" +}; + +std::vector FeatParser::_symbolicNames = { + "", "ANON", "ANON_v", "COMMENT", "WHITESPACE", "INCLUDE", "FEATURE", "TABLE", + "SCRIPT", "LANGUAGE", "LANGSYS", "SUBTABLE", "LOOKUP", "LOOKUPFLAG", "NOTDEF", + "RIGHT_TO_LEFT", "IGNORE_BASE_GLYPHS", "IGNORE_LIGATURES", "IGNORE_MARKS", + "USE_MARK_FILTERING_SET", "MARK_ATTACHMENT_TYPE", "EXCLUDE_DFLT", "INCLUDE_DFLT", + "EXCLUDE_dflt", "INCLUDE_dflt", "USE_EXTENSION", "BEGINVALUE", "ENDVALUE", + "ENUMERATE", "ENUMERATE_v", "EXCEPT", "IGNORE", "SUBSTITUTE", "SUBSTITUTE_v", + "REVERSE", "REVERSE_v", "BY", "FROM", "POSITION", "POSITION_v", "PARAMETERS", + "FEATURE_NAMES", "CV_PARAMETERS", "CV_UI_LABEL", "CV_TOOLTIP", "CV_SAMPLE_TEXT", + "CV_PARAM_LABEL", "CV_CHARACTER", "SIZEMENUNAME", "CONTOURPOINT", "ANCHOR", + "ANCHOR_DEF", "VALUE_RECORD_DEF", "MARK", "MARK_CLASS", "CURSIVE", "MARKBASE", + "MARKLIG", "MARKLIG_v", "LIG_COMPONENT", "KNULL", "BASE", "HA_BTL", "VA_BTL", + "HA_BSL", "VA_BSL", "GDEF", "GLYPH_CLASS_DEF", "ATTACH", "LIG_CARET_BY_POS", + "LIG_CARET_BY_IDX", "HEAD", "FONT_REVISION", "HHEA", "ASCENDER", "DESCENDER", + "LINE_GAP", "CARET_OFFSET", "NAME", "NAMEID", "OS_2", "FS_TYPE", "FS_TYPE_v", + "OS2_LOWER_OP_SIZE", "OS2_UPPER_OP_SIZE", "PANOSE", "TYPO_ASCENDER", "TYPO_DESCENDER", + "TYPO_LINE_GAP", "WIN_ASCENT", "WIN_DESCENT", "X_HEIGHT", "CAP_HEIGHT", + "WEIGHT_CLASS", "WIDTH_CLASS", "VENDOR", "UNICODE_RANGE", "CODE_PAGE_RANGE", + "FAMILY_CLASS", "STAT", "ELIDED_FALLBACK_NAME", "ELIDED_FALLBACK_NAME_ID", + "DESIGN_AXIS", "AXIS_VALUE", "FLAG", "LOCATION", "AXIS_EAVN", "AXIS_OSFA", + "VHEA", "VERT_TYPO_ASCENDER", "VERT_TYPO_DESCENDER", "VERT_TYPO_LINE_GAP", + "VMTX", "VERT_ORIGIN_Y", "VERT_ADVANCE_Y", "LCBRACE", "RCBRACE", "LBRACKET", + "RBRACKET", "HYPHEN", "SEMI", "EQUALS", "MARKER", "COMMA", "QUOTE", "GCLASS", + "CID", "ESCGNAME", "NAMELABEL", "EXTNAME", "POINTNUM", "NUMEXT", "NUMOCT", + "NUM", "CATCHTAG", "A_WHITESPACE", "A_LABEL", "A_LBRACE", "A_CLOSE", "A_LINE", + "I_WHITESPACE", "I_RPAREN", "IFILE", "I_LPAREN", "STRVAL", "EQUOTE" +}; + +dfa::Vocabulary FeatParser::_vocabulary(_literalNames, _symbolicNames); + +std::vector FeatParser::_tokenNames; + +FeatParser::Initializer::Initializer() { + for (size_t i = 0; i < _symbolicNames.size(); ++i) { + std::string name = _vocabulary.getLiteralName(i); + if (name.empty()) { + name = _vocabulary.getSymbolicName(i); + } + + if (name.empty()) { + _tokenNames.push_back(""); + } else { + _tokenNames.push_back(name); + } + } + + static const uint16_t serializedATNSegment0[] = { + 0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, + 0x3, 0x93, 0x486, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4, + 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, + 0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, + 0x4, 0xb, 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, + 0xe, 0x9, 0xe, 0x4, 0xf, 0x9, 0xf, 0x4, 0x10, 0x9, 0x10, 0x4, 0x11, + 0x9, 0x11, 0x4, 0x12, 0x9, 0x12, 0x4, 0x13, 0x9, 0x13, 0x4, 0x14, + 0x9, 0x14, 0x4, 0x15, 0x9, 0x15, 0x4, 0x16, 0x9, 0x16, 0x4, 0x17, + 0x9, 0x17, 0x4, 0x18, 0x9, 0x18, 0x4, 0x19, 0x9, 0x19, 0x4, 0x1a, + 0x9, 0x1a, 0x4, 0x1b, 0x9, 0x1b, 0x4, 0x1c, 0x9, 0x1c, 0x4, 0x1d, + 0x9, 0x1d, 0x4, 0x1e, 0x9, 0x1e, 0x4, 0x1f, 0x9, 0x1f, 0x4, 0x20, + 0x9, 0x20, 0x4, 0x21, 0x9, 0x21, 0x4, 0x22, 0x9, 0x22, 0x4, 0x23, + 0x9, 0x23, 0x4, 0x24, 0x9, 0x24, 0x4, 0x25, 0x9, 0x25, 0x4, 0x26, + 0x9, 0x26, 0x4, 0x27, 0x9, 0x27, 0x4, 0x28, 0x9, 0x28, 0x4, 0x29, + 0x9, 0x29, 0x4, 0x2a, 0x9, 0x2a, 0x4, 0x2b, 0x9, 0x2b, 0x4, 0x2c, + 0x9, 0x2c, 0x4, 0x2d, 0x9, 0x2d, 0x4, 0x2e, 0x9, 0x2e, 0x4, 0x2f, + 0x9, 0x2f, 0x4, 0x30, 0x9, 0x30, 0x4, 0x31, 0x9, 0x31, 0x4, 0x32, + 0x9, 0x32, 0x4, 0x33, 0x9, 0x33, 0x4, 0x34, 0x9, 0x34, 0x4, 0x35, + 0x9, 0x35, 0x4, 0x36, 0x9, 0x36, 0x4, 0x37, 0x9, 0x37, 0x4, 0x38, + 0x9, 0x38, 0x4, 0x39, 0x9, 0x39, 0x4, 0x3a, 0x9, 0x3a, 0x4, 0x3b, + 0x9, 0x3b, 0x4, 0x3c, 0x9, 0x3c, 0x4, 0x3d, 0x9, 0x3d, 0x4, 0x3e, + 0x9, 0x3e, 0x4, 0x3f, 0x9, 0x3f, 0x4, 0x40, 0x9, 0x40, 0x4, 0x41, + 0x9, 0x41, 0x4, 0x42, 0x9, 0x42, 0x4, 0x43, 0x9, 0x43, 0x4, 0x44, + 0x9, 0x44, 0x4, 0x45, 0x9, 0x45, 0x4, 0x46, 0x9, 0x46, 0x4, 0x47, + 0x9, 0x47, 0x4, 0x48, 0x9, 0x48, 0x4, 0x49, 0x9, 0x49, 0x4, 0x4a, + 0x9, 0x4a, 0x4, 0x4b, 0x9, 0x4b, 0x4, 0x4c, 0x9, 0x4c, 0x4, 0x4d, + 0x9, 0x4d, 0x4, 0x4e, 0x9, 0x4e, 0x4, 0x4f, 0x9, 0x4f, 0x4, 0x50, + 0x9, 0x50, 0x4, 0x51, 0x9, 0x51, 0x4, 0x52, 0x9, 0x52, 0x4, 0x53, + 0x9, 0x53, 0x4, 0x54, 0x9, 0x54, 0x4, 0x55, 0x9, 0x55, 0x4, 0x56, + 0x9, 0x56, 0x4, 0x57, 0x9, 0x57, 0x4, 0x58, 0x9, 0x58, 0x4, 0x59, + 0x9, 0x59, 0x4, 0x5a, 0x9, 0x5a, 0x4, 0x5b, 0x9, 0x5b, 0x4, 0x5c, + 0x9, 0x5c, 0x4, 0x5d, 0x9, 0x5d, 0x4, 0x5e, 0x9, 0x5e, 0x4, 0x5f, + 0x9, 0x5f, 0x4, 0x60, 0x9, 0x60, 0x4, 0x61, 0x9, 0x61, 0x4, 0x62, + 0x9, 0x62, 0x4, 0x63, 0x9, 0x63, 0x4, 0x64, 0x9, 0x64, 0x4, 0x65, + 0x9, 0x65, 0x4, 0x66, 0x9, 0x66, 0x4, 0x67, 0x9, 0x67, 0x4, 0x68, + 0x9, 0x68, 0x4, 0x69, 0x9, 0x69, 0x4, 0x6a, 0x9, 0x6a, 0x4, 0x6b, + 0x9, 0x6b, 0x4, 0x6c, 0x9, 0x6c, 0x4, 0x6d, 0x9, 0x6d, 0x4, 0x6e, + 0x9, 0x6e, 0x4, 0x6f, 0x9, 0x6f, 0x4, 0x70, 0x9, 0x70, 0x3, 0x2, + 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, 0x7, 0x2, 0xe6, 0xa, 0x2, + 0xc, 0x2, 0xe, 0x2, 0xe9, 0xb, 0x2, 0x3, 0x2, 0x3, 0x2, 0x3, 0x3, + 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x5, 0x3, 0xf3, + 0xa, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x4, 0x3, 0x4, 0x3, + 0x4, 0x3, 0x4, 0x3, 0x5, 0x3, 0x5, 0x3, 0x5, 0x3, 0x5, 0x3, 0x6, + 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x5, + 0x7, 0x107, 0xa, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x8, 0x3, + 0x8, 0x3, 0x8, 0x3, 0x8, 0x3, 0x8, 0x5, 0x8, 0x111, 0xa, 0x8, 0x3, + 0x8, 0x3, 0x8, 0x3, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0xa, + 0x3, 0xa, 0x3, 0xa, 0x5, 0xa, 0x11c, 0xa, 0xa, 0x3, 0xa, 0x3, 0xa, + 0x6, 0xa, 0x120, 0xa, 0xa, 0xd, 0xa, 0xe, 0xa, 0x121, 0x3, 0xa, 0x3, + 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, + 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x3, 0xb, 0x5, + 0xb, 0x132, 0xa, 0xb, 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, 0x3, 0xc, 0x7, + 0xc, 0x138, 0xa, 0xc, 0xc, 0xc, 0xe, 0xc, 0x13b, 0xb, 0xc, 0x3, 0xc, + 0x3, 0xc, 0x3, 0xd, 0x3, 0xd, 0x3, 0xd, 0x5, 0xd, 0x142, 0xa, 0xd, + 0x3, 0xd, 0x3, 0xd, 0x6, 0xd, 0x146, 0xa, 0xd, 0xd, 0xd, 0xe, 0xd, + 0x147, 0x3, 0xd, 0x3, 0xd, 0x3, 0xd, 0x3, 0xd, 0x3, 0xe, 0x3, 0xe, + 0x3, 0xe, 0x5, 0xe, 0x151, 0xa, 0xe, 0x3, 0xf, 0x3, 0xf, 0x3, 0xf, + 0x5, 0xf, 0x156, 0xa, 0xf, 0x3, 0xf, 0x3, 0xf, 0x6, 0xf, 0x15a, 0xa, + 0xf, 0xd, 0xf, 0xe, 0xf, 0x15b, 0x3, 0xf, 0x3, 0xf, 0x3, 0xf, 0x5, + 0xf, 0x161, 0xa, 0xf, 0x3, 0xf, 0x3, 0xf, 0x3, 0x10, 0x3, 0x10, 0x3, + 0x10, 0x7, 0x10, 0x168, 0xa, 0x10, 0xc, 0x10, 0xe, 0x10, 0x16b, 0xb, + 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x10, 0x3, 0x11, 0x3, 0x11, 0x5, + 0x11, 0x172, 0xa, 0x11, 0x3, 0x11, 0x3, 0x11, 0x3, 0x12, 0x3, 0x12, + 0x3, 0x12, 0x6, 0x12, 0x179, 0xa, 0x12, 0xd, 0x12, 0xe, 0x12, 0x17a, + 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x12, 0x5, 0x12, 0x181, 0xa, + 0x12, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, + 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, 0x13, 0x3, + 0x13, 0x3, 0x13, 0x3, 0x13, 0x5, 0x13, 0x191, 0xa, 0x13, 0x3, 0x13, + 0x3, 0x13, 0x3, 0x14, 0x3, 0x14, 0x3, 0x14, 0x3, 0x15, 0x3, 0x15, + 0x3, 0x15, 0x3, 0x16, 0x3, 0x16, 0x3, 0x16, 0x5, 0x16, 0x19e, 0xa, + 0x16, 0x3, 0x17, 0x3, 0x17, 0x3, 0x17, 0x6, 0x17, 0x1a3, 0xa, 0x17, + 0xd, 0x17, 0xe, 0x17, 0x1a4, 0x5, 0x17, 0x1a7, 0xa, 0x17, 0x3, 0x18, + 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, 0x3, 0x18, + 0x3, 0x18, 0x5, 0x18, 0x1b1, 0xa, 0x18, 0x3, 0x19, 0x3, 0x19, 0x3, + 0x19, 0x3, 0x19, 0x5, 0x19, 0x1b7, 0xa, 0x19, 0x3, 0x19, 0x3, 0x19, + 0x3, 0x19, 0x7, 0x19, 0x1bc, 0xa, 0x19, 0xc, 0x19, 0xe, 0x19, 0x1bf, + 0xb, 0x19, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x7, 0x1a, + 0x1c5, 0xa, 0x1a, 0xc, 0x1a, 0xe, 0x1a, 0x1c8, 0xb, 0x1a, 0x5, 0x1a, + 0x1ca, 0xa, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, + 0x1a, 0x5, 0x1a, 0x1d1, 0xa, 0x1a, 0x5, 0x1a, 0x1d3, 0xa, 0x1a, 0x3, + 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x3, 0x1a, 0x5, 0x1a, 0x1da, + 0xa, 0x1a, 0x5, 0x1a, 0x1dc, 0xa, 0x1a, 0x5, 0x1a, 0x1de, 0xa, 0x1a, + 0x3, 0x1b, 0x5, 0x1b, 0x1e1, 0xa, 0x1b, 0x3, 0x1b, 0x3, 0x1b, 0x5, + 0x1b, 0x1e5, 0xa, 0x1b, 0x3, 0x1b, 0x3, 0x1b, 0x7, 0x1b, 0x1e9, 0xa, + 0x1b, 0xc, 0x1b, 0xe, 0x1b, 0x1ec, 0xb, 0x1b, 0x3, 0x1b, 0x3, 0x1b, + 0x6, 0x1b, 0x1f0, 0xa, 0x1b, 0xd, 0x1b, 0xe, 0x1b, 0x1f1, 0x3, 0x1b, + 0x7, 0x1b, 0x1f5, 0xa, 0x1b, 0xc, 0x1b, 0xe, 0x1b, 0x1f8, 0xb, 0x1b, + 0x3, 0x1b, 0x3, 0x1b, 0x3, 0x1b, 0x5, 0x1b, 0x1fd, 0xa, 0x1b, 0x3, + 0x1b, 0x3, 0x1b, 0x3, 0x1b, 0x6, 0x1b, 0x202, 0xa, 0x1b, 0xd, 0x1b, + 0xe, 0x1b, 0x203, 0x3, 0x1b, 0x5, 0x1b, 0x207, 0xa, 0x1b, 0x3, 0x1b, + 0x3, 0x1b, 0x3, 0x1b, 0x6, 0x1b, 0x20c, 0xa, 0x1b, 0xd, 0x1b, 0xe, + 0x1b, 0x20d, 0x3, 0x1b, 0x5, 0x1b, 0x211, 0xa, 0x1b, 0x3, 0x1b, 0x3, + 0x1b, 0x3, 0x1b, 0x6, 0x1b, 0x216, 0xa, 0x1b, 0xd, 0x1b, 0xe, 0x1b, + 0x217, 0x3, 0x1b, 0x5, 0x1b, 0x21b, 0xa, 0x1b, 0x5, 0x1b, 0x21d, + 0xa, 0x1b, 0x3, 0x1c, 0x3, 0x1c, 0x5, 0x1c, 0x221, 0xa, 0x1c, 0x3, + 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x3, 0x1d, 0x5, 0x1d, 0x228, + 0xa, 0x1d, 0x3, 0x1e, 0x3, 0x1e, 0x3, 0x1e, 0x3, 0x1e, 0x3, 0x1e, + 0x3, 0x1e, 0x3, 0x1e, 0x5, 0x1e, 0x231, 0xa, 0x1e, 0x3, 0x1f, 0x3, + 0x1f, 0x3, 0x1f, 0x3, 0x1f, 0x3, 0x20, 0x3, 0x20, 0x3, 0x20, 0x3, + 0x20, 0x5, 0x20, 0x23b, 0xa, 0x20, 0x3, 0x21, 0x3, 0x21, 0x3, 0x21, + 0x5, 0x21, 0x240, 0xa, 0x21, 0x3, 0x21, 0x5, 0x21, 0x243, 0xa, 0x21, + 0x3, 0x21, 0x5, 0x21, 0x246, 0xa, 0x21, 0x3, 0x22, 0x3, 0x22, 0x6, + 0x22, 0x24a, 0xa, 0x22, 0xd, 0x22, 0xe, 0x22, 0x24b, 0x3, 0x23, 0x3, + 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x5, 0x23, 0x253, 0xa, 0x23, + 0x5, 0x23, 0x255, 0xa, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, 0x23, 0x3, + 0x23, 0x3, 0x24, 0x3, 0x24, 0x3, 0x24, 0x6, 0x24, 0x25e, 0xa, 0x24, + 0xd, 0x24, 0xe, 0x24, 0x25f, 0x3, 0x24, 0x3, 0x24, 0x3, 0x25, 0x3, + 0x25, 0x3, 0x26, 0x3, 0x26, 0x3, 0x26, 0x6, 0x26, 0x269, 0xa, 0x26, + 0xd, 0x26, 0xe, 0x26, 0x26a, 0x3, 0x26, 0x3, 0x26, 0x3, 0x26, 0x3, + 0x26, 0x3, 0x27, 0x3, 0x27, 0x3, 0x27, 0x5, 0x27, 0x274, 0xa, 0x27, + 0x3, 0x27, 0x3, 0x27, 0x3, 0x28, 0x3, 0x28, 0x6, 0x28, 0x27a, 0xa, + 0x28, 0xd, 0x28, 0xe, 0x28, 0x27b, 0x3, 0x29, 0x3, 0x29, 0x3, 0x29, + 0x3, 0x29, 0x7, 0x29, 0x282, 0xa, 0x29, 0xc, 0x29, 0xe, 0x29, 0x285, + 0xb, 0x29, 0x3, 0x2a, 0x3, 0x2a, 0x3, 0x2a, 0x6, 0x2a, 0x28a, 0xa, + 0x2a, 0xd, 0x2a, 0xe, 0x2a, 0x28b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, + 0x6, 0x2b, 0x291, 0xa, 0x2b, 0xd, 0x2b, 0xe, 0x2b, 0x292, 0x3, 0x2b, + 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, + 0x3, 0x2c, 0x3, 0x2c, 0x5, 0x2c, 0x29e, 0xa, 0x2c, 0x3, 0x2c, 0x3, + 0x2c, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, + 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2e, 0x3, 0x2e, 0x3, + 0x2e, 0x6, 0x2e, 0x2ae, 0xa, 0x2e, 0xd, 0x2e, 0xe, 0x2e, 0x2af, 0x3, + 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x6, 0x2f, 0x2b5, 0xa, 0x2f, 0xd, 0x2f, + 0xe, 0x2f, 0x2b6, 0x3, 0x30, 0x3, 0x30, 0x3, 0x30, 0x6, 0x30, 0x2bc, + 0xa, 0x30, 0xd, 0x30, 0xe, 0x30, 0x2bd, 0x3, 0x31, 0x3, 0x31, 0x3, + 0x31, 0x6, 0x31, 0x2c3, 0xa, 0x31, 0xd, 0x31, 0xe, 0x31, 0x2c4, 0x3, + 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x31, 0x3, 0x32, 0x3, 0x32, 0x5, + 0x32, 0x2cd, 0xa, 0x32, 0x3, 0x32, 0x3, 0x32, 0x3, 0x33, 0x3, 0x33, + 0x3, 0x33, 0x3, 0x34, 0x3, 0x34, 0x3, 0x34, 0x7, 0x34, 0x2d7, 0xa, + 0x34, 0xc, 0x34, 0xe, 0x34, 0x2da, 0xb, 0x34, 0x3, 0x34, 0x3, 0x34, + 0x3, 0x34, 0x3, 0x34, 0x3, 0x35, 0x3, 0x35, 0x5, 0x35, 0x2e2, 0xa, + 0x35, 0x3, 0x35, 0x3, 0x35, 0x3, 0x36, 0x3, 0x36, 0x3, 0x36, 0x3, + 0x37, 0x3, 0x37, 0x3, 0x37, 0x7, 0x37, 0x2ec, 0xa, 0x37, 0xc, 0x37, + 0xe, 0x37, 0x2ef, 0xb, 0x37, 0x3, 0x37, 0x3, 0x37, 0x3, 0x37, 0x3, + 0x37, 0x3, 0x38, 0x3, 0x38, 0x5, 0x38, 0x2f7, 0xa, 0x38, 0x3, 0x38, + 0x3, 0x38, 0x3, 0x39, 0x3, 0x39, 0x3, 0x39, 0x3, 0x3a, 0x3, 0x3a, + 0x3, 0x3a, 0x6, 0x3a, 0x301, 0xa, 0x3a, 0xd, 0x3a, 0xe, 0x3a, 0x302, + 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3a, 0x3, 0x3b, 0x3, 0x3b, + 0x5, 0x3b, 0x30b, 0xa, 0x3b, 0x3, 0x3b, 0x3, 0x3b, 0x3, 0x3c, 0x3, + 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x5, 0x3c, 0x315, + 0xa, 0x3c, 0x5, 0x3c, 0x317, 0xa, 0x3c, 0x3, 0x3c, 0x3, 0x3c, 0x3, + 0x3c, 0x3, 0x3c, 0x3, 0x3d, 0x3, 0x3d, 0x3, 0x3d, 0x6, 0x3d, 0x320, + 0xa, 0x3d, 0xd, 0x3d, 0xe, 0x3d, 0x321, 0x3, 0x3d, 0x3, 0x3d, 0x3, + 0x3d, 0x3, 0x3d, 0x3, 0x3e, 0x3, 0x3e, 0x5, 0x3e, 0x32a, 0xa, 0x3e, + 0x3, 0x3e, 0x3, 0x3e, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, + 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, + 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, + 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, 0x3, 0x3f, + 0x3, 0x3f, 0x6, 0x3f, 0x345, 0xa, 0x3f, 0xd, 0x3f, 0xe, 0x3f, 0x346, + 0x5, 0x3f, 0x349, 0xa, 0x3f, 0x3, 0x40, 0x3, 0x40, 0x3, 0x40, 0x6, + 0x40, 0x34e, 0xa, 0x40, 0xd, 0x40, 0xe, 0x40, 0x34f, 0x3, 0x40, 0x3, + 0x40, 0x3, 0x40, 0x3, 0x40, 0x3, 0x41, 0x3, 0x41, 0x3, 0x41, 0x3, + 0x41, 0x3, 0x41, 0x5, 0x41, 0x35b, 0xa, 0x41, 0x3, 0x41, 0x3, 0x41, + 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x3, 0x42, 0x6, 0x42, + 0x364, 0xa, 0x42, 0xd, 0x42, 0xe, 0x42, 0x365, 0x3, 0x42, 0x3, 0x42, + 0x3, 0x43, 0x3, 0x43, 0x3, 0x43, 0x6, 0x43, 0x36d, 0xa, 0x43, 0xd, + 0x43, 0xe, 0x43, 0x36e, 0x3, 0x43, 0x3, 0x43, 0x3, 0x44, 0x3, 0x44, + 0x3, 0x44, 0x3, 0x44, 0x5, 0x44, 0x377, 0xa, 0x44, 0x3, 0x44, 0x3, + 0x44, 0x3, 0x45, 0x3, 0x45, 0x3, 0x45, 0x3, 0x45, 0x3, 0x45, 0x5, + 0x45, 0x380, 0xa, 0x45, 0x5, 0x45, 0x382, 0xa, 0x45, 0x3, 0x46, 0x3, + 0x46, 0x6, 0x46, 0x386, 0xa, 0x46, 0xd, 0x46, 0xe, 0x46, 0x387, 0x3, + 0x47, 0x3, 0x47, 0x3, 0x47, 0x6, 0x47, 0x38d, 0xa, 0x47, 0xd, 0x47, + 0xe, 0x47, 0x38e, 0x3, 0x47, 0x3, 0x47, 0x3, 0x48, 0x3, 0x48, 0x5, + 0x48, 0x395, 0xa, 0x48, 0x3, 0x48, 0x3, 0x48, 0x3, 0x49, 0x3, 0x49, + 0x3, 0x49, 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4a, + 0x5, 0x4a, 0x3a1, 0xa, 0x4a, 0x5, 0x4a, 0x3a3, 0xa, 0x4a, 0x3, 0x4a, + 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4a, 0x3, 0x4b, 0x3, 0x4b, 0x3, 0x4b, + 0x6, 0x4b, 0x3ac, 0xa, 0x4b, 0xd, 0x4b, 0xe, 0x4b, 0x3ad, 0x3, 0x4b, + 0x3, 0x4b, 0x3, 0x4b, 0x3, 0x4b, 0x3, 0x4c, 0x3, 0x4c, 0x5, 0x4c, + 0x3b6, 0xa, 0x4c, 0x3, 0x4c, 0x3, 0x4c, 0x3, 0x4d, 0x3, 0x4d, 0x3, + 0x4d, 0x3, 0x4d, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, + 0x4e, 0x3, 0x4e, 0x5, 0x4e, 0x3c4, 0xa, 0x4e, 0x3, 0x4e, 0x3, 0x4e, + 0x5, 0x4e, 0x3c8, 0xa, 0x4e, 0x3, 0x4e, 0x3, 0x4e, 0x3, 0x4f, 0x6, + 0x4f, 0x3cd, 0xa, 0x4f, 0xd, 0x4f, 0xe, 0x4f, 0x3ce, 0x3, 0x50, 0x3, + 0x50, 0x3, 0x50, 0x7, 0x50, 0x3d4, 0xa, 0x50, 0xc, 0x50, 0xe, 0x50, + 0x3d7, 0xb, 0x50, 0x3, 0x51, 0x6, 0x51, 0x3da, 0xa, 0x51, 0xd, 0x51, + 0xe, 0x51, 0x3db, 0x3, 0x52, 0x3, 0x52, 0x5, 0x52, 0x3e0, 0xa, 0x52, + 0x3, 0x52, 0x5, 0x52, 0x3e3, 0xa, 0x52, 0x3, 0x53, 0x5, 0x53, 0x3e6, + 0xa, 0x53, 0x3, 0x54, 0x3, 0x54, 0x5, 0x54, 0x3ea, 0xa, 0x54, 0x3, + 0x55, 0x3, 0x55, 0x6, 0x55, 0x3ee, 0xa, 0x55, 0xd, 0x55, 0xe, 0x55, + 0x3ef, 0x3, 0x55, 0x3, 0x55, 0x3, 0x56, 0x3, 0x56, 0x3, 0x56, 0x5, + 0x56, 0x3f7, 0xa, 0x56, 0x3, 0x56, 0x5, 0x56, 0x3fa, 0xa, 0x56, 0x3, + 0x57, 0x3, 0x57, 0x5, 0x57, 0x3fe, 0xa, 0x57, 0x3, 0x58, 0x3, 0x58, + 0x3, 0x59, 0x3, 0x59, 0x3, 0x5a, 0x3, 0x5a, 0x3, 0x5b, 0x3, 0x5b, + 0x3, 0x5c, 0x3, 0x5c, 0x3, 0x5d, 0x7, 0x5d, 0x40b, 0xa, 0x5d, 0xc, + 0x5d, 0xe, 0x5d, 0x40e, 0xb, 0x5d, 0x3, 0x5d, 0x3, 0x5d, 0x3, 0x5e, + 0x7, 0x5e, 0x413, 0xa, 0x5e, 0xc, 0x5e, 0xe, 0x5e, 0x416, 0xb, 0x5e, + 0x3, 0x5e, 0x3, 0x5e, 0x3, 0x5f, 0x7, 0x5f, 0x41b, 0xa, 0x5f, 0xc, + 0x5f, 0xe, 0x5f, 0x41e, 0xb, 0x5f, 0x3, 0x5f, 0x3, 0x5f, 0x3, 0x60, + 0x7, 0x60, 0x423, 0xa, 0x60, 0xc, 0x60, 0xe, 0x60, 0x426, 0xb, 0x60, + 0x3, 0x60, 0x3, 0x60, 0x3, 0x61, 0x7, 0x61, 0x42b, 0xa, 0x61, 0xc, + 0x61, 0xe, 0x61, 0x42e, 0xb, 0x61, 0x3, 0x61, 0x3, 0x61, 0x3, 0x62, + 0x7, 0x62, 0x433, 0xa, 0x62, 0xc, 0x62, 0xe, 0x62, 0x436, 0xb, 0x62, + 0x3, 0x62, 0x3, 0x62, 0x3, 0x63, 0x7, 0x63, 0x43b, 0xa, 0x63, 0xc, + 0x63, 0xe, 0x63, 0x43e, 0xb, 0x63, 0x3, 0x63, 0x3, 0x63, 0x3, 0x64, + 0x7, 0x64, 0x443, 0xa, 0x64, 0xc, 0x64, 0xe, 0x64, 0x446, 0xb, 0x64, + 0x3, 0x64, 0x3, 0x64, 0x3, 0x65, 0x7, 0x65, 0x44b, 0xa, 0x65, 0xc, + 0x65, 0xe, 0x65, 0x44e, 0xb, 0x65, 0x3, 0x65, 0x3, 0x65, 0x3, 0x66, + 0x7, 0x66, 0x453, 0xa, 0x66, 0xc, 0x66, 0xe, 0x66, 0x456, 0xb, 0x66, + 0x3, 0x66, 0x3, 0x66, 0x3, 0x67, 0x7, 0x67, 0x45b, 0xa, 0x67, 0xc, + 0x67, 0xe, 0x67, 0x45e, 0xb, 0x67, 0x3, 0x67, 0x3, 0x67, 0x3, 0x68, + 0x7, 0x68, 0x463, 0xa, 0x68, 0xc, 0x68, 0xe, 0x68, 0x466, 0xb, 0x68, + 0x3, 0x68, 0x3, 0x68, 0x3, 0x69, 0x7, 0x69, 0x46b, 0xa, 0x69, 0xc, + 0x69, 0xe, 0x69, 0x46e, 0xb, 0x69, 0x3, 0x69, 0x3, 0x69, 0x3, 0x6a, + 0x7, 0x6a, 0x473, 0xa, 0x6a, 0xc, 0x6a, 0xe, 0x6a, 0x476, 0xb, 0x6a, + 0x3, 0x6a, 0x3, 0x6a, 0x3, 0x6b, 0x3, 0x6b, 0x3, 0x6c, 0x3, 0x6c, + 0x3, 0x6d, 0x3, 0x6d, 0x3, 0x6e, 0x3, 0x6e, 0x3, 0x6f, 0x3, 0x6f, + 0x3, 0x70, 0x3, 0x70, 0x3, 0x70, 0x2, 0x2, 0x71, 0x2, 0x4, 0x6, 0x8, + 0xa, 0xc, 0xe, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, + 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, + 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, + 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, 0x60, 0x62, + 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, + 0x7a, 0x7c, 0x7e, 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, + 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, + 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, + 0xbc, 0xbe, 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, + 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, 0x2, 0x18, 0x3, 0x2, 0x2d, + 0x30, 0x3, 0x2, 0x17, 0x1a, 0x3, 0x2, 0x26, 0x27, 0x3, 0x2, 0x40, + 0x41, 0x3, 0x2, 0x42, 0x43, 0x3, 0x2, 0x4c, 0x4f, 0x3, 0x2, 0x6f, + 0x71, 0x3, 0x2, 0x58, 0x5e, 0x4, 0x2, 0x53, 0x56, 0x5f, 0x60, 0x3, + 0x2, 0x62, 0x63, 0x3, 0x2, 0x6c, 0x6d, 0x3, 0x2, 0x73, 0x74, 0x4, + 0x2, 0x10, 0x10, 0x81, 0x83, 0x5, 0x2, 0x37, 0x37, 0x82, 0x83, 0x88, + 0x88, 0x4, 0x2, 0x84, 0x84, 0x87, 0x87, 0x3, 0x2, 0x85, 0x87, 0x3, + 0x2, 0x22, 0x23, 0x3, 0x2, 0x24, 0x25, 0x3, 0x2, 0x3, 0x4, 0x3, 0x2, + 0x1e, 0x1f, 0x3, 0x2, 0x28, 0x29, 0x3, 0x2, 0x3b, 0x3c, 0x2, 0x4c2, + 0x2, 0xe7, 0x3, 0x2, 0x2, 0x2, 0x4, 0xf2, 0x3, 0x2, 0x2, 0x2, 0x6, + 0xf6, 0x3, 0x2, 0x2, 0x2, 0x8, 0xfb, 0x3, 0x2, 0x2, 0x2, 0xa, 0xff, + 0x3, 0x2, 0x2, 0x2, 0xc, 0x103, 0x3, 0x2, 0x2, 0x2, 0xe, 0x10b, 0x3, + 0x2, 0x2, 0x2, 0x10, 0x114, 0x3, 0x2, 0x2, 0x2, 0x12, 0x118, 0x3, + 0x2, 0x2, 0x2, 0x14, 0x127, 0x3, 0x2, 0x2, 0x2, 0x16, 0x133, 0x3, + 0x2, 0x2, 0x2, 0x18, 0x13e, 0x3, 0x2, 0x2, 0x2, 0x1a, 0x150, 0x3, + 0x2, 0x2, 0x2, 0x1c, 0x152, 0x3, 0x2, 0x2, 0x2, 0x1e, 0x164, 0x3, + 0x2, 0x2, 0x2, 0x20, 0x171, 0x3, 0x2, 0x2, 0x2, 0x22, 0x180, 0x3, + 0x2, 0x2, 0x2, 0x24, 0x190, 0x3, 0x2, 0x2, 0x2, 0x26, 0x194, 0x3, + 0x2, 0x2, 0x2, 0x28, 0x197, 0x3, 0x2, 0x2, 0x2, 0x2a, 0x19a, 0x3, + 0x2, 0x2, 0x2, 0x2c, 0x19f, 0x3, 0x2, 0x2, 0x2, 0x2e, 0x1b0, 0x3, + 0x2, 0x2, 0x2, 0x30, 0x1b2, 0x3, 0x2, 0x2, 0x2, 0x32, 0x1c9, 0x3, + 0x2, 0x2, 0x2, 0x34, 0x1e0, 0x3, 0x2, 0x2, 0x2, 0x36, 0x21e, 0x3, + 0x2, 0x2, 0x2, 0x38, 0x227, 0x3, 0x2, 0x2, 0x2, 0x3a, 0x230, 0x3, + 0x2, 0x2, 0x2, 0x3c, 0x232, 0x3, 0x2, 0x2, 0x2, 0x3e, 0x236, 0x3, + 0x2, 0x2, 0x2, 0x40, 0x23c, 0x3, 0x2, 0x2, 0x2, 0x42, 0x247, 0x3, + 0x2, 0x2, 0x2, 0x44, 0x24d, 0x3, 0x2, 0x2, 0x2, 0x46, 0x25a, 0x3, + 0x2, 0x2, 0x2, 0x48, 0x263, 0x3, 0x2, 0x2, 0x2, 0x4a, 0x265, 0x3, + 0x2, 0x2, 0x2, 0x4c, 0x273, 0x3, 0x2, 0x2, 0x2, 0x4e, 0x277, 0x3, + 0x2, 0x2, 0x2, 0x50, 0x27d, 0x3, 0x2, 0x2, 0x2, 0x52, 0x286, 0x3, + 0x2, 0x2, 0x2, 0x54, 0x28d, 0x3, 0x2, 0x2, 0x2, 0x56, 0x29d, 0x3, + 0x2, 0x2, 0x2, 0x58, 0x2a1, 0x3, 0x2, 0x2, 0x2, 0x5a, 0x2aa, 0x3, + 0x2, 0x2, 0x2, 0x5c, 0x2b1, 0x3, 0x2, 0x2, 0x2, 0x5e, 0x2b8, 0x3, + 0x2, 0x2, 0x2, 0x60, 0x2bf, 0x3, 0x2, 0x2, 0x2, 0x62, 0x2cc, 0x3, + 0x2, 0x2, 0x2, 0x64, 0x2d0, 0x3, 0x2, 0x2, 0x2, 0x66, 0x2d3, 0x3, + 0x2, 0x2, 0x2, 0x68, 0x2e1, 0x3, 0x2, 0x2, 0x2, 0x6a, 0x2e5, 0x3, + 0x2, 0x2, 0x2, 0x6c, 0x2e8, 0x3, 0x2, 0x2, 0x2, 0x6e, 0x2f6, 0x3, + 0x2, 0x2, 0x2, 0x70, 0x2fa, 0x3, 0x2, 0x2, 0x2, 0x72, 0x2fd, 0x3, + 0x2, 0x2, 0x2, 0x74, 0x30a, 0x3, 0x2, 0x2, 0x2, 0x76, 0x30e, 0x3, + 0x2, 0x2, 0x2, 0x78, 0x31c, 0x3, 0x2, 0x2, 0x2, 0x7a, 0x329, 0x3, + 0x2, 0x2, 0x2, 0x7c, 0x348, 0x3, 0x2, 0x2, 0x2, 0x7e, 0x34a, 0x3, + 0x2, 0x2, 0x2, 0x80, 0x35a, 0x3, 0x2, 0x2, 0x2, 0x82, 0x35e, 0x3, + 0x2, 0x2, 0x2, 0x84, 0x369, 0x3, 0x2, 0x2, 0x2, 0x86, 0x376, 0x3, + 0x2, 0x2, 0x2, 0x88, 0x37a, 0x3, 0x2, 0x2, 0x2, 0x8a, 0x383, 0x3, + 0x2, 0x2, 0x2, 0x8c, 0x389, 0x3, 0x2, 0x2, 0x2, 0x8e, 0x394, 0x3, + 0x2, 0x2, 0x2, 0x90, 0x398, 0x3, 0x2, 0x2, 0x2, 0x92, 0x39b, 0x3, + 0x2, 0x2, 0x2, 0x94, 0x3a8, 0x3, 0x2, 0x2, 0x2, 0x96, 0x3b5, 0x3, + 0x2, 0x2, 0x2, 0x98, 0x3b9, 0x3, 0x2, 0x2, 0x2, 0x9a, 0x3bd, 0x3, + 0x2, 0x2, 0x2, 0x9c, 0x3cc, 0x3, 0x2, 0x2, 0x2, 0x9e, 0x3d0, 0x3, + 0x2, 0x2, 0x2, 0xa0, 0x3d9, 0x3, 0x2, 0x2, 0x2, 0xa2, 0x3df, 0x3, + 0x2, 0x2, 0x2, 0xa4, 0x3e5, 0x3, 0x2, 0x2, 0x2, 0xa6, 0x3e9, 0x3, + 0x2, 0x2, 0x2, 0xa8, 0x3eb, 0x3, 0x2, 0x2, 0x2, 0xaa, 0x3f9, 0x3, + 0x2, 0x2, 0x2, 0xac, 0x3fd, 0x3, 0x2, 0x2, 0x2, 0xae, 0x3ff, 0x3, + 0x2, 0x2, 0x2, 0xb0, 0x401, 0x3, 0x2, 0x2, 0x2, 0xb2, 0x403, 0x3, + 0x2, 0x2, 0x2, 0xb4, 0x405, 0x3, 0x2, 0x2, 0x2, 0xb6, 0x407, 0x3, + 0x2, 0x2, 0x2, 0xb8, 0x40c, 0x3, 0x2, 0x2, 0x2, 0xba, 0x414, 0x3, + 0x2, 0x2, 0x2, 0xbc, 0x41c, 0x3, 0x2, 0x2, 0x2, 0xbe, 0x424, 0x3, + 0x2, 0x2, 0x2, 0xc0, 0x42c, 0x3, 0x2, 0x2, 0x2, 0xc2, 0x434, 0x3, + 0x2, 0x2, 0x2, 0xc4, 0x43c, 0x3, 0x2, 0x2, 0x2, 0xc6, 0x444, 0x3, + 0x2, 0x2, 0x2, 0xc8, 0x44c, 0x3, 0x2, 0x2, 0x2, 0xca, 0x454, 0x3, + 0x2, 0x2, 0x2, 0xcc, 0x45c, 0x3, 0x2, 0x2, 0x2, 0xce, 0x464, 0x3, + 0x2, 0x2, 0x2, 0xd0, 0x46c, 0x3, 0x2, 0x2, 0x2, 0xd2, 0x474, 0x3, + 0x2, 0x2, 0x2, 0xd4, 0x479, 0x3, 0x2, 0x2, 0x2, 0xd6, 0x47b, 0x3, + 0x2, 0x2, 0x2, 0xd8, 0x47d, 0x3, 0x2, 0x2, 0x2, 0xda, 0x47f, 0x3, + 0x2, 0x2, 0x2, 0xdc, 0x481, 0x3, 0x2, 0x2, 0x2, 0xde, 0x483, 0x3, + 0x2, 0x2, 0x2, 0xe0, 0xe6, 0x5, 0x4, 0x3, 0x2, 0xe1, 0xe6, 0x5, 0x12, + 0xa, 0x2, 0xe2, 0xe6, 0x5, 0x14, 0xb, 0x2, 0xe3, 0xe6, 0x5, 0x16, + 0xc, 0x2, 0xe4, 0xe6, 0x5, 0x18, 0xd, 0x2, 0xe5, 0xe0, 0x3, 0x2, + 0x2, 0x2, 0xe5, 0xe1, 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe2, 0x3, 0x2, 0x2, + 0x2, 0xe5, 0xe3, 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe4, 0x3, 0x2, 0x2, 0x2, + 0xe6, 0xe9, 0x3, 0x2, 0x2, 0x2, 0xe7, 0xe5, 0x3, 0x2, 0x2, 0x2, 0xe7, + 0xe8, 0x3, 0x2, 0x2, 0x2, 0xe8, 0xea, 0x3, 0x2, 0x2, 0x2, 0xe9, 0xe7, + 0x3, 0x2, 0x2, 0x2, 0xea, 0xeb, 0x7, 0x2, 0x2, 0x3, 0xeb, 0x3, 0x3, + 0x2, 0x2, 0x2, 0xec, 0xf3, 0x5, 0x6, 0x4, 0x2, 0xed, 0xf3, 0x5, 0x8, + 0x5, 0x2, 0xee, 0xf3, 0x5, 0xa, 0x6, 0x2, 0xef, 0xf3, 0x5, 0xc, 0x7, + 0x2, 0xf0, 0xf3, 0x5, 0xe, 0x8, 0x2, 0xf1, 0xf3, 0x5, 0x10, 0x9, + 0x2, 0xf2, 0xec, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xed, 0x3, 0x2, 0x2, 0x2, + 0xf2, 0xee, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xef, 0x3, 0x2, 0x2, 0x2, 0xf2, + 0xf0, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xf1, 0x3, 0x2, 0x2, 0x2, 0xf3, 0xf4, + 0x3, 0x2, 0x2, 0x2, 0xf4, 0xf5, 0x7, 0x7a, 0x2, 0x2, 0xf5, 0x5, 0x3, + 0x2, 0x2, 0x2, 0xf6, 0xf7, 0x7, 0x7, 0x2, 0x2, 0xf7, 0xf8, 0x7, 0x8f, + 0x2, 0x2, 0xf8, 0xf9, 0x7, 0x90, 0x2, 0x2, 0xf9, 0xfa, 0x7, 0x91, + 0x2, 0x2, 0xfa, 0x7, 0x3, 0x2, 0x2, 0x2, 0xfb, 0xfc, 0x7, 0x7f, 0x2, + 0x2, 0xfc, 0xfd, 0x7, 0x7b, 0x2, 0x2, 0xfd, 0xfe, 0x5, 0xa6, 0x54, + 0x2, 0xfe, 0x9, 0x3, 0x2, 0x2, 0x2, 0xff, 0x100, 0x7, 0xc, 0x2, 0x2, + 0x100, 0x101, 0x5, 0xb2, 0x5a, 0x2, 0x101, 0x102, 0x5, 0xb2, 0x5a, + 0x2, 0x102, 0xb, 0x3, 0x2, 0x2, 0x2, 0x103, 0x106, 0x7, 0x38, 0x2, + 0x2, 0x104, 0x107, 0x5, 0xac, 0x57, 0x2, 0x105, 0x107, 0x5, 0xa6, + 0x54, 0x2, 0x106, 0x104, 0x3, 0x2, 0x2, 0x2, 0x106, 0x105, 0x3, 0x2, + 0x2, 0x2, 0x107, 0x108, 0x3, 0x2, 0x2, 0x2, 0x108, 0x109, 0x5, 0x9a, + 0x4e, 0x2, 0x109, 0x10a, 0x7, 0x7f, 0x2, 0x2, 0x10a, 0xd, 0x3, 0x2, + 0x2, 0x2, 0x10b, 0x10c, 0x7, 0x35, 0x2, 0x2, 0x10c, 0x10d, 0x7, 0x87, + 0x2, 0x2, 0x10d, 0x110, 0x7, 0x87, 0x2, 0x2, 0x10e, 0x10f, 0x7, 0x33, + 0x2, 0x2, 0x10f, 0x111, 0x7, 0x87, 0x2, 0x2, 0x110, 0x10e, 0x3, 0x2, + 0x2, 0x2, 0x110, 0x111, 0x3, 0x2, 0x2, 0x2, 0x111, 0x112, 0x3, 0x2, + 0x2, 0x2, 0x112, 0x113, 0x5, 0xb0, 0x59, 0x2, 0x113, 0xf, 0x3, 0x2, + 0x2, 0x2, 0x114, 0x115, 0x7, 0x36, 0x2, 0x2, 0x115, 0x116, 0x5, 0x3a, + 0x1e, 0x2, 0x116, 0x117, 0x5, 0xb0, 0x59, 0x2, 0x117, 0x11, 0x3, + 0x2, 0x2, 0x2, 0x118, 0x119, 0x7, 0x8, 0x2, 0x2, 0x119, 0x11b, 0x5, + 0xb2, 0x5a, 0x2, 0x11a, 0x11c, 0x7, 0x1b, 0x2, 0x2, 0x11b, 0x11a, + 0x3, 0x2, 0x2, 0x2, 0x11b, 0x11c, 0x3, 0x2, 0x2, 0x2, 0x11c, 0x11d, + 0x3, 0x2, 0x2, 0x2, 0x11d, 0x11f, 0x7, 0x75, 0x2, 0x2, 0x11e, 0x120, + 0x5, 0x1a, 0xe, 0x2, 0x11f, 0x11e, 0x3, 0x2, 0x2, 0x2, 0x120, 0x121, + 0x3, 0x2, 0x2, 0x2, 0x121, 0x11f, 0x3, 0x2, 0x2, 0x2, 0x121, 0x122, + 0x3, 0x2, 0x2, 0x2, 0x122, 0x123, 0x3, 0x2, 0x2, 0x2, 0x123, 0x124, + 0x7, 0x76, 0x2, 0x2, 0x124, 0x125, 0x5, 0xb2, 0x5a, 0x2, 0x125, 0x126, + 0x7, 0x7a, 0x2, 0x2, 0x126, 0x13, 0x3, 0x2, 0x2, 0x2, 0x127, 0x131, + 0x7, 0x9, 0x2, 0x2, 0x128, 0x132, 0x5, 0x4a, 0x26, 0x2, 0x129, 0x132, + 0x5, 0x54, 0x2b, 0x2, 0x12a, 0x132, 0x5, 0x60, 0x31, 0x2, 0x12b, + 0x132, 0x5, 0x66, 0x34, 0x2, 0x12c, 0x132, 0x5, 0x6c, 0x37, 0x2, + 0x12d, 0x132, 0x5, 0x72, 0x3a, 0x2, 0x12e, 0x132, 0x5, 0x78, 0x3d, + 0x2, 0x12f, 0x132, 0x5, 0x7e, 0x40, 0x2, 0x130, 0x132, 0x5, 0x94, + 0x4b, 0x2, 0x131, 0x128, 0x3, 0x2, 0x2, 0x2, 0x131, 0x129, 0x3, 0x2, + 0x2, 0x2, 0x131, 0x12a, 0x3, 0x2, 0x2, 0x2, 0x131, 0x12b, 0x3, 0x2, + 0x2, 0x2, 0x131, 0x12c, 0x3, 0x2, 0x2, 0x2, 0x131, 0x12d, 0x3, 0x2, + 0x2, 0x2, 0x131, 0x12e, 0x3, 0x2, 0x2, 0x2, 0x131, 0x12f, 0x3, 0x2, + 0x2, 0x2, 0x131, 0x130, 0x3, 0x2, 0x2, 0x2, 0x132, 0x15, 0x3, 0x2, + 0x2, 0x2, 0x133, 0x134, 0x5, 0xd8, 0x6d, 0x2, 0x134, 0x135, 0x7, + 0x8a, 0x2, 0x2, 0x135, 0x139, 0x7, 0x8b, 0x2, 0x2, 0x136, 0x138, + 0x7, 0x8d, 0x2, 0x2, 0x137, 0x136, 0x3, 0x2, 0x2, 0x2, 0x138, 0x13b, + 0x3, 0x2, 0x2, 0x2, 0x139, 0x137, 0x3, 0x2, 0x2, 0x2, 0x139, 0x13a, + 0x3, 0x2, 0x2, 0x2, 0x13a, 0x13c, 0x3, 0x2, 0x2, 0x2, 0x13b, 0x139, + 0x3, 0x2, 0x2, 0x2, 0x13c, 0x13d, 0x7, 0x8c, 0x2, 0x2, 0x13d, 0x17, + 0x3, 0x2, 0x2, 0x2, 0x13e, 0x13f, 0x7, 0xe, 0x2, 0x2, 0x13f, 0x141, + 0x5, 0xb0, 0x59, 0x2, 0x140, 0x142, 0x7, 0x1b, 0x2, 0x2, 0x141, 0x140, + 0x3, 0x2, 0x2, 0x2, 0x141, 0x142, 0x3, 0x2, 0x2, 0x2, 0x142, 0x143, + 0x3, 0x2, 0x2, 0x2, 0x143, 0x145, 0x7, 0x75, 0x2, 0x2, 0x144, 0x146, + 0x5, 0x24, 0x13, 0x2, 0x145, 0x144, 0x3, 0x2, 0x2, 0x2, 0x146, 0x147, + 0x3, 0x2, 0x2, 0x2, 0x147, 0x145, 0x3, 0x2, 0x2, 0x2, 0x147, 0x148, + 0x3, 0x2, 0x2, 0x2, 0x148, 0x149, 0x3, 0x2, 0x2, 0x2, 0x149, 0x14a, + 0x7, 0x76, 0x2, 0x2, 0x14a, 0x14b, 0x5, 0xb0, 0x59, 0x2, 0x14b, 0x14c, + 0x7, 0x7a, 0x2, 0x2, 0x14c, 0x19, 0x3, 0x2, 0x2, 0x2, 0x14d, 0x151, + 0x5, 0x24, 0x13, 0x2, 0x14e, 0x151, 0x5, 0x1c, 0xf, 0x2, 0x14f, 0x151, + 0x5, 0x1e, 0x10, 0x2, 0x150, 0x14d, 0x3, 0x2, 0x2, 0x2, 0x150, 0x14e, + 0x3, 0x2, 0x2, 0x2, 0x150, 0x14f, 0x3, 0x2, 0x2, 0x2, 0x151, 0x1b, + 0x3, 0x2, 0x2, 0x2, 0x152, 0x153, 0x7, 0xe, 0x2, 0x2, 0x153, 0x160, + 0x5, 0xb0, 0x59, 0x2, 0x154, 0x156, 0x7, 0x1b, 0x2, 0x2, 0x155, 0x154, + 0x3, 0x2, 0x2, 0x2, 0x155, 0x156, 0x3, 0x2, 0x2, 0x2, 0x156, 0x157, + 0x3, 0x2, 0x2, 0x2, 0x157, 0x159, 0x7, 0x75, 0x2, 0x2, 0x158, 0x15a, + 0x5, 0x24, 0x13, 0x2, 0x159, 0x158, 0x3, 0x2, 0x2, 0x2, 0x15a, 0x15b, + 0x3, 0x2, 0x2, 0x2, 0x15b, 0x159, 0x3, 0x2, 0x2, 0x2, 0x15b, 0x15c, + 0x3, 0x2, 0x2, 0x2, 0x15c, 0x15d, 0x3, 0x2, 0x2, 0x2, 0x15d, 0x15e, + 0x7, 0x76, 0x2, 0x2, 0x15e, 0x15f, 0x5, 0xb0, 0x59, 0x2, 0x15f, 0x161, + 0x3, 0x2, 0x2, 0x2, 0x160, 0x155, 0x3, 0x2, 0x2, 0x2, 0x160, 0x161, + 0x3, 0x2, 0x2, 0x2, 0x161, 0x162, 0x3, 0x2, 0x2, 0x2, 0x162, 0x163, + 0x7, 0x7a, 0x2, 0x2, 0x163, 0x1d, 0x3, 0x2, 0x2, 0x2, 0x164, 0x165, + 0x7, 0x2c, 0x2, 0x2, 0x165, 0x169, 0x7, 0x75, 0x2, 0x2, 0x166, 0x168, + 0x5, 0x20, 0x11, 0x2, 0x167, 0x166, 0x3, 0x2, 0x2, 0x2, 0x168, 0x16b, + 0x3, 0x2, 0x2, 0x2, 0x169, 0x167, 0x3, 0x2, 0x2, 0x2, 0x169, 0x16a, + 0x3, 0x2, 0x2, 0x2, 0x16a, 0x16c, 0x3, 0x2, 0x2, 0x2, 0x16b, 0x169, + 0x3, 0x2, 0x2, 0x2, 0x16c, 0x16d, 0x7, 0x76, 0x2, 0x2, 0x16d, 0x16e, + 0x7, 0x7a, 0x2, 0x2, 0x16e, 0x1f, 0x3, 0x2, 0x2, 0x2, 0x16f, 0x172, + 0x5, 0x22, 0x12, 0x2, 0x170, 0x172, 0x5, 0x6, 0x4, 0x2, 0x171, 0x16f, + 0x3, 0x2, 0x2, 0x2, 0x171, 0x170, 0x3, 0x2, 0x2, 0x2, 0x172, 0x173, + 0x3, 0x2, 0x2, 0x2, 0x173, 0x174, 0x7, 0x7a, 0x2, 0x2, 0x174, 0x21, + 0x3, 0x2, 0x2, 0x2, 0x175, 0x176, 0x9, 0x2, 0x2, 0x2, 0x176, 0x178, + 0x7, 0x75, 0x2, 0x2, 0x177, 0x179, 0x5, 0x8e, 0x48, 0x2, 0x178, 0x177, + 0x3, 0x2, 0x2, 0x2, 0x179, 0x17a, 0x3, 0x2, 0x2, 0x2, 0x17a, 0x178, + 0x3, 0x2, 0x2, 0x2, 0x17a, 0x17b, 0x3, 0x2, 0x2, 0x2, 0x17b, 0x17c, + 0x3, 0x2, 0x2, 0x2, 0x17c, 0x17d, 0x7, 0x76, 0x2, 0x2, 0x17d, 0x181, + 0x3, 0x2, 0x2, 0x2, 0x17e, 0x17f, 0x7, 0x31, 0x2, 0x2, 0x17f, 0x181, + 0x5, 0xb6, 0x5c, 0x2, 0x180, 0x175, 0x3, 0x2, 0x2, 0x2, 0x180, 0x17e, + 0x3, 0x2, 0x2, 0x2, 0x181, 0x23, 0x3, 0x2, 0x2, 0x2, 0x182, 0x191, + 0x5, 0x26, 0x14, 0x2, 0x183, 0x191, 0x5, 0x28, 0x15, 0x2, 0x184, + 0x191, 0x5, 0x2a, 0x16, 0x2, 0x185, 0x191, 0x5, 0x2c, 0x17, 0x2, + 0x186, 0x191, 0x5, 0x8, 0x5, 0x2, 0x187, 0x191, 0x5, 0x30, 0x19, + 0x2, 0x188, 0x191, 0x5, 0x32, 0x1a, 0x2, 0x189, 0x191, 0x5, 0xc, + 0x7, 0x2, 0x18a, 0x191, 0x5, 0x34, 0x1b, 0x2, 0x18b, 0x191, 0x5, + 0x42, 0x22, 0x2, 0x18c, 0x191, 0x5, 0x44, 0x23, 0x2, 0x18d, 0x191, + 0x5, 0x46, 0x24, 0x2, 0x18e, 0x191, 0x5, 0x48, 0x25, 0x2, 0x18f, + 0x191, 0x5, 0x6, 0x4, 0x2, 0x190, 0x182, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x183, 0x3, 0x2, 0x2, 0x2, 0x190, 0x184, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x185, 0x3, 0x2, 0x2, 0x2, 0x190, 0x186, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x187, 0x3, 0x2, 0x2, 0x2, 0x190, 0x188, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x189, 0x3, 0x2, 0x2, 0x2, 0x190, 0x18a, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x18b, 0x3, 0x2, 0x2, 0x2, 0x190, 0x18c, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x18d, 0x3, 0x2, 0x2, 0x2, 0x190, 0x18e, 0x3, 0x2, 0x2, 0x2, 0x190, + 0x18f, 0x3, 0x2, 0x2, 0x2, 0x191, 0x192, 0x3, 0x2, 0x2, 0x2, 0x192, + 0x193, 0x7, 0x7a, 0x2, 0x2, 0x193, 0x25, 0x3, 0x2, 0x2, 0x2, 0x194, + 0x195, 0x7, 0x8, 0x2, 0x2, 0x195, 0x196, 0x5, 0xb2, 0x5a, 0x2, 0x196, + 0x27, 0x3, 0x2, 0x2, 0x2, 0x197, 0x198, 0x7, 0xa, 0x2, 0x2, 0x198, + 0x199, 0x5, 0xb2, 0x5a, 0x2, 0x199, 0x29, 0x3, 0x2, 0x2, 0x2, 0x19a, + 0x19b, 0x7, 0xb, 0x2, 0x2, 0x19b, 0x19d, 0x5, 0xb2, 0x5a, 0x2, 0x19c, + 0x19e, 0x9, 0x3, 0x2, 0x2, 0x19d, 0x19c, 0x3, 0x2, 0x2, 0x2, 0x19d, + 0x19e, 0x3, 0x2, 0x2, 0x2, 0x19e, 0x2b, 0x3, 0x2, 0x2, 0x2, 0x19f, + 0x1a6, 0x7, 0xf, 0x2, 0x2, 0x1a0, 0x1a7, 0x7, 0x87, 0x2, 0x2, 0x1a1, + 0x1a3, 0x5, 0x2e, 0x18, 0x2, 0x1a2, 0x1a1, 0x3, 0x2, 0x2, 0x2, 0x1a3, + 0x1a4, 0x3, 0x2, 0x2, 0x2, 0x1a4, 0x1a2, 0x3, 0x2, 0x2, 0x2, 0x1a4, + 0x1a5, 0x3, 0x2, 0x2, 0x2, 0x1a5, 0x1a7, 0x3, 0x2, 0x2, 0x2, 0x1a6, + 0x1a0, 0x3, 0x2, 0x2, 0x2, 0x1a6, 0x1a2, 0x3, 0x2, 0x2, 0x2, 0x1a7, + 0x2d, 0x3, 0x2, 0x2, 0x2, 0x1a8, 0x1b1, 0x7, 0x11, 0x2, 0x2, 0x1a9, + 0x1b1, 0x7, 0x12, 0x2, 0x2, 0x1aa, 0x1b1, 0x7, 0x13, 0x2, 0x2, 0x1ab, + 0x1b1, 0x7, 0x14, 0x2, 0x2, 0x1ac, 0x1ad, 0x7, 0x16, 0x2, 0x2, 0x1ad, + 0x1b1, 0x5, 0xa6, 0x54, 0x2, 0x1ae, 0x1af, 0x7, 0x15, 0x2, 0x2, 0x1af, + 0x1b1, 0x5, 0xa6, 0x54, 0x2, 0x1b0, 0x1a8, 0x3, 0x2, 0x2, 0x2, 0x1b0, + 0x1a9, 0x3, 0x2, 0x2, 0x2, 0x1b0, 0x1aa, 0x3, 0x2, 0x2, 0x2, 0x1b0, + 0x1ab, 0x3, 0x2, 0x2, 0x2, 0x1b0, 0x1ac, 0x3, 0x2, 0x2, 0x2, 0x1b0, + 0x1ae, 0x3, 0x2, 0x2, 0x2, 0x1b1, 0x2f, 0x3, 0x2, 0x2, 0x2, 0x1b2, + 0x1b6, 0x7, 0x21, 0x2, 0x2, 0x1b3, 0x1b7, 0x5, 0xd4, 0x6b, 0x2, 0x1b4, + 0x1b7, 0x5, 0xd6, 0x6c, 0x2, 0x1b5, 0x1b7, 0x5, 0xdc, 0x6f, 0x2, + 0x1b6, 0x1b3, 0x3, 0x2, 0x2, 0x2, 0x1b6, 0x1b4, 0x3, 0x2, 0x2, 0x2, + 0x1b6, 0x1b5, 0x3, 0x2, 0x2, 0x2, 0x1b7, 0x1b8, 0x3, 0x2, 0x2, 0x2, + 0x1b8, 0x1bd, 0x5, 0x9c, 0x4f, 0x2, 0x1b9, 0x1ba, 0x7, 0x7d, 0x2, + 0x2, 0x1ba, 0x1bc, 0x5, 0x9c, 0x4f, 0x2, 0x1bb, 0x1b9, 0x3, 0x2, + 0x2, 0x2, 0x1bc, 0x1bf, 0x3, 0x2, 0x2, 0x2, 0x1bd, 0x1bb, 0x3, 0x2, + 0x2, 0x2, 0x1bd, 0x1be, 0x3, 0x2, 0x2, 0x2, 0x1be, 0x31, 0x3, 0x2, + 0x2, 0x2, 0x1bf, 0x1bd, 0x3, 0x2, 0x2, 0x2, 0x1c0, 0x1c1, 0x7, 0x20, + 0x2, 0x2, 0x1c1, 0x1c6, 0x5, 0x9c, 0x4f, 0x2, 0x1c2, 0x1c3, 0x7, + 0x7d, 0x2, 0x2, 0x1c3, 0x1c5, 0x5, 0x9c, 0x4f, 0x2, 0x1c4, 0x1c2, + 0x3, 0x2, 0x2, 0x2, 0x1c5, 0x1c8, 0x3, 0x2, 0x2, 0x2, 0x1c6, 0x1c4, + 0x3, 0x2, 0x2, 0x2, 0x1c6, 0x1c7, 0x3, 0x2, 0x2, 0x2, 0x1c7, 0x1ca, + 0x3, 0x2, 0x2, 0x2, 0x1c8, 0x1c6, 0x3, 0x2, 0x2, 0x2, 0x1c9, 0x1c0, + 0x3, 0x2, 0x2, 0x2, 0x1c9, 0x1ca, 0x3, 0x2, 0x2, 0x2, 0x1ca, 0x1dd, + 0x3, 0x2, 0x2, 0x2, 0x1cb, 0x1cc, 0x5, 0xd6, 0x6c, 0x2, 0x1cc, 0x1d2, + 0x5, 0x9c, 0x4f, 0x2, 0x1cd, 0x1d0, 0x7, 0x26, 0x2, 0x2, 0x1ce, 0x1d1, + 0x7, 0x3e, 0x2, 0x2, 0x1cf, 0x1d1, 0x5, 0x9c, 0x4f, 0x2, 0x1d0, 0x1ce, + 0x3, 0x2, 0x2, 0x2, 0x1d0, 0x1cf, 0x3, 0x2, 0x2, 0x2, 0x1d1, 0x1d3, + 0x3, 0x2, 0x2, 0x2, 0x1d2, 0x1cd, 0x3, 0x2, 0x2, 0x2, 0x1d2, 0x1d3, + 0x3, 0x2, 0x2, 0x2, 0x1d3, 0x1de, 0x3, 0x2, 0x2, 0x2, 0x1d4, 0x1d5, + 0x5, 0xd4, 0x6b, 0x2, 0x1d5, 0x1db, 0x5, 0x9c, 0x4f, 0x2, 0x1d6, + 0x1d9, 0x9, 0x4, 0x2, 0x2, 0x1d7, 0x1da, 0x7, 0x3e, 0x2, 0x2, 0x1d8, + 0x1da, 0x5, 0x9c, 0x4f, 0x2, 0x1d9, 0x1d7, 0x3, 0x2, 0x2, 0x2, 0x1d9, + 0x1d8, 0x3, 0x2, 0x2, 0x2, 0x1da, 0x1dc, 0x3, 0x2, 0x2, 0x2, 0x1db, + 0x1d6, 0x3, 0x2, 0x2, 0x2, 0x1db, 0x1dc, 0x3, 0x2, 0x2, 0x2, 0x1dc, + 0x1de, 0x3, 0x2, 0x2, 0x2, 0x1dd, 0x1cb, 0x3, 0x2, 0x2, 0x2, 0x1dd, + 0x1d4, 0x3, 0x2, 0x2, 0x2, 0x1de, 0x33, 0x3, 0x2, 0x2, 0x2, 0x1df, + 0x1e1, 0x5, 0xda, 0x6e, 0x2, 0x1e0, 0x1df, 0x3, 0x2, 0x2, 0x2, 0x1e0, + 0x1e1, 0x3, 0x2, 0x2, 0x2, 0x1e1, 0x1e2, 0x3, 0x2, 0x2, 0x2, 0x1e2, + 0x1e4, 0x5, 0xdc, 0x6f, 0x2, 0x1e3, 0x1e5, 0x5, 0xa0, 0x51, 0x2, + 0x1e4, 0x1e3, 0x3, 0x2, 0x2, 0x2, 0x1e4, 0x1e5, 0x3, 0x2, 0x2, 0x2, + 0x1e5, 0x21c, 0x3, 0x2, 0x2, 0x2, 0x1e6, 0x1ea, 0x5, 0x38, 0x1d, + 0x2, 0x1e7, 0x1e9, 0x5, 0x36, 0x1c, 0x2, 0x1e8, 0x1e7, 0x3, 0x2, + 0x2, 0x2, 0x1e9, 0x1ec, 0x3, 0x2, 0x2, 0x2, 0x1ea, 0x1e8, 0x3, 0x2, + 0x2, 0x2, 0x1ea, 0x1eb, 0x3, 0x2, 0x2, 0x2, 0x1eb, 0x21d, 0x3, 0x2, + 0x2, 0x2, 0x1ec, 0x1ea, 0x3, 0x2, 0x2, 0x2, 0x1ed, 0x1ee, 0x7, 0xe, + 0x2, 0x2, 0x1ee, 0x1f0, 0x5, 0xb0, 0x59, 0x2, 0x1ef, 0x1ed, 0x3, + 0x2, 0x2, 0x2, 0x1f0, 0x1f1, 0x3, 0x2, 0x2, 0x2, 0x1f1, 0x1ef, 0x3, + 0x2, 0x2, 0x2, 0x1f1, 0x1f2, 0x3, 0x2, 0x2, 0x2, 0x1f2, 0x1f6, 0x3, + 0x2, 0x2, 0x2, 0x1f3, 0x1f5, 0x5, 0x9e, 0x50, 0x2, 0x1f4, 0x1f3, + 0x3, 0x2, 0x2, 0x2, 0x1f5, 0x1f8, 0x3, 0x2, 0x2, 0x2, 0x1f6, 0x1f4, + 0x3, 0x2, 0x2, 0x2, 0x1f6, 0x1f7, 0x3, 0x2, 0x2, 0x2, 0x1f7, 0x21d, + 0x3, 0x2, 0x2, 0x2, 0x1f8, 0x1f6, 0x3, 0x2, 0x2, 0x2, 0x1f9, 0x1fa, + 0x7, 0x39, 0x2, 0x2, 0x1fa, 0x1fc, 0x5, 0x3c, 0x1f, 0x2, 0x1fb, 0x1fd, + 0x5, 0xa0, 0x51, 0x2, 0x1fc, 0x1fb, 0x3, 0x2, 0x2, 0x2, 0x1fc, 0x1fd, + 0x3, 0x2, 0x2, 0x2, 0x1fd, 0x21d, 0x3, 0x2, 0x2, 0x2, 0x1fe, 0x1ff, + 0x7, 0x3a, 0x2, 0x2, 0x1ff, 0x201, 0x5, 0xa0, 0x51, 0x2, 0x200, 0x202, + 0x5, 0x3e, 0x20, 0x2, 0x201, 0x200, 0x3, 0x2, 0x2, 0x2, 0x202, 0x203, + 0x3, 0x2, 0x2, 0x2, 0x203, 0x201, 0x3, 0x2, 0x2, 0x2, 0x203, 0x204, + 0x3, 0x2, 0x2, 0x2, 0x204, 0x206, 0x3, 0x2, 0x2, 0x2, 0x205, 0x207, + 0x5, 0xa0, 0x51, 0x2, 0x206, 0x205, 0x3, 0x2, 0x2, 0x2, 0x206, 0x207, + 0x3, 0x2, 0x2, 0x2, 0x207, 0x21d, 0x3, 0x2, 0x2, 0x2, 0x208, 0x209, + 0x5, 0xde, 0x70, 0x2, 0x209, 0x20b, 0x5, 0xa0, 0x51, 0x2, 0x20a, + 0x20c, 0x5, 0x40, 0x21, 0x2, 0x20b, 0x20a, 0x3, 0x2, 0x2, 0x2, 0x20c, + 0x20d, 0x3, 0x2, 0x2, 0x2, 0x20d, 0x20b, 0x3, 0x2, 0x2, 0x2, 0x20d, + 0x20e, 0x3, 0x2, 0x2, 0x2, 0x20e, 0x210, 0x3, 0x2, 0x2, 0x2, 0x20f, + 0x211, 0x5, 0xa0, 0x51, 0x2, 0x210, 0x20f, 0x3, 0x2, 0x2, 0x2, 0x210, + 0x211, 0x3, 0x2, 0x2, 0x2, 0x211, 0x21d, 0x3, 0x2, 0x2, 0x2, 0x212, + 0x213, 0x7, 0x37, 0x2, 0x2, 0x213, 0x215, 0x5, 0xa0, 0x51, 0x2, 0x214, + 0x216, 0x5, 0x3e, 0x20, 0x2, 0x215, 0x214, 0x3, 0x2, 0x2, 0x2, 0x216, + 0x217, 0x3, 0x2, 0x2, 0x2, 0x217, 0x215, 0x3, 0x2, 0x2, 0x2, 0x217, + 0x218, 0x3, 0x2, 0x2, 0x2, 0x218, 0x21a, 0x3, 0x2, 0x2, 0x2, 0x219, + 0x21b, 0x5, 0xa0, 0x51, 0x2, 0x21a, 0x219, 0x3, 0x2, 0x2, 0x2, 0x21a, + 0x21b, 0x3, 0x2, 0x2, 0x2, 0x21b, 0x21d, 0x3, 0x2, 0x2, 0x2, 0x21c, + 0x1e6, 0x3, 0x2, 0x2, 0x2, 0x21c, 0x1ef, 0x3, 0x2, 0x2, 0x2, 0x21c, + 0x1f9, 0x3, 0x2, 0x2, 0x2, 0x21c, 0x1fe, 0x3, 0x2, 0x2, 0x2, 0x21c, + 0x208, 0x3, 0x2, 0x2, 0x2, 0x21c, 0x212, 0x3, 0x2, 0x2, 0x2, 0x21d, + 0x35, 0x3, 0x2, 0x2, 0x2, 0x21e, 0x220, 0x5, 0xa2, 0x52, 0x2, 0x21f, + 0x221, 0x5, 0x38, 0x1d, 0x2, 0x220, 0x21f, 0x3, 0x2, 0x2, 0x2, 0x220, + 0x221, 0x3, 0x2, 0x2, 0x2, 0x221, 0x37, 0x3, 0x2, 0x2, 0x2, 0x222, + 0x223, 0x7, 0x1c, 0x2, 0x2, 0x223, 0x224, 0x5, 0xb0, 0x59, 0x2, 0x224, + 0x225, 0x7, 0x1d, 0x2, 0x2, 0x225, 0x228, 0x3, 0x2, 0x2, 0x2, 0x226, + 0x228, 0x5, 0x3a, 0x1e, 0x2, 0x227, 0x222, 0x3, 0x2, 0x2, 0x2, 0x227, + 0x226, 0x3, 0x2, 0x2, 0x2, 0x228, 0x39, 0x3, 0x2, 0x2, 0x2, 0x229, + 0x22a, 0x7, 0x1c, 0x2, 0x2, 0x22a, 0x22b, 0x7, 0x87, 0x2, 0x2, 0x22b, + 0x22c, 0x7, 0x87, 0x2, 0x2, 0x22c, 0x22d, 0x7, 0x87, 0x2, 0x2, 0x22d, + 0x22e, 0x7, 0x87, 0x2, 0x2, 0x22e, 0x231, 0x7, 0x1d, 0x2, 0x2, 0x22f, + 0x231, 0x7, 0x87, 0x2, 0x2, 0x230, 0x229, 0x3, 0x2, 0x2, 0x2, 0x230, + 0x22f, 0x3, 0x2, 0x2, 0x2, 0x231, 0x3b, 0x3, 0x2, 0x2, 0x2, 0x232, + 0x233, 0x5, 0xa2, 0x52, 0x2, 0x233, 0x234, 0x5, 0x9a, 0x4e, 0x2, + 0x234, 0x235, 0x5, 0x9a, 0x4e, 0x2, 0x235, 0x3d, 0x3, 0x2, 0x2, 0x2, + 0x236, 0x237, 0x5, 0x9a, 0x4e, 0x2, 0x237, 0x238, 0x7, 0x37, 0x2, + 0x2, 0x238, 0x23a, 0x7, 0x7f, 0x2, 0x2, 0x239, 0x23b, 0x7, 0x7c, + 0x2, 0x2, 0x23a, 0x239, 0x3, 0x2, 0x2, 0x2, 0x23a, 0x23b, 0x3, 0x2, + 0x2, 0x2, 0x23b, 0x3f, 0x3, 0x2, 0x2, 0x2, 0x23c, 0x23f, 0x5, 0x9a, + 0x4e, 0x2, 0x23d, 0x23e, 0x7, 0x37, 0x2, 0x2, 0x23e, 0x240, 0x7, + 0x7f, 0x2, 0x2, 0x23f, 0x23d, 0x3, 0x2, 0x2, 0x2, 0x23f, 0x240, 0x3, + 0x2, 0x2, 0x2, 0x240, 0x242, 0x3, 0x2, 0x2, 0x2, 0x241, 0x243, 0x7, + 0x3d, 0x2, 0x2, 0x242, 0x241, 0x3, 0x2, 0x2, 0x2, 0x242, 0x243, 0x3, + 0x2, 0x2, 0x2, 0x243, 0x245, 0x3, 0x2, 0x2, 0x2, 0x244, 0x246, 0x7, + 0x7c, 0x2, 0x2, 0x245, 0x244, 0x3, 0x2, 0x2, 0x2, 0x245, 0x246, 0x3, + 0x2, 0x2, 0x2, 0x246, 0x41, 0x3, 0x2, 0x2, 0x2, 0x247, 0x249, 0x7, + 0x2a, 0x2, 0x2, 0x248, 0x24a, 0x5, 0xb4, 0x5b, 0x2, 0x249, 0x248, + 0x3, 0x2, 0x2, 0x2, 0x24a, 0x24b, 0x3, 0x2, 0x2, 0x2, 0x24b, 0x249, + 0x3, 0x2, 0x2, 0x2, 0x24b, 0x24c, 0x3, 0x2, 0x2, 0x2, 0x24c, 0x43, + 0x3, 0x2, 0x2, 0x2, 0x24d, 0x254, 0x7, 0x32, 0x2, 0x2, 0x24e, 0x252, + 0x5, 0xb6, 0x5c, 0x2, 0x24f, 0x250, 0x5, 0xb6, 0x5c, 0x2, 0x250, + 0x251, 0x5, 0xb6, 0x5c, 0x2, 0x251, 0x253, 0x3, 0x2, 0x2, 0x2, 0x252, + 0x24f, 0x3, 0x2, 0x2, 0x2, 0x252, 0x253, 0x3, 0x2, 0x2, 0x2, 0x253, + 0x255, 0x3, 0x2, 0x2, 0x2, 0x254, 0x24e, 0x3, 0x2, 0x2, 0x2, 0x254, + 0x255, 0x3, 0x2, 0x2, 0x2, 0x255, 0x256, 0x3, 0x2, 0x2, 0x2, 0x256, + 0x257, 0x7, 0x7e, 0x2, 0x2, 0x257, 0x258, 0x7, 0x92, 0x2, 0x2, 0x258, + 0x259, 0x7, 0x93, 0x2, 0x2, 0x259, 0x45, 0x3, 0x2, 0x2, 0x2, 0x25a, + 0x25b, 0x7, 0x2b, 0x2, 0x2, 0x25b, 0x25d, 0x7, 0x75, 0x2, 0x2, 0x25c, + 0x25e, 0x5, 0x8e, 0x48, 0x2, 0x25d, 0x25c, 0x3, 0x2, 0x2, 0x2, 0x25e, + 0x25f, 0x3, 0x2, 0x2, 0x2, 0x25f, 0x25d, 0x3, 0x2, 0x2, 0x2, 0x25f, + 0x260, 0x3, 0x2, 0x2, 0x2, 0x260, 0x261, 0x3, 0x2, 0x2, 0x2, 0x261, + 0x262, 0x7, 0x76, 0x2, 0x2, 0x262, 0x47, 0x3, 0x2, 0x2, 0x2, 0x263, + 0x264, 0x7, 0xd, 0x2, 0x2, 0x264, 0x49, 0x3, 0x2, 0x2, 0x2, 0x265, + 0x266, 0x7, 0x3f, 0x2, 0x2, 0x266, 0x268, 0x7, 0x75, 0x2, 0x2, 0x267, + 0x269, 0x5, 0x4c, 0x27, 0x2, 0x268, 0x267, 0x3, 0x2, 0x2, 0x2, 0x269, + 0x26a, 0x3, 0x2, 0x2, 0x2, 0x26a, 0x268, 0x3, 0x2, 0x2, 0x2, 0x26a, + 0x26b, 0x3, 0x2, 0x2, 0x2, 0x26b, 0x26c, 0x3, 0x2, 0x2, 0x2, 0x26c, + 0x26d, 0x7, 0x76, 0x2, 0x2, 0x26d, 0x26e, 0x7, 0x3f, 0x2, 0x2, 0x26e, + 0x26f, 0x7, 0x7a, 0x2, 0x2, 0x26f, 0x4b, 0x3, 0x2, 0x2, 0x2, 0x270, + 0x274, 0x5, 0x4e, 0x28, 0x2, 0x271, 0x274, 0x5, 0x50, 0x29, 0x2, + 0x272, 0x274, 0x5, 0x6, 0x4, 0x2, 0x273, 0x270, 0x3, 0x2, 0x2, 0x2, + 0x273, 0x271, 0x3, 0x2, 0x2, 0x2, 0x273, 0x272, 0x3, 0x2, 0x2, 0x2, + 0x274, 0x275, 0x3, 0x2, 0x2, 0x2, 0x275, 0x276, 0x7, 0x7a, 0x2, 0x2, + 0x276, 0x4d, 0x3, 0x2, 0x2, 0x2, 0x277, 0x279, 0x9, 0x5, 0x2, 0x2, + 0x278, 0x27a, 0x5, 0xb2, 0x5a, 0x2, 0x279, 0x278, 0x3, 0x2, 0x2, + 0x2, 0x27a, 0x27b, 0x3, 0x2, 0x2, 0x2, 0x27b, 0x279, 0x3, 0x2, 0x2, + 0x2, 0x27b, 0x27c, 0x3, 0x2, 0x2, 0x2, 0x27c, 0x4f, 0x3, 0x2, 0x2, + 0x2, 0x27d, 0x27e, 0x9, 0x6, 0x2, 0x2, 0x27e, 0x283, 0x5, 0x52, 0x2a, + 0x2, 0x27f, 0x280, 0x7, 0x7d, 0x2, 0x2, 0x280, 0x282, 0x5, 0x52, + 0x2a, 0x2, 0x281, 0x27f, 0x3, 0x2, 0x2, 0x2, 0x282, 0x285, 0x3, 0x2, + 0x2, 0x2, 0x283, 0x281, 0x3, 0x2, 0x2, 0x2, 0x283, 0x284, 0x3, 0x2, + 0x2, 0x2, 0x284, 0x51, 0x3, 0x2, 0x2, 0x2, 0x285, 0x283, 0x3, 0x2, + 0x2, 0x2, 0x286, 0x287, 0x5, 0xb2, 0x5a, 0x2, 0x287, 0x289, 0x5, + 0xb2, 0x5a, 0x2, 0x288, 0x28a, 0x7, 0x87, 0x2, 0x2, 0x289, 0x288, + 0x3, 0x2, 0x2, 0x2, 0x28a, 0x28b, 0x3, 0x2, 0x2, 0x2, 0x28b, 0x289, + 0x3, 0x2, 0x2, 0x2, 0x28b, 0x28c, 0x3, 0x2, 0x2, 0x2, 0x28c, 0x53, + 0x3, 0x2, 0x2, 0x2, 0x28d, 0x28e, 0x7, 0x44, 0x2, 0x2, 0x28e, 0x290, + 0x7, 0x75, 0x2, 0x2, 0x28f, 0x291, 0x5, 0x56, 0x2c, 0x2, 0x290, 0x28f, + 0x3, 0x2, 0x2, 0x2, 0x291, 0x292, 0x3, 0x2, 0x2, 0x2, 0x292, 0x290, + 0x3, 0x2, 0x2, 0x2, 0x292, 0x293, 0x3, 0x2, 0x2, 0x2, 0x293, 0x294, + 0x3, 0x2, 0x2, 0x2, 0x294, 0x295, 0x7, 0x76, 0x2, 0x2, 0x295, 0x296, + 0x7, 0x44, 0x2, 0x2, 0x296, 0x297, 0x7, 0x7a, 0x2, 0x2, 0x297, 0x55, + 0x3, 0x2, 0x2, 0x2, 0x298, 0x29e, 0x5, 0x58, 0x2d, 0x2, 0x299, 0x29e, + 0x5, 0x5a, 0x2e, 0x2, 0x29a, 0x29e, 0x5, 0x5c, 0x2f, 0x2, 0x29b, + 0x29e, 0x5, 0x5e, 0x30, 0x2, 0x29c, 0x29e, 0x5, 0x6, 0x4, 0x2, 0x29d, + 0x298, 0x3, 0x2, 0x2, 0x2, 0x29d, 0x299, 0x3, 0x2, 0x2, 0x2, 0x29d, + 0x29a, 0x3, 0x2, 0x2, 0x2, 0x29d, 0x29b, 0x3, 0x2, 0x2, 0x2, 0x29d, + 0x29c, 0x3, 0x2, 0x2, 0x2, 0x29e, 0x29f, 0x3, 0x2, 0x2, 0x2, 0x29f, + 0x2a0, 0x7, 0x7a, 0x2, 0x2, 0x2a0, 0x57, 0x3, 0x2, 0x2, 0x2, 0x2a1, + 0x2a2, 0x7, 0x45, 0x2, 0x2, 0x2a2, 0x2a3, 0x5, 0xa4, 0x53, 0x2, 0x2a3, + 0x2a4, 0x7, 0x7d, 0x2, 0x2, 0x2a4, 0x2a5, 0x5, 0xa4, 0x53, 0x2, 0x2a5, + 0x2a6, 0x7, 0x7d, 0x2, 0x2, 0x2a6, 0x2a7, 0x5, 0xa4, 0x53, 0x2, 0x2a7, + 0x2a8, 0x7, 0x7d, 0x2, 0x2, 0x2a8, 0x2a9, 0x5, 0xa4, 0x53, 0x2, 0x2a9, + 0x59, 0x3, 0x2, 0x2, 0x2, 0x2aa, 0x2ab, 0x7, 0x46, 0x2, 0x2, 0x2ab, + 0x2ad, 0x5, 0x9c, 0x4f, 0x2, 0x2ac, 0x2ae, 0x7, 0x87, 0x2, 0x2, 0x2ad, + 0x2ac, 0x3, 0x2, 0x2, 0x2, 0x2ae, 0x2af, 0x3, 0x2, 0x2, 0x2, 0x2af, + 0x2ad, 0x3, 0x2, 0x2, 0x2, 0x2af, 0x2b0, 0x3, 0x2, 0x2, 0x2, 0x2b0, + 0x5b, 0x3, 0x2, 0x2, 0x2, 0x2b1, 0x2b2, 0x7, 0x47, 0x2, 0x2, 0x2b2, + 0x2b4, 0x5, 0x9c, 0x4f, 0x2, 0x2b3, 0x2b5, 0x7, 0x87, 0x2, 0x2, 0x2b4, + 0x2b3, 0x3, 0x2, 0x2, 0x2, 0x2b5, 0x2b6, 0x3, 0x2, 0x2, 0x2, 0x2b6, + 0x2b4, 0x3, 0x2, 0x2, 0x2, 0x2b6, 0x2b7, 0x3, 0x2, 0x2, 0x2, 0x2b7, + 0x5d, 0x3, 0x2, 0x2, 0x2, 0x2b8, 0x2b9, 0x7, 0x48, 0x2, 0x2, 0x2b9, + 0x2bb, 0x5, 0x9c, 0x4f, 0x2, 0x2ba, 0x2bc, 0x7, 0x87, 0x2, 0x2, 0x2bb, + 0x2ba, 0x3, 0x2, 0x2, 0x2, 0x2bc, 0x2bd, 0x3, 0x2, 0x2, 0x2, 0x2bd, + 0x2bb, 0x3, 0x2, 0x2, 0x2, 0x2bd, 0x2be, 0x3, 0x2, 0x2, 0x2, 0x2be, + 0x5f, 0x3, 0x2, 0x2, 0x2, 0x2bf, 0x2c0, 0x7, 0x49, 0x2, 0x2, 0x2c0, + 0x2c2, 0x7, 0x75, 0x2, 0x2, 0x2c1, 0x2c3, 0x5, 0x62, 0x32, 0x2, 0x2c2, + 0x2c1, 0x3, 0x2, 0x2, 0x2, 0x2c3, 0x2c4, 0x3, 0x2, 0x2, 0x2, 0x2c4, + 0x2c2, 0x3, 0x2, 0x2, 0x2, 0x2c4, 0x2c5, 0x3, 0x2, 0x2, 0x2, 0x2c5, + 0x2c6, 0x3, 0x2, 0x2, 0x2, 0x2c6, 0x2c7, 0x7, 0x76, 0x2, 0x2, 0x2c7, + 0x2c8, 0x7, 0x49, 0x2, 0x2, 0x2c8, 0x2c9, 0x7, 0x7a, 0x2, 0x2, 0x2c9, + 0x61, 0x3, 0x2, 0x2, 0x2, 0x2ca, 0x2cd, 0x5, 0x64, 0x33, 0x2, 0x2cb, + 0x2cd, 0x5, 0x6, 0x4, 0x2, 0x2cc, 0x2ca, 0x3, 0x2, 0x2, 0x2, 0x2cc, + 0x2cb, 0x3, 0x2, 0x2, 0x2, 0x2cd, 0x2ce, 0x3, 0x2, 0x2, 0x2, 0x2ce, + 0x2cf, 0x7, 0x7a, 0x2, 0x2, 0x2cf, 0x63, 0x3, 0x2, 0x2, 0x2, 0x2d0, + 0x2d1, 0x7, 0x4a, 0x2, 0x2, 0x2d1, 0x2d2, 0x7, 0x84, 0x2, 0x2, 0x2d2, + 0x65, 0x3, 0x2, 0x2, 0x2, 0x2d3, 0x2d4, 0x7, 0x4b, 0x2, 0x2, 0x2d4, + 0x2d8, 0x7, 0x75, 0x2, 0x2, 0x2d5, 0x2d7, 0x5, 0x68, 0x35, 0x2, 0x2d6, + 0x2d5, 0x3, 0x2, 0x2, 0x2, 0x2d7, 0x2da, 0x3, 0x2, 0x2, 0x2, 0x2d8, + 0x2d6, 0x3, 0x2, 0x2, 0x2, 0x2d8, 0x2d9, 0x3, 0x2, 0x2, 0x2, 0x2d9, + 0x2db, 0x3, 0x2, 0x2, 0x2, 0x2da, 0x2d8, 0x3, 0x2, 0x2, 0x2, 0x2db, + 0x2dc, 0x7, 0x76, 0x2, 0x2, 0x2dc, 0x2dd, 0x7, 0x4b, 0x2, 0x2, 0x2dd, + 0x2de, 0x7, 0x7a, 0x2, 0x2, 0x2de, 0x67, 0x3, 0x2, 0x2, 0x2, 0x2df, + 0x2e2, 0x5, 0x6a, 0x36, 0x2, 0x2e0, 0x2e2, 0x5, 0x6, 0x4, 0x2, 0x2e1, + 0x2df, 0x3, 0x2, 0x2, 0x2, 0x2e1, 0x2e0, 0x3, 0x2, 0x2, 0x2, 0x2e2, + 0x2e3, 0x3, 0x2, 0x2, 0x2, 0x2e3, 0x2e4, 0x7, 0x7a, 0x2, 0x2, 0x2e4, + 0x69, 0x3, 0x2, 0x2, 0x2, 0x2e5, 0x2e6, 0x9, 0x7, 0x2, 0x2, 0x2e6, + 0x2e7, 0x7, 0x87, 0x2, 0x2, 0x2e7, 0x6b, 0x3, 0x2, 0x2, 0x2, 0x2e8, + 0x2e9, 0x7, 0x6e, 0x2, 0x2, 0x2e9, 0x2ed, 0x7, 0x75, 0x2, 0x2, 0x2ea, + 0x2ec, 0x5, 0x6e, 0x38, 0x2, 0x2eb, 0x2ea, 0x3, 0x2, 0x2, 0x2, 0x2ec, + 0x2ef, 0x3, 0x2, 0x2, 0x2, 0x2ed, 0x2eb, 0x3, 0x2, 0x2, 0x2, 0x2ed, + 0x2ee, 0x3, 0x2, 0x2, 0x2, 0x2ee, 0x2f0, 0x3, 0x2, 0x2, 0x2, 0x2ef, + 0x2ed, 0x3, 0x2, 0x2, 0x2, 0x2f0, 0x2f1, 0x7, 0x76, 0x2, 0x2, 0x2f1, + 0x2f2, 0x7, 0x6e, 0x2, 0x2, 0x2f2, 0x2f3, 0x7, 0x7a, 0x2, 0x2, 0x2f3, + 0x6d, 0x3, 0x2, 0x2, 0x2, 0x2f4, 0x2f7, 0x5, 0x70, 0x39, 0x2, 0x2f5, + 0x2f7, 0x5, 0x6, 0x4, 0x2, 0x2f6, 0x2f4, 0x3, 0x2, 0x2, 0x2, 0x2f6, + 0x2f5, 0x3, 0x2, 0x2, 0x2, 0x2f7, 0x2f8, 0x3, 0x2, 0x2, 0x2, 0x2f8, + 0x2f9, 0x7, 0x7a, 0x2, 0x2, 0x2f9, 0x6f, 0x3, 0x2, 0x2, 0x2, 0x2fa, + 0x2fb, 0x9, 0x8, 0x2, 0x2, 0x2fb, 0x2fc, 0x7, 0x87, 0x2, 0x2, 0x2fc, + 0x71, 0x3, 0x2, 0x2, 0x2, 0x2fd, 0x2fe, 0x7, 0x50, 0x2, 0x2, 0x2fe, + 0x300, 0x7, 0x75, 0x2, 0x2, 0x2ff, 0x301, 0x5, 0x74, 0x3b, 0x2, 0x300, + 0x2ff, 0x3, 0x2, 0x2, 0x2, 0x301, 0x302, 0x3, 0x2, 0x2, 0x2, 0x302, + 0x300, 0x3, 0x2, 0x2, 0x2, 0x302, 0x303, 0x3, 0x2, 0x2, 0x2, 0x303, + 0x304, 0x3, 0x2, 0x2, 0x2, 0x304, 0x305, 0x7, 0x76, 0x2, 0x2, 0x305, + 0x306, 0x7, 0x50, 0x2, 0x2, 0x306, 0x307, 0x7, 0x7a, 0x2, 0x2, 0x307, + 0x73, 0x3, 0x2, 0x2, 0x2, 0x308, 0x30b, 0x5, 0x76, 0x3c, 0x2, 0x309, + 0x30b, 0x5, 0x6, 0x4, 0x2, 0x30a, 0x308, 0x3, 0x2, 0x2, 0x2, 0x30a, + 0x309, 0x3, 0x2, 0x2, 0x2, 0x30b, 0x30c, 0x3, 0x2, 0x2, 0x2, 0x30c, + 0x30d, 0x7, 0x7a, 0x2, 0x2, 0x30d, 0x75, 0x3, 0x2, 0x2, 0x2, 0x30e, + 0x30f, 0x7, 0x51, 0x2, 0x2, 0x30f, 0x316, 0x5, 0xb6, 0x5c, 0x2, 0x310, + 0x314, 0x5, 0xb6, 0x5c, 0x2, 0x311, 0x312, 0x5, 0xb6, 0x5c, 0x2, + 0x312, 0x313, 0x5, 0xb6, 0x5c, 0x2, 0x313, 0x315, 0x3, 0x2, 0x2, + 0x2, 0x314, 0x311, 0x3, 0x2, 0x2, 0x2, 0x314, 0x315, 0x3, 0x2, 0x2, + 0x2, 0x315, 0x317, 0x3, 0x2, 0x2, 0x2, 0x316, 0x310, 0x3, 0x2, 0x2, + 0x2, 0x316, 0x317, 0x3, 0x2, 0x2, 0x2, 0x317, 0x318, 0x3, 0x2, 0x2, + 0x2, 0x318, 0x319, 0x7, 0x7e, 0x2, 0x2, 0x319, 0x31a, 0x7, 0x92, + 0x2, 0x2, 0x31a, 0x31b, 0x7, 0x93, 0x2, 0x2, 0x31b, 0x77, 0x3, 0x2, + 0x2, 0x2, 0x31c, 0x31d, 0x7, 0x52, 0x2, 0x2, 0x31d, 0x31f, 0x7, 0x75, + 0x2, 0x2, 0x31e, 0x320, 0x5, 0x7a, 0x3e, 0x2, 0x31f, 0x31e, 0x3, + 0x2, 0x2, 0x2, 0x320, 0x321, 0x3, 0x2, 0x2, 0x2, 0x321, 0x31f, 0x3, + 0x2, 0x2, 0x2, 0x321, 0x322, 0x3, 0x2, 0x2, 0x2, 0x322, 0x323, 0x3, + 0x2, 0x2, 0x2, 0x323, 0x324, 0x7, 0x76, 0x2, 0x2, 0x324, 0x325, 0x7, + 0x52, 0x2, 0x2, 0x325, 0x326, 0x7, 0x7a, 0x2, 0x2, 0x326, 0x79, 0x3, + 0x2, 0x2, 0x2, 0x327, 0x32a, 0x5, 0x7c, 0x3f, 0x2, 0x328, 0x32a, + 0x5, 0x6, 0x4, 0x2, 0x329, 0x327, 0x3, 0x2, 0x2, 0x2, 0x329, 0x328, + 0x3, 0x2, 0x2, 0x2, 0x32a, 0x32b, 0x3, 0x2, 0x2, 0x2, 0x32b, 0x32c, + 0x7, 0x7a, 0x2, 0x2, 0x32c, 0x7b, 0x3, 0x2, 0x2, 0x2, 0x32d, 0x32e, + 0x9, 0x9, 0x2, 0x2, 0x32e, 0x349, 0x7, 0x87, 0x2, 0x2, 0x32f, 0x330, + 0x9, 0xa, 0x2, 0x2, 0x330, 0x349, 0x7, 0x87, 0x2, 0x2, 0x331, 0x332, + 0x7, 0x64, 0x2, 0x2, 0x332, 0x349, 0x5, 0xb6, 0x5c, 0x2, 0x333, 0x334, + 0x7, 0x61, 0x2, 0x2, 0x334, 0x335, 0x7, 0x7e, 0x2, 0x2, 0x335, 0x336, + 0x7, 0x92, 0x2, 0x2, 0x336, 0x349, 0x7, 0x93, 0x2, 0x2, 0x337, 0x338, + 0x7, 0x57, 0x2, 0x2, 0x338, 0x339, 0x7, 0x87, 0x2, 0x2, 0x339, 0x33a, + 0x7, 0x87, 0x2, 0x2, 0x33a, 0x33b, 0x7, 0x87, 0x2, 0x2, 0x33b, 0x33c, + 0x7, 0x87, 0x2, 0x2, 0x33c, 0x33d, 0x7, 0x87, 0x2, 0x2, 0x33d, 0x33e, + 0x7, 0x87, 0x2, 0x2, 0x33e, 0x33f, 0x7, 0x87, 0x2, 0x2, 0x33f, 0x340, + 0x7, 0x87, 0x2, 0x2, 0x340, 0x341, 0x7, 0x87, 0x2, 0x2, 0x341, 0x349, + 0x7, 0x87, 0x2, 0x2, 0x342, 0x344, 0x9, 0xb, 0x2, 0x2, 0x343, 0x345, + 0x7, 0x87, 0x2, 0x2, 0x344, 0x343, 0x3, 0x2, 0x2, 0x2, 0x345, 0x346, + 0x3, 0x2, 0x2, 0x2, 0x346, 0x344, 0x3, 0x2, 0x2, 0x2, 0x346, 0x347, + 0x3, 0x2, 0x2, 0x2, 0x347, 0x349, 0x3, 0x2, 0x2, 0x2, 0x348, 0x32d, + 0x3, 0x2, 0x2, 0x2, 0x348, 0x32f, 0x3, 0x2, 0x2, 0x2, 0x348, 0x331, + 0x3, 0x2, 0x2, 0x2, 0x348, 0x333, 0x3, 0x2, 0x2, 0x2, 0x348, 0x337, + 0x3, 0x2, 0x2, 0x2, 0x348, 0x342, 0x3, 0x2, 0x2, 0x2, 0x349, 0x7d, + 0x3, 0x2, 0x2, 0x2, 0x34a, 0x34b, 0x7, 0x65, 0x2, 0x2, 0x34b, 0x34d, + 0x7, 0x75, 0x2, 0x2, 0x34c, 0x34e, 0x5, 0x80, 0x41, 0x2, 0x34d, 0x34c, + 0x3, 0x2, 0x2, 0x2, 0x34e, 0x34f, 0x3, 0x2, 0x2, 0x2, 0x34f, 0x34d, + 0x3, 0x2, 0x2, 0x2, 0x34f, 0x350, 0x3, 0x2, 0x2, 0x2, 0x350, 0x351, + 0x3, 0x2, 0x2, 0x2, 0x351, 0x352, 0x7, 0x76, 0x2, 0x2, 0x352, 0x353, + 0x7, 0x65, 0x2, 0x2, 0x353, 0x354, 0x7, 0x7a, 0x2, 0x2, 0x354, 0x7f, + 0x3, 0x2, 0x2, 0x2, 0x355, 0x35b, 0x5, 0x82, 0x42, 0x2, 0x356, 0x35b, + 0x5, 0x84, 0x43, 0x2, 0x357, 0x35b, 0x5, 0x8c, 0x47, 0x2, 0x358, + 0x35b, 0x5, 0x90, 0x49, 0x2, 0x359, 0x35b, 0x5, 0x6, 0x4, 0x2, 0x35a, + 0x355, 0x3, 0x2, 0x2, 0x2, 0x35a, 0x356, 0x3, 0x2, 0x2, 0x2, 0x35a, + 0x357, 0x3, 0x2, 0x2, 0x2, 0x35a, 0x358, 0x3, 0x2, 0x2, 0x2, 0x35a, + 0x359, 0x3, 0x2, 0x2, 0x2, 0x35b, 0x35c, 0x3, 0x2, 0x2, 0x2, 0x35c, + 0x35d, 0x7, 0x7a, 0x2, 0x2, 0x35d, 0x81, 0x3, 0x2, 0x2, 0x2, 0x35e, + 0x35f, 0x7, 0x68, 0x2, 0x2, 0x35f, 0x360, 0x5, 0xb2, 0x5a, 0x2, 0x360, + 0x361, 0x7, 0x87, 0x2, 0x2, 0x361, 0x363, 0x7, 0x75, 0x2, 0x2, 0x362, + 0x364, 0x5, 0x8e, 0x48, 0x2, 0x363, 0x362, 0x3, 0x2, 0x2, 0x2, 0x364, + 0x365, 0x3, 0x2, 0x2, 0x2, 0x365, 0x363, 0x3, 0x2, 0x2, 0x2, 0x365, + 0x366, 0x3, 0x2, 0x2, 0x2, 0x366, 0x367, 0x3, 0x2, 0x2, 0x2, 0x367, + 0x368, 0x7, 0x76, 0x2, 0x2, 0x368, 0x83, 0x3, 0x2, 0x2, 0x2, 0x369, + 0x36a, 0x7, 0x69, 0x2, 0x2, 0x36a, 0x36c, 0x7, 0x75, 0x2, 0x2, 0x36b, + 0x36d, 0x5, 0x86, 0x44, 0x2, 0x36c, 0x36b, 0x3, 0x2, 0x2, 0x2, 0x36d, + 0x36e, 0x3, 0x2, 0x2, 0x2, 0x36e, 0x36c, 0x3, 0x2, 0x2, 0x2, 0x36e, + 0x36f, 0x3, 0x2, 0x2, 0x2, 0x36f, 0x370, 0x3, 0x2, 0x2, 0x2, 0x370, + 0x371, 0x7, 0x76, 0x2, 0x2, 0x371, 0x85, 0x3, 0x2, 0x2, 0x2, 0x372, + 0x377, 0x5, 0x92, 0x4a, 0x2, 0x373, 0x377, 0x5, 0x88, 0x45, 0x2, + 0x374, 0x377, 0x5, 0x8a, 0x46, 0x2, 0x375, 0x377, 0x5, 0x6, 0x4, + 0x2, 0x376, 0x372, 0x3, 0x2, 0x2, 0x2, 0x376, 0x373, 0x3, 0x2, 0x2, + 0x2, 0x376, 0x374, 0x3, 0x2, 0x2, 0x2, 0x376, 0x375, 0x3, 0x2, 0x2, + 0x2, 0x377, 0x378, 0x3, 0x2, 0x2, 0x2, 0x378, 0x379, 0x7, 0x7a, 0x2, + 0x2, 0x379, 0x87, 0x3, 0x2, 0x2, 0x2, 0x37a, 0x37b, 0x7, 0x6b, 0x2, + 0x2, 0x37b, 0x37c, 0x5, 0xb2, 0x5a, 0x2, 0x37c, 0x381, 0x5, 0xb4, + 0x5b, 0x2, 0x37d, 0x37f, 0x5, 0xb4, 0x5b, 0x2, 0x37e, 0x380, 0x5, + 0xb4, 0x5b, 0x2, 0x37f, 0x37e, 0x3, 0x2, 0x2, 0x2, 0x37f, 0x380, + 0x3, 0x2, 0x2, 0x2, 0x380, 0x382, 0x3, 0x2, 0x2, 0x2, 0x381, 0x37d, + 0x3, 0x2, 0x2, 0x2, 0x381, 0x382, 0x3, 0x2, 0x2, 0x2, 0x382, 0x89, + 0x3, 0x2, 0x2, 0x2, 0x383, 0x385, 0x7, 0x6a, 0x2, 0x2, 0x384, 0x386, + 0x9, 0xc, 0x2, 0x2, 0x385, 0x384, 0x3, 0x2, 0x2, 0x2, 0x386, 0x387, + 0x3, 0x2, 0x2, 0x2, 0x387, 0x385, 0x3, 0x2, 0x2, 0x2, 0x387, 0x388, + 0x3, 0x2, 0x2, 0x2, 0x388, 0x8b, 0x3, 0x2, 0x2, 0x2, 0x389, 0x38a, + 0x7, 0x66, 0x2, 0x2, 0x38a, 0x38c, 0x7, 0x75, 0x2, 0x2, 0x38b, 0x38d, + 0x5, 0x8e, 0x48, 0x2, 0x38c, 0x38b, 0x3, 0x2, 0x2, 0x2, 0x38d, 0x38e, + 0x3, 0x2, 0x2, 0x2, 0x38e, 0x38c, 0x3, 0x2, 0x2, 0x2, 0x38e, 0x38f, + 0x3, 0x2, 0x2, 0x2, 0x38f, 0x390, 0x3, 0x2, 0x2, 0x2, 0x390, 0x391, + 0x7, 0x76, 0x2, 0x2, 0x391, 0x8d, 0x3, 0x2, 0x2, 0x2, 0x392, 0x395, + 0x5, 0x92, 0x4a, 0x2, 0x393, 0x395, 0x5, 0x6, 0x4, 0x2, 0x394, 0x392, + 0x3, 0x2, 0x2, 0x2, 0x394, 0x393, 0x3, 0x2, 0x2, 0x2, 0x395, 0x396, + 0x3, 0x2, 0x2, 0x2, 0x396, 0x397, 0x7, 0x7a, 0x2, 0x2, 0x397, 0x8f, + 0x3, 0x2, 0x2, 0x2, 0x398, 0x399, 0x7, 0x67, 0x2, 0x2, 0x399, 0x39a, + 0x5, 0xb6, 0x5c, 0x2, 0x39a, 0x91, 0x3, 0x2, 0x2, 0x2, 0x39b, 0x3a2, + 0x7, 0x50, 0x2, 0x2, 0x39c, 0x3a0, 0x5, 0xb6, 0x5c, 0x2, 0x39d, 0x39e, + 0x5, 0xb6, 0x5c, 0x2, 0x39e, 0x39f, 0x5, 0xb6, 0x5c, 0x2, 0x39f, + 0x3a1, 0x3, 0x2, 0x2, 0x2, 0x3a0, 0x39d, 0x3, 0x2, 0x2, 0x2, 0x3a0, + 0x3a1, 0x3, 0x2, 0x2, 0x2, 0x3a1, 0x3a3, 0x3, 0x2, 0x2, 0x2, 0x3a2, + 0x39c, 0x3, 0x2, 0x2, 0x2, 0x3a2, 0x3a3, 0x3, 0x2, 0x2, 0x2, 0x3a3, + 0x3a4, 0x3, 0x2, 0x2, 0x2, 0x3a4, 0x3a5, 0x7, 0x7e, 0x2, 0x2, 0x3a5, + 0x3a6, 0x7, 0x92, 0x2, 0x2, 0x3a6, 0x3a7, 0x7, 0x93, 0x2, 0x2, 0x3a7, + 0x93, 0x3, 0x2, 0x2, 0x2, 0x3a8, 0x3a9, 0x7, 0x72, 0x2, 0x2, 0x3a9, + 0x3ab, 0x7, 0x75, 0x2, 0x2, 0x3aa, 0x3ac, 0x5, 0x96, 0x4c, 0x2, 0x3ab, + 0x3aa, 0x3, 0x2, 0x2, 0x2, 0x3ac, 0x3ad, 0x3, 0x2, 0x2, 0x2, 0x3ad, + 0x3ab, 0x3, 0x2, 0x2, 0x2, 0x3ad, 0x3ae, 0x3, 0x2, 0x2, 0x2, 0x3ae, + 0x3af, 0x3, 0x2, 0x2, 0x2, 0x3af, 0x3b0, 0x7, 0x76, 0x2, 0x2, 0x3b0, + 0x3b1, 0x7, 0x72, 0x2, 0x2, 0x3b1, 0x3b2, 0x7, 0x7a, 0x2, 0x2, 0x3b2, + 0x95, 0x3, 0x2, 0x2, 0x2, 0x3b3, 0x3b6, 0x5, 0x98, 0x4d, 0x2, 0x3b4, + 0x3b6, 0x5, 0x6, 0x4, 0x2, 0x3b5, 0x3b3, 0x3, 0x2, 0x2, 0x2, 0x3b5, + 0x3b4, 0x3, 0x2, 0x2, 0x2, 0x3b6, 0x3b7, 0x3, 0x2, 0x2, 0x2, 0x3b7, + 0x3b8, 0x7, 0x7a, 0x2, 0x2, 0x3b8, 0x97, 0x3, 0x2, 0x2, 0x2, 0x3b9, + 0x3ba, 0x9, 0xd, 0x2, 0x2, 0x3ba, 0x3bb, 0x5, 0xac, 0x57, 0x2, 0x3bb, + 0x3bc, 0x7, 0x87, 0x2, 0x2, 0x3bc, 0x99, 0x3, 0x2, 0x2, 0x2, 0x3bd, + 0x3be, 0x7, 0x1c, 0x2, 0x2, 0x3be, 0x3c7, 0x7, 0x34, 0x2, 0x2, 0x3bf, + 0x3c0, 0x7, 0x87, 0x2, 0x2, 0x3c0, 0x3c3, 0x7, 0x87, 0x2, 0x2, 0x3c1, + 0x3c2, 0x7, 0x33, 0x2, 0x2, 0x3c2, 0x3c4, 0x7, 0x87, 0x2, 0x2, 0x3c3, + 0x3c1, 0x3, 0x2, 0x2, 0x2, 0x3c3, 0x3c4, 0x3, 0x2, 0x2, 0x2, 0x3c4, + 0x3c8, 0x3, 0x2, 0x2, 0x2, 0x3c5, 0x3c8, 0x7, 0x3e, 0x2, 0x2, 0x3c6, + 0x3c8, 0x5, 0xb0, 0x59, 0x2, 0x3c7, 0x3bf, 0x3, 0x2, 0x2, 0x2, 0x3c7, + 0x3c5, 0x3, 0x2, 0x2, 0x2, 0x3c7, 0x3c6, 0x3, 0x2, 0x2, 0x2, 0x3c8, + 0x3c9, 0x3, 0x2, 0x2, 0x2, 0x3c9, 0x3ca, 0x7, 0x1d, 0x2, 0x2, 0x3ca, + 0x9b, 0x3, 0x2, 0x2, 0x2, 0x3cb, 0x3cd, 0x5, 0x9e, 0x50, 0x2, 0x3cc, + 0x3cb, 0x3, 0x2, 0x2, 0x2, 0x3cd, 0x3ce, 0x3, 0x2, 0x2, 0x2, 0x3ce, + 0x3cc, 0x3, 0x2, 0x2, 0x2, 0x3ce, 0x3cf, 0x3, 0x2, 0x2, 0x2, 0x3cf, + 0x9d, 0x3, 0x2, 0x2, 0x2, 0x3d0, 0x3d5, 0x5, 0xa2, 0x52, 0x2, 0x3d1, + 0x3d2, 0x7, 0xe, 0x2, 0x2, 0x3d2, 0x3d4, 0x5, 0xb0, 0x59, 0x2, 0x3d3, + 0x3d1, 0x3, 0x2, 0x2, 0x2, 0x3d4, 0x3d7, 0x3, 0x2, 0x2, 0x2, 0x3d5, + 0x3d3, 0x3, 0x2, 0x2, 0x2, 0x3d5, 0x3d6, 0x3, 0x2, 0x2, 0x2, 0x3d6, + 0x9f, 0x3, 0x2, 0x2, 0x2, 0x3d7, 0x3d5, 0x3, 0x2, 0x2, 0x2, 0x3d8, + 0x3da, 0x5, 0xa2, 0x52, 0x2, 0x3d9, 0x3d8, 0x3, 0x2, 0x2, 0x2, 0x3da, + 0x3db, 0x3, 0x2, 0x2, 0x2, 0x3db, 0x3d9, 0x3, 0x2, 0x2, 0x2, 0x3db, + 0x3dc, 0x3, 0x2, 0x2, 0x2, 0x3dc, 0xa1, 0x3, 0x2, 0x2, 0x2, 0x3dd, + 0x3e0, 0x5, 0xa6, 0x54, 0x2, 0x3de, 0x3e0, 0x5, 0xac, 0x57, 0x2, + 0x3df, 0x3dd, 0x3, 0x2, 0x2, 0x2, 0x3df, 0x3de, 0x3, 0x2, 0x2, 0x2, + 0x3e0, 0x3e2, 0x3, 0x2, 0x2, 0x2, 0x3e1, 0x3e3, 0x7, 0x7c, 0x2, 0x2, + 0x3e2, 0x3e1, 0x3, 0x2, 0x2, 0x2, 0x3e2, 0x3e3, 0x3, 0x2, 0x2, 0x2, + 0x3e3, 0xa3, 0x3, 0x2, 0x2, 0x2, 0x3e4, 0x3e6, 0x5, 0xa6, 0x54, 0x2, + 0x3e5, 0x3e4, 0x3, 0x2, 0x2, 0x2, 0x3e5, 0x3e6, 0x3, 0x2, 0x2, 0x2, + 0x3e6, 0xa5, 0x3, 0x2, 0x2, 0x2, 0x3e7, 0x3ea, 0x7, 0x7f, 0x2, 0x2, + 0x3e8, 0x3ea, 0x5, 0xa8, 0x55, 0x2, 0x3e9, 0x3e7, 0x3, 0x2, 0x2, + 0x2, 0x3e9, 0x3e8, 0x3, 0x2, 0x2, 0x2, 0x3ea, 0xa7, 0x3, 0x2, 0x2, + 0x2, 0x3eb, 0x3ed, 0x7, 0x77, 0x2, 0x2, 0x3ec, 0x3ee, 0x5, 0xaa, + 0x56, 0x2, 0x3ed, 0x3ec, 0x3, 0x2, 0x2, 0x2, 0x3ee, 0x3ef, 0x3, 0x2, + 0x2, 0x2, 0x3ef, 0x3ed, 0x3, 0x2, 0x2, 0x2, 0x3ef, 0x3f0, 0x3, 0x2, + 0x2, 0x2, 0x3f0, 0x3f1, 0x3, 0x2, 0x2, 0x2, 0x3f1, 0x3f2, 0x7, 0x78, + 0x2, 0x2, 0x3f2, 0xa9, 0x3, 0x2, 0x2, 0x2, 0x3f3, 0x3f6, 0x5, 0xac, + 0x57, 0x2, 0x3f4, 0x3f5, 0x7, 0x79, 0x2, 0x2, 0x3f5, 0x3f7, 0x5, + 0xac, 0x57, 0x2, 0x3f6, 0x3f4, 0x3, 0x2, 0x2, 0x2, 0x3f6, 0x3f7, + 0x3, 0x2, 0x2, 0x2, 0x3f7, 0x3fa, 0x3, 0x2, 0x2, 0x2, 0x3f8, 0x3fa, + 0x7, 0x7f, 0x2, 0x2, 0x3f9, 0x3f3, 0x3, 0x2, 0x2, 0x2, 0x3f9, 0x3f8, + 0x3, 0x2, 0x2, 0x2, 0x3fa, 0xab, 0x3, 0x2, 0x2, 0x2, 0x3fb, 0x3fe, + 0x5, 0xae, 0x58, 0x2, 0x3fc, 0x3fe, 0x7, 0x80, 0x2, 0x2, 0x3fd, 0x3fb, + 0x3, 0x2, 0x2, 0x2, 0x3fd, 0x3fc, 0x3, 0x2, 0x2, 0x2, 0x3fe, 0xad, + 0x3, 0x2, 0x2, 0x2, 0x3ff, 0x400, 0x9, 0xe, 0x2, 0x2, 0x400, 0xaf, + 0x3, 0x2, 0x2, 0x2, 0x401, 0x402, 0x7, 0x82, 0x2, 0x2, 0x402, 0xb1, + 0x3, 0x2, 0x2, 0x2, 0x403, 0x404, 0x9, 0xf, 0x2, 0x2, 0x404, 0xb3, + 0x3, 0x2, 0x2, 0x2, 0x405, 0x406, 0x9, 0x10, 0x2, 0x2, 0x406, 0xb5, + 0x3, 0x2, 0x2, 0x2, 0x407, 0x408, 0x9, 0x11, 0x2, 0x2, 0x408, 0xb7, + 0x3, 0x2, 0x2, 0x2, 0x409, 0x40b, 0x5, 0x1a, 0xe, 0x2, 0x40a, 0x409, + 0x3, 0x2, 0x2, 0x2, 0x40b, 0x40e, 0x3, 0x2, 0x2, 0x2, 0x40c, 0x40a, + 0x3, 0x2, 0x2, 0x2, 0x40c, 0x40d, 0x3, 0x2, 0x2, 0x2, 0x40d, 0x40f, + 0x3, 0x2, 0x2, 0x2, 0x40e, 0x40c, 0x3, 0x2, 0x2, 0x2, 0x40f, 0x410, + 0x7, 0x2, 0x2, 0x3, 0x410, 0xb9, 0x3, 0x2, 0x2, 0x2, 0x411, 0x413, + 0x5, 0x24, 0x13, 0x2, 0x412, 0x411, 0x3, 0x2, 0x2, 0x2, 0x413, 0x416, + 0x3, 0x2, 0x2, 0x2, 0x414, 0x412, 0x3, 0x2, 0x2, 0x2, 0x414, 0x415, + 0x3, 0x2, 0x2, 0x2, 0x415, 0x417, 0x3, 0x2, 0x2, 0x2, 0x416, 0x414, + 0x3, 0x2, 0x2, 0x2, 0x417, 0x418, 0x7, 0x2, 0x2, 0x3, 0x418, 0xbb, + 0x3, 0x2, 0x2, 0x2, 0x419, 0x41b, 0x5, 0x20, 0x11, 0x2, 0x41a, 0x419, + 0x3, 0x2, 0x2, 0x2, 0x41b, 0x41e, 0x3, 0x2, 0x2, 0x2, 0x41c, 0x41a, + 0x3, 0x2, 0x2, 0x2, 0x41c, 0x41d, 0x3, 0x2, 0x2, 0x2, 0x41d, 0x41f, + 0x3, 0x2, 0x2, 0x2, 0x41e, 0x41c, 0x3, 0x2, 0x2, 0x2, 0x41f, 0x420, + 0x7, 0x2, 0x2, 0x3, 0x420, 0xbd, 0x3, 0x2, 0x2, 0x2, 0x421, 0x423, + 0x5, 0x4c, 0x27, 0x2, 0x422, 0x421, 0x3, 0x2, 0x2, 0x2, 0x423, 0x426, + 0x3, 0x2, 0x2, 0x2, 0x424, 0x422, 0x3, 0x2, 0x2, 0x2, 0x424, 0x425, + 0x3, 0x2, 0x2, 0x2, 0x425, 0x427, 0x3, 0x2, 0x2, 0x2, 0x426, 0x424, + 0x3, 0x2, 0x2, 0x2, 0x427, 0x428, 0x7, 0x2, 0x2, 0x3, 0x428, 0xbf, + 0x3, 0x2, 0x2, 0x2, 0x429, 0x42b, 0x5, 0x62, 0x32, 0x2, 0x42a, 0x429, + 0x3, 0x2, 0x2, 0x2, 0x42b, 0x42e, 0x3, 0x2, 0x2, 0x2, 0x42c, 0x42a, + 0x3, 0x2, 0x2, 0x2, 0x42c, 0x42d, 0x3, 0x2, 0x2, 0x2, 0x42d, 0x42f, + 0x3, 0x2, 0x2, 0x2, 0x42e, 0x42c, 0x3, 0x2, 0x2, 0x2, 0x42f, 0x430, + 0x7, 0x2, 0x2, 0x3, 0x430, 0xc1, 0x3, 0x2, 0x2, 0x2, 0x431, 0x433, + 0x5, 0x68, 0x35, 0x2, 0x432, 0x431, 0x3, 0x2, 0x2, 0x2, 0x433, 0x436, + 0x3, 0x2, 0x2, 0x2, 0x434, 0x432, 0x3, 0x2, 0x2, 0x2, 0x434, 0x435, + 0x3, 0x2, 0x2, 0x2, 0x435, 0x437, 0x3, 0x2, 0x2, 0x2, 0x436, 0x434, + 0x3, 0x2, 0x2, 0x2, 0x437, 0x438, 0x7, 0x2, 0x2, 0x3, 0x438, 0xc3, + 0x3, 0x2, 0x2, 0x2, 0x439, 0x43b, 0x5, 0x6e, 0x38, 0x2, 0x43a, 0x439, + 0x3, 0x2, 0x2, 0x2, 0x43b, 0x43e, 0x3, 0x2, 0x2, 0x2, 0x43c, 0x43a, + 0x3, 0x2, 0x2, 0x2, 0x43c, 0x43d, 0x3, 0x2, 0x2, 0x2, 0x43d, 0x43f, + 0x3, 0x2, 0x2, 0x2, 0x43e, 0x43c, 0x3, 0x2, 0x2, 0x2, 0x43f, 0x440, + 0x7, 0x2, 0x2, 0x3, 0x440, 0xc5, 0x3, 0x2, 0x2, 0x2, 0x441, 0x443, + 0x5, 0x56, 0x2c, 0x2, 0x442, 0x441, 0x3, 0x2, 0x2, 0x2, 0x443, 0x446, + 0x3, 0x2, 0x2, 0x2, 0x444, 0x442, 0x3, 0x2, 0x2, 0x2, 0x444, 0x445, + 0x3, 0x2, 0x2, 0x2, 0x445, 0x447, 0x3, 0x2, 0x2, 0x2, 0x446, 0x444, + 0x3, 0x2, 0x2, 0x2, 0x447, 0x448, 0x7, 0x2, 0x2, 0x3, 0x448, 0xc7, + 0x3, 0x2, 0x2, 0x2, 0x449, 0x44b, 0x5, 0x74, 0x3b, 0x2, 0x44a, 0x449, + 0x3, 0x2, 0x2, 0x2, 0x44b, 0x44e, 0x3, 0x2, 0x2, 0x2, 0x44c, 0x44a, + 0x3, 0x2, 0x2, 0x2, 0x44c, 0x44d, 0x3, 0x2, 0x2, 0x2, 0x44d, 0x44f, + 0x3, 0x2, 0x2, 0x2, 0x44e, 0x44c, 0x3, 0x2, 0x2, 0x2, 0x44f, 0x450, + 0x7, 0x2, 0x2, 0x3, 0x450, 0xc9, 0x3, 0x2, 0x2, 0x2, 0x451, 0x453, + 0x5, 0x96, 0x4c, 0x2, 0x452, 0x451, 0x3, 0x2, 0x2, 0x2, 0x453, 0x456, + 0x3, 0x2, 0x2, 0x2, 0x454, 0x452, 0x3, 0x2, 0x2, 0x2, 0x454, 0x455, + 0x3, 0x2, 0x2, 0x2, 0x455, 0x457, 0x3, 0x2, 0x2, 0x2, 0x456, 0x454, + 0x3, 0x2, 0x2, 0x2, 0x457, 0x458, 0x7, 0x2, 0x2, 0x3, 0x458, 0xcb, + 0x3, 0x2, 0x2, 0x2, 0x459, 0x45b, 0x5, 0x7a, 0x3e, 0x2, 0x45a, 0x459, + 0x3, 0x2, 0x2, 0x2, 0x45b, 0x45e, 0x3, 0x2, 0x2, 0x2, 0x45c, 0x45a, + 0x3, 0x2, 0x2, 0x2, 0x45c, 0x45d, 0x3, 0x2, 0x2, 0x2, 0x45d, 0x45f, + 0x3, 0x2, 0x2, 0x2, 0x45e, 0x45c, 0x3, 0x2, 0x2, 0x2, 0x45f, 0x460, + 0x7, 0x2, 0x2, 0x3, 0x460, 0xcd, 0x3, 0x2, 0x2, 0x2, 0x461, 0x463, + 0x5, 0x80, 0x41, 0x2, 0x462, 0x461, 0x3, 0x2, 0x2, 0x2, 0x463, 0x466, + 0x3, 0x2, 0x2, 0x2, 0x464, 0x462, 0x3, 0x2, 0x2, 0x2, 0x464, 0x465, + 0x3, 0x2, 0x2, 0x2, 0x465, 0x467, 0x3, 0x2, 0x2, 0x2, 0x466, 0x464, + 0x3, 0x2, 0x2, 0x2, 0x467, 0x468, 0x7, 0x2, 0x2, 0x3, 0x468, 0xcf, + 0x3, 0x2, 0x2, 0x2, 0x469, 0x46b, 0x5, 0x86, 0x44, 0x2, 0x46a, 0x469, + 0x3, 0x2, 0x2, 0x2, 0x46b, 0x46e, 0x3, 0x2, 0x2, 0x2, 0x46c, 0x46a, + 0x3, 0x2, 0x2, 0x2, 0x46c, 0x46d, 0x3, 0x2, 0x2, 0x2, 0x46d, 0x46f, + 0x3, 0x2, 0x2, 0x2, 0x46e, 0x46c, 0x3, 0x2, 0x2, 0x2, 0x46f, 0x470, + 0x7, 0x2, 0x2, 0x3, 0x470, 0xd1, 0x3, 0x2, 0x2, 0x2, 0x471, 0x473, + 0x5, 0x8e, 0x48, 0x2, 0x472, 0x471, 0x3, 0x2, 0x2, 0x2, 0x473, 0x476, + 0x3, 0x2, 0x2, 0x2, 0x474, 0x472, 0x3, 0x2, 0x2, 0x2, 0x474, 0x475, + 0x3, 0x2, 0x2, 0x2, 0x475, 0x477, 0x3, 0x2, 0x2, 0x2, 0x476, 0x474, + 0x3, 0x2, 0x2, 0x2, 0x477, 0x478, 0x7, 0x2, 0x2, 0x3, 0x478, 0xd3, + 0x3, 0x2, 0x2, 0x2, 0x479, 0x47a, 0x9, 0x12, 0x2, 0x2, 0x47a, 0xd5, + 0x3, 0x2, 0x2, 0x2, 0x47b, 0x47c, 0x9, 0x13, 0x2, 0x2, 0x47c, 0xd7, + 0x3, 0x2, 0x2, 0x2, 0x47d, 0x47e, 0x9, 0x14, 0x2, 0x2, 0x47e, 0xd9, + 0x3, 0x2, 0x2, 0x2, 0x47f, 0x480, 0x9, 0x15, 0x2, 0x2, 0x480, 0xdb, + 0x3, 0x2, 0x2, 0x2, 0x481, 0x482, 0x9, 0x16, 0x2, 0x2, 0x482, 0xdd, + 0x3, 0x2, 0x2, 0x2, 0x483, 0x484, 0x9, 0x17, 0x2, 0x2, 0x484, 0xdf, + 0x3, 0x2, 0x2, 0x2, 0x7c, 0xe5, 0xe7, 0xf2, 0x106, 0x110, 0x11b, + 0x121, 0x131, 0x139, 0x141, 0x147, 0x150, 0x155, 0x15b, 0x160, 0x169, + 0x171, 0x17a, 0x180, 0x190, 0x19d, 0x1a4, 0x1a6, 0x1b0, 0x1b6, 0x1bd, + 0x1c6, 0x1c9, 0x1d0, 0x1d2, 0x1d9, 0x1db, 0x1dd, 0x1e0, 0x1e4, 0x1ea, + 0x1f1, 0x1f6, 0x1fc, 0x203, 0x206, 0x20d, 0x210, 0x217, 0x21a, 0x21c, + 0x220, 0x227, 0x230, 0x23a, 0x23f, 0x242, 0x245, 0x24b, 0x252, 0x254, + 0x25f, 0x26a, 0x273, 0x27b, 0x283, 0x28b, 0x292, 0x29d, 0x2af, 0x2b6, + 0x2bd, 0x2c4, 0x2cc, 0x2d8, 0x2e1, 0x2ed, 0x2f6, 0x302, 0x30a, 0x314, + 0x316, 0x321, 0x329, 0x346, 0x348, 0x34f, 0x35a, 0x365, 0x36e, 0x376, + 0x37f, 0x381, 0x387, 0x38e, 0x394, 0x3a0, 0x3a2, 0x3ad, 0x3b5, 0x3c3, + 0x3c7, 0x3ce, 0x3d5, 0x3db, 0x3df, 0x3e2, 0x3e5, 0x3e9, 0x3ef, 0x3f6, + 0x3f9, 0x3fd, 0x40c, 0x414, 0x41c, 0x424, 0x42c, 0x434, 0x43c, 0x444, + 0x44c, 0x454, 0x45c, 0x464, 0x46c, 0x474, + }; + + _serializedATN.insert(_serializedATN.end(), serializedATNSegment0, + serializedATNSegment0 + sizeof(serializedATNSegment0) / sizeof(serializedATNSegment0[0])); + + + atn::ATNDeserializer deserializer; + _atn = deserializer.deserialize(_serializedATN); + + size_t count = _atn.getNumberOfDecisions(); + _decisionToDFA.reserve(count); + for (size_t i = 0; i < count; i++) { + _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); + } +} + +FeatParser::Initializer FeatParser::_init; diff --git a/c/makeotf/lib/hotconv/FeatParser.g4 b/c/makeotf/lib/hotconv/FeatParser.g4 new file mode 100644 index 000000000..972014fcb --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParser.g4 @@ -0,0 +1,602 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +// ------------------------- Feature file grammar --------------------------- + +parser grammar FeatParser; + +options { tokenVocab = FeatLexer; } + +file: + ( topLevelStatement + | featureBlock + | tableBlock + | anonBlock + | lookupBlockTopLevel + )* EOF +; + +topLevelStatement: + ( include + | glyphClassAssign + | langsysAssign + | mark_statement + | anchorDef + | valueRecordDef + ) + SEMI +; + +include: + INCLUDE I_RPAREN IFILE I_LPAREN +; + +glyphClassAssign: + GCLASS EQUALS glyphClass +; + +langsysAssign: + LANGSYS script=tag lang=tag +; + +mark_statement: + MARK_CLASS ( glyph | glyphClass ) anchor GCLASS +; + +anchorDef: + ANCHOR_DEF xval=NUM yval=NUM ( CONTOURPOINT cp=NUM )? name=label +; + +valueRecordDef: + VALUE_RECORD_DEF valueLiteral label +; + +featureBlock: + FEATURE starttag=tag USE_EXTENSION? LCBRACE + featureStatement+ + RCBRACE endtag=tag SEMI +; + +tableBlock: + TABLE + ( table_BASE + | table_GDEF + | table_head + | table_hhea + | table_vhea + | table_name + | table_OS_2 + | table_STAT + | table_vmtx + ) +; + +anonBlock: + anontok A_LABEL A_LBRACE A_LINE* A_CLOSE +; + +lookupBlockTopLevel: + LOOKUP startlabel=label USE_EXTENSION? LCBRACE + statement+ + RCBRACE endlabel=label SEMI +; + +featureStatement: + statement + | lookupBlockOrUse + | cvParameterBlock +; + +lookupBlockOrUse: + LOOKUP startlabel=label ( USE_EXTENSION? LCBRACE + statement+ + RCBRACE endlabel=label )? SEMI +; + +cvParameterBlock: + CV_PARAMETERS LCBRACE + cvParameterStatement* + RCBRACE SEMI +; + +cvParameterStatement: + ( cvParameter + | include + ) SEMI +; + +cvParameter: + ( CV_UI_LABEL | CV_TOOLTIP | CV_SAMPLE_TEXT | CV_PARAM_LABEL ) LCBRACE + nameEntryStatement+ + RCBRACE + | CV_CHARACTER genNum +; + +statement: + ( featureUse + | scriptAssign + | langAssign + | lookupflagAssign + | glyphClassAssign + | ignoreSubOrPos + | substitute + | mark_statement + | position + | parameters + | sizemenuname + | featureNames + | subtable + | include + ) SEMI +; + +featureUse: + FEATURE tag +; + +scriptAssign: + SCRIPT tag +; + +langAssign: + LANGUAGE tag ( EXCLUDE_DFLT | INCLUDE_DFLT | EXCLUDE_dflt | INCLUDE_dflt )? +; + +lookupflagAssign: + LOOKUPFLAG ( NUM | lookupflagElement+ ) +; + +lookupflagElement: + RIGHT_TO_LEFT + | IGNORE_BASE_GLYPHS + | IGNORE_LIGATURES + | IGNORE_MARKS + | ( MARK_ATTACHMENT_TYPE glyphClass ) + | ( USE_MARK_FILTERING_SET glyphClass ) +; + +ignoreSubOrPos: + IGNORE ( subtok | revtok | postok ) lookupPattern ( COMMA lookupPattern )* +; + +substitute: + ( EXCEPT lookupPattern ( COMMA lookupPattern )* )? + ( revtok startpat=lookupPattern ( BY ( KNULL | endpat=lookupPattern ) )? + | subtok startpat=lookupPattern ( ( BY | FROM ) ( KNULL | endpat=lookupPattern ) )? ) +; + +position: + enumtok? postok startpat=pattern? + ( + ( valueRecord valuePattern* ) + | ( ( LOOKUP label )+ lookupPatternElement* ) + | ( CURSIVE cursiveElement endpat=pattern? ) + | ( MARKBASE midpat=pattern baseToMarkElement+ endpat=pattern? ) + | ( markligtok midpat=pattern ligatureMarkElement+ endpat=pattern? ) + | ( MARK midpat=pattern baseToMarkElement+ endpat=pattern? ) + ) +; + +valuePattern: + patternElement valueRecord? +; + +valueRecord: + BEGINVALUE valuename=label ENDVALUE | valueLiteral +; + +valueLiteral: + ( BEGINVALUE NUM NUM NUM NUM ENDVALUE ) | NUM +; + +cursiveElement: + patternElement anchor anchor +; + +baseToMarkElement: + anchor MARK GCLASS MARKER? +; + +ligatureMarkElement: + anchor ( MARK GCLASS )? LIG_COMPONENT? MARKER? +; + +parameters: + PARAMETERS fixedNum+ +; + +sizemenuname: + SIZEMENUNAME ( genNum ( genNum genNum )? )? QUOTE STRVAL EQUOTE +; + +featureNames: + FEATURE_NAMES LCBRACE + nameEntryStatement+ + RCBRACE +; + +subtable: + SUBTABLE +; + +table_BASE: + BASE LCBRACE + baseStatement+ + RCBRACE BASE SEMI +; + +baseStatement: + ( axisTags + | axisScripts + | include + ) SEMI +; + +axisTags: + ( HA_BTL | VA_BTL ) tag+ +; + +axisScripts: + ( HA_BSL | VA_BSL ) baseScript ( COMMA baseScript )* +; + +baseScript: + script=tag db=tag NUM+ +; + +table_GDEF: + GDEF LCBRACE + gdefStatement+ + RCBRACE GDEF SEMI +; + +gdefStatement: + ( gdefGlyphClass + | gdefAttach + | gdefLigCaretPos + | gdefLigCaretIndex + | include + ) SEMI +; + +gdefGlyphClass: + GLYPH_CLASS_DEF glyphClassOptional COMMA + glyphClassOptional COMMA + glyphClassOptional COMMA + glyphClassOptional +; + +gdefAttach: + ATTACH lookupPattern NUM+ +; + +gdefLigCaretPos: + LIG_CARET_BY_POS lookupPattern NUM+ +; + +gdefLigCaretIndex: + LIG_CARET_BY_IDX lookupPattern NUM+ +; + +table_head: + HEAD LCBRACE + headStatement+ + RCBRACE HEAD SEMI +; + +headStatement: + ( head + | include + ) SEMI +; + +head: + FONT_REVISION POINTNUM +; + +table_hhea: + HHEA LCBRACE + hheaStatement* + RCBRACE HHEA SEMI +; + +hheaStatement: + ( hhea + | include + ) SEMI +; + +hhea: + ( CARET_OFFSET | ASCENDER | DESCENDER | LINE_GAP ) NUM +; + +table_vhea: + VHEA LCBRACE + vheaStatement* + RCBRACE VHEA SEMI +; + +vheaStatement: + ( vhea + | include + ) SEMI +; + +vhea: + ( VERT_TYPO_ASCENDER | VERT_TYPO_DESCENDER | VERT_TYPO_LINE_GAP ) NUM +; + +table_name: + NAME LCBRACE + nameStatement+ + RCBRACE NAME SEMI +; + +nameStatement: + ( nameID + | include + ) SEMI +; + +nameID: + NAMEID id=genNum ( plat=genNum ( spec=genNum lang=genNum )? )? QUOTE STRVAL EQUOTE +; + +table_OS_2: + OS_2 LCBRACE + os_2Statement+ + RCBRACE OS_2 SEMI +; + +os_2Statement: + ( os_2 + | include + ) SEMI +; + +os_2: + ( TYPO_ASCENDER | TYPO_DESCENDER | TYPO_LINE_GAP + | WIN_ASCENT | WIN_DESCENT | X_HEIGHT | CAP_HEIGHT ) num=NUM + | + ( FS_TYPE | FS_TYPE_v | WEIGHT_CLASS | WIDTH_CLASS + | OS2_LOWER_OP_SIZE | OS2_UPPER_OP_SIZE ) unum=NUM + | FAMILY_CLASS gnum=genNum + | VENDOR QUOTE STRVAL EQUOTE + | PANOSE NUM NUM NUM NUM NUM NUM NUM NUM NUM NUM + | ( UNICODE_RANGE | CODE_PAGE_RANGE ) NUM+ +; + + +table_STAT: + STAT LCBRACE + statStatement+ + RCBRACE STAT SEMI +; + +statStatement: + ( designAxis + | axisValue + | elidedFallbackName + | elidedFallbackNameID + | include + ) SEMI +; + +designAxis: + DESIGN_AXIS tag NUM LCBRACE + nameEntryStatement+ + RCBRACE +; + +axisValue: + AXIS_VALUE LCBRACE + axisValueStatement+ + RCBRACE +; + +axisValueStatement: + ( nameEntry + | axisValueLocation + | axisValueFlags + | include + ) SEMI +; + +axisValueLocation: + LOCATION tag fixedNum ( fixedNum fixedNum? )? +; + +axisValueFlags: + FLAG ( AXIS_OSFA | AXIS_EAVN )+ +; + +elidedFallbackName: + ELIDED_FALLBACK_NAME LCBRACE + nameEntryStatement+ + RCBRACE +; + +nameEntryStatement: + ( nameEntry + | include + ) SEMI +; + +elidedFallbackNameID: + ELIDED_FALLBACK_NAME_ID genNum +; + +nameEntry: + NAME ( genNum ( genNum genNum )? )? QUOTE STRVAL EQUOTE +; + +table_vmtx: + VMTX LCBRACE + vmtxStatement+ + RCBRACE VMTX SEMI +; + +vmtxStatement: + ( vmtx + | include + ) SEMI +; + +vmtx: + ( VERT_ORIGIN_Y | VERT_ADVANCE_Y ) glyph NUM +; + +anchor: + BEGINVALUE ANCHOR + ( ( xval=NUM yval=NUM ( CONTOURPOINT cp=NUM )? ) + | KNULL + | name=label + ) ENDVALUE +; + +lookupPattern: + lookupPatternElement+ +; + +lookupPatternElement: + patternElement ( LOOKUP label )* +; + +pattern: + patternElement+ +; + +patternElement: + ( glyphClass | glyph ) MARKER? +; + +glyphClassOptional: + glyphClass? +; + +glyphClass: + GCLASS | gcLiteral +; + +gcLiteral: + LBRACKET gcLiteralElement+ RBRACKET +; + +gcLiteralElement: + startg=glyph ( HYPHEN endg=glyph )? + | GCLASS +; + +glyph: + glyphName + | CID +; + +glyphName: + ESCGNAME | NAMELABEL | EXTNAME | NOTDEF +; + +label: + NAMELABEL +; + +tag: + NAMELABEL | EXTNAME | CATCHTAG | MARK // MARK included for "feature mark" +; + +fixedNum: + POINTNUM | NUM +; + +genNum: + NUM | NUMOCT | NUMEXT +; + +// These are for an include directive in a block with statements + +featureFile: + featureStatement* EOF +; + +statementFile: + statement* EOF +; + +cvStatementFile: + cvParameterStatement* EOF +; + +baseFile: + baseStatement* EOF +; + +headFile: + headStatement* EOF +; + +hheaFile: + hheaStatement* EOF +; + +vheaFile: + vheaStatement* EOF +; + +gdefFile: + gdefStatement* EOF +; + +nameFile: + nameStatement* EOF +; + +vmtxFile: + vmtxStatement* EOF +; + +os_2File: + os_2Statement* EOF +; + +statFile: + statStatement* EOF +; + +axisValueFile: + axisValueStatement* EOF +; + +nameEntryFile: + nameEntryStatement* EOF +; + +/* These tokens are defined this way because they slightly improves + * Antlr 4's default error reporting. If we wind up overloading the + * class with the token literals at the C++ level I will devolve these + * back into the Lexer grammar. + */ +subtok: + SUBSTITUTE | SUBSTITUTE_v +; + +revtok: + REVERSE | REVERSE_v +; + +anontok: + ANON | ANON_v +; + +enumtok: + ENUMERATE | ENUMERATE_v +; + +postok: + POSITION | POSITION_v +; + +markligtok: + MARKLIG | MARKLIG_v +; diff --git a/c/makeotf/lib/hotconv/FeatParser.h b/c/makeotf/lib/hotconv/FeatParser.h new file mode 100644 index 000000000..7a4d94a8d --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParser.h @@ -0,0 +1,2123 @@ + +// Generated from FeatParser.g4 by ANTLR 4.9.2 + +#pragma once + + +#include "antlr4-runtime.h" + + + + +class FeatParser : public antlr4::Parser { +public: + enum { + ANON = 1, ANON_v = 2, COMMENT = 3, WHITESPACE = 4, INCLUDE = 5, FEATURE = 6, + TABLE = 7, SCRIPT = 8, LANGUAGE = 9, LANGSYS = 10, SUBTABLE = 11, LOOKUP = 12, + LOOKUPFLAG = 13, NOTDEF = 14, RIGHT_TO_LEFT = 15, IGNORE_BASE_GLYPHS = 16, + IGNORE_LIGATURES = 17, IGNORE_MARKS = 18, USE_MARK_FILTERING_SET = 19, + MARK_ATTACHMENT_TYPE = 20, EXCLUDE_DFLT = 21, INCLUDE_DFLT = 22, EXCLUDE_dflt = 23, + INCLUDE_dflt = 24, USE_EXTENSION = 25, BEGINVALUE = 26, ENDVALUE = 27, + ENUMERATE = 28, ENUMERATE_v = 29, EXCEPT = 30, IGNORE = 31, SUBSTITUTE = 32, + SUBSTITUTE_v = 33, REVERSE = 34, REVERSE_v = 35, BY = 36, FROM = 37, + POSITION = 38, POSITION_v = 39, PARAMETERS = 40, FEATURE_NAMES = 41, + CV_PARAMETERS = 42, CV_UI_LABEL = 43, CV_TOOLTIP = 44, CV_SAMPLE_TEXT = 45, + CV_PARAM_LABEL = 46, CV_CHARACTER = 47, SIZEMENUNAME = 48, CONTOURPOINT = 49, + ANCHOR = 50, ANCHOR_DEF = 51, VALUE_RECORD_DEF = 52, MARK = 53, MARK_CLASS = 54, + CURSIVE = 55, MARKBASE = 56, MARKLIG = 57, MARKLIG_v = 58, LIG_COMPONENT = 59, + KNULL = 60, BASE = 61, HA_BTL = 62, VA_BTL = 63, HA_BSL = 64, VA_BSL = 65, + GDEF = 66, GLYPH_CLASS_DEF = 67, ATTACH = 68, LIG_CARET_BY_POS = 69, + LIG_CARET_BY_IDX = 70, HEAD = 71, FONT_REVISION = 72, HHEA = 73, ASCENDER = 74, + DESCENDER = 75, LINE_GAP = 76, CARET_OFFSET = 77, NAME = 78, NAMEID = 79, + OS_2 = 80, FS_TYPE = 81, FS_TYPE_v = 82, OS2_LOWER_OP_SIZE = 83, OS2_UPPER_OP_SIZE = 84, + PANOSE = 85, TYPO_ASCENDER = 86, TYPO_DESCENDER = 87, TYPO_LINE_GAP = 88, + WIN_ASCENT = 89, WIN_DESCENT = 90, X_HEIGHT = 91, CAP_HEIGHT = 92, WEIGHT_CLASS = 93, + WIDTH_CLASS = 94, VENDOR = 95, UNICODE_RANGE = 96, CODE_PAGE_RANGE = 97, + FAMILY_CLASS = 98, STAT = 99, ELIDED_FALLBACK_NAME = 100, ELIDED_FALLBACK_NAME_ID = 101, + DESIGN_AXIS = 102, AXIS_VALUE = 103, FLAG = 104, LOCATION = 105, AXIS_EAVN = 106, + AXIS_OSFA = 107, VHEA = 108, VERT_TYPO_ASCENDER = 109, VERT_TYPO_DESCENDER = 110, + VERT_TYPO_LINE_GAP = 111, VMTX = 112, VERT_ORIGIN_Y = 113, VERT_ADVANCE_Y = 114, + LCBRACE = 115, RCBRACE = 116, LBRACKET = 117, RBRACKET = 118, HYPHEN = 119, + SEMI = 120, EQUALS = 121, MARKER = 122, COMMA = 123, QUOTE = 124, GCLASS = 125, + CID = 126, ESCGNAME = 127, NAMELABEL = 128, EXTNAME = 129, POINTNUM = 130, + NUMEXT = 131, NUMOCT = 132, NUM = 133, CATCHTAG = 134, A_WHITESPACE = 135, + A_LABEL = 136, A_LBRACE = 137, A_CLOSE = 138, A_LINE = 139, I_WHITESPACE = 140, + I_RPAREN = 141, IFILE = 142, I_LPAREN = 143, STRVAL = 144, EQUOTE = 145 + }; + + enum { + RuleFile = 0, RuleTopLevelStatement = 1, RuleInclude = 2, RuleGlyphClassAssign = 3, + RuleLangsysAssign = 4, RuleMark_statement = 5, RuleAnchorDef = 6, RuleValueRecordDef = 7, + RuleFeatureBlock = 8, RuleTableBlock = 9, RuleAnonBlock = 10, RuleLookupBlockTopLevel = 11, + RuleFeatureStatement = 12, RuleLookupBlockOrUse = 13, RuleCvParameterBlock = 14, + RuleCvParameterStatement = 15, RuleCvParameter = 16, RuleStatement = 17, + RuleFeatureUse = 18, RuleScriptAssign = 19, RuleLangAssign = 20, RuleLookupflagAssign = 21, + RuleLookupflagElement = 22, RuleIgnoreSubOrPos = 23, RuleSubstitute = 24, + RulePosition = 25, RuleValuePattern = 26, RuleValueRecord = 27, RuleValueLiteral = 28, + RuleCursiveElement = 29, RuleBaseToMarkElement = 30, RuleLigatureMarkElement = 31, + RuleParameters = 32, RuleSizemenuname = 33, RuleFeatureNames = 34, RuleSubtable = 35, + RuleTable_BASE = 36, RuleBaseStatement = 37, RuleAxisTags = 38, RuleAxisScripts = 39, + RuleBaseScript = 40, RuleTable_GDEF = 41, RuleGdefStatement = 42, RuleGdefGlyphClass = 43, + RuleGdefAttach = 44, RuleGdefLigCaretPos = 45, RuleGdefLigCaretIndex = 46, + RuleTable_head = 47, RuleHeadStatement = 48, RuleHead = 49, RuleTable_hhea = 50, + RuleHheaStatement = 51, RuleHhea = 52, RuleTable_vhea = 53, RuleVheaStatement = 54, + RuleVhea = 55, RuleTable_name = 56, RuleNameStatement = 57, RuleNameID = 58, + RuleTable_OS_2 = 59, RuleOs_2Statement = 60, RuleOs_2 = 61, RuleTable_STAT = 62, + RuleStatStatement = 63, RuleDesignAxis = 64, RuleAxisValue = 65, RuleAxisValueStatement = 66, + RuleAxisValueLocation = 67, RuleAxisValueFlags = 68, RuleElidedFallbackName = 69, + RuleNameEntryStatement = 70, RuleElidedFallbackNameID = 71, RuleNameEntry = 72, + RuleTable_vmtx = 73, RuleVmtxStatement = 74, RuleVmtx = 75, RuleAnchor = 76, + RuleLookupPattern = 77, RuleLookupPatternElement = 78, RulePattern = 79, + RulePatternElement = 80, RuleGlyphClassOptional = 81, RuleGlyphClass = 82, + RuleGcLiteral = 83, RuleGcLiteralElement = 84, RuleGlyph = 85, RuleGlyphName = 86, + RuleLabel = 87, RuleTag = 88, RuleFixedNum = 89, RuleGenNum = 90, RuleFeatureFile = 91, + RuleStatementFile = 92, RuleCvStatementFile = 93, RuleBaseFile = 94, + RuleHeadFile = 95, RuleHheaFile = 96, RuleVheaFile = 97, RuleGdefFile = 98, + RuleNameFile = 99, RuleVmtxFile = 100, RuleOs_2File = 101, RuleStatFile = 102, + RuleAxisValueFile = 103, RuleNameEntryFile = 104, RuleSubtok = 105, + RuleRevtok = 106, RuleAnontok = 107, RuleEnumtok = 108, RulePostok = 109, + RuleMarkligtok = 110 + }; + + explicit FeatParser(antlr4::TokenStream *input); + ~FeatParser(); + + virtual std::string getGrammarFileName() const override; + virtual const antlr4::atn::ATN& getATN() const override { return _atn; }; + virtual const std::vector& getTokenNames() const override { return _tokenNames; }; // deprecated: use vocabulary instead. + virtual const std::vector& getRuleNames() const override; + virtual antlr4::dfa::Vocabulary& getVocabulary() const override; + + + class FileContext; + class TopLevelStatementContext; + class IncludeContext; + class GlyphClassAssignContext; + class LangsysAssignContext; + class Mark_statementContext; + class AnchorDefContext; + class ValueRecordDefContext; + class FeatureBlockContext; + class TableBlockContext; + class AnonBlockContext; + class LookupBlockTopLevelContext; + class FeatureStatementContext; + class LookupBlockOrUseContext; + class CvParameterBlockContext; + class CvParameterStatementContext; + class CvParameterContext; + class StatementContext; + class FeatureUseContext; + class ScriptAssignContext; + class LangAssignContext; + class LookupflagAssignContext; + class LookupflagElementContext; + class IgnoreSubOrPosContext; + class SubstituteContext; + class PositionContext; + class ValuePatternContext; + class ValueRecordContext; + class ValueLiteralContext; + class CursiveElementContext; + class BaseToMarkElementContext; + class LigatureMarkElementContext; + class ParametersContext; + class SizemenunameContext; + class FeatureNamesContext; + class SubtableContext; + class Table_BASEContext; + class BaseStatementContext; + class AxisTagsContext; + class AxisScriptsContext; + class BaseScriptContext; + class Table_GDEFContext; + class GdefStatementContext; + class GdefGlyphClassContext; + class GdefAttachContext; + class GdefLigCaretPosContext; + class GdefLigCaretIndexContext; + class Table_headContext; + class HeadStatementContext; + class HeadContext; + class Table_hheaContext; + class HheaStatementContext; + class HheaContext; + class Table_vheaContext; + class VheaStatementContext; + class VheaContext; + class Table_nameContext; + class NameStatementContext; + class NameIDContext; + class Table_OS_2Context; + class Os_2StatementContext; + class Os_2Context; + class Table_STATContext; + class StatStatementContext; + class DesignAxisContext; + class AxisValueContext; + class AxisValueStatementContext; + class AxisValueLocationContext; + class AxisValueFlagsContext; + class ElidedFallbackNameContext; + class NameEntryStatementContext; + class ElidedFallbackNameIDContext; + class NameEntryContext; + class Table_vmtxContext; + class VmtxStatementContext; + class VmtxContext; + class AnchorContext; + class LookupPatternContext; + class LookupPatternElementContext; + class PatternContext; + class PatternElementContext; + class GlyphClassOptionalContext; + class GlyphClassContext; + class GcLiteralContext; + class GcLiteralElementContext; + class GlyphContext; + class GlyphNameContext; + class LabelContext; + class TagContext; + class FixedNumContext; + class GenNumContext; + class FeatureFileContext; + class StatementFileContext; + class CvStatementFileContext; + class BaseFileContext; + class HeadFileContext; + class HheaFileContext; + class VheaFileContext; + class GdefFileContext; + class NameFileContext; + class VmtxFileContext; + class Os_2FileContext; + class StatFileContext; + class AxisValueFileContext; + class NameEntryFileContext; + class SubtokContext; + class RevtokContext; + class AnontokContext; + class EnumtokContext; + class PostokContext; + class MarkligtokContext; + + class FileContext : public antlr4::ParserRuleContext { + public: + FileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector topLevelStatement(); + TopLevelStatementContext* topLevelStatement(size_t i); + std::vector featureBlock(); + FeatureBlockContext* featureBlock(size_t i); + std::vector tableBlock(); + TableBlockContext* tableBlock(size_t i); + std::vector anonBlock(); + AnonBlockContext* anonBlock(size_t i); + std::vector lookupBlockTopLevel(); + LookupBlockTopLevelContext* lookupBlockTopLevel(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FileContext* file(); + + class TopLevelStatementContext : public antlr4::ParserRuleContext { + public: + TopLevelStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + IncludeContext *include(); + GlyphClassAssignContext *glyphClassAssign(); + LangsysAssignContext *langsysAssign(); + Mark_statementContext *mark_statement(); + AnchorDefContext *anchorDef(); + ValueRecordDefContext *valueRecordDef(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + TopLevelStatementContext* topLevelStatement(); + + class IncludeContext : public antlr4::ParserRuleContext { + public: + IncludeContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *INCLUDE(); + antlr4::tree::TerminalNode *I_RPAREN(); + antlr4::tree::TerminalNode *IFILE(); + antlr4::tree::TerminalNode *I_LPAREN(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + IncludeContext* include(); + + class GlyphClassAssignContext : public antlr4::ParserRuleContext { + public: + GlyphClassAssignContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *GCLASS(); + antlr4::tree::TerminalNode *EQUALS(); + GlyphClassContext *glyphClass(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GlyphClassAssignContext* glyphClassAssign(); + + class LangsysAssignContext : public antlr4::ParserRuleContext { + public: + FeatParser::TagContext *script = nullptr; + FeatParser::TagContext *lang = nullptr; + LangsysAssignContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LANGSYS(); + std::vector tag(); + TagContext* tag(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LangsysAssignContext* langsysAssign(); + + class Mark_statementContext : public antlr4::ParserRuleContext { + public: + Mark_statementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *MARK_CLASS(); + AnchorContext *anchor(); + antlr4::tree::TerminalNode *GCLASS(); + GlyphContext *glyph(); + GlyphClassContext *glyphClass(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Mark_statementContext* mark_statement(); + + class AnchorDefContext : public antlr4::ParserRuleContext { + public: + antlr4::Token *xval = nullptr; + antlr4::Token *yval = nullptr; + antlr4::Token *cp = nullptr; + FeatParser::LabelContext *name = nullptr; + AnchorDefContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ANCHOR_DEF(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + LabelContext *label(); + antlr4::tree::TerminalNode *CONTOURPOINT(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AnchorDefContext* anchorDef(); + + class ValueRecordDefContext : public antlr4::ParserRuleContext { + public: + ValueRecordDefContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *VALUE_RECORD_DEF(); + ValueLiteralContext *valueLiteral(); + LabelContext *label(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ValueRecordDefContext* valueRecordDef(); + + class FeatureBlockContext : public antlr4::ParserRuleContext { + public: + FeatParser::TagContext *starttag = nullptr; + FeatParser::TagContext *endtag = nullptr; + FeatureBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *FEATURE(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector tag(); + TagContext* tag(size_t i); + antlr4::tree::TerminalNode *USE_EXTENSION(); + std::vector featureStatement(); + FeatureStatementContext* featureStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FeatureBlockContext* featureBlock(); + + class TableBlockContext : public antlr4::ParserRuleContext { + public: + TableBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *TABLE(); + Table_BASEContext *table_BASE(); + Table_GDEFContext *table_GDEF(); + Table_headContext *table_head(); + Table_hheaContext *table_hhea(); + Table_vheaContext *table_vhea(); + Table_nameContext *table_name(); + Table_OS_2Context *table_OS_2(); + Table_STATContext *table_STAT(); + Table_vmtxContext *table_vmtx(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + TableBlockContext* tableBlock(); + + class AnonBlockContext : public antlr4::ParserRuleContext { + public: + AnonBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + AnontokContext *anontok(); + antlr4::tree::TerminalNode *A_LABEL(); + antlr4::tree::TerminalNode *A_LBRACE(); + antlr4::tree::TerminalNode *A_CLOSE(); + std::vector A_LINE(); + antlr4::tree::TerminalNode* A_LINE(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AnonBlockContext* anonBlock(); + + class LookupBlockTopLevelContext : public antlr4::ParserRuleContext { + public: + FeatParser::LabelContext *startlabel = nullptr; + FeatParser::LabelContext *endlabel = nullptr; + LookupBlockTopLevelContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LOOKUP(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector label(); + LabelContext* label(size_t i); + antlr4::tree::TerminalNode *USE_EXTENSION(); + std::vector statement(); + StatementContext* statement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LookupBlockTopLevelContext* lookupBlockTopLevel(); + + class FeatureStatementContext : public antlr4::ParserRuleContext { + public: + FeatureStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + StatementContext *statement(); + LookupBlockOrUseContext *lookupBlockOrUse(); + CvParameterBlockContext *cvParameterBlock(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FeatureStatementContext* featureStatement(); + + class LookupBlockOrUseContext : public antlr4::ParserRuleContext { + public: + FeatParser::LabelContext *startlabel = nullptr; + FeatParser::LabelContext *endlabel = nullptr; + LookupBlockOrUseContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LOOKUP(); + antlr4::tree::TerminalNode *SEMI(); + std::vector label(); + LabelContext* label(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *USE_EXTENSION(); + std::vector statement(); + StatementContext* statement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LookupBlockOrUseContext* lookupBlockOrUse(); + + class CvParameterBlockContext : public antlr4::ParserRuleContext { + public: + CvParameterBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *CV_PARAMETERS(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector cvParameterStatement(); + CvParameterStatementContext* cvParameterStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CvParameterBlockContext* cvParameterBlock(); + + class CvParameterStatementContext : public antlr4::ParserRuleContext { + public: + CvParameterStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + CvParameterContext *cvParameter(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CvParameterStatementContext* cvParameterStatement(); + + class CvParameterContext : public antlr4::ParserRuleContext { + public: + CvParameterContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *CV_UI_LABEL(); + antlr4::tree::TerminalNode *CV_TOOLTIP(); + antlr4::tree::TerminalNode *CV_SAMPLE_TEXT(); + antlr4::tree::TerminalNode *CV_PARAM_LABEL(); + std::vector nameEntryStatement(); + NameEntryStatementContext* nameEntryStatement(size_t i); + antlr4::tree::TerminalNode *CV_CHARACTER(); + GenNumContext *genNum(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CvParameterContext* cvParameter(); + + class StatementContext : public antlr4::ParserRuleContext { + public: + StatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + FeatureUseContext *featureUse(); + ScriptAssignContext *scriptAssign(); + LangAssignContext *langAssign(); + LookupflagAssignContext *lookupflagAssign(); + GlyphClassAssignContext *glyphClassAssign(); + IgnoreSubOrPosContext *ignoreSubOrPos(); + SubstituteContext *substitute(); + Mark_statementContext *mark_statement(); + PositionContext *position(); + ParametersContext *parameters(); + SizemenunameContext *sizemenuname(); + FeatureNamesContext *featureNames(); + SubtableContext *subtable(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + StatementContext* statement(); + + class FeatureUseContext : public antlr4::ParserRuleContext { + public: + FeatureUseContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *FEATURE(); + TagContext *tag(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FeatureUseContext* featureUse(); + + class ScriptAssignContext : public antlr4::ParserRuleContext { + public: + ScriptAssignContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SCRIPT(); + TagContext *tag(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ScriptAssignContext* scriptAssign(); + + class LangAssignContext : public antlr4::ParserRuleContext { + public: + LangAssignContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LANGUAGE(); + TagContext *tag(); + antlr4::tree::TerminalNode *EXCLUDE_DFLT(); + antlr4::tree::TerminalNode *INCLUDE_DFLT(); + antlr4::tree::TerminalNode *EXCLUDE_dflt(); + antlr4::tree::TerminalNode *INCLUDE_dflt(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LangAssignContext* langAssign(); + + class LookupflagAssignContext : public antlr4::ParserRuleContext { + public: + LookupflagAssignContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LOOKUPFLAG(); + antlr4::tree::TerminalNode *NUM(); + std::vector lookupflagElement(); + LookupflagElementContext* lookupflagElement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LookupflagAssignContext* lookupflagAssign(); + + class LookupflagElementContext : public antlr4::ParserRuleContext { + public: + LookupflagElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *RIGHT_TO_LEFT(); + antlr4::tree::TerminalNode *IGNORE_BASE_GLYPHS(); + antlr4::tree::TerminalNode *IGNORE_LIGATURES(); + antlr4::tree::TerminalNode *IGNORE_MARKS(); + antlr4::tree::TerminalNode *MARK_ATTACHMENT_TYPE(); + GlyphClassContext *glyphClass(); + antlr4::tree::TerminalNode *USE_MARK_FILTERING_SET(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LookupflagElementContext* lookupflagElement(); + + class IgnoreSubOrPosContext : public antlr4::ParserRuleContext { + public: + IgnoreSubOrPosContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *IGNORE(); + std::vector lookupPattern(); + LookupPatternContext* lookupPattern(size_t i); + SubtokContext *subtok(); + RevtokContext *revtok(); + PostokContext *postok(); + std::vector COMMA(); + antlr4::tree::TerminalNode* COMMA(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + IgnoreSubOrPosContext* ignoreSubOrPos(); + + class SubstituteContext : public antlr4::ParserRuleContext { + public: + FeatParser::LookupPatternContext *startpat = nullptr; + FeatParser::LookupPatternContext *endpat = nullptr; + SubstituteContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + RevtokContext *revtok(); + SubtokContext *subtok(); + antlr4::tree::TerminalNode *EXCEPT(); + std::vector lookupPattern(); + LookupPatternContext* lookupPattern(size_t i); + antlr4::tree::TerminalNode *BY(); + std::vector COMMA(); + antlr4::tree::TerminalNode* COMMA(size_t i); + antlr4::tree::TerminalNode *FROM(); + antlr4::tree::TerminalNode *KNULL(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SubstituteContext* substitute(); + + class PositionContext : public antlr4::ParserRuleContext { + public: + FeatParser::PatternContext *startpat = nullptr; + FeatParser::PatternContext *endpat = nullptr; + FeatParser::PatternContext *midpat = nullptr; + PositionContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PostokContext *postok(); + EnumtokContext *enumtok(); + std::vector pattern(); + PatternContext* pattern(size_t i); + ValueRecordContext *valueRecord(); + antlr4::tree::TerminalNode *CURSIVE(); + CursiveElementContext *cursiveElement(); + antlr4::tree::TerminalNode *MARKBASE(); + MarkligtokContext *markligtok(); + antlr4::tree::TerminalNode *MARK(); + std::vector valuePattern(); + ValuePatternContext* valuePattern(size_t i); + std::vector LOOKUP(); + antlr4::tree::TerminalNode* LOOKUP(size_t i); + std::vector label(); + LabelContext* label(size_t i); + std::vector lookupPatternElement(); + LookupPatternElementContext* lookupPatternElement(size_t i); + std::vector baseToMarkElement(); + BaseToMarkElementContext* baseToMarkElement(size_t i); + std::vector ligatureMarkElement(); + LigatureMarkElementContext* ligatureMarkElement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PositionContext* position(); + + class ValuePatternContext : public antlr4::ParserRuleContext { + public: + ValuePatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PatternElementContext *patternElement(); + ValueRecordContext *valueRecord(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ValuePatternContext* valuePattern(); + + class ValueRecordContext : public antlr4::ParserRuleContext { + public: + FeatParser::LabelContext *valuename = nullptr; + ValueRecordContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *BEGINVALUE(); + antlr4::tree::TerminalNode *ENDVALUE(); + LabelContext *label(); + ValueLiteralContext *valueLiteral(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ValueRecordContext* valueRecord(); + + class ValueLiteralContext : public antlr4::ParserRuleContext { + public: + ValueLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *BEGINVALUE(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + antlr4::tree::TerminalNode *ENDVALUE(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ValueLiteralContext* valueLiteral(); + + class CursiveElementContext : public antlr4::ParserRuleContext { + public: + CursiveElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PatternElementContext *patternElement(); + std::vector anchor(); + AnchorContext* anchor(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CursiveElementContext* cursiveElement(); + + class BaseToMarkElementContext : public antlr4::ParserRuleContext { + public: + BaseToMarkElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + AnchorContext *anchor(); + antlr4::tree::TerminalNode *MARK(); + antlr4::tree::TerminalNode *GCLASS(); + antlr4::tree::TerminalNode *MARKER(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + BaseToMarkElementContext* baseToMarkElement(); + + class LigatureMarkElementContext : public antlr4::ParserRuleContext { + public: + LigatureMarkElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + AnchorContext *anchor(); + antlr4::tree::TerminalNode *MARK(); + antlr4::tree::TerminalNode *GCLASS(); + antlr4::tree::TerminalNode *LIG_COMPONENT(); + antlr4::tree::TerminalNode *MARKER(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LigatureMarkElementContext* ligatureMarkElement(); + + class ParametersContext : public antlr4::ParserRuleContext { + public: + ParametersContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *PARAMETERS(); + std::vector fixedNum(); + FixedNumContext* fixedNum(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ParametersContext* parameters(); + + class SizemenunameContext : public antlr4::ParserRuleContext { + public: + SizemenunameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SIZEMENUNAME(); + antlr4::tree::TerminalNode *QUOTE(); + antlr4::tree::TerminalNode *STRVAL(); + antlr4::tree::TerminalNode *EQUOTE(); + std::vector genNum(); + GenNumContext* genNum(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SizemenunameContext* sizemenuname(); + + class FeatureNamesContext : public antlr4::ParserRuleContext { + public: + FeatureNamesContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *FEATURE_NAMES(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + std::vector nameEntryStatement(); + NameEntryStatementContext* nameEntryStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FeatureNamesContext* featureNames(); + + class SubtableContext : public antlr4::ParserRuleContext { + public: + SubtableContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SUBTABLE(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SubtableContext* subtable(); + + class Table_BASEContext : public antlr4::ParserRuleContext { + public: + Table_BASEContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector BASE(); + antlr4::tree::TerminalNode* BASE(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector baseStatement(); + BaseStatementContext* baseStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_BASEContext* table_BASE(); + + class BaseStatementContext : public antlr4::ParserRuleContext { + public: + BaseStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + AxisTagsContext *axisTags(); + AxisScriptsContext *axisScripts(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + BaseStatementContext* baseStatement(); + + class AxisTagsContext : public antlr4::ParserRuleContext { + public: + AxisTagsContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *HA_BTL(); + antlr4::tree::TerminalNode *VA_BTL(); + std::vector tag(); + TagContext* tag(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisTagsContext* axisTags(); + + class AxisScriptsContext : public antlr4::ParserRuleContext { + public: + AxisScriptsContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector baseScript(); + BaseScriptContext* baseScript(size_t i); + antlr4::tree::TerminalNode *HA_BSL(); + antlr4::tree::TerminalNode *VA_BSL(); + std::vector COMMA(); + antlr4::tree::TerminalNode* COMMA(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisScriptsContext* axisScripts(); + + class BaseScriptContext : public antlr4::ParserRuleContext { + public: + FeatParser::TagContext *script = nullptr; + FeatParser::TagContext *db = nullptr; + BaseScriptContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector tag(); + TagContext* tag(size_t i); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + BaseScriptContext* baseScript(); + + class Table_GDEFContext : public antlr4::ParserRuleContext { + public: + Table_GDEFContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector GDEF(); + antlr4::tree::TerminalNode* GDEF(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector gdefStatement(); + GdefStatementContext* gdefStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_GDEFContext* table_GDEF(); + + class GdefStatementContext : public antlr4::ParserRuleContext { + public: + GdefStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + GdefGlyphClassContext *gdefGlyphClass(); + GdefAttachContext *gdefAttach(); + GdefLigCaretPosContext *gdefLigCaretPos(); + GdefLigCaretIndexContext *gdefLigCaretIndex(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GdefStatementContext* gdefStatement(); + + class GdefGlyphClassContext : public antlr4::ParserRuleContext { + public: + GdefGlyphClassContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *GLYPH_CLASS_DEF(); + std::vector glyphClassOptional(); + GlyphClassOptionalContext* glyphClassOptional(size_t i); + std::vector COMMA(); + antlr4::tree::TerminalNode* COMMA(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GdefGlyphClassContext* gdefGlyphClass(); + + class GdefAttachContext : public antlr4::ParserRuleContext { + public: + GdefAttachContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ATTACH(); + LookupPatternContext *lookupPattern(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GdefAttachContext* gdefAttach(); + + class GdefLigCaretPosContext : public antlr4::ParserRuleContext { + public: + GdefLigCaretPosContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LIG_CARET_BY_POS(); + LookupPatternContext *lookupPattern(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GdefLigCaretPosContext* gdefLigCaretPos(); + + class GdefLigCaretIndexContext : public antlr4::ParserRuleContext { + public: + GdefLigCaretIndexContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LIG_CARET_BY_IDX(); + LookupPatternContext *lookupPattern(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GdefLigCaretIndexContext* gdefLigCaretIndex(); + + class Table_headContext : public antlr4::ParserRuleContext { + public: + Table_headContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector HEAD(); + antlr4::tree::TerminalNode* HEAD(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector headStatement(); + HeadStatementContext* headStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_headContext* table_head(); + + class HeadStatementContext : public antlr4::ParserRuleContext { + public: + HeadStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + HeadContext *head(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + HeadStatementContext* headStatement(); + + class HeadContext : public antlr4::ParserRuleContext { + public: + HeadContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *FONT_REVISION(); + antlr4::tree::TerminalNode *POINTNUM(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + HeadContext* head(); + + class Table_hheaContext : public antlr4::ParserRuleContext { + public: + Table_hheaContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector HHEA(); + antlr4::tree::TerminalNode* HHEA(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector hheaStatement(); + HheaStatementContext* hheaStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_hheaContext* table_hhea(); + + class HheaStatementContext : public antlr4::ParserRuleContext { + public: + HheaStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + HheaContext *hhea(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + HheaStatementContext* hheaStatement(); + + class HheaContext : public antlr4::ParserRuleContext { + public: + HheaContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NUM(); + antlr4::tree::TerminalNode *CARET_OFFSET(); + antlr4::tree::TerminalNode *ASCENDER(); + antlr4::tree::TerminalNode *DESCENDER(); + antlr4::tree::TerminalNode *LINE_GAP(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + HheaContext* hhea(); + + class Table_vheaContext : public antlr4::ParserRuleContext { + public: + Table_vheaContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector VHEA(); + antlr4::tree::TerminalNode* VHEA(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector vheaStatement(); + VheaStatementContext* vheaStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_vheaContext* table_vhea(); + + class VheaStatementContext : public antlr4::ParserRuleContext { + public: + VheaStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + VheaContext *vhea(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VheaStatementContext* vheaStatement(); + + class VheaContext : public antlr4::ParserRuleContext { + public: + VheaContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NUM(); + antlr4::tree::TerminalNode *VERT_TYPO_ASCENDER(); + antlr4::tree::TerminalNode *VERT_TYPO_DESCENDER(); + antlr4::tree::TerminalNode *VERT_TYPO_LINE_GAP(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VheaContext* vhea(); + + class Table_nameContext : public antlr4::ParserRuleContext { + public: + Table_nameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector NAME(); + antlr4::tree::TerminalNode* NAME(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector nameStatement(); + NameStatementContext* nameStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_nameContext* table_name(); + + class NameStatementContext : public antlr4::ParserRuleContext { + public: + NameStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + NameIDContext *nameID(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NameStatementContext* nameStatement(); + + class NameIDContext : public antlr4::ParserRuleContext { + public: + FeatParser::GenNumContext *id = nullptr; + FeatParser::GenNumContext *plat = nullptr; + FeatParser::GenNumContext *spec = nullptr; + FeatParser::GenNumContext *lang = nullptr; + NameIDContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NAMEID(); + antlr4::tree::TerminalNode *QUOTE(); + antlr4::tree::TerminalNode *STRVAL(); + antlr4::tree::TerminalNode *EQUOTE(); + std::vector genNum(); + GenNumContext* genNum(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NameIDContext* nameID(); + + class Table_OS_2Context : public antlr4::ParserRuleContext { + public: + Table_OS_2Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector OS_2(); + antlr4::tree::TerminalNode* OS_2(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector os_2Statement(); + Os_2StatementContext* os_2Statement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_OS_2Context* table_OS_2(); + + class Os_2StatementContext : public antlr4::ParserRuleContext { + public: + Os_2StatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + Os_2Context *os_2(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Os_2StatementContext* os_2Statement(); + + class Os_2Context : public antlr4::ParserRuleContext { + public: + antlr4::Token *num = nullptr; + antlr4::Token *unum = nullptr; + FeatParser::GenNumContext *gnum = nullptr; + Os_2Context(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *TYPO_ASCENDER(); + antlr4::tree::TerminalNode *TYPO_DESCENDER(); + antlr4::tree::TerminalNode *TYPO_LINE_GAP(); + antlr4::tree::TerminalNode *WIN_ASCENT(); + antlr4::tree::TerminalNode *WIN_DESCENT(); + antlr4::tree::TerminalNode *X_HEIGHT(); + antlr4::tree::TerminalNode *CAP_HEIGHT(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + antlr4::tree::TerminalNode *FS_TYPE(); + antlr4::tree::TerminalNode *FS_TYPE_v(); + antlr4::tree::TerminalNode *WEIGHT_CLASS(); + antlr4::tree::TerminalNode *WIDTH_CLASS(); + antlr4::tree::TerminalNode *OS2_LOWER_OP_SIZE(); + antlr4::tree::TerminalNode *OS2_UPPER_OP_SIZE(); + antlr4::tree::TerminalNode *FAMILY_CLASS(); + GenNumContext *genNum(); + antlr4::tree::TerminalNode *VENDOR(); + antlr4::tree::TerminalNode *QUOTE(); + antlr4::tree::TerminalNode *STRVAL(); + antlr4::tree::TerminalNode *EQUOTE(); + antlr4::tree::TerminalNode *PANOSE(); + antlr4::tree::TerminalNode *UNICODE_RANGE(); + antlr4::tree::TerminalNode *CODE_PAGE_RANGE(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Os_2Context* os_2(); + + class Table_STATContext : public antlr4::ParserRuleContext { + public: + Table_STATContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector STAT(); + antlr4::tree::TerminalNode* STAT(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector statStatement(); + StatStatementContext* statStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_STATContext* table_STAT(); + + class StatStatementContext : public antlr4::ParserRuleContext { + public: + StatStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + DesignAxisContext *designAxis(); + AxisValueContext *axisValue(); + ElidedFallbackNameContext *elidedFallbackName(); + ElidedFallbackNameIDContext *elidedFallbackNameID(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + StatStatementContext* statStatement(); + + class DesignAxisContext : public antlr4::ParserRuleContext { + public: + DesignAxisContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *DESIGN_AXIS(); + TagContext *tag(); + antlr4::tree::TerminalNode *NUM(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + std::vector nameEntryStatement(); + NameEntryStatementContext* nameEntryStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + DesignAxisContext* designAxis(); + + class AxisValueContext : public antlr4::ParserRuleContext { + public: + AxisValueContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *AXIS_VALUE(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + std::vector axisValueStatement(); + AxisValueStatementContext* axisValueStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisValueContext* axisValue(); + + class AxisValueStatementContext : public antlr4::ParserRuleContext { + public: + AxisValueStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + NameEntryContext *nameEntry(); + AxisValueLocationContext *axisValueLocation(); + AxisValueFlagsContext *axisValueFlags(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisValueStatementContext* axisValueStatement(); + + class AxisValueLocationContext : public antlr4::ParserRuleContext { + public: + AxisValueLocationContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LOCATION(); + TagContext *tag(); + std::vector fixedNum(); + FixedNumContext* fixedNum(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisValueLocationContext* axisValueLocation(); + + class AxisValueFlagsContext : public antlr4::ParserRuleContext { + public: + AxisValueFlagsContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *FLAG(); + std::vector AXIS_OSFA(); + antlr4::tree::TerminalNode* AXIS_OSFA(size_t i); + std::vector AXIS_EAVN(); + antlr4::tree::TerminalNode* AXIS_EAVN(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisValueFlagsContext* axisValueFlags(); + + class ElidedFallbackNameContext : public antlr4::ParserRuleContext { + public: + ElidedFallbackNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ELIDED_FALLBACK_NAME(); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + std::vector nameEntryStatement(); + NameEntryStatementContext* nameEntryStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ElidedFallbackNameContext* elidedFallbackName(); + + class NameEntryStatementContext : public antlr4::ParserRuleContext { + public: + NameEntryStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + NameEntryContext *nameEntry(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NameEntryStatementContext* nameEntryStatement(); + + class ElidedFallbackNameIDContext : public antlr4::ParserRuleContext { + public: + ElidedFallbackNameIDContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ELIDED_FALLBACK_NAME_ID(); + GenNumContext *genNum(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + ElidedFallbackNameIDContext* elidedFallbackNameID(); + + class NameEntryContext : public antlr4::ParserRuleContext { + public: + NameEntryContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NAME(); + antlr4::tree::TerminalNode *QUOTE(); + antlr4::tree::TerminalNode *STRVAL(); + antlr4::tree::TerminalNode *EQUOTE(); + std::vector genNum(); + GenNumContext* genNum(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NameEntryContext* nameEntry(); + + class Table_vmtxContext : public antlr4::ParserRuleContext { + public: + Table_vmtxContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector VMTX(); + antlr4::tree::TerminalNode* VMTX(size_t i); + antlr4::tree::TerminalNode *LCBRACE(); + antlr4::tree::TerminalNode *RCBRACE(); + antlr4::tree::TerminalNode *SEMI(); + std::vector vmtxStatement(); + VmtxStatementContext* vmtxStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Table_vmtxContext* table_vmtx(); + + class VmtxStatementContext : public antlr4::ParserRuleContext { + public: + VmtxStatementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SEMI(); + VmtxContext *vmtx(); + IncludeContext *include(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VmtxStatementContext* vmtxStatement(); + + class VmtxContext : public antlr4::ParserRuleContext { + public: + VmtxContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + GlyphContext *glyph(); + antlr4::tree::TerminalNode *NUM(); + antlr4::tree::TerminalNode *VERT_ORIGIN_Y(); + antlr4::tree::TerminalNode *VERT_ADVANCE_Y(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VmtxContext* vmtx(); + + class AnchorContext : public antlr4::ParserRuleContext { + public: + antlr4::Token *xval = nullptr; + antlr4::Token *yval = nullptr; + antlr4::Token *cp = nullptr; + FeatParser::LabelContext *name = nullptr; + AnchorContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *BEGINVALUE(); + antlr4::tree::TerminalNode *ANCHOR(); + antlr4::tree::TerminalNode *ENDVALUE(); + antlr4::tree::TerminalNode *KNULL(); + LabelContext *label(); + std::vector NUM(); + antlr4::tree::TerminalNode* NUM(size_t i); + antlr4::tree::TerminalNode *CONTOURPOINT(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AnchorContext* anchor(); + + class LookupPatternContext : public antlr4::ParserRuleContext { + public: + LookupPatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector lookupPatternElement(); + LookupPatternElementContext* lookupPatternElement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LookupPatternContext* lookupPattern(); + + class LookupPatternElementContext : public antlr4::ParserRuleContext { + public: + LookupPatternElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + PatternElementContext *patternElement(); + std::vector LOOKUP(); + antlr4::tree::TerminalNode* LOOKUP(size_t i); + std::vector label(); + LabelContext* label(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LookupPatternElementContext* lookupPatternElement(); + + class PatternContext : public antlr4::ParserRuleContext { + public: + PatternContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector patternElement(); + PatternElementContext* patternElement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PatternContext* pattern(); + + class PatternElementContext : public antlr4::ParserRuleContext { + public: + PatternElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + GlyphClassContext *glyphClass(); + GlyphContext *glyph(); + antlr4::tree::TerminalNode *MARKER(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PatternElementContext* patternElement(); + + class GlyphClassOptionalContext : public antlr4::ParserRuleContext { + public: + GlyphClassOptionalContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + GlyphClassContext *glyphClass(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GlyphClassOptionalContext* glyphClassOptional(); + + class GlyphClassContext : public antlr4::ParserRuleContext { + public: + GlyphClassContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *GCLASS(); + GcLiteralContext *gcLiteral(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GlyphClassContext* glyphClass(); + + class GcLiteralContext : public antlr4::ParserRuleContext { + public: + GcLiteralContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *LBRACKET(); + antlr4::tree::TerminalNode *RBRACKET(); + std::vector gcLiteralElement(); + GcLiteralElementContext* gcLiteralElement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GcLiteralContext* gcLiteral(); + + class GcLiteralElementContext : public antlr4::ParserRuleContext { + public: + FeatParser::GlyphContext *startg = nullptr; + FeatParser::GlyphContext *endg = nullptr; + GcLiteralElementContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + std::vector glyph(); + GlyphContext* glyph(size_t i); + antlr4::tree::TerminalNode *HYPHEN(); + antlr4::tree::TerminalNode *GCLASS(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GcLiteralElementContext* gcLiteralElement(); + + class GlyphContext : public antlr4::ParserRuleContext { + public: + GlyphContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + GlyphNameContext *glyphName(); + antlr4::tree::TerminalNode *CID(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GlyphContext* glyph(); + + class GlyphNameContext : public antlr4::ParserRuleContext { + public: + GlyphNameContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ESCGNAME(); + antlr4::tree::TerminalNode *NAMELABEL(); + antlr4::tree::TerminalNode *EXTNAME(); + antlr4::tree::TerminalNode *NOTDEF(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GlyphNameContext* glyphName(); + + class LabelContext : public antlr4::ParserRuleContext { + public: + LabelContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NAMELABEL(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + LabelContext* label(); + + class TagContext : public antlr4::ParserRuleContext { + public: + TagContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NAMELABEL(); + antlr4::tree::TerminalNode *EXTNAME(); + antlr4::tree::TerminalNode *CATCHTAG(); + antlr4::tree::TerminalNode *MARK(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + TagContext* tag(); + + class FixedNumContext : public antlr4::ParserRuleContext { + public: + FixedNumContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *POINTNUM(); + antlr4::tree::TerminalNode *NUM(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FixedNumContext* fixedNum(); + + class GenNumContext : public antlr4::ParserRuleContext { + public: + GenNumContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *NUM(); + antlr4::tree::TerminalNode *NUMOCT(); + antlr4::tree::TerminalNode *NUMEXT(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GenNumContext* genNum(); + + class FeatureFileContext : public antlr4::ParserRuleContext { + public: + FeatureFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector featureStatement(); + FeatureStatementContext* featureStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + FeatureFileContext* featureFile(); + + class StatementFileContext : public antlr4::ParserRuleContext { + public: + StatementFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector statement(); + StatementContext* statement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + StatementFileContext* statementFile(); + + class CvStatementFileContext : public antlr4::ParserRuleContext { + public: + CvStatementFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector cvParameterStatement(); + CvParameterStatementContext* cvParameterStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + CvStatementFileContext* cvStatementFile(); + + class BaseFileContext : public antlr4::ParserRuleContext { + public: + BaseFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector baseStatement(); + BaseStatementContext* baseStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + BaseFileContext* baseFile(); + + class HeadFileContext : public antlr4::ParserRuleContext { + public: + HeadFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector headStatement(); + HeadStatementContext* headStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + HeadFileContext* headFile(); + + class HheaFileContext : public antlr4::ParserRuleContext { + public: + HheaFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector hheaStatement(); + HheaStatementContext* hheaStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + HheaFileContext* hheaFile(); + + class VheaFileContext : public antlr4::ParserRuleContext { + public: + VheaFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector vheaStatement(); + VheaStatementContext* vheaStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VheaFileContext* vheaFile(); + + class GdefFileContext : public antlr4::ParserRuleContext { + public: + GdefFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector gdefStatement(); + GdefStatementContext* gdefStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + GdefFileContext* gdefFile(); + + class NameFileContext : public antlr4::ParserRuleContext { + public: + NameFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector nameStatement(); + NameStatementContext* nameStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NameFileContext* nameFile(); + + class VmtxFileContext : public antlr4::ParserRuleContext { + public: + VmtxFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector vmtxStatement(); + VmtxStatementContext* vmtxStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + VmtxFileContext* vmtxFile(); + + class Os_2FileContext : public antlr4::ParserRuleContext { + public: + Os_2FileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector os_2Statement(); + Os_2StatementContext* os_2Statement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + Os_2FileContext* os_2File(); + + class StatFileContext : public antlr4::ParserRuleContext { + public: + StatFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector statStatement(); + StatStatementContext* statStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + StatFileContext* statFile(); + + class AxisValueFileContext : public antlr4::ParserRuleContext { + public: + AxisValueFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector axisValueStatement(); + AxisValueStatementContext* axisValueStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AxisValueFileContext* axisValueFile(); + + class NameEntryFileContext : public antlr4::ParserRuleContext { + public: + NameEntryFileContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *EOF(); + std::vector nameEntryStatement(); + NameEntryStatementContext* nameEntryStatement(size_t i); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + NameEntryFileContext* nameEntryFile(); + + class SubtokContext : public antlr4::ParserRuleContext { + public: + SubtokContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *SUBSTITUTE(); + antlr4::tree::TerminalNode *SUBSTITUTE_v(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + SubtokContext* subtok(); + + class RevtokContext : public antlr4::ParserRuleContext { + public: + RevtokContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *REVERSE(); + antlr4::tree::TerminalNode *REVERSE_v(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + RevtokContext* revtok(); + + class AnontokContext : public antlr4::ParserRuleContext { + public: + AnontokContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ANON(); + antlr4::tree::TerminalNode *ANON_v(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + AnontokContext* anontok(); + + class EnumtokContext : public antlr4::ParserRuleContext { + public: + EnumtokContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *ENUMERATE(); + antlr4::tree::TerminalNode *ENUMERATE_v(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + EnumtokContext* enumtok(); + + class PostokContext : public antlr4::ParserRuleContext { + public: + PostokContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *POSITION(); + antlr4::tree::TerminalNode *POSITION_v(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + PostokContext* postok(); + + class MarkligtokContext : public antlr4::ParserRuleContext { + public: + MarkligtokContext(antlr4::ParserRuleContext *parent, size_t invokingState); + virtual size_t getRuleIndex() const override; + antlr4::tree::TerminalNode *MARKLIG(); + antlr4::tree::TerminalNode *MARKLIG_v(); + + + virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; + + }; + + MarkligtokContext* markligtok(); + + +private: + static std::vector _decisionToDFA; + static antlr4::atn::PredictionContextCache _sharedContextCache; + static std::vector _ruleNames; + static std::vector _tokenNames; + + static std::vector _literalNames; + static std::vector _symbolicNames; + static antlr4::dfa::Vocabulary _vocabulary; + static antlr4::atn::ATN _atn; + static std::vector _serializedATN; + + + struct Initializer { + Initializer(); + }; + static Initializer _init; +}; + diff --git a/c/makeotf/lib/hotconv/FeatParser.interp b/c/makeotf/lib/hotconv/FeatParser.interp new file mode 100644 index 000000000..9d483931a --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParser.interp @@ -0,0 +1,412 @@ +token literal names: +null +'anon' +'anonymous' +null +null +'include' +'feature' +'table' +'script' +'language' +'languagesystem' +'subtable' +'lookup' +'lookupflag' +'.notdef' +'RightToLeft' +'IgnoreBaseGlyphs' +'IgnoreLigatures' +'IgnoreMarks' +'UseMarkFilteringSet' +'MarkAttachmentType' +'excludeDFLT' +'includeDFLT' +'exclude_dflt' +'include_dflt' +'useExtension' +'<' +'>' +'enumerate' +'enum' +'except' +'ignore' +'substitute' +'sub' +'reversesub' +'rsub' +'by' +'from' +'position' +'pos' +'parameters' +'featureNames' +'cvParameters' +'FeatUILabelNameID' +'FeatUITooltipTextNameID' +'SampleTextNameID' +'ParamUILabelNameID' +'Character' +'sizemenuname' +'contourpoint' +'anchor' +'anchorDef' +'valueRecordDef' +'mark' +'markClass' +'cursive' +'base' +'ligature' +'lig' +'ligComponent' +'NULL' +'BASE' +'HorizAxis.BaseTagList' +'VertAxis.BaseTagList' +'HorizAxis.BaseScriptList' +'VertAxis.BaseScriptList' +'GDEF' +'GlyphClassDef' +'Attach' +'LigatureCaretByPos' +'LigatureCaretByIndex' +'head' +'FontRevision' +'hhea' +'Ascender' +'Descender' +'LineGap' +'CaretOffset' +'name' +'nameid' +'OS/2' +'FSType' +'fsType' +'LowerOpSize' +'UpperOpSize' +'Panose' +'TypoAscender' +'TypoDescender' +'TypoLineGap' +'winAscent' +'winDescent' +'XHeight' +'CapHeight' +'WeightClass' +'WidthClass' +'Vendor' +'UnicodeRange' +'CodePageRange' +'FamilyClass' +'STAT' +'ElidedFallbackName' +'ElidedFallbackNameID' +'DesignAxis' +'AxisValue' +'flag' +'location' +'ElidableAxisValueName' +'OlderSiblingFontAttribute' +'vhea' +'VertTypoAscender' +'VertTypoDescender' +'VertTypoLineGap' +'vmtx' +'VertOriginY' +'VertAdvanceY' +null +'}' +'[' +']' +'-' +';' +'=' +'\'' +',' +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +'(' +null +')' +null +null + +token symbolic names: +null +ANON +ANON_v +COMMENT +WHITESPACE +INCLUDE +FEATURE +TABLE +SCRIPT +LANGUAGE +LANGSYS +SUBTABLE +LOOKUP +LOOKUPFLAG +NOTDEF +RIGHT_TO_LEFT +IGNORE_BASE_GLYPHS +IGNORE_LIGATURES +IGNORE_MARKS +USE_MARK_FILTERING_SET +MARK_ATTACHMENT_TYPE +EXCLUDE_DFLT +INCLUDE_DFLT +EXCLUDE_dflt +INCLUDE_dflt +USE_EXTENSION +BEGINVALUE +ENDVALUE +ENUMERATE +ENUMERATE_v +EXCEPT +IGNORE +SUBSTITUTE +SUBSTITUTE_v +REVERSE +REVERSE_v +BY +FROM +POSITION +POSITION_v +PARAMETERS +FEATURE_NAMES +CV_PARAMETERS +CV_UI_LABEL +CV_TOOLTIP +CV_SAMPLE_TEXT +CV_PARAM_LABEL +CV_CHARACTER +SIZEMENUNAME +CONTOURPOINT +ANCHOR +ANCHOR_DEF +VALUE_RECORD_DEF +MARK +MARK_CLASS +CURSIVE +MARKBASE +MARKLIG +MARKLIG_v +LIG_COMPONENT +KNULL +BASE +HA_BTL +VA_BTL +HA_BSL +VA_BSL +GDEF +GLYPH_CLASS_DEF +ATTACH +LIG_CARET_BY_POS +LIG_CARET_BY_IDX +HEAD +FONT_REVISION +HHEA +ASCENDER +DESCENDER +LINE_GAP +CARET_OFFSET +NAME +NAMEID +OS_2 +FS_TYPE +FS_TYPE_v +OS2_LOWER_OP_SIZE +OS2_UPPER_OP_SIZE +PANOSE +TYPO_ASCENDER +TYPO_DESCENDER +TYPO_LINE_GAP +WIN_ASCENT +WIN_DESCENT +X_HEIGHT +CAP_HEIGHT +WEIGHT_CLASS +WIDTH_CLASS +VENDOR +UNICODE_RANGE +CODE_PAGE_RANGE +FAMILY_CLASS +STAT +ELIDED_FALLBACK_NAME +ELIDED_FALLBACK_NAME_ID +DESIGN_AXIS +AXIS_VALUE +FLAG +LOCATION +AXIS_EAVN +AXIS_OSFA +VHEA +VERT_TYPO_ASCENDER +VERT_TYPO_DESCENDER +VERT_TYPO_LINE_GAP +VMTX +VERT_ORIGIN_Y +VERT_ADVANCE_Y +LCBRACE +RCBRACE +LBRACKET +RBRACKET +HYPHEN +SEMI +EQUALS +MARKER +COMMA +QUOTE +GCLASS +CID +ESCGNAME +NAMELABEL +EXTNAME +POINTNUM +NUMEXT +NUMOCT +NUM +CATCHTAG +A_WHITESPACE +A_LABEL +A_LBRACE +A_CLOSE +A_LINE +I_WHITESPACE +I_RPAREN +IFILE +I_LPAREN +STRVAL +EQUOTE + +rule names: +file +topLevelStatement +include +glyphClassAssign +langsysAssign +mark_statement +anchorDef +valueRecordDef +featureBlock +tableBlock +anonBlock +lookupBlockTopLevel +featureStatement +lookupBlockOrUse +cvParameterBlock +cvParameterStatement +cvParameter +statement +featureUse +scriptAssign +langAssign +lookupflagAssign +lookupflagElement +ignoreSubOrPos +substitute +position +valuePattern +valueRecord +valueLiteral +cursiveElement +baseToMarkElement +ligatureMarkElement +parameters +sizemenuname +featureNames +subtable +table_BASE +baseStatement +axisTags +axisScripts +baseScript +table_GDEF +gdefStatement +gdefGlyphClass +gdefAttach +gdefLigCaretPos +gdefLigCaretIndex +table_head +headStatement +head +table_hhea +hheaStatement +hhea +table_vhea +vheaStatement +vhea +table_name +nameStatement +nameID +table_OS_2 +os_2Statement +os_2 +table_STAT +statStatement +designAxis +axisValue +axisValueStatement +axisValueLocation +axisValueFlags +elidedFallbackName +nameEntryStatement +elidedFallbackNameID +nameEntry +table_vmtx +vmtxStatement +vmtx +anchor +lookupPattern +lookupPatternElement +pattern +patternElement +glyphClassOptional +glyphClass +gcLiteral +gcLiteralElement +glyph +glyphName +label +tag +fixedNum +genNum +featureFile +statementFile +cvStatementFile +baseFile +headFile +hheaFile +vheaFile +gdefFile +nameFile +vmtxFile +os_2File +statFile +axisValueFile +nameEntryFile +subtok +revtok +anontok +enumtok +postok +markligtok + + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 147, 1158, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 230, 10, 2, 12, 2, 14, 2, 233, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 243, 10, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 263, 10, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 273, 10, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 5, 10, 284, 10, 10, 3, 10, 3, 10, 6, 10, 288, 10, 10, 13, 10, 14, 10, 289, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 306, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 312, 10, 12, 12, 12, 14, 12, 315, 11, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 5, 13, 322, 10, 13, 3, 13, 3, 13, 6, 13, 326, 10, 13, 13, 13, 14, 13, 327, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 5, 14, 337, 10, 14, 3, 15, 3, 15, 3, 15, 5, 15, 342, 10, 15, 3, 15, 3, 15, 6, 15, 346, 10, 15, 13, 15, 14, 15, 347, 3, 15, 3, 15, 3, 15, 5, 15, 353, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 7, 16, 360, 10, 16, 12, 16, 14, 16, 363, 11, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 370, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 6, 18, 377, 10, 18, 13, 18, 14, 18, 378, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 385, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 401, 10, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 5, 22, 414, 10, 22, 3, 23, 3, 23, 3, 23, 6, 23, 419, 10, 23, 13, 23, 14, 23, 420, 5, 23, 423, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 433, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 439, 10, 25, 3, 25, 3, 25, 3, 25, 7, 25, 444, 10, 25, 12, 25, 14, 25, 447, 11, 25, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 453, 10, 26, 12, 26, 14, 26, 456, 11, 26, 5, 26, 458, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 465, 10, 26, 5, 26, 467, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 474, 10, 26, 5, 26, 476, 10, 26, 5, 26, 478, 10, 26, 3, 27, 5, 27, 481, 10, 27, 3, 27, 3, 27, 5, 27, 485, 10, 27, 3, 27, 3, 27, 7, 27, 489, 10, 27, 12, 27, 14, 27, 492, 11, 27, 3, 27, 3, 27, 6, 27, 496, 10, 27, 13, 27, 14, 27, 497, 3, 27, 7, 27, 501, 10, 27, 12, 27, 14, 27, 504, 11, 27, 3, 27, 3, 27, 3, 27, 5, 27, 509, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 514, 10, 27, 13, 27, 14, 27, 515, 3, 27, 5, 27, 519, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 524, 10, 27, 13, 27, 14, 27, 525, 3, 27, 5, 27, 529, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 534, 10, 27, 13, 27, 14, 27, 535, 3, 27, 5, 27, 539, 10, 27, 5, 27, 541, 10, 27, 3, 28, 3, 28, 5, 28, 545, 10, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 552, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 561, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 571, 10, 32, 3, 33, 3, 33, 3, 33, 5, 33, 576, 10, 33, 3, 33, 5, 33, 579, 10, 33, 3, 33, 5, 33, 582, 10, 33, 3, 34, 3, 34, 6, 34, 586, 10, 34, 13, 34, 14, 34, 587, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 595, 10, 35, 5, 35, 597, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 6, 36, 606, 10, 36, 13, 36, 14, 36, 607, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 6, 38, 617, 10, 38, 13, 38, 14, 38, 618, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 5, 39, 628, 10, 39, 3, 39, 3, 39, 3, 40, 3, 40, 6, 40, 634, 10, 40, 13, 40, 14, 40, 635, 3, 41, 3, 41, 3, 41, 3, 41, 7, 41, 642, 10, 41, 12, 41, 14, 41, 645, 11, 41, 3, 42, 3, 42, 3, 42, 6, 42, 650, 10, 42, 13, 42, 14, 42, 651, 3, 43, 3, 43, 3, 43, 6, 43, 657, 10, 43, 13, 43, 14, 43, 658, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 670, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 6, 46, 686, 10, 46, 13, 46, 14, 46, 687, 3, 47, 3, 47, 3, 47, 6, 47, 693, 10, 47, 13, 47, 14, 47, 694, 3, 48, 3, 48, 3, 48, 6, 48, 700, 10, 48, 13, 48, 14, 48, 701, 3, 49, 3, 49, 3, 49, 6, 49, 707, 10, 49, 13, 49, 14, 49, 708, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 5, 50, 717, 10, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 7, 52, 727, 10, 52, 12, 52, 14, 52, 730, 11, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 5, 53, 738, 10, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 7, 55, 748, 10, 55, 12, 55, 14, 55, 751, 11, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 759, 10, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 6, 58, 769, 10, 58, 13, 58, 14, 58, 770, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 5, 59, 779, 10, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 789, 10, 60, 5, 60, 791, 10, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 6, 61, 800, 10, 61, 13, 61, 14, 61, 801, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 5, 62, 810, 10, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 6, 63, 837, 10, 63, 13, 63, 14, 63, 838, 5, 63, 841, 10, 63, 3, 64, 3, 64, 3, 64, 6, 64, 846, 10, 64, 13, 64, 14, 64, 847, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 5, 65, 859, 10, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 6, 66, 868, 10, 66, 13, 66, 14, 66, 869, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 6, 67, 877, 10, 67, 13, 67, 14, 67, 878, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 5, 68, 887, 10, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 5, 69, 896, 10, 69, 5, 69, 898, 10, 69, 3, 70, 3, 70, 6, 70, 902, 10, 70, 13, 70, 14, 70, 903, 3, 71, 3, 71, 3, 71, 6, 71, 909, 10, 71, 13, 71, 14, 71, 910, 3, 71, 3, 71, 3, 72, 3, 72, 5, 72, 917, 10, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 929, 10, 74, 5, 74, 931, 10, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 6, 75, 940, 10, 75, 13, 75, 14, 75, 941, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 5, 76, 950, 10, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 5, 78, 964, 10, 78, 3, 78, 3, 78, 5, 78, 968, 10, 78, 3, 78, 3, 78, 3, 79, 6, 79, 973, 10, 79, 13, 79, 14, 79, 974, 3, 80, 3, 80, 3, 80, 7, 80, 980, 10, 80, 12, 80, 14, 80, 983, 11, 80, 3, 81, 6, 81, 986, 10, 81, 13, 81, 14, 81, 987, 3, 82, 3, 82, 5, 82, 992, 10, 82, 3, 82, 5, 82, 995, 10, 82, 3, 83, 5, 83, 998, 10, 83, 3, 84, 3, 84, 5, 84, 1002, 10, 84, 3, 85, 3, 85, 6, 85, 1006, 10, 85, 13, 85, 14, 85, 1007, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 5, 86, 1015, 10, 86, 3, 86, 5, 86, 1018, 10, 86, 3, 87, 3, 87, 5, 87, 1022, 10, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 7, 93, 1035, 10, 93, 12, 93, 14, 93, 1038, 11, 93, 3, 93, 3, 93, 3, 94, 7, 94, 1043, 10, 94, 12, 94, 14, 94, 1046, 11, 94, 3, 94, 3, 94, 3, 95, 7, 95, 1051, 10, 95, 12, 95, 14, 95, 1054, 11, 95, 3, 95, 3, 95, 3, 96, 7, 96, 1059, 10, 96, 12, 96, 14, 96, 1062, 11, 96, 3, 96, 3, 96, 3, 97, 7, 97, 1067, 10, 97, 12, 97, 14, 97, 1070, 11, 97, 3, 97, 3, 97, 3, 98, 7, 98, 1075, 10, 98, 12, 98, 14, 98, 1078, 11, 98, 3, 98, 3, 98, 3, 99, 7, 99, 1083, 10, 99, 12, 99, 14, 99, 1086, 11, 99, 3, 99, 3, 99, 3, 100, 7, 100, 1091, 10, 100, 12, 100, 14, 100, 1094, 11, 100, 3, 100, 3, 100, 3, 101, 7, 101, 1099, 10, 101, 12, 101, 14, 101, 1102, 11, 101, 3, 101, 3, 101, 3, 102, 7, 102, 1107, 10, 102, 12, 102, 14, 102, 1110, 11, 102, 3, 102, 3, 102, 3, 103, 7, 103, 1115, 10, 103, 12, 103, 14, 103, 1118, 11, 103, 3, 103, 3, 103, 3, 104, 7, 104, 1123, 10, 104, 12, 104, 14, 104, 1126, 11, 104, 3, 104, 3, 104, 3, 105, 7, 105, 1131, 10, 105, 12, 105, 14, 105, 1134, 11, 105, 3, 105, 3, 105, 3, 106, 7, 106, 1139, 10, 106, 12, 106, 14, 106, 1142, 11, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 109, 3, 109, 3, 110, 3, 110, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 2, 2, 113, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 2, 24, 3, 2, 45, 48, 3, 2, 23, 26, 3, 2, 38, 39, 3, 2, 64, 65, 3, 2, 66, 67, 3, 2, 76, 79, 3, 2, 111, 113, 3, 2, 88, 94, 4, 2, 83, 86, 95, 96, 3, 2, 98, 99, 3, 2, 108, 109, 3, 2, 115, 116, 4, 2, 16, 16, 129, 131, 5, 2, 55, 55, 130, 131, 136, 136, 4, 2, 132, 132, 135, 135, 3, 2, 133, 135, 3, 2, 34, 35, 3, 2, 36, 37, 3, 2, 3, 4, 3, 2, 30, 31, 3, 2, 40, 41, 3, 2, 59, 60, 2, 1218, 2, 231, 3, 2, 2, 2, 4, 242, 3, 2, 2, 2, 6, 246, 3, 2, 2, 2, 8, 251, 3, 2, 2, 2, 10, 255, 3, 2, 2, 2, 12, 259, 3, 2, 2, 2, 14, 267, 3, 2, 2, 2, 16, 276, 3, 2, 2, 2, 18, 280, 3, 2, 2, 2, 20, 295, 3, 2, 2, 2, 22, 307, 3, 2, 2, 2, 24, 318, 3, 2, 2, 2, 26, 336, 3, 2, 2, 2, 28, 338, 3, 2, 2, 2, 30, 356, 3, 2, 2, 2, 32, 369, 3, 2, 2, 2, 34, 384, 3, 2, 2, 2, 36, 400, 3, 2, 2, 2, 38, 404, 3, 2, 2, 2, 40, 407, 3, 2, 2, 2, 42, 410, 3, 2, 2, 2, 44, 415, 3, 2, 2, 2, 46, 432, 3, 2, 2, 2, 48, 434, 3, 2, 2, 2, 50, 457, 3, 2, 2, 2, 52, 480, 3, 2, 2, 2, 54, 542, 3, 2, 2, 2, 56, 551, 3, 2, 2, 2, 58, 560, 3, 2, 2, 2, 60, 562, 3, 2, 2, 2, 62, 566, 3, 2, 2, 2, 64, 572, 3, 2, 2, 2, 66, 583, 3, 2, 2, 2, 68, 589, 3, 2, 2, 2, 70, 602, 3, 2, 2, 2, 72, 611, 3, 2, 2, 2, 74, 613, 3, 2, 2, 2, 76, 627, 3, 2, 2, 2, 78, 631, 3, 2, 2, 2, 80, 637, 3, 2, 2, 2, 82, 646, 3, 2, 2, 2, 84, 653, 3, 2, 2, 2, 86, 669, 3, 2, 2, 2, 88, 673, 3, 2, 2, 2, 90, 682, 3, 2, 2, 2, 92, 689, 3, 2, 2, 2, 94, 696, 3, 2, 2, 2, 96, 703, 3, 2, 2, 2, 98, 716, 3, 2, 2, 2, 100, 720, 3, 2, 2, 2, 102, 723, 3, 2, 2, 2, 104, 737, 3, 2, 2, 2, 106, 741, 3, 2, 2, 2, 108, 744, 3, 2, 2, 2, 110, 758, 3, 2, 2, 2, 112, 762, 3, 2, 2, 2, 114, 765, 3, 2, 2, 2, 116, 778, 3, 2, 2, 2, 118, 782, 3, 2, 2, 2, 120, 796, 3, 2, 2, 2, 122, 809, 3, 2, 2, 2, 124, 840, 3, 2, 2, 2, 126, 842, 3, 2, 2, 2, 128, 858, 3, 2, 2, 2, 130, 862, 3, 2, 2, 2, 132, 873, 3, 2, 2, 2, 134, 886, 3, 2, 2, 2, 136, 890, 3, 2, 2, 2, 138, 899, 3, 2, 2, 2, 140, 905, 3, 2, 2, 2, 142, 916, 3, 2, 2, 2, 144, 920, 3, 2, 2, 2, 146, 923, 3, 2, 2, 2, 148, 936, 3, 2, 2, 2, 150, 949, 3, 2, 2, 2, 152, 953, 3, 2, 2, 2, 154, 957, 3, 2, 2, 2, 156, 972, 3, 2, 2, 2, 158, 976, 3, 2, 2, 2, 160, 985, 3, 2, 2, 2, 162, 991, 3, 2, 2, 2, 164, 997, 3, 2, 2, 2, 166, 1001, 3, 2, 2, 2, 168, 1003, 3, 2, 2, 2, 170, 1017, 3, 2, 2, 2, 172, 1021, 3, 2, 2, 2, 174, 1023, 3, 2, 2, 2, 176, 1025, 3, 2, 2, 2, 178, 1027, 3, 2, 2, 2, 180, 1029, 3, 2, 2, 2, 182, 1031, 3, 2, 2, 2, 184, 1036, 3, 2, 2, 2, 186, 1044, 3, 2, 2, 2, 188, 1052, 3, 2, 2, 2, 190, 1060, 3, 2, 2, 2, 192, 1068, 3, 2, 2, 2, 194, 1076, 3, 2, 2, 2, 196, 1084, 3, 2, 2, 2, 198, 1092, 3, 2, 2, 2, 200, 1100, 3, 2, 2, 2, 202, 1108, 3, 2, 2, 2, 204, 1116, 3, 2, 2, 2, 206, 1124, 3, 2, 2, 2, 208, 1132, 3, 2, 2, 2, 210, 1140, 3, 2, 2, 2, 212, 1145, 3, 2, 2, 2, 214, 1147, 3, 2, 2, 2, 216, 1149, 3, 2, 2, 2, 218, 1151, 3, 2, 2, 2, 220, 1153, 3, 2, 2, 2, 222, 1155, 3, 2, 2, 2, 224, 230, 5, 4, 3, 2, 225, 230, 5, 18, 10, 2, 226, 230, 5, 20, 11, 2, 227, 230, 5, 22, 12, 2, 228, 230, 5, 24, 13, 2, 229, 224, 3, 2, 2, 2, 229, 225, 3, 2, 2, 2, 229, 226, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 228, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 234, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 7, 2, 2, 3, 235, 3, 3, 2, 2, 2, 236, 243, 5, 6, 4, 2, 237, 243, 5, 8, 5, 2, 238, 243, 5, 10, 6, 2, 239, 243, 5, 12, 7, 2, 240, 243, 5, 14, 8, 2, 241, 243, 5, 16, 9, 2, 242, 236, 3, 2, 2, 2, 242, 237, 3, 2, 2, 2, 242, 238, 3, 2, 2, 2, 242, 239, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 122, 2, 2, 245, 5, 3, 2, 2, 2, 246, 247, 7, 7, 2, 2, 247, 248, 7, 143, 2, 2, 248, 249, 7, 144, 2, 2, 249, 250, 7, 145, 2, 2, 250, 7, 3, 2, 2, 2, 251, 252, 7, 127, 2, 2, 252, 253, 7, 123, 2, 2, 253, 254, 5, 166, 84, 2, 254, 9, 3, 2, 2, 2, 255, 256, 7, 12, 2, 2, 256, 257, 5, 178, 90, 2, 257, 258, 5, 178, 90, 2, 258, 11, 3, 2, 2, 2, 259, 262, 7, 56, 2, 2, 260, 263, 5, 172, 87, 2, 261, 263, 5, 166, 84, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 265, 5, 154, 78, 2, 265, 266, 7, 127, 2, 2, 266, 13, 3, 2, 2, 2, 267, 268, 7, 53, 2, 2, 268, 269, 7, 135, 2, 2, 269, 272, 7, 135, 2, 2, 270, 271, 7, 51, 2, 2, 271, 273, 7, 135, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 5, 176, 89, 2, 275, 15, 3, 2, 2, 2, 276, 277, 7, 54, 2, 2, 277, 278, 5, 58, 30, 2, 278, 279, 5, 176, 89, 2, 279, 17, 3, 2, 2, 2, 280, 281, 7, 8, 2, 2, 281, 283, 5, 178, 90, 2, 282, 284, 7, 27, 2, 2, 283, 282, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 287, 7, 117, 2, 2, 286, 288, 5, 26, 14, 2, 287, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 292, 7, 118, 2, 2, 292, 293, 5, 178, 90, 2, 293, 294, 7, 122, 2, 2, 294, 19, 3, 2, 2, 2, 295, 305, 7, 9, 2, 2, 296, 306, 5, 74, 38, 2, 297, 306, 5, 84, 43, 2, 298, 306, 5, 96, 49, 2, 299, 306, 5, 102, 52, 2, 300, 306, 5, 108, 55, 2, 301, 306, 5, 114, 58, 2, 302, 306, 5, 120, 61, 2, 303, 306, 5, 126, 64, 2, 304, 306, 5, 148, 75, 2, 305, 296, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 298, 3, 2, 2, 2, 305, 299, 3, 2, 2, 2, 305, 300, 3, 2, 2, 2, 305, 301, 3, 2, 2, 2, 305, 302, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 21, 3, 2, 2, 2, 307, 308, 5, 216, 109, 2, 308, 309, 7, 138, 2, 2, 309, 313, 7, 139, 2, 2, 310, 312, 7, 141, 2, 2, 311, 310, 3, 2, 2, 2, 312, 315, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 316, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 316, 317, 7, 140, 2, 2, 317, 23, 3, 2, 2, 2, 318, 319, 7, 14, 2, 2, 319, 321, 5, 176, 89, 2, 320, 322, 7, 27, 2, 2, 321, 320, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 325, 7, 117, 2, 2, 324, 326, 5, 36, 19, 2, 325, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 330, 7, 118, 2, 2, 330, 331, 5, 176, 89, 2, 331, 332, 7, 122, 2, 2, 332, 25, 3, 2, 2, 2, 333, 337, 5, 36, 19, 2, 334, 337, 5, 28, 15, 2, 335, 337, 5, 30, 16, 2, 336, 333, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 335, 3, 2, 2, 2, 337, 27, 3, 2, 2, 2, 338, 339, 7, 14, 2, 2, 339, 352, 5, 176, 89, 2, 340, 342, 7, 27, 2, 2, 341, 340, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 345, 7, 117, 2, 2, 344, 346, 5, 36, 19, 2, 345, 344, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 7, 118, 2, 2, 350, 351, 5, 176, 89, 2, 351, 353, 3, 2, 2, 2, 352, 341, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 355, 7, 122, 2, 2, 355, 29, 3, 2, 2, 2, 356, 357, 7, 44, 2, 2, 357, 361, 7, 117, 2, 2, 358, 360, 5, 32, 17, 2, 359, 358, 3, 2, 2, 2, 360, 363, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 364, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 364, 365, 7, 118, 2, 2, 365, 366, 7, 122, 2, 2, 366, 31, 3, 2, 2, 2, 367, 370, 5, 34, 18, 2, 368, 370, 5, 6, 4, 2, 369, 367, 3, 2, 2, 2, 369, 368, 3, 2, 2, 2, 370, 371, 3, 2, 2, 2, 371, 372, 7, 122, 2, 2, 372, 33, 3, 2, 2, 2, 373, 374, 9, 2, 2, 2, 374, 376, 7, 117, 2, 2, 375, 377, 5, 142, 72, 2, 376, 375, 3, 2, 2, 2, 377, 378, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 118, 2, 2, 381, 385, 3, 2, 2, 2, 382, 383, 7, 49, 2, 2, 383, 385, 5, 182, 92, 2, 384, 373, 3, 2, 2, 2, 384, 382, 3, 2, 2, 2, 385, 35, 3, 2, 2, 2, 386, 401, 5, 38, 20, 2, 387, 401, 5, 40, 21, 2, 388, 401, 5, 42, 22, 2, 389, 401, 5, 44, 23, 2, 390, 401, 5, 8, 5, 2, 391, 401, 5, 48, 25, 2, 392, 401, 5, 50, 26, 2, 393, 401, 5, 12, 7, 2, 394, 401, 5, 52, 27, 2, 395, 401, 5, 66, 34, 2, 396, 401, 5, 68, 35, 2, 397, 401, 5, 70, 36, 2, 398, 401, 5, 72, 37, 2, 399, 401, 5, 6, 4, 2, 400, 386, 3, 2, 2, 2, 400, 387, 3, 2, 2, 2, 400, 388, 3, 2, 2, 2, 400, 389, 3, 2, 2, 2, 400, 390, 3, 2, 2, 2, 400, 391, 3, 2, 2, 2, 400, 392, 3, 2, 2, 2, 400, 393, 3, 2, 2, 2, 400, 394, 3, 2, 2, 2, 400, 395, 3, 2, 2, 2, 400, 396, 3, 2, 2, 2, 400, 397, 3, 2, 2, 2, 400, 398, 3, 2, 2, 2, 400, 399, 3, 2, 2, 2, 401, 402, 3, 2, 2, 2, 402, 403, 7, 122, 2, 2, 403, 37, 3, 2, 2, 2, 404, 405, 7, 8, 2, 2, 405, 406, 5, 178, 90, 2, 406, 39, 3, 2, 2, 2, 407, 408, 7, 10, 2, 2, 408, 409, 5, 178, 90, 2, 409, 41, 3, 2, 2, 2, 410, 411, 7, 11, 2, 2, 411, 413, 5, 178, 90, 2, 412, 414, 9, 3, 2, 2, 413, 412, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 43, 3, 2, 2, 2, 415, 422, 7, 15, 2, 2, 416, 423, 7, 135, 2, 2, 417, 419, 5, 46, 24, 2, 418, 417, 3, 2, 2, 2, 419, 420, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 420, 421, 3, 2, 2, 2, 421, 423, 3, 2, 2, 2, 422, 416, 3, 2, 2, 2, 422, 418, 3, 2, 2, 2, 423, 45, 3, 2, 2, 2, 424, 433, 7, 17, 2, 2, 425, 433, 7, 18, 2, 2, 426, 433, 7, 19, 2, 2, 427, 433, 7, 20, 2, 2, 428, 429, 7, 22, 2, 2, 429, 433, 5, 166, 84, 2, 430, 431, 7, 21, 2, 2, 431, 433, 5, 166, 84, 2, 432, 424, 3, 2, 2, 2, 432, 425, 3, 2, 2, 2, 432, 426, 3, 2, 2, 2, 432, 427, 3, 2, 2, 2, 432, 428, 3, 2, 2, 2, 432, 430, 3, 2, 2, 2, 433, 47, 3, 2, 2, 2, 434, 438, 7, 33, 2, 2, 435, 439, 5, 212, 107, 2, 436, 439, 5, 214, 108, 2, 437, 439, 5, 220, 111, 2, 438, 435, 3, 2, 2, 2, 438, 436, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 440, 3, 2, 2, 2, 440, 445, 5, 156, 79, 2, 441, 442, 7, 125, 2, 2, 442, 444, 5, 156, 79, 2, 443, 441, 3, 2, 2, 2, 444, 447, 3, 2, 2, 2, 445, 443, 3, 2, 2, 2, 445, 446, 3, 2, 2, 2, 446, 49, 3, 2, 2, 2, 447, 445, 3, 2, 2, 2, 448, 449, 7, 32, 2, 2, 449, 454, 5, 156, 79, 2, 450, 451, 7, 125, 2, 2, 451, 453, 5, 156, 79, 2, 452, 450, 3, 2, 2, 2, 453, 456, 3, 2, 2, 2, 454, 452, 3, 2, 2, 2, 454, 455, 3, 2, 2, 2, 455, 458, 3, 2, 2, 2, 456, 454, 3, 2, 2, 2, 457, 448, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 477, 3, 2, 2, 2, 459, 460, 5, 214, 108, 2, 460, 466, 5, 156, 79, 2, 461, 464, 7, 38, 2, 2, 462, 465, 7, 62, 2, 2, 463, 465, 5, 156, 79, 2, 464, 462, 3, 2, 2, 2, 464, 463, 3, 2, 2, 2, 465, 467, 3, 2, 2, 2, 466, 461, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 478, 3, 2, 2, 2, 468, 469, 5, 212, 107, 2, 469, 475, 5, 156, 79, 2, 470, 473, 9, 4, 2, 2, 471, 474, 7, 62, 2, 2, 472, 474, 5, 156, 79, 2, 473, 471, 3, 2, 2, 2, 473, 472, 3, 2, 2, 2, 474, 476, 3, 2, 2, 2, 475, 470, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 478, 3, 2, 2, 2, 477, 459, 3, 2, 2, 2, 477, 468, 3, 2, 2, 2, 478, 51, 3, 2, 2, 2, 479, 481, 5, 218, 110, 2, 480, 479, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 482, 3, 2, 2, 2, 482, 484, 5, 220, 111, 2, 483, 485, 5, 160, 81, 2, 484, 483, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 540, 3, 2, 2, 2, 486, 490, 5, 56, 29, 2, 487, 489, 5, 54, 28, 2, 488, 487, 3, 2, 2, 2, 489, 492, 3, 2, 2, 2, 490, 488, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 541, 3, 2, 2, 2, 492, 490, 3, 2, 2, 2, 493, 494, 7, 14, 2, 2, 494, 496, 5, 176, 89, 2, 495, 493, 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, 502, 3, 2, 2, 2, 499, 501, 5, 158, 80, 2, 500, 499, 3, 2, 2, 2, 501, 504, 3, 2, 2, 2, 502, 500, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 541, 3, 2, 2, 2, 504, 502, 3, 2, 2, 2, 505, 506, 7, 57, 2, 2, 506, 508, 5, 60, 31, 2, 507, 509, 5, 160, 81, 2, 508, 507, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 541, 3, 2, 2, 2, 510, 511, 7, 58, 2, 2, 511, 513, 5, 160, 81, 2, 512, 514, 5, 62, 32, 2, 513, 512, 3, 2, 2, 2, 514, 515, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 516, 3, 2, 2, 2, 516, 518, 3, 2, 2, 2, 517, 519, 5, 160, 81, 2, 518, 517, 3, 2, 2, 2, 518, 519, 3, 2, 2, 2, 519, 541, 3, 2, 2, 2, 520, 521, 5, 222, 112, 2, 521, 523, 5, 160, 81, 2, 522, 524, 5, 64, 33, 2, 523, 522, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 523, 3, 2, 2, 2, 525, 526, 3, 2, 2, 2, 526, 528, 3, 2, 2, 2, 527, 529, 5, 160, 81, 2, 528, 527, 3, 2, 2, 2, 528, 529, 3, 2, 2, 2, 529, 541, 3, 2, 2, 2, 530, 531, 7, 55, 2, 2, 531, 533, 5, 160, 81, 2, 532, 534, 5, 62, 32, 2, 533, 532, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 533, 3, 2, 2, 2, 535, 536, 3, 2, 2, 2, 536, 538, 3, 2, 2, 2, 537, 539, 5, 160, 81, 2, 538, 537, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 541, 3, 2, 2, 2, 540, 486, 3, 2, 2, 2, 540, 495, 3, 2, 2, 2, 540, 505, 3, 2, 2, 2, 540, 510, 3, 2, 2, 2, 540, 520, 3, 2, 2, 2, 540, 530, 3, 2, 2, 2, 541, 53, 3, 2, 2, 2, 542, 544, 5, 162, 82, 2, 543, 545, 5, 56, 29, 2, 544, 543, 3, 2, 2, 2, 544, 545, 3, 2, 2, 2, 545, 55, 3, 2, 2, 2, 546, 547, 7, 28, 2, 2, 547, 548, 5, 176, 89, 2, 548, 549, 7, 29, 2, 2, 549, 552, 3, 2, 2, 2, 550, 552, 5, 58, 30, 2, 551, 546, 3, 2, 2, 2, 551, 550, 3, 2, 2, 2, 552, 57, 3, 2, 2, 2, 553, 554, 7, 28, 2, 2, 554, 555, 7, 135, 2, 2, 555, 556, 7, 135, 2, 2, 556, 557, 7, 135, 2, 2, 557, 558, 7, 135, 2, 2, 558, 561, 7, 29, 2, 2, 559, 561, 7, 135, 2, 2, 560, 553, 3, 2, 2, 2, 560, 559, 3, 2, 2, 2, 561, 59, 3, 2, 2, 2, 562, 563, 5, 162, 82, 2, 563, 564, 5, 154, 78, 2, 564, 565, 5, 154, 78, 2, 565, 61, 3, 2, 2, 2, 566, 567, 5, 154, 78, 2, 567, 568, 7, 55, 2, 2, 568, 570, 7, 127, 2, 2, 569, 571, 7, 124, 2, 2, 570, 569, 3, 2, 2, 2, 570, 571, 3, 2, 2, 2, 571, 63, 3, 2, 2, 2, 572, 575, 5, 154, 78, 2, 573, 574, 7, 55, 2, 2, 574, 576, 7, 127, 2, 2, 575, 573, 3, 2, 2, 2, 575, 576, 3, 2, 2, 2, 576, 578, 3, 2, 2, 2, 577, 579, 7, 61, 2, 2, 578, 577, 3, 2, 2, 2, 578, 579, 3, 2, 2, 2, 579, 581, 3, 2, 2, 2, 580, 582, 7, 124, 2, 2, 581, 580, 3, 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 65, 3, 2, 2, 2, 583, 585, 7, 42, 2, 2, 584, 586, 5, 180, 91, 2, 585, 584, 3, 2, 2, 2, 586, 587, 3, 2, 2, 2, 587, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 67, 3, 2, 2, 2, 589, 596, 7, 50, 2, 2, 590, 594, 5, 182, 92, 2, 591, 592, 5, 182, 92, 2, 592, 593, 5, 182, 92, 2, 593, 595, 3, 2, 2, 2, 594, 591, 3, 2, 2, 2, 594, 595, 3, 2, 2, 2, 595, 597, 3, 2, 2, 2, 596, 590, 3, 2, 2, 2, 596, 597, 3, 2, 2, 2, 597, 598, 3, 2, 2, 2, 598, 599, 7, 126, 2, 2, 599, 600, 7, 146, 2, 2, 600, 601, 7, 147, 2, 2, 601, 69, 3, 2, 2, 2, 602, 603, 7, 43, 2, 2, 603, 605, 7, 117, 2, 2, 604, 606, 5, 142, 72, 2, 605, 604, 3, 2, 2, 2, 606, 607, 3, 2, 2, 2, 607, 605, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2, 608, 609, 3, 2, 2, 2, 609, 610, 7, 118, 2, 2, 610, 71, 3, 2, 2, 2, 611, 612, 7, 13, 2, 2, 612, 73, 3, 2, 2, 2, 613, 614, 7, 63, 2, 2, 614, 616, 7, 117, 2, 2, 615, 617, 5, 76, 39, 2, 616, 615, 3, 2, 2, 2, 617, 618, 3, 2, 2, 2, 618, 616, 3, 2, 2, 2, 618, 619, 3, 2, 2, 2, 619, 620, 3, 2, 2, 2, 620, 621, 7, 118, 2, 2, 621, 622, 7, 63, 2, 2, 622, 623, 7, 122, 2, 2, 623, 75, 3, 2, 2, 2, 624, 628, 5, 78, 40, 2, 625, 628, 5, 80, 41, 2, 626, 628, 5, 6, 4, 2, 627, 624, 3, 2, 2, 2, 627, 625, 3, 2, 2, 2, 627, 626, 3, 2, 2, 2, 628, 629, 3, 2, 2, 2, 629, 630, 7, 122, 2, 2, 630, 77, 3, 2, 2, 2, 631, 633, 9, 5, 2, 2, 632, 634, 5, 178, 90, 2, 633, 632, 3, 2, 2, 2, 634, 635, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 79, 3, 2, 2, 2, 637, 638, 9, 6, 2, 2, 638, 643, 5, 82, 42, 2, 639, 640, 7, 125, 2, 2, 640, 642, 5, 82, 42, 2, 641, 639, 3, 2, 2, 2, 642, 645, 3, 2, 2, 2, 643, 641, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, 81, 3, 2, 2, 2, 645, 643, 3, 2, 2, 2, 646, 647, 5, 178, 90, 2, 647, 649, 5, 178, 90, 2, 648, 650, 7, 135, 2, 2, 649, 648, 3, 2, 2, 2, 650, 651, 3, 2, 2, 2, 651, 649, 3, 2, 2, 2, 651, 652, 3, 2, 2, 2, 652, 83, 3, 2, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 7, 117, 2, 2, 655, 657, 5, 86, 44, 2, 656, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 656, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 661, 7, 118, 2, 2, 661, 662, 7, 68, 2, 2, 662, 663, 7, 122, 2, 2, 663, 85, 3, 2, 2, 2, 664, 670, 5, 88, 45, 2, 665, 670, 5, 90, 46, 2, 666, 670, 5, 92, 47, 2, 667, 670, 5, 94, 48, 2, 668, 670, 5, 6, 4, 2, 669, 664, 3, 2, 2, 2, 669, 665, 3, 2, 2, 2, 669, 666, 3, 2, 2, 2, 669, 667, 3, 2, 2, 2, 669, 668, 3, 2, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 7, 122, 2, 2, 672, 87, 3, 2, 2, 2, 673, 674, 7, 69, 2, 2, 674, 675, 5, 164, 83, 2, 675, 676, 7, 125, 2, 2, 676, 677, 5, 164, 83, 2, 677, 678, 7, 125, 2, 2, 678, 679, 5, 164, 83, 2, 679, 680, 7, 125, 2, 2, 680, 681, 5, 164, 83, 2, 681, 89, 3, 2, 2, 2, 682, 683, 7, 70, 2, 2, 683, 685, 5, 156, 79, 2, 684, 686, 7, 135, 2, 2, 685, 684, 3, 2, 2, 2, 686, 687, 3, 2, 2, 2, 687, 685, 3, 2, 2, 2, 687, 688, 3, 2, 2, 2, 688, 91, 3, 2, 2, 2, 689, 690, 7, 71, 2, 2, 690, 692, 5, 156, 79, 2, 691, 693, 7, 135, 2, 2, 692, 691, 3, 2, 2, 2, 693, 694, 3, 2, 2, 2, 694, 692, 3, 2, 2, 2, 694, 695, 3, 2, 2, 2, 695, 93, 3, 2, 2, 2, 696, 697, 7, 72, 2, 2, 697, 699, 5, 156, 79, 2, 698, 700, 7, 135, 2, 2, 699, 698, 3, 2, 2, 2, 700, 701, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 95, 3, 2, 2, 2, 703, 704, 7, 73, 2, 2, 704, 706, 7, 117, 2, 2, 705, 707, 5, 98, 50, 2, 706, 705, 3, 2, 2, 2, 707, 708, 3, 2, 2, 2, 708, 706, 3, 2, 2, 2, 708, 709, 3, 2, 2, 2, 709, 710, 3, 2, 2, 2, 710, 711, 7, 118, 2, 2, 711, 712, 7, 73, 2, 2, 712, 713, 7, 122, 2, 2, 713, 97, 3, 2, 2, 2, 714, 717, 5, 100, 51, 2, 715, 717, 5, 6, 4, 2, 716, 714, 3, 2, 2, 2, 716, 715, 3, 2, 2, 2, 717, 718, 3, 2, 2, 2, 718, 719, 7, 122, 2, 2, 719, 99, 3, 2, 2, 2, 720, 721, 7, 74, 2, 2, 721, 722, 7, 132, 2, 2, 722, 101, 3, 2, 2, 2, 723, 724, 7, 75, 2, 2, 724, 728, 7, 117, 2, 2, 725, 727, 5, 104, 53, 2, 726, 725, 3, 2, 2, 2, 727, 730, 3, 2, 2, 2, 728, 726, 3, 2, 2, 2, 728, 729, 3, 2, 2, 2, 729, 731, 3, 2, 2, 2, 730, 728, 3, 2, 2, 2, 731, 732, 7, 118, 2, 2, 732, 733, 7, 75, 2, 2, 733, 734, 7, 122, 2, 2, 734, 103, 3, 2, 2, 2, 735, 738, 5, 106, 54, 2, 736, 738, 5, 6, 4, 2, 737, 735, 3, 2, 2, 2, 737, 736, 3, 2, 2, 2, 738, 739, 3, 2, 2, 2, 739, 740, 7, 122, 2, 2, 740, 105, 3, 2, 2, 2, 741, 742, 9, 7, 2, 2, 742, 743, 7, 135, 2, 2, 743, 107, 3, 2, 2, 2, 744, 745, 7, 110, 2, 2, 745, 749, 7, 117, 2, 2, 746, 748, 5, 110, 56, 2, 747, 746, 3, 2, 2, 2, 748, 751, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 749, 750, 3, 2, 2, 2, 750, 752, 3, 2, 2, 2, 751, 749, 3, 2, 2, 2, 752, 753, 7, 118, 2, 2, 753, 754, 7, 110, 2, 2, 754, 755, 7, 122, 2, 2, 755, 109, 3, 2, 2, 2, 756, 759, 5, 112, 57, 2, 757, 759, 5, 6, 4, 2, 758, 756, 3, 2, 2, 2, 758, 757, 3, 2, 2, 2, 759, 760, 3, 2, 2, 2, 760, 761, 7, 122, 2, 2, 761, 111, 3, 2, 2, 2, 762, 763, 9, 8, 2, 2, 763, 764, 7, 135, 2, 2, 764, 113, 3, 2, 2, 2, 765, 766, 7, 80, 2, 2, 766, 768, 7, 117, 2, 2, 767, 769, 5, 116, 59, 2, 768, 767, 3, 2, 2, 2, 769, 770, 3, 2, 2, 2, 770, 768, 3, 2, 2, 2, 770, 771, 3, 2, 2, 2, 771, 772, 3, 2, 2, 2, 772, 773, 7, 118, 2, 2, 773, 774, 7, 80, 2, 2, 774, 775, 7, 122, 2, 2, 775, 115, 3, 2, 2, 2, 776, 779, 5, 118, 60, 2, 777, 779, 5, 6, 4, 2, 778, 776, 3, 2, 2, 2, 778, 777, 3, 2, 2, 2, 779, 780, 3, 2, 2, 2, 780, 781, 7, 122, 2, 2, 781, 117, 3, 2, 2, 2, 782, 783, 7, 81, 2, 2, 783, 790, 5, 182, 92, 2, 784, 788, 5, 182, 92, 2, 785, 786, 5, 182, 92, 2, 786, 787, 5, 182, 92, 2, 787, 789, 3, 2, 2, 2, 788, 785, 3, 2, 2, 2, 788, 789, 3, 2, 2, 2, 789, 791, 3, 2, 2, 2, 790, 784, 3, 2, 2, 2, 790, 791, 3, 2, 2, 2, 791, 792, 3, 2, 2, 2, 792, 793, 7, 126, 2, 2, 793, 794, 7, 146, 2, 2, 794, 795, 7, 147, 2, 2, 795, 119, 3, 2, 2, 2, 796, 797, 7, 82, 2, 2, 797, 799, 7, 117, 2, 2, 798, 800, 5, 122, 62, 2, 799, 798, 3, 2, 2, 2, 800, 801, 3, 2, 2, 2, 801, 799, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 803, 3, 2, 2, 2, 803, 804, 7, 118, 2, 2, 804, 805, 7, 82, 2, 2, 805, 806, 7, 122, 2, 2, 806, 121, 3, 2, 2, 2, 807, 810, 5, 124, 63, 2, 808, 810, 5, 6, 4, 2, 809, 807, 3, 2, 2, 2, 809, 808, 3, 2, 2, 2, 810, 811, 3, 2, 2, 2, 811, 812, 7, 122, 2, 2, 812, 123, 3, 2, 2, 2, 813, 814, 9, 9, 2, 2, 814, 841, 7, 135, 2, 2, 815, 816, 9, 10, 2, 2, 816, 841, 7, 135, 2, 2, 817, 818, 7, 100, 2, 2, 818, 841, 5, 182, 92, 2, 819, 820, 7, 97, 2, 2, 820, 821, 7, 126, 2, 2, 821, 822, 7, 146, 2, 2, 822, 841, 7, 147, 2, 2, 823, 824, 7, 87, 2, 2, 824, 825, 7, 135, 2, 2, 825, 826, 7, 135, 2, 2, 826, 827, 7, 135, 2, 2, 827, 828, 7, 135, 2, 2, 828, 829, 7, 135, 2, 2, 829, 830, 7, 135, 2, 2, 830, 831, 7, 135, 2, 2, 831, 832, 7, 135, 2, 2, 832, 833, 7, 135, 2, 2, 833, 841, 7, 135, 2, 2, 834, 836, 9, 11, 2, 2, 835, 837, 7, 135, 2, 2, 836, 835, 3, 2, 2, 2, 837, 838, 3, 2, 2, 2, 838, 836, 3, 2, 2, 2, 838, 839, 3, 2, 2, 2, 839, 841, 3, 2, 2, 2, 840, 813, 3, 2, 2, 2, 840, 815, 3, 2, 2, 2, 840, 817, 3, 2, 2, 2, 840, 819, 3, 2, 2, 2, 840, 823, 3, 2, 2, 2, 840, 834, 3, 2, 2, 2, 841, 125, 3, 2, 2, 2, 842, 843, 7, 101, 2, 2, 843, 845, 7, 117, 2, 2, 844, 846, 5, 128, 65, 2, 845, 844, 3, 2, 2, 2, 846, 847, 3, 2, 2, 2, 847, 845, 3, 2, 2, 2, 847, 848, 3, 2, 2, 2, 848, 849, 3, 2, 2, 2, 849, 850, 7, 118, 2, 2, 850, 851, 7, 101, 2, 2, 851, 852, 7, 122, 2, 2, 852, 127, 3, 2, 2, 2, 853, 859, 5, 130, 66, 2, 854, 859, 5, 132, 67, 2, 855, 859, 5, 140, 71, 2, 856, 859, 5, 144, 73, 2, 857, 859, 5, 6, 4, 2, 858, 853, 3, 2, 2, 2, 858, 854, 3, 2, 2, 2, 858, 855, 3, 2, 2, 2, 858, 856, 3, 2, 2, 2, 858, 857, 3, 2, 2, 2, 859, 860, 3, 2, 2, 2, 860, 861, 7, 122, 2, 2, 861, 129, 3, 2, 2, 2, 862, 863, 7, 104, 2, 2, 863, 864, 5, 178, 90, 2, 864, 865, 7, 135, 2, 2, 865, 867, 7, 117, 2, 2, 866, 868, 5, 142, 72, 2, 867, 866, 3, 2, 2, 2, 868, 869, 3, 2, 2, 2, 869, 867, 3, 2, 2, 2, 869, 870, 3, 2, 2, 2, 870, 871, 3, 2, 2, 2, 871, 872, 7, 118, 2, 2, 872, 131, 3, 2, 2, 2, 873, 874, 7, 105, 2, 2, 874, 876, 7, 117, 2, 2, 875, 877, 5, 134, 68, 2, 876, 875, 3, 2, 2, 2, 877, 878, 3, 2, 2, 2, 878, 876, 3, 2, 2, 2, 878, 879, 3, 2, 2, 2, 879, 880, 3, 2, 2, 2, 880, 881, 7, 118, 2, 2, 881, 133, 3, 2, 2, 2, 882, 887, 5, 146, 74, 2, 883, 887, 5, 136, 69, 2, 884, 887, 5, 138, 70, 2, 885, 887, 5, 6, 4, 2, 886, 882, 3, 2, 2, 2, 886, 883, 3, 2, 2, 2, 886, 884, 3, 2, 2, 2, 886, 885, 3, 2, 2, 2, 887, 888, 3, 2, 2, 2, 888, 889, 7, 122, 2, 2, 889, 135, 3, 2, 2, 2, 890, 891, 7, 107, 2, 2, 891, 892, 5, 178, 90, 2, 892, 897, 5, 180, 91, 2, 893, 895, 5, 180, 91, 2, 894, 896, 5, 180, 91, 2, 895, 894, 3, 2, 2, 2, 895, 896, 3, 2, 2, 2, 896, 898, 3, 2, 2, 2, 897, 893, 3, 2, 2, 2, 897, 898, 3, 2, 2, 2, 898, 137, 3, 2, 2, 2, 899, 901, 7, 106, 2, 2, 900, 902, 9, 12, 2, 2, 901, 900, 3, 2, 2, 2, 902, 903, 3, 2, 2, 2, 903, 901, 3, 2, 2, 2, 903, 904, 3, 2, 2, 2, 904, 139, 3, 2, 2, 2, 905, 906, 7, 102, 2, 2, 906, 908, 7, 117, 2, 2, 907, 909, 5, 142, 72, 2, 908, 907, 3, 2, 2, 2, 909, 910, 3, 2, 2, 2, 910, 908, 3, 2, 2, 2, 910, 911, 3, 2, 2, 2, 911, 912, 3, 2, 2, 2, 912, 913, 7, 118, 2, 2, 913, 141, 3, 2, 2, 2, 914, 917, 5, 146, 74, 2, 915, 917, 5, 6, 4, 2, 916, 914, 3, 2, 2, 2, 916, 915, 3, 2, 2, 2, 917, 918, 3, 2, 2, 2, 918, 919, 7, 122, 2, 2, 919, 143, 3, 2, 2, 2, 920, 921, 7, 103, 2, 2, 921, 922, 5, 182, 92, 2, 922, 145, 3, 2, 2, 2, 923, 930, 7, 80, 2, 2, 924, 928, 5, 182, 92, 2, 925, 926, 5, 182, 92, 2, 926, 927, 5, 182, 92, 2, 927, 929, 3, 2, 2, 2, 928, 925, 3, 2, 2, 2, 928, 929, 3, 2, 2, 2, 929, 931, 3, 2, 2, 2, 930, 924, 3, 2, 2, 2, 930, 931, 3, 2, 2, 2, 931, 932, 3, 2, 2, 2, 932, 933, 7, 126, 2, 2, 933, 934, 7, 146, 2, 2, 934, 935, 7, 147, 2, 2, 935, 147, 3, 2, 2, 2, 936, 937, 7, 114, 2, 2, 937, 939, 7, 117, 2, 2, 938, 940, 5, 150, 76, 2, 939, 938, 3, 2, 2, 2, 940, 941, 3, 2, 2, 2, 941, 939, 3, 2, 2, 2, 941, 942, 3, 2, 2, 2, 942, 943, 3, 2, 2, 2, 943, 944, 7, 118, 2, 2, 944, 945, 7, 114, 2, 2, 945, 946, 7, 122, 2, 2, 946, 149, 3, 2, 2, 2, 947, 950, 5, 152, 77, 2, 948, 950, 5, 6, 4, 2, 949, 947, 3, 2, 2, 2, 949, 948, 3, 2, 2, 2, 950, 951, 3, 2, 2, 2, 951, 952, 7, 122, 2, 2, 952, 151, 3, 2, 2, 2, 953, 954, 9, 13, 2, 2, 954, 955, 5, 172, 87, 2, 955, 956, 7, 135, 2, 2, 956, 153, 3, 2, 2, 2, 957, 958, 7, 28, 2, 2, 958, 967, 7, 52, 2, 2, 959, 960, 7, 135, 2, 2, 960, 963, 7, 135, 2, 2, 961, 962, 7, 51, 2, 2, 962, 964, 7, 135, 2, 2, 963, 961, 3, 2, 2, 2, 963, 964, 3, 2, 2, 2, 964, 968, 3, 2, 2, 2, 965, 968, 7, 62, 2, 2, 966, 968, 5, 176, 89, 2, 967, 959, 3, 2, 2, 2, 967, 965, 3, 2, 2, 2, 967, 966, 3, 2, 2, 2, 968, 969, 3, 2, 2, 2, 969, 970, 7, 29, 2, 2, 970, 155, 3, 2, 2, 2, 971, 973, 5, 158, 80, 2, 972, 971, 3, 2, 2, 2, 973, 974, 3, 2, 2, 2, 974, 972, 3, 2, 2, 2, 974, 975, 3, 2, 2, 2, 975, 157, 3, 2, 2, 2, 976, 981, 5, 162, 82, 2, 977, 978, 7, 14, 2, 2, 978, 980, 5, 176, 89, 2, 979, 977, 3, 2, 2, 2, 980, 983, 3, 2, 2, 2, 981, 979, 3, 2, 2, 2, 981, 982, 3, 2, 2, 2, 982, 159, 3, 2, 2, 2, 983, 981, 3, 2, 2, 2, 984, 986, 5, 162, 82, 2, 985, 984, 3, 2, 2, 2, 986, 987, 3, 2, 2, 2, 987, 985, 3, 2, 2, 2, 987, 988, 3, 2, 2, 2, 988, 161, 3, 2, 2, 2, 989, 992, 5, 166, 84, 2, 990, 992, 5, 172, 87, 2, 991, 989, 3, 2, 2, 2, 991, 990, 3, 2, 2, 2, 992, 994, 3, 2, 2, 2, 993, 995, 7, 124, 2, 2, 994, 993, 3, 2, 2, 2, 994, 995, 3, 2, 2, 2, 995, 163, 3, 2, 2, 2, 996, 998, 5, 166, 84, 2, 997, 996, 3, 2, 2, 2, 997, 998, 3, 2, 2, 2, 998, 165, 3, 2, 2, 2, 999, 1002, 7, 127, 2, 2, 1000, 1002, 5, 168, 85, 2, 1001, 999, 3, 2, 2, 2, 1001, 1000, 3, 2, 2, 2, 1002, 167, 3, 2, 2, 2, 1003, 1005, 7, 119, 2, 2, 1004, 1006, 5, 170, 86, 2, 1005, 1004, 3, 2, 2, 2, 1006, 1007, 3, 2, 2, 2, 1007, 1005, 3, 2, 2, 2, 1007, 1008, 3, 2, 2, 2, 1008, 1009, 3, 2, 2, 2, 1009, 1010, 7, 120, 2, 2, 1010, 169, 3, 2, 2, 2, 1011, 1014, 5, 172, 87, 2, 1012, 1013, 7, 121, 2, 2, 1013, 1015, 5, 172, 87, 2, 1014, 1012, 3, 2, 2, 2, 1014, 1015, 3, 2, 2, 2, 1015, 1018, 3, 2, 2, 2, 1016, 1018, 7, 127, 2, 2, 1017, 1011, 3, 2, 2, 2, 1017, 1016, 3, 2, 2, 2, 1018, 171, 3, 2, 2, 2, 1019, 1022, 5, 174, 88, 2, 1020, 1022, 7, 128, 2, 2, 1021, 1019, 3, 2, 2, 2, 1021, 1020, 3, 2, 2, 2, 1022, 173, 3, 2, 2, 2, 1023, 1024, 9, 14, 2, 2, 1024, 175, 3, 2, 2, 2, 1025, 1026, 7, 130, 2, 2, 1026, 177, 3, 2, 2, 2, 1027, 1028, 9, 15, 2, 2, 1028, 179, 3, 2, 2, 2, 1029, 1030, 9, 16, 2, 2, 1030, 181, 3, 2, 2, 2, 1031, 1032, 9, 17, 2, 2, 1032, 183, 3, 2, 2, 2, 1033, 1035, 5, 26, 14, 2, 1034, 1033, 3, 2, 2, 2, 1035, 1038, 3, 2, 2, 2, 1036, 1034, 3, 2, 2, 2, 1036, 1037, 3, 2, 2, 2, 1037, 1039, 3, 2, 2, 2, 1038, 1036, 3, 2, 2, 2, 1039, 1040, 7, 2, 2, 3, 1040, 185, 3, 2, 2, 2, 1041, 1043, 5, 36, 19, 2, 1042, 1041, 3, 2, 2, 2, 1043, 1046, 3, 2, 2, 2, 1044, 1042, 3, 2, 2, 2, 1044, 1045, 3, 2, 2, 2, 1045, 1047, 3, 2, 2, 2, 1046, 1044, 3, 2, 2, 2, 1047, 1048, 7, 2, 2, 3, 1048, 187, 3, 2, 2, 2, 1049, 1051, 5, 32, 17, 2, 1050, 1049, 3, 2, 2, 2, 1051, 1054, 3, 2, 2, 2, 1052, 1050, 3, 2, 2, 2, 1052, 1053, 3, 2, 2, 2, 1053, 1055, 3, 2, 2, 2, 1054, 1052, 3, 2, 2, 2, 1055, 1056, 7, 2, 2, 3, 1056, 189, 3, 2, 2, 2, 1057, 1059, 5, 76, 39, 2, 1058, 1057, 3, 2, 2, 2, 1059, 1062, 3, 2, 2, 2, 1060, 1058, 3, 2, 2, 2, 1060, 1061, 3, 2, 2, 2, 1061, 1063, 3, 2, 2, 2, 1062, 1060, 3, 2, 2, 2, 1063, 1064, 7, 2, 2, 3, 1064, 191, 3, 2, 2, 2, 1065, 1067, 5, 98, 50, 2, 1066, 1065, 3, 2, 2, 2, 1067, 1070, 3, 2, 2, 2, 1068, 1066, 3, 2, 2, 2, 1068, 1069, 3, 2, 2, 2, 1069, 1071, 3, 2, 2, 2, 1070, 1068, 3, 2, 2, 2, 1071, 1072, 7, 2, 2, 3, 1072, 193, 3, 2, 2, 2, 1073, 1075, 5, 104, 53, 2, 1074, 1073, 3, 2, 2, 2, 1075, 1078, 3, 2, 2, 2, 1076, 1074, 3, 2, 2, 2, 1076, 1077, 3, 2, 2, 2, 1077, 1079, 3, 2, 2, 2, 1078, 1076, 3, 2, 2, 2, 1079, 1080, 7, 2, 2, 3, 1080, 195, 3, 2, 2, 2, 1081, 1083, 5, 110, 56, 2, 1082, 1081, 3, 2, 2, 2, 1083, 1086, 3, 2, 2, 2, 1084, 1082, 3, 2, 2, 2, 1084, 1085, 3, 2, 2, 2, 1085, 1087, 3, 2, 2, 2, 1086, 1084, 3, 2, 2, 2, 1087, 1088, 7, 2, 2, 3, 1088, 197, 3, 2, 2, 2, 1089, 1091, 5, 86, 44, 2, 1090, 1089, 3, 2, 2, 2, 1091, 1094, 3, 2, 2, 2, 1092, 1090, 3, 2, 2, 2, 1092, 1093, 3, 2, 2, 2, 1093, 1095, 3, 2, 2, 2, 1094, 1092, 3, 2, 2, 2, 1095, 1096, 7, 2, 2, 3, 1096, 199, 3, 2, 2, 2, 1097, 1099, 5, 116, 59, 2, 1098, 1097, 3, 2, 2, 2, 1099, 1102, 3, 2, 2, 2, 1100, 1098, 3, 2, 2, 2, 1100, 1101, 3, 2, 2, 2, 1101, 1103, 3, 2, 2, 2, 1102, 1100, 3, 2, 2, 2, 1103, 1104, 7, 2, 2, 3, 1104, 201, 3, 2, 2, 2, 1105, 1107, 5, 150, 76, 2, 1106, 1105, 3, 2, 2, 2, 1107, 1110, 3, 2, 2, 2, 1108, 1106, 3, 2, 2, 2, 1108, 1109, 3, 2, 2, 2, 1109, 1111, 3, 2, 2, 2, 1110, 1108, 3, 2, 2, 2, 1111, 1112, 7, 2, 2, 3, 1112, 203, 3, 2, 2, 2, 1113, 1115, 5, 122, 62, 2, 1114, 1113, 3, 2, 2, 2, 1115, 1118, 3, 2, 2, 2, 1116, 1114, 3, 2, 2, 2, 1116, 1117, 3, 2, 2, 2, 1117, 1119, 3, 2, 2, 2, 1118, 1116, 3, 2, 2, 2, 1119, 1120, 7, 2, 2, 3, 1120, 205, 3, 2, 2, 2, 1121, 1123, 5, 128, 65, 2, 1122, 1121, 3, 2, 2, 2, 1123, 1126, 3, 2, 2, 2, 1124, 1122, 3, 2, 2, 2, 1124, 1125, 3, 2, 2, 2, 1125, 1127, 3, 2, 2, 2, 1126, 1124, 3, 2, 2, 2, 1127, 1128, 7, 2, 2, 3, 1128, 207, 3, 2, 2, 2, 1129, 1131, 5, 134, 68, 2, 1130, 1129, 3, 2, 2, 2, 1131, 1134, 3, 2, 2, 2, 1132, 1130, 3, 2, 2, 2, 1132, 1133, 3, 2, 2, 2, 1133, 1135, 3, 2, 2, 2, 1134, 1132, 3, 2, 2, 2, 1135, 1136, 7, 2, 2, 3, 1136, 209, 3, 2, 2, 2, 1137, 1139, 5, 142, 72, 2, 1138, 1137, 3, 2, 2, 2, 1139, 1142, 3, 2, 2, 2, 1140, 1138, 3, 2, 2, 2, 1140, 1141, 3, 2, 2, 2, 1141, 1143, 3, 2, 2, 2, 1142, 1140, 3, 2, 2, 2, 1143, 1144, 7, 2, 2, 3, 1144, 211, 3, 2, 2, 2, 1145, 1146, 9, 18, 2, 2, 1146, 213, 3, 2, 2, 2, 1147, 1148, 9, 19, 2, 2, 1148, 215, 3, 2, 2, 2, 1149, 1150, 9, 20, 2, 2, 1150, 217, 3, 2, 2, 2, 1151, 1152, 9, 21, 2, 2, 1152, 219, 3, 2, 2, 2, 1153, 1154, 9, 22, 2, 2, 1154, 221, 3, 2, 2, 2, 1155, 1156, 9, 23, 2, 2, 1156, 223, 3, 2, 2, 2, 124, 229, 231, 242, 262, 272, 283, 289, 305, 313, 321, 327, 336, 341, 347, 352, 361, 369, 378, 384, 400, 413, 420, 422, 432, 438, 445, 454, 457, 464, 466, 473, 475, 477, 480, 484, 490, 497, 502, 508, 515, 518, 525, 528, 535, 538, 540, 544, 551, 560, 570, 575, 578, 581, 587, 594, 596, 607, 618, 627, 635, 643, 651, 658, 669, 687, 694, 701, 708, 716, 728, 737, 749, 758, 770, 778, 788, 790, 801, 809, 838, 840, 847, 858, 869, 878, 886, 895, 897, 903, 910, 916, 928, 930, 941, 949, 963, 967, 974, 981, 987, 991, 994, 997, 1001, 1007, 1014, 1017, 1021, 1036, 1044, 1052, 1060, 1068, 1076, 1084, 1092, 1100, 1108, 1116, 1124, 1132, 1140] \ No newline at end of file diff --git a/c/makeotf/lib/hotconv/FeatParser.tokens b/c/makeotf/lib/hotconv/FeatParser.tokens new file mode 100644 index 000000000..b2e38d4b5 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParser.tokens @@ -0,0 +1,267 @@ +ANON=1 +ANON_v=2 +COMMENT=3 +WHITESPACE=4 +INCLUDE=5 +FEATURE=6 +TABLE=7 +SCRIPT=8 +LANGUAGE=9 +LANGSYS=10 +SUBTABLE=11 +LOOKUP=12 +LOOKUPFLAG=13 +NOTDEF=14 +RIGHT_TO_LEFT=15 +IGNORE_BASE_GLYPHS=16 +IGNORE_LIGATURES=17 +IGNORE_MARKS=18 +USE_MARK_FILTERING_SET=19 +MARK_ATTACHMENT_TYPE=20 +EXCLUDE_DFLT=21 +INCLUDE_DFLT=22 +EXCLUDE_dflt=23 +INCLUDE_dflt=24 +USE_EXTENSION=25 +BEGINVALUE=26 +ENDVALUE=27 +ENUMERATE=28 +ENUMERATE_v=29 +EXCEPT=30 +IGNORE=31 +SUBSTITUTE=32 +SUBSTITUTE_v=33 +REVERSE=34 +REVERSE_v=35 +BY=36 +FROM=37 +POSITION=38 +POSITION_v=39 +PARAMETERS=40 +FEATURE_NAMES=41 +CV_PARAMETERS=42 +CV_UI_LABEL=43 +CV_TOOLTIP=44 +CV_SAMPLE_TEXT=45 +CV_PARAM_LABEL=46 +CV_CHARACTER=47 +SIZEMENUNAME=48 +CONTOURPOINT=49 +ANCHOR=50 +ANCHOR_DEF=51 +VALUE_RECORD_DEF=52 +MARK=53 +MARK_CLASS=54 +CURSIVE=55 +MARKBASE=56 +MARKLIG=57 +MARKLIG_v=58 +LIG_COMPONENT=59 +KNULL=60 +BASE=61 +HA_BTL=62 +VA_BTL=63 +HA_BSL=64 +VA_BSL=65 +GDEF=66 +GLYPH_CLASS_DEF=67 +ATTACH=68 +LIG_CARET_BY_POS=69 +LIG_CARET_BY_IDX=70 +HEAD=71 +FONT_REVISION=72 +HHEA=73 +ASCENDER=74 +DESCENDER=75 +LINE_GAP=76 +CARET_OFFSET=77 +NAME=78 +NAMEID=79 +OS_2=80 +FS_TYPE=81 +FS_TYPE_v=82 +OS2_LOWER_OP_SIZE=83 +OS2_UPPER_OP_SIZE=84 +PANOSE=85 +TYPO_ASCENDER=86 +TYPO_DESCENDER=87 +TYPO_LINE_GAP=88 +WIN_ASCENT=89 +WIN_DESCENT=90 +X_HEIGHT=91 +CAP_HEIGHT=92 +WEIGHT_CLASS=93 +WIDTH_CLASS=94 +VENDOR=95 +UNICODE_RANGE=96 +CODE_PAGE_RANGE=97 +FAMILY_CLASS=98 +STAT=99 +ELIDED_FALLBACK_NAME=100 +ELIDED_FALLBACK_NAME_ID=101 +DESIGN_AXIS=102 +AXIS_VALUE=103 +FLAG=104 +LOCATION=105 +AXIS_EAVN=106 +AXIS_OSFA=107 +VHEA=108 +VERT_TYPO_ASCENDER=109 +VERT_TYPO_DESCENDER=110 +VERT_TYPO_LINE_GAP=111 +VMTX=112 +VERT_ORIGIN_Y=113 +VERT_ADVANCE_Y=114 +LCBRACE=115 +RCBRACE=116 +LBRACKET=117 +RBRACKET=118 +HYPHEN=119 +SEMI=120 +EQUALS=121 +MARKER=122 +COMMA=123 +QUOTE=124 +GCLASS=125 +CID=126 +ESCGNAME=127 +NAMELABEL=128 +EXTNAME=129 +POINTNUM=130 +NUMEXT=131 +NUMOCT=132 +NUM=133 +CATCHTAG=134 +A_WHITESPACE=135 +A_LABEL=136 +A_LBRACE=137 +A_CLOSE=138 +A_LINE=139 +I_WHITESPACE=140 +I_RPAREN=141 +IFILE=142 +I_LPAREN=143 +STRVAL=144 +EQUOTE=145 +'anon'=1 +'anonymous'=2 +'include'=5 +'feature'=6 +'table'=7 +'script'=8 +'language'=9 +'languagesystem'=10 +'subtable'=11 +'lookup'=12 +'lookupflag'=13 +'.notdef'=14 +'RightToLeft'=15 +'IgnoreBaseGlyphs'=16 +'IgnoreLigatures'=17 +'IgnoreMarks'=18 +'UseMarkFilteringSet'=19 +'MarkAttachmentType'=20 +'excludeDFLT'=21 +'includeDFLT'=22 +'exclude_dflt'=23 +'include_dflt'=24 +'useExtension'=25 +'<'=26 +'>'=27 +'enumerate'=28 +'enum'=29 +'except'=30 +'ignore'=31 +'substitute'=32 +'sub'=33 +'reversesub'=34 +'rsub'=35 +'by'=36 +'from'=37 +'position'=38 +'pos'=39 +'parameters'=40 +'featureNames'=41 +'cvParameters'=42 +'FeatUILabelNameID'=43 +'FeatUITooltipTextNameID'=44 +'SampleTextNameID'=45 +'ParamUILabelNameID'=46 +'Character'=47 +'sizemenuname'=48 +'contourpoint'=49 +'anchor'=50 +'anchorDef'=51 +'valueRecordDef'=52 +'mark'=53 +'markClass'=54 +'cursive'=55 +'base'=56 +'ligature'=57 +'lig'=58 +'ligComponent'=59 +'NULL'=60 +'BASE'=61 +'HorizAxis.BaseTagList'=62 +'VertAxis.BaseTagList'=63 +'HorizAxis.BaseScriptList'=64 +'VertAxis.BaseScriptList'=65 +'GDEF'=66 +'GlyphClassDef'=67 +'Attach'=68 +'LigatureCaretByPos'=69 +'LigatureCaretByIndex'=70 +'head'=71 +'FontRevision'=72 +'hhea'=73 +'Ascender'=74 +'Descender'=75 +'LineGap'=76 +'CaretOffset'=77 +'name'=78 +'nameid'=79 +'OS/2'=80 +'FSType'=81 +'fsType'=82 +'LowerOpSize'=83 +'UpperOpSize'=84 +'Panose'=85 +'TypoAscender'=86 +'TypoDescender'=87 +'TypoLineGap'=88 +'winAscent'=89 +'winDescent'=90 +'XHeight'=91 +'CapHeight'=92 +'WeightClass'=93 +'WidthClass'=94 +'Vendor'=95 +'UnicodeRange'=96 +'CodePageRange'=97 +'FamilyClass'=98 +'STAT'=99 +'ElidedFallbackName'=100 +'ElidedFallbackNameID'=101 +'DesignAxis'=102 +'AxisValue'=103 +'flag'=104 +'location'=105 +'ElidableAxisValueName'=106 +'OlderSiblingFontAttribute'=107 +'vhea'=108 +'VertTypoAscender'=109 +'VertTypoDescender'=110 +'VertTypoLineGap'=111 +'vmtx'=112 +'VertOriginY'=113 +'VertAdvanceY'=114 +'}'=116 +'['=117 +']'=118 +'-'=119 +';'=120 +'='=121 +'\''=122 +','=123 +'('=141 +')'=143 diff --git a/c/makeotf/lib/hotconv/FeatParserBaseVisitor.cpp b/c/makeotf/lib/hotconv/FeatParserBaseVisitor.cpp new file mode 100644 index 000000000..2b13987d3 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParserBaseVisitor.cpp @@ -0,0 +1,7 @@ + +// Generated from FeatParser.g4 by ANTLR 4.9.2 + + +#include "FeatParserBaseVisitor.h" + + diff --git a/c/makeotf/lib/hotconv/FeatParserBaseVisitor.h b/c/makeotf/lib/hotconv/FeatParserBaseVisitor.h new file mode 100644 index 000000000..98d717f70 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParserBaseVisitor.h @@ -0,0 +1,464 @@ + +// Generated from FeatParser.g4 by ANTLR 4.9.2 + +#pragma once + + +#include "antlr4-runtime.h" +#include "FeatParserVisitor.h" + + +/** + * This class provides an empty implementation of FeatParserVisitor, which can be + * extended to create a visitor which only needs to handle a subset of the available methods. + */ +class FeatParserBaseVisitor : public FeatParserVisitor { +public: + + virtual antlrcpp::Any visitFile(FeatParser::FileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTopLevelStatement(FeatParser::TopLevelStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitInclude(FeatParser::IncludeContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGlyphClassAssign(FeatParser::GlyphClassAssignContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLangsysAssign(FeatParser::LangsysAssignContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitMark_statement(FeatParser::Mark_statementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAnchorDef(FeatParser::AnchorDefContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitValueRecordDef(FeatParser::ValueRecordDefContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFeatureBlock(FeatParser::FeatureBlockContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTableBlock(FeatParser::TableBlockContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAnonBlock(FeatParser::AnonBlockContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLookupBlockTopLevel(FeatParser::LookupBlockTopLevelContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFeatureStatement(FeatParser::FeatureStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLookupBlockOrUse(FeatParser::LookupBlockOrUseContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCvParameterBlock(FeatParser::CvParameterBlockContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCvParameterStatement(FeatParser::CvParameterStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCvParameter(FeatParser::CvParameterContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitStatement(FeatParser::StatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFeatureUse(FeatParser::FeatureUseContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitScriptAssign(FeatParser::ScriptAssignContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLangAssign(FeatParser::LangAssignContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLookupflagAssign(FeatParser::LookupflagAssignContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLookupflagElement(FeatParser::LookupflagElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitIgnoreSubOrPos(FeatParser::IgnoreSubOrPosContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSubstitute(FeatParser::SubstituteContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPosition(FeatParser::PositionContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitValuePattern(FeatParser::ValuePatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitValueRecord(FeatParser::ValueRecordContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitValueLiteral(FeatParser::ValueLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCursiveElement(FeatParser::CursiveElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitBaseToMarkElement(FeatParser::BaseToMarkElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLigatureMarkElement(FeatParser::LigatureMarkElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitParameters(FeatParser::ParametersContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSizemenuname(FeatParser::SizemenunameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFeatureNames(FeatParser::FeatureNamesContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSubtable(FeatParser::SubtableContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_BASE(FeatParser::Table_BASEContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitBaseStatement(FeatParser::BaseStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisTags(FeatParser::AxisTagsContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisScripts(FeatParser::AxisScriptsContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitBaseScript(FeatParser::BaseScriptContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_GDEF(FeatParser::Table_GDEFContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGdefStatement(FeatParser::GdefStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGdefGlyphClass(FeatParser::GdefGlyphClassContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGdefAttach(FeatParser::GdefAttachContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGdefLigCaretPos(FeatParser::GdefLigCaretPosContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGdefLigCaretIndex(FeatParser::GdefLigCaretIndexContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_head(FeatParser::Table_headContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitHeadStatement(FeatParser::HeadStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitHead(FeatParser::HeadContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_hhea(FeatParser::Table_hheaContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitHheaStatement(FeatParser::HheaStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitHhea(FeatParser::HheaContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_vhea(FeatParser::Table_vheaContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVheaStatement(FeatParser::VheaStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVhea(FeatParser::VheaContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_name(FeatParser::Table_nameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNameStatement(FeatParser::NameStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNameID(FeatParser::NameIDContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_OS_2(FeatParser::Table_OS_2Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitOs_2Statement(FeatParser::Os_2StatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitOs_2(FeatParser::Os_2Context *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_STAT(FeatParser::Table_STATContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitStatStatement(FeatParser::StatStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitDesignAxis(FeatParser::DesignAxisContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisValue(FeatParser::AxisValueContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisValueStatement(FeatParser::AxisValueStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisValueLocation(FeatParser::AxisValueLocationContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisValueFlags(FeatParser::AxisValueFlagsContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitElidedFallbackName(FeatParser::ElidedFallbackNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNameEntryStatement(FeatParser::NameEntryStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitElidedFallbackNameID(FeatParser::ElidedFallbackNameIDContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNameEntry(FeatParser::NameEntryContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTable_vmtx(FeatParser::Table_vmtxContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVmtxStatement(FeatParser::VmtxStatementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVmtx(FeatParser::VmtxContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAnchor(FeatParser::AnchorContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLookupPattern(FeatParser::LookupPatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLookupPatternElement(FeatParser::LookupPatternElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPattern(FeatParser::PatternContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPatternElement(FeatParser::PatternElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGlyphClassOptional(FeatParser::GlyphClassOptionalContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGlyphClass(FeatParser::GlyphClassContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGcLiteral(FeatParser::GcLiteralContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGcLiteralElement(FeatParser::GcLiteralElementContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGlyph(FeatParser::GlyphContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGlyphName(FeatParser::GlyphNameContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitLabel(FeatParser::LabelContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitTag(FeatParser::TagContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFixedNum(FeatParser::FixedNumContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGenNum(FeatParser::GenNumContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitFeatureFile(FeatParser::FeatureFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitStatementFile(FeatParser::StatementFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitCvStatementFile(FeatParser::CvStatementFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitBaseFile(FeatParser::BaseFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitHeadFile(FeatParser::HeadFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitHheaFile(FeatParser::HheaFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVheaFile(FeatParser::VheaFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitGdefFile(FeatParser::GdefFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNameFile(FeatParser::NameFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitVmtxFile(FeatParser::VmtxFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitOs_2File(FeatParser::Os_2FileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitStatFile(FeatParser::StatFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAxisValueFile(FeatParser::AxisValueFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitNameEntryFile(FeatParser::NameEntryFileContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitSubtok(FeatParser::SubtokContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitRevtok(FeatParser::RevtokContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitAnontok(FeatParser::AnontokContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitEnumtok(FeatParser::EnumtokContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitPostok(FeatParser::PostokContext *ctx) override { + return visitChildren(ctx); + } + + virtual antlrcpp::Any visitMarkligtok(FeatParser::MarkligtokContext *ctx) override { + return visitChildren(ctx); + } + + +}; + diff --git a/c/makeotf/lib/hotconv/FeatParserVisitor.cpp b/c/makeotf/lib/hotconv/FeatParserVisitor.cpp new file mode 100644 index 000000000..b2a2ce002 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParserVisitor.cpp @@ -0,0 +1,7 @@ + +// Generated from FeatParser.g4 by ANTLR 4.9.2 + + +#include "FeatParserVisitor.h" + + diff --git a/c/makeotf/lib/hotconv/FeatParserVisitor.h b/c/makeotf/lib/hotconv/FeatParserVisitor.h new file mode 100644 index 000000000..5dbffa2ed --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatParserVisitor.h @@ -0,0 +1,246 @@ + +// Generated from FeatParser.g4 by ANTLR 4.9.2 + +#pragma once + + +#include "antlr4-runtime.h" +#include "FeatParser.h" + + + +/** + * This class defines an abstract visitor for a parse tree + * produced by FeatParser. + */ +class FeatParserVisitor : public antlr4::tree::AbstractParseTreeVisitor { +public: + + /** + * Visit parse trees produced by FeatParser. + */ + virtual antlrcpp::Any visitFile(FeatParser::FileContext *context) = 0; + + virtual antlrcpp::Any visitTopLevelStatement(FeatParser::TopLevelStatementContext *context) = 0; + + virtual antlrcpp::Any visitInclude(FeatParser::IncludeContext *context) = 0; + + virtual antlrcpp::Any visitGlyphClassAssign(FeatParser::GlyphClassAssignContext *context) = 0; + + virtual antlrcpp::Any visitLangsysAssign(FeatParser::LangsysAssignContext *context) = 0; + + virtual antlrcpp::Any visitMark_statement(FeatParser::Mark_statementContext *context) = 0; + + virtual antlrcpp::Any visitAnchorDef(FeatParser::AnchorDefContext *context) = 0; + + virtual antlrcpp::Any visitValueRecordDef(FeatParser::ValueRecordDefContext *context) = 0; + + virtual antlrcpp::Any visitFeatureBlock(FeatParser::FeatureBlockContext *context) = 0; + + virtual antlrcpp::Any visitTableBlock(FeatParser::TableBlockContext *context) = 0; + + virtual antlrcpp::Any visitAnonBlock(FeatParser::AnonBlockContext *context) = 0; + + virtual antlrcpp::Any visitLookupBlockTopLevel(FeatParser::LookupBlockTopLevelContext *context) = 0; + + virtual antlrcpp::Any visitFeatureStatement(FeatParser::FeatureStatementContext *context) = 0; + + virtual antlrcpp::Any visitLookupBlockOrUse(FeatParser::LookupBlockOrUseContext *context) = 0; + + virtual antlrcpp::Any visitCvParameterBlock(FeatParser::CvParameterBlockContext *context) = 0; + + virtual antlrcpp::Any visitCvParameterStatement(FeatParser::CvParameterStatementContext *context) = 0; + + virtual antlrcpp::Any visitCvParameter(FeatParser::CvParameterContext *context) = 0; + + virtual antlrcpp::Any visitStatement(FeatParser::StatementContext *context) = 0; + + virtual antlrcpp::Any visitFeatureUse(FeatParser::FeatureUseContext *context) = 0; + + virtual antlrcpp::Any visitScriptAssign(FeatParser::ScriptAssignContext *context) = 0; + + virtual antlrcpp::Any visitLangAssign(FeatParser::LangAssignContext *context) = 0; + + virtual antlrcpp::Any visitLookupflagAssign(FeatParser::LookupflagAssignContext *context) = 0; + + virtual antlrcpp::Any visitLookupflagElement(FeatParser::LookupflagElementContext *context) = 0; + + virtual antlrcpp::Any visitIgnoreSubOrPos(FeatParser::IgnoreSubOrPosContext *context) = 0; + + virtual antlrcpp::Any visitSubstitute(FeatParser::SubstituteContext *context) = 0; + + virtual antlrcpp::Any visitPosition(FeatParser::PositionContext *context) = 0; + + virtual antlrcpp::Any visitValuePattern(FeatParser::ValuePatternContext *context) = 0; + + virtual antlrcpp::Any visitValueRecord(FeatParser::ValueRecordContext *context) = 0; + + virtual antlrcpp::Any visitValueLiteral(FeatParser::ValueLiteralContext *context) = 0; + + virtual antlrcpp::Any visitCursiveElement(FeatParser::CursiveElementContext *context) = 0; + + virtual antlrcpp::Any visitBaseToMarkElement(FeatParser::BaseToMarkElementContext *context) = 0; + + virtual antlrcpp::Any visitLigatureMarkElement(FeatParser::LigatureMarkElementContext *context) = 0; + + virtual antlrcpp::Any visitParameters(FeatParser::ParametersContext *context) = 0; + + virtual antlrcpp::Any visitSizemenuname(FeatParser::SizemenunameContext *context) = 0; + + virtual antlrcpp::Any visitFeatureNames(FeatParser::FeatureNamesContext *context) = 0; + + virtual antlrcpp::Any visitSubtable(FeatParser::SubtableContext *context) = 0; + + virtual antlrcpp::Any visitTable_BASE(FeatParser::Table_BASEContext *context) = 0; + + virtual antlrcpp::Any visitBaseStatement(FeatParser::BaseStatementContext *context) = 0; + + virtual antlrcpp::Any visitAxisTags(FeatParser::AxisTagsContext *context) = 0; + + virtual antlrcpp::Any visitAxisScripts(FeatParser::AxisScriptsContext *context) = 0; + + virtual antlrcpp::Any visitBaseScript(FeatParser::BaseScriptContext *context) = 0; + + virtual antlrcpp::Any visitTable_GDEF(FeatParser::Table_GDEFContext *context) = 0; + + virtual antlrcpp::Any visitGdefStatement(FeatParser::GdefStatementContext *context) = 0; + + virtual antlrcpp::Any visitGdefGlyphClass(FeatParser::GdefGlyphClassContext *context) = 0; + + virtual antlrcpp::Any visitGdefAttach(FeatParser::GdefAttachContext *context) = 0; + + virtual antlrcpp::Any visitGdefLigCaretPos(FeatParser::GdefLigCaretPosContext *context) = 0; + + virtual antlrcpp::Any visitGdefLigCaretIndex(FeatParser::GdefLigCaretIndexContext *context) = 0; + + virtual antlrcpp::Any visitTable_head(FeatParser::Table_headContext *context) = 0; + + virtual antlrcpp::Any visitHeadStatement(FeatParser::HeadStatementContext *context) = 0; + + virtual antlrcpp::Any visitHead(FeatParser::HeadContext *context) = 0; + + virtual antlrcpp::Any visitTable_hhea(FeatParser::Table_hheaContext *context) = 0; + + virtual antlrcpp::Any visitHheaStatement(FeatParser::HheaStatementContext *context) = 0; + + virtual antlrcpp::Any visitHhea(FeatParser::HheaContext *context) = 0; + + virtual antlrcpp::Any visitTable_vhea(FeatParser::Table_vheaContext *context) = 0; + + virtual antlrcpp::Any visitVheaStatement(FeatParser::VheaStatementContext *context) = 0; + + virtual antlrcpp::Any visitVhea(FeatParser::VheaContext *context) = 0; + + virtual antlrcpp::Any visitTable_name(FeatParser::Table_nameContext *context) = 0; + + virtual antlrcpp::Any visitNameStatement(FeatParser::NameStatementContext *context) = 0; + + virtual antlrcpp::Any visitNameID(FeatParser::NameIDContext *context) = 0; + + virtual antlrcpp::Any visitTable_OS_2(FeatParser::Table_OS_2Context *context) = 0; + + virtual antlrcpp::Any visitOs_2Statement(FeatParser::Os_2StatementContext *context) = 0; + + virtual antlrcpp::Any visitOs_2(FeatParser::Os_2Context *context) = 0; + + virtual antlrcpp::Any visitTable_STAT(FeatParser::Table_STATContext *context) = 0; + + virtual antlrcpp::Any visitStatStatement(FeatParser::StatStatementContext *context) = 0; + + virtual antlrcpp::Any visitDesignAxis(FeatParser::DesignAxisContext *context) = 0; + + virtual antlrcpp::Any visitAxisValue(FeatParser::AxisValueContext *context) = 0; + + virtual antlrcpp::Any visitAxisValueStatement(FeatParser::AxisValueStatementContext *context) = 0; + + virtual antlrcpp::Any visitAxisValueLocation(FeatParser::AxisValueLocationContext *context) = 0; + + virtual antlrcpp::Any visitAxisValueFlags(FeatParser::AxisValueFlagsContext *context) = 0; + + virtual antlrcpp::Any visitElidedFallbackName(FeatParser::ElidedFallbackNameContext *context) = 0; + + virtual antlrcpp::Any visitNameEntryStatement(FeatParser::NameEntryStatementContext *context) = 0; + + virtual antlrcpp::Any visitElidedFallbackNameID(FeatParser::ElidedFallbackNameIDContext *context) = 0; + + virtual antlrcpp::Any visitNameEntry(FeatParser::NameEntryContext *context) = 0; + + virtual antlrcpp::Any visitTable_vmtx(FeatParser::Table_vmtxContext *context) = 0; + + virtual antlrcpp::Any visitVmtxStatement(FeatParser::VmtxStatementContext *context) = 0; + + virtual antlrcpp::Any visitVmtx(FeatParser::VmtxContext *context) = 0; + + virtual antlrcpp::Any visitAnchor(FeatParser::AnchorContext *context) = 0; + + virtual antlrcpp::Any visitLookupPattern(FeatParser::LookupPatternContext *context) = 0; + + virtual antlrcpp::Any visitLookupPatternElement(FeatParser::LookupPatternElementContext *context) = 0; + + virtual antlrcpp::Any visitPattern(FeatParser::PatternContext *context) = 0; + + virtual antlrcpp::Any visitPatternElement(FeatParser::PatternElementContext *context) = 0; + + virtual antlrcpp::Any visitGlyphClassOptional(FeatParser::GlyphClassOptionalContext *context) = 0; + + virtual antlrcpp::Any visitGlyphClass(FeatParser::GlyphClassContext *context) = 0; + + virtual antlrcpp::Any visitGcLiteral(FeatParser::GcLiteralContext *context) = 0; + + virtual antlrcpp::Any visitGcLiteralElement(FeatParser::GcLiteralElementContext *context) = 0; + + virtual antlrcpp::Any visitGlyph(FeatParser::GlyphContext *context) = 0; + + virtual antlrcpp::Any visitGlyphName(FeatParser::GlyphNameContext *context) = 0; + + virtual antlrcpp::Any visitLabel(FeatParser::LabelContext *context) = 0; + + virtual antlrcpp::Any visitTag(FeatParser::TagContext *context) = 0; + + virtual antlrcpp::Any visitFixedNum(FeatParser::FixedNumContext *context) = 0; + + virtual antlrcpp::Any visitGenNum(FeatParser::GenNumContext *context) = 0; + + virtual antlrcpp::Any visitFeatureFile(FeatParser::FeatureFileContext *context) = 0; + + virtual antlrcpp::Any visitStatementFile(FeatParser::StatementFileContext *context) = 0; + + virtual antlrcpp::Any visitCvStatementFile(FeatParser::CvStatementFileContext *context) = 0; + + virtual antlrcpp::Any visitBaseFile(FeatParser::BaseFileContext *context) = 0; + + virtual antlrcpp::Any visitHeadFile(FeatParser::HeadFileContext *context) = 0; + + virtual antlrcpp::Any visitHheaFile(FeatParser::HheaFileContext *context) = 0; + + virtual antlrcpp::Any visitVheaFile(FeatParser::VheaFileContext *context) = 0; + + virtual antlrcpp::Any visitGdefFile(FeatParser::GdefFileContext *context) = 0; + + virtual antlrcpp::Any visitNameFile(FeatParser::NameFileContext *context) = 0; + + virtual antlrcpp::Any visitVmtxFile(FeatParser::VmtxFileContext *context) = 0; + + virtual antlrcpp::Any visitOs_2File(FeatParser::Os_2FileContext *context) = 0; + + virtual antlrcpp::Any visitStatFile(FeatParser::StatFileContext *context) = 0; + + virtual antlrcpp::Any visitAxisValueFile(FeatParser::AxisValueFileContext *context) = 0; + + virtual antlrcpp::Any visitNameEntryFile(FeatParser::NameEntryFileContext *context) = 0; + + virtual antlrcpp::Any visitSubtok(FeatParser::SubtokContext *context) = 0; + + virtual antlrcpp::Any visitRevtok(FeatParser::RevtokContext *context) = 0; + + virtual antlrcpp::Any visitAnontok(FeatParser::AnontokContext *context) = 0; + + virtual antlrcpp::Any visitEnumtok(FeatParser::EnumtokContext *context) = 0; + + virtual antlrcpp::Any visitPostok(FeatParser::PostokContext *context) = 0; + + virtual antlrcpp::Any visitMarkligtok(FeatParser::MarkligtokContext *context) = 0; + + +}; + diff --git a/c/makeotf/lib/hotconv/FeatVisitor.cpp b/c/makeotf/lib/hotconv/FeatVisitor.cpp new file mode 100644 index 000000000..ca36e3ee7 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatVisitor.cpp @@ -0,0 +1,1642 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +#include "BASE.h" +#include "FeatVisitor.h" +#include "GDEF.h" +#include "GPOS.h" +#include "GSUB.h" +#include "hhea.h" +#include "name.h" +#include "OS_2.h" +#include "otl.h" +#include "STAT.h" +#include "vhea.h" + +#include +#include + +extern "C" char *curdir(); +extern "C" char *sep(); + +#define MAX_INCL 50 + +// -------------------------------- Helper ----------------------------------- + +static const char* findDirName(const char *path) +{ + size_t i = strlen(path); + const char* end = nullptr; + while (i > 0) + { + end = strchr("/\\:", path[--i]); + if (end != nullptr) + break; + } + if (end != nullptr) + end = &path[i]; + return end; +} + +static void assignDirName(const std::string &of, std::string &to) { + const char *p = findDirName(of.c_str()); + if ( p == nullptr ) { + to.assign(curdir()); + } else { + to.assign(of, 0, (size_t)(p-of.c_str())); + } +} + +FeatVisitor::~FeatVisitor() { + for (auto i : includes) + delete i; + + // The tree pointer itself is managed by the parser + delete parser; + delete tokens; + delete lexer; + delete input; +} + +// ----------------------------- Entry Points -------------------------------- + +void FeatVisitor::Parse(bool do_includes) { + std::ifstream stream; + + if ( depth >= MAX_INCL ) { + fc->featMsg(hotFATAL, "Can't include [%s]; maximum include levels <%d> reached", + pathname.c_str(), MAX_INCL); + return; + } + if ( parent == nullptr ) { + stream.open(pathname); + if ( !stream.is_open() ) { + fc->featMsg(hotFATAL, "Specified feature file '%s' not found", pathname.c_str()); + return; + } + assignDirName(pathname, dirname); + } else { + std::string &rootdir = fc->root_visitor->dirname; + std::string fullname; + // Try relative to (potential) UFO fontinfo.plist file + stream.open(rootdir + sep() + "fontinfo.plist"); + if ( stream.is_open() ) { + stream.close(); + fullname = rootdir + sep() + ".." + sep() + pathname; + stream.open(fullname); + } + // Try relative to top-level file + if ( !stream.is_open() ) { + fullname = rootdir + sep() + pathname; + stream.open(fullname); + } + // Try relative to including file + if ( !stream.is_open() && rootdir != parent->dirname ) { + fullname = parent->dirname + sep() + pathname; + stream.open(fullname); + } + // Try just the pathname + if ( !stream.is_open() ) { + fullname = pathname; + stream.open(fullname); + } + if ( !stream.is_open() ) { + fc->featMsg(hotERROR, "Included feature file '%s' not found", pathname.c_str()); + return; + } + assignDirName(fullname, dirname); + } + + input = new antlr4::ANTLRInputStream(stream); + lexer = new FeatLexer(input); + tokens = new antlr4::CommonTokenStream(lexer); + parser = new FeatParser(tokens); + parser->removeErrorListeners(); + FeatErrorListener el{*this}; + parser->addErrorListener(&el); + + fc->current_visitor = this; + + tree = top_ep(*parser); + + parser->removeErrorListeners(); + + if ( tree == nullptr || !do_includes ) { + fc->current_visitor = nullptr; + return; + } + + stage = vInclude; + include_ep = top_ep; + tree->accept(this); + + fc->current_visitor = nullptr; + return; +} + +void FeatVisitor::Translate() { + fc->current_visitor = this; + stage = vExtract; // This will still parse includes if not already done + include_ep = top_ep; + tree->accept(this); + fc->current_visitor = nullptr; +} + +// --------------------------- Message Reporting ----------------------------- + +const char *FeatVisitor::currentTokStr() { + if ( current_msg_token == nullptr ) + return nullptr; + + return current_msg_token->getText().c_str(); +} + +void FeatVisitor::newFileMsg(char **msg) { + assert(msg != nullptr); + if ( need_file_msg ) { + std::string m = (parent == nullptr ? "in top-level feature file '" + : "in feature file '") + + pathname + "' "; + auto a = parent; + bool did_a = false; + while ( a != nullptr && a->need_file_msg ) { + if ( !did_a ) + m += "("; + else + m += ", "; + did_a = true; + m += "included from " + a->pathname; + a->need_file_msg = false; + a = a->parent; + } + if ( did_a ) + m += ")"; + m += ":"; + *msg = (char *) MEM_NEW(fc->g, m.size()+1); + memcpy(*msg, m.c_str(), m.size()+1); + need_file_msg = false; + } else + *msg = nullptr; +} + +void FeatVisitor::tokenPositionMsg(char **msg, bool full) { + assert(msg != nullptr); + + if ( current_msg_token == nullptr && !full ) { + *msg = nullptr; + return; + } + + *msg = (char *) MEM_NEW(fc->g, 50 + pathname.length()); + if ( current_msg_token != nullptr && !full ) { + sprintf(*msg, "[line %5ld char %3ld] ", (long)current_msg_token->getLine(), + (long)current_msg_token->getCharPositionInLine()+1); + } else if ( current_msg_token != nullptr ) { + assert(full); + sprintf(*msg, "file '%s' line %5ld char %3ld", pathname.c_str(), + (long)current_msg_token->getLine(), + (long)current_msg_token->getCharPositionInLine()+1); + } else { + assert(full); + sprintf(*msg, "unknown"); + } +} + +void FeatVisitor::FeatErrorListener::syntaxError(antlr4::Recognizer *, + antlr4::Token *t, + size_t, size_t, + const std::string &msg, + std::exception_ptr) { + v.TOK(t); + // Whatever messages the parser can produce are printed as a group + // before processing ends if there are any errors, so here we just + // mark them all as ERR instead of FATAL + hotMsg(v.fc->g, hotERROR, msg.c_str()); +} + +// --------------------------------- Blocks ----------------------------------- + +antlrcpp::Any FeatVisitor::visitFeatureBlock(FeatParser::FeatureBlockContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::featureFile; + if ( stage == vExtract ) { + Tag t = checkTag(ctx->starttag, ctx->endtag); + TOK(ctx); + fc->startFeature(t); + if ( ctx->USE_EXTENSION() != nullptr ) + fc->flagExtension(false); + } + + for (auto i : ctx->featureStatement()) + visitFeatureStatement(i); + + if ( stage == vExtract ) { + TOK(ctx->endtag); + fc->endFeature(); + } + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAnonBlock(FeatParser::AnonBlockContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + Tag tag = fc->str2tag(TOK(ctx->A_LABEL())->getText()); + std::string buf; + for (auto al : ctx->A_LINE()) + buf += al->getText(); + + TOK(ctx); + fc->g->cb.featAddAnonData(fc->g->cb.ctx, buf.c_str(), buf.size(), tag); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitLookupBlockTopLevel(FeatParser::LookupBlockTopLevelContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::statementFile; + if ( stage == vExtract ) { + checkLabel(ctx->startlabel, ctx->endlabel); + fc->startLookup(TOK(ctx->startlabel)->getText(), true); + if ( ctx->USE_EXTENSION() != nullptr ) + fc->flagExtension(true); + } + + for (auto i : ctx->statement()) + visitStatement(i); + + if ( stage == vExtract ) { + TOK(ctx->endlabel); + fc->endLookup(); + } + include_ep = tmp_ep; + return nullptr; +} + +// --------------------------- Top-level statements --------------------------- + +antlrcpp::Any FeatVisitor::visitInclude(FeatParser::IncludeContext *ctx) { + assert(ctx->IFILE() != nullptr); + FeatVisitor *inc; + + bool old_nfm = need_file_msg; + need_file_msg = true; + if ( includes.size() == current_include ) { + std::string fname = TOK(ctx->IFILE())->getText(); + // (dubiously) strip leading and trailing spaces from the filename + while ( !fname.empty() && std::isspace(*fname.begin()) ) + fname.erase(fname.begin()); + while ( !fname.empty() && std::isspace(*fname.rbegin()) ) + fname.erase(fname.length()-1); + inc = new FeatVisitor(fc, fname.c_str(), this, include_ep, depth+1); + inc->Parse(true); + includes.emplace_back(inc); + fc->current_visitor = this; + } else { + assert(includes.size() > current_include); + inc = includes[current_include]; + } + + if ( stage == vExtract ) { + inc->Translate(); + fc->current_visitor = this; + } + + if ( need_file_msg ) + need_file_msg = old_nfm; + else + need_file_msg = false; + + current_include++; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitLangsysAssign(FeatParser::LangsysAssignContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + Tag stag = fc->str2tag(TOK(ctx->script)->getText()); + Tag ltag = fc->str2tag(ctx->lang->getText()); + fc->addLangSys(stag, ltag, true, ctx->lang); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitValueRecordDef(FeatParser::ValueRecordDefContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + MetricsInfo mi = METRICSINFOEMPTYPP; + getValueLiteral(ctx->valueLiteral(), mi); + fc->addValueDef(TOK(ctx->label())->getText(), mi); + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAnchorDef(FeatParser::AnchorDefContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + FeatCtx::AnchorDef a; + a.x = getNum(TOK(ctx->xval)->getText(), 10); + a.y = getNum(TOK(ctx->yval)->getText(), 10); + if ( ctx->cp != nullptr ) { + a.contourpoint = getNum(TOK(ctx->cp)->getText(), 10); + a.hasContour = true; + } + + fc->addAnchorDef(TOK(ctx->name)->getText(), a); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitGlyphClassAssign(FeatParser::GlyphClassAssignContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + getGlyphClassAsCurrentGC(ctx->glyphClass(), ctx->GCLASS(), false); + TOK(ctx); + fc->finishCurrentGC(); + + return nullptr; +} + +// ---------------- Statements (in feature and lookup blocks) ----------------- + +antlrcpp::Any FeatVisitor::visitFeatureUse(FeatParser::FeatureUseContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + fc->aaltAddFeatureTag(fc->str2tag(TOK(ctx->tag())->getText())); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitScriptAssign(FeatParser::ScriptAssignContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + fc->startScriptOrLang(FeatCtx::scriptTag, fc->str2tag(TOK(ctx->tag())->getText())); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitLangAssign(FeatParser::LangAssignContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + int lang_change = fc->startScriptOrLang(FeatCtx::languageTag, fc->str2tag(TOK(ctx->tag())->getText())); + + bool old_format = false, include_dflt = true; + if ( ctx->EXCLUDE_dflt() || ctx->EXCLUDE_DFLT() ) + include_dflt = false; + if ( ctx->EXCLUDE_DFLT() || ctx->INCLUDE_DFLT() ) + old_format = true; + + TOK(ctx); + if ( lang_change != -1 ) + fc->includeDFLT(include_dflt, lang_change, old_format); + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitLookupflagAssign(FeatParser::LookupflagAssignContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + uint16_t v = 0; + GNode *gc = nullptr; + for (auto e : ctx->lookupflagElement()) { + if ( e->RIGHT_TO_LEFT() != nullptr ) + v = fc->setLkpFlagAttribute(v, otlRightToLeft, 0); + else if ( e->IGNORE_BASE_GLYPHS() != nullptr ) + v = fc->setLkpFlagAttribute(v, otlIgnoreBaseGlyphs, 0); + else if ( e->IGNORE_LIGATURES() != nullptr ) + v = fc->setLkpFlagAttribute(v, otlIgnoreLigatures, 0); + else if ( e->IGNORE_MARKS() != nullptr ) + v = fc->setLkpFlagAttribute(v, otlIgnoreMarks, 0); + else if ( e->USE_MARK_FILTERING_SET() != nullptr ) { + gc = getGlyphClass(e->glyphClass(), true); + uint16_t umfIndex = addMarkSetClassGDEF(fc->g, gc); + v = fc->setLkpFlagAttribute(v, otlUseMarkFilteringSet, umfIndex); + } else { + assert(e->MARK_ATTACHMENT_TYPE() != nullptr); + gc = getGlyphClass(e->glyphClass(), true); + uint16_t macIndex = addGlyphMarkClassGDEF(fc->g, gc); + if ( macIndex > kMaxMarkAttachClasses ) + fc->featMsg(hotERROR, "No more than 15 different class names can be used with the \"lookupflag MarkAttachmentType\". This would be a 16th."); + v = fc->setLkpFlagAttribute(v, otlMarkAttachmentType, macIndex); + } + } + if ( ctx->lookupflagElement().size() == 0 ) { + assert(ctx->NUM() != nullptr); + v = getNum(TOK(ctx->NUM())->getText(), 10); + } + fc->setLkpFlag(v); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitIgnoreSubOrPos(FeatParser::IgnoreSubOrPosContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + int sub_type = ctx->revtok() != nullptr ? GSUBReverse : GSUBChain; + bool is_sub = ctx->postok() == nullptr; + + for (auto lp : ctx->lookupPattern()) { + GNode *targ = getLookupPattern(lp, true); + targ->flags |= FEAT_IGNORE_CLAUSE; + if ( is_sub ) + fc->addSub(targ, nullptr, sub_type); + else + fc->addPos(targ, 0, 0); + } + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitSubstitute(FeatParser::SubstituteContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + GNode *targ, *repl = nullptr; + int type = 0; + + if ( ctx->EXCEPT() != nullptr ) { + type = GSUBChain; + fc->syntax.numExcept++; + for (auto i : ctx->lookupPattern()) { + if ( i == ctx->startpat || i == ctx->endpat ) + continue; + targ = getLookupPattern(i, true); + targ->flags |= FEAT_IGNORE_CLAUSE; + fc->addSub(targ, nullptr, type); + } + } + if ( ctx->revtok() != nullptr ) { + type = GSUBReverse; + assert(ctx->subtok() == nullptr); + assert(ctx->startpat != nullptr); + + targ = getLookupPattern(ctx->startpat, true); + if ( ctx->endpat != nullptr ) + repl = getLookupPattern(ctx->endpat, false); + } else { + assert(ctx->subtok() != nullptr); + assert(ctx->startpat != nullptr); + if ( ctx->FROM() != nullptr ) + type = GSUBAlternate; + targ = getLookupPattern(ctx->startpat, true); + if ( ctx->endpat != nullptr ) + repl = getLookupPattern(ctx->endpat, false); + } + TOK(ctx); + fc->addSub(targ, repl, type); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitMark_statement(FeatParser::Mark_statementContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + GNode *targ = nullptr; + fc->anchorMarkInfo.clear(); + + if ( ctx->glyph() != nullptr ) { + targ = fc->setNewNode(getGlyph(ctx->glyph(), false)); + } else { + assert(ctx->glyphClass() != nullptr); + targ = getGlyphClass(ctx->glyphClass(), false); + } + + translateAnchor(ctx->anchor(), 0); + + fc->addMark(TOK(ctx->GCLASS())->getText(), targ); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitPosition(FeatParser::PositionContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + bool enumerate = ctx->enumtok() != nullptr; + int type = 0; + GNode *head = nullptr, *tail = nullptr, **marks; + + fc->anchorMarkInfo.clear(); + + if ( ctx->startpat != nullptr ) + tail = concatenatePattern(&head, ctx->startpat); + + if ( TOK(ctx->valueRecord()) != nullptr ) { + if ( tail == nullptr ) { + fc->featMsg(hotERROR, "Glyph or glyph class must precede a value record."); + return nullptr; + } + type = GPOSSingle; + getValueRecord(ctx->valueRecord(), tail->metricsInfo); + for (auto vp : ctx->valuePattern()) { + tail = concatenatePatternElement(&tail, vp->patternElement()); + if ( vp->valueRecord() ) + getValueRecord(vp->valueRecord(), tail->metricsInfo); + } + } else if ( ctx->LOOKUP().size() != 0 ) { + if ( tail == nullptr ) { + TOK(ctx->LOOKUP(0)); + fc->featMsg(hotERROR, "Glyph or glyph class must precede a lookup reference in a contextual rule."); + return nullptr; + } + type = GPOSChain; + for (auto l : ctx->label()) { + tail->lookupLabels[tail->lookupLabelCount++] = fc->getLabelIndex(TOK(l)->getText()); + if ( tail->lookupLabelCount > 255 ) + fc->featMsg(hotFATAL, "Too many lookup references in one glyph position."); + } + for (auto lpe : ctx->lookupPatternElement()) { + tail->nextSeq = getLookupPatternElement(lpe, true); + tail = tail->nextSeq; + } + } else if ( ctx->cursiveElement() != nullptr ) { + type = GPOSCursive; + tail = concatenatePatternElement(tail == nullptr ? &head : &tail, + ctx->cursiveElement()->patternElement()); + tail->flags |= FEAT_IS_BASE_NODE; + for (auto a : ctx->cursiveElement()->anchor()) + translateAnchor(a, 0); + if ( ctx->endpat != nullptr ) + tail = concatenatePattern(&tail, ctx->endpat); + } else if ( ctx->MARKBASE() != nullptr ) { + type = GPOSMarkToBase; + tail = concatenatePattern(tail == nullptr ? &head : &tail, ctx->midpat, FEAT_IS_BASE_NODE); + marks = &tail->nextSeq; + for (auto mbe : ctx->baseToMarkElement()) { + translateAnchor(mbe->anchor(), 0); + fc->addMarkClass(TOK(mbe->GCLASS())->getText()); + if ( mbe->MARKER() != nullptr ) + marks = fc->copyGlyphClass(marks, fc->lookupGlyphClass(mbe->GCLASS()->getText())); + } + if ( tail->nextSeq != nullptr ) { + tail->flags |= FEAT_MARKED; + tail = tail->nextSeq; + tail->flags |= FEAT_IS_MARK_NODE; + } + if ( ctx->endpat != nullptr ) + tail = concatenatePattern(&tail, ctx->endpat); + } else if ( ctx->markligtok() != nullptr ) { + type = GPOSMarkToLigature; + int componentIndex = 0; + tail = concatenatePattern(tail == nullptr ? &head : &tail, ctx->midpat, FEAT_IS_BASE_NODE); + marks = &tail->nextSeq; + for (auto lme : ctx->ligatureMarkElement()) { + bool isNULL = translateAnchor(lme->anchor(), componentIndex); + if ( lme->MARK() ) { + fc->addMarkClass(TOK(lme->GCLASS())->getText()); + } else if ( !isNULL ) + fc->featMsg(hotERROR, "In mark to ligature, non-null anchor must be followed by a mark class."); + if ( lme->LIG_COMPONENT() != nullptr ) + componentIndex++; + if ( lme->MARKER() != nullptr ) + marks = fc->copyGlyphClass(marks, fc->lookupGlyphClass(lme->GCLASS()->getText())); + } + if ( tail->nextSeq != nullptr ) { + tail->flags |= FEAT_MARKED; + tail = tail->nextSeq; + tail->flags |= FEAT_IS_MARK_NODE; + } + if ( ctx->endpat != nullptr ) + tail = concatenatePattern(&tail, ctx->endpat); + } else { + assert(ctx->MARK() != nullptr); + type = GPOSMarkToMark; + tail = concatenatePattern(tail == nullptr ? &head : &tail, ctx->midpat, FEAT_IS_BASE_NODE); + marks = &tail->nextSeq; + for (auto mbe : ctx->baseToMarkElement()) { + translateAnchor(mbe->anchor(), 0); + fc->addMarkClass(TOK(mbe->GCLASS())->getText()); + if ( mbe->MARKER() != nullptr ) + marks = fc->copyGlyphClass(marks, fc->lookupGlyphClass(mbe->GCLASS()->getText())); + } + if ( tail->nextSeq != nullptr ) { + tail->flags |= FEAT_MARKED; + tail = tail->nextSeq; + tail->flags |= FEAT_IS_MARK_NODE; + } + if ( ctx->endpat != nullptr ) + tail = concatenatePattern(&tail, ctx->endpat); + } + assert(head != nullptr); + fc->addPos(head, type, enumerate); + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitParameters(FeatParser::ParametersContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + size_t s = ctx->fixedNum().size(); + if ( s > MAX_FEAT_PARAM_NUM ) { + TOK(ctx->fixedNum(0)); + fc->featMsg(hotERROR, "Too many parameter values."); + s = MAX_FEAT_PARAM_NUM; + } + fc->featNameID = 0; + std::vector p(s); + for (size_t i=0; i < s; ++i) + p[i] = getFixed(ctx->fixedNum(i), true); + fc->addFeatureParam(p); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitSizemenuname(FeatParser::SizemenunameContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + long v[3] {-1, -1, -1}; + assert(ctx->genNum().size() == 0 || ctx->genNum().size() == 1 || + ctx->genNum().size() == 3); + + for (size_t i = 0; i < ctx->genNum().size(); ++i) + v[i] = getNum(TOK(ctx->genNum(i))->getText()); + + if ( ctx->genNum().size() > 0 && + v[0] != HOT_NAME_MS_PLATFORM && v[0] != HOT_NAME_MAC_PLATFORM ) { + TOK(ctx->genNum(0)); + fc->featMsg(hotERROR, "platform id must be %d or %d", + HOT_NAME_MS_PLATFORM, HOT_NAME_MAC_PLATFORM); + } + + fc->addSizeNameString(v[0], v[1], v[2], TOK(ctx->STRVAL())->getText()); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitFeatureNames(FeatParser::FeatureNamesContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::nameEntryFile; + + if ( stage == vExtract ) { + fc->sawFeatNames = true; + fc->featNameID = nameReserveUserID(fc->g); + fc->addNameFn = &FeatCtx::addFeatureNameString; + } + + for (auto i : ctx->nameEntryStatement()) + visitNameEntryStatement(i); + + if ( stage == vExtract ) { + fc->addFeatureNameParam(); + } + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitSubtable(FeatParser::SubtableContext *ctx) { + if ( stage != vExtract ) + return nullptr; + TOK(ctx); + fc->subtableBreak(); + return nullptr; +} + +// ---------------------------- Feature-specific ----------------------------- + +antlrcpp::Any FeatVisitor::visitLookupBlockOrUse(FeatParser::LookupBlockOrUseContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::statementFile; + if ( stage == vExtract ) { + if ( ctx->RCBRACE() == nullptr ) { + fc->useLkp(TOK(ctx->startlabel)->getText()); + include_ep = tmp_ep; + return nullptr; + } + checkLabel(ctx->startlabel, ctx->endlabel); + fc->startLookup(TOK(ctx->startlabel)->getText(), false); + if ( ctx->USE_EXTENSION() != nullptr ) + fc->flagExtension(true); + } + + for (auto i : ctx->statement()) + visitStatement(i); + + if ( stage == vExtract ) { + TOK(ctx->endlabel); + fc->endLookup(); + } + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitCvParameterBlock(FeatParser::CvParameterBlockContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::cvStatementFile; + if ( stage == vExtract ) { + fc->clearCVParameters(); + fc->featNameID = 0; + } + + for (auto i : ctx->cvParameterStatement()) + visitCvParameterStatement(i); + + if ( stage == vExtract ) { + fc->addCVParam(); + } + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitCvParameter(FeatParser::CvParameterContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + int en = 0; + if ( ctx->CV_UI_LABEL() != nullptr ) + en = FeatCtx::cvUILabelEnum; + else if ( ctx->CV_TOOLTIP() != nullptr ) + en = FeatCtx::cvToolTipEnum; + else if ( ctx->CV_SAMPLE_TEXT() != nullptr ) + en = FeatCtx::cvSampleTextEnum; + else if ( ctx->CV_PARAM_LABEL() != nullptr ) + en = FeatCtx::kCVParameterLabelEnum; + else + assert(ctx->CV_CHARACTER() != nullptr); + + if ( en != 0 ) { + fc->addNameFn = &FeatCtx::addFeatureNameString; + for (auto i : ctx->nameEntryStatement()) + visitNameEntryStatement(i); + fc->addCVNameID(en); + } else + fc->addCVParametersCharValue(getNum(TOK(ctx->genNum())->getText(), 0)); + return nullptr; +} + +// --------------------------------- Tables ---------------------------------- + +antlrcpp::Any FeatVisitor::visitTable_BASE(FeatParser::Table_BASEContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::baseFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->BASE(0))->getText())); + } + + for (auto i : ctx->baseStatement()) + visitBaseStatement(i); + + if ( stage == vExtract ) { + if ( fc->axistag_count != 0 ) + fc->featMsg(hotERROR, fc->axistag_visitor, fc->axistag_token, + "BaseTagList without corresponding BaseScriptList"); + fc->axistag_count = 0; + fc->axistag_token = nullptr; + fc->axistag_visitor = nullptr; + } + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAxisTags(FeatParser::AxisTagsContext *ctx) { + if ( stage != vExtract ) + return nullptr; + assert(ctx->HA_BTL() != nullptr || ctx->VA_BTL() != nullptr); + + if ( fc->axistag_count != 0 ) + fc->featMsg(hotERROR, fc->axistag_visitor, fc->axistag_token, + "BaseTagList without corresponding BaseScriptList"); + + fc->axistag_vert = ctx->VA_BTL() != nullptr; + fc->axistag_count = ctx->tag().size(); + fc->axistag_token = ctx->getStart(); + fc->axistag_visitor = this; + + TOK(ctx); + if ( fc->axistag_vert ) { + if ( fc->sawBASEvert ) + fc->featMsg(hotERROR, "VertAxis.BaseTagList must only be specified once"); + fc->sawBASEvert = true; + } else { + if ( fc->sawBASEhoriz ) + fc->featMsg(hotERROR, "HorizAxis.BaseTagList must only be specified once"); + fc->sawBASEhoriz = true; + } + + std::vector tv; + tv.reserve(fc->axistag_count); + for (auto t : ctx->tag()) + tv.push_back(fc->str2tag(TOK(t)->getText())); + BASESetBaselineTags(fc->g, fc->axistag_vert, tv.size(), tv.data()); + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAxisScripts(FeatParser::AxisScriptsContext *ctx) { + if ( stage != vExtract ) + return nullptr; + assert(ctx->HA_BSL() != nullptr || ctx->VA_BSL() != nullptr); + + if ( ctx->HA_BSL() != nullptr && fc->axistag_vert ) + fc->featMsg(hotERROR, "expecting \"VertAxis.BaseScriptList\""); + else if ( ctx->VA_BSL() != nullptr && !fc->axistag_vert ) + fc->featMsg(hotERROR, "expecting \"HorizAxis.BaseScriptList\""); + + for (auto bs : ctx->baseScript()) + translateBaseScript(bs, fc->axistag_vert, fc->axistag_count); + + fc->axistag_count = 0; + fc->axistag_token = nullptr; + fc->axistag_visitor = nullptr; + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_GDEF(FeatParser::Table_GDEFContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::gdefFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->GDEF(0))->getText())); + } + + for (auto i : ctx->gdefStatement()) + visitGdefStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitGdefGlyphClass(FeatParser::GdefGlyphClassContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + GNode *gc[4] = {nullptr}; + assert(ctx->glyphClassOptional().size() == 4); + + for (int i = 0; i < 4; ++i) { + auto gco = ctx->glyphClassOptional(i); + if ( gco->glyphClass() != nullptr ) + gc[i] = getGlyphClass(gco->glyphClass(), false); + } + fc->setGDEFGlyphClassDef(gc[0], gc[1], gc[2], gc[3]); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitGdefAttach(FeatParser::GdefAttachContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + GNode *pat = getLookupPattern(ctx->lookupPattern(), false); + if (pat->nextSeq != NULL) + fc->featMsg(hotERROR, + "Only one glyph|glyphClass may be present per" + " AttachTable statement"); + + for (auto n : ctx->NUM()) { + int s = getNum(TOK(n)->getText(), 10); + GNode *next = pat; + while (next != NULL) { + if ( addAttachEntryGDEF(fc->g, next, s) ) + fc->featMsg(hotWARNING, "Skipping duplicate contour index %d", s); + next = next->nextCl; + } + } + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitGdefLigCaretPos(FeatParser::GdefLigCaretPosContext *ctx) { + if ( stage != vExtract ) + return nullptr; + translateGdefLigCaret(ctx->lookupPattern(), ctx->NUM(), 1); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitGdefLigCaretIndex(FeatParser::GdefLigCaretIndexContext *ctx) { + if ( stage != vExtract ) + return nullptr; + translateGdefLigCaret(ctx->lookupPattern(), ctx->NUM(), 2); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_head(FeatParser::Table_headContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::headFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->HEAD(0))->getText())); + } + + for (auto i : ctx->headStatement()) + visitHeadStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitHead(FeatParser::HeadContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + const std::string s = TOK(ctx->POINTNUM())->getText(); + if ( s[0] == '-' ) + fc->featMsg(hotERROR, "Font revision numbers must be positive"); + + fc->setFontRev(s); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_hhea(FeatParser::Table_hheaContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::hheaFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->HHEA(0))->getText())); + } + + for (auto i : ctx->hheaStatement()) + visitHheaStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitHhea(FeatParser::HheaContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + assert(ctx->NUM() != nullptr); + int16_t v = getNum(TOK(ctx->NUM())->getText(), 10); + if ( TOK(ctx->CARET_OFFSET()) != nullptr ) + hheaSetCaretOffset(fc->g, v); + else if ( TOK(ctx->ASCENDER()) != nullptr ) + fc->g->font.hheaAscender = v; + else if ( TOK(ctx->DESCENDER()) != nullptr ) + fc->g->font.hheaDescender = v; + else { + assert(TOK(ctx->LINE_GAP()) != nullptr); + fc->g->font.hheaLineGap = v; + } + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_vhea(FeatParser::Table_vheaContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::vheaFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->VHEA(0))->getText())); + } + + for (auto i : ctx->vheaStatement()) + visitVheaStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitVhea(FeatParser::VheaContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + assert(ctx->NUM() != nullptr); + int16_t v = getNum(TOK(ctx->NUM())->getText(), 10); + if ( TOK(ctx->VERT_TYPO_ASCENDER()) != nullptr ) + fc->g->font.VertTypoAscender = v; + else if ( TOK(ctx->VERT_TYPO_DESCENDER()) != nullptr ) + fc->g->font.VertTypoDescender = v; + else { + assert(TOK(ctx->VERT_TYPO_LINE_GAP()) != nullptr); + fc->g->font.VertTypoLineGap = v; + } + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_name(FeatParser::Table_nameContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::nameFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->NAME(0))->getText())); + } + + for (auto i : ctx->nameStatement()) + visitNameStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitNameID(FeatParser::NameIDContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + long v[4] {-1, -1, -1, -1}; + assert(ctx->genNum().size() == 1 || ctx->genNum().size() == 2 || + ctx->genNum().size() == 4); + + for (size_t i = 0; i < ctx->genNum().size(); ++i) + v[i] = getNum(TOK(ctx->genNum(i))->getText()); + + if ( fc->sawSTAT && v[0] > 255 ) + fc->featMsg(hotFATAL, "name table should be defined before " + "STAT table with nameids above 255"); + if ( fc->sawCVParams && v[0] > 255) + fc->featMsg(hotFATAL, "name table should be defined before " + "GSUB cvParameters with nameids above 255"); + if ( fc->sawFeatNames && v[0] > 255) + fc->featMsg(hotFATAL, "name table should be defined before " + "GSUB featureNames with nameids above 255"); + if ( ctx->genNum().size() > 1 && + v[1] != HOT_NAME_MS_PLATFORM && v[1] != HOT_NAME_MAC_PLATFORM ) { + TOK(ctx->genNum(1)); + fc->featMsg(hotFATAL, "platform id must be %d or %d", + HOT_NAME_MS_PLATFORM, HOT_NAME_MAC_PLATFORM); + } + fc->addNameString(v[1], v[2], v[3], v[0], TOK(ctx->STRVAL())->getText()); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_vmtx(FeatParser::Table_vmtxContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::vmtxFile; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->VMTX(0))->getText())); + } + + for (auto i : ctx->vmtxStatement()) + visitVmtxStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitVmtx(FeatParser::VmtxContext *ctx) { + if ( stage != vExtract ) + return nullptr; + GID gid = getGlyph(ctx->glyph(), false); + int16_t v = getNum(TOK(ctx->NUM())->getText(), 10); + TOK(ctx); + if ( ctx->VERT_ORIGIN_Y() != nullptr ) + hotAddVertOriginY(fc->g, gid, v); + else { + assert(ctx->VERT_ADVANCE_Y() != nullptr); + hotAddVertAdvanceY(fc->g, gid, v); + } + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_STAT(FeatParser::Table_STATContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::statFile; + if ( stage == vExtract ) { + fc->sawSTAT = true; + fc->startTable(fc->str2tag(TOK(ctx->STAT(0))->getText())); + } + + for (auto i : ctx->statStatement()) + visitStatStatement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitDesignAxis(FeatParser::DesignAxisContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::nameEntryFile; + + if ( stage == vExtract ) { + fc->featNameID = 0; + fc->addNameFn = &FeatCtx::addUserNameString; + } + + for (auto i : ctx->nameEntryStatement()) + visitNameEntryStatement(i); + + if ( stage == vExtract ) { + STATAddDesignAxis(fc->g, fc->str2tag(TOK(ctx->tag())->getText()), + fc->featNameID, + getNum(TOK(ctx->NUM())->getText())); + fc->featNameID = 0; + } + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitNameEntry(FeatParser::NameEntryContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + long v[3] {-1, -1, -1}; + assert(ctx->genNum().size() == 0 || ctx->genNum().size() == 1 || + ctx->genNum().size() == 3); + + for (size_t i = 0; i < ctx->genNum().size(); ++i) + v[i] = getNum(TOK(ctx->genNum(i))->getText()); + + if ( ctx->genNum().size() > 0 && + v[0] != HOT_NAME_MS_PLATFORM && v[0] != HOT_NAME_MAC_PLATFORM ) { + TOK(ctx->genNum(0)); + fc->featMsg(hotERROR, "platform id must be %d or %d", + HOT_NAME_MS_PLATFORM, HOT_NAME_MAC_PLATFORM); + } + + (fc->*(fc->addNameFn))(v[0], v[1], v[2], TOK(ctx->STRVAL())->getText()); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAxisValue(FeatParser::AxisValueContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::axisValueFile; + if ( stage == vExtract ) { + fc->featNameID = fc->stat.flags = fc->stat.format = fc->stat.prev = 0; + fc->stat.axisTags.clear(); + fc->stat.values.clear(); + fc->addNameFn = &FeatCtx::addUserNameString; + } + + for (auto i : ctx->axisValueStatement()) + visitAxisValueStatement(i); + + if ( stage == vExtract ) { + if ( fc->stat.format == 0 ) + fc->featMsg(hotERROR, "AxisValue missing location statement"); + if ( fc->featNameID == 0 ) + fc->featMsg(hotERROR, "AxisValue missing name entry"); + STATAddAxisValueTable(fc->g, fc->stat.format, fc->stat.axisTags.data(), + fc->stat.values.data(), fc->stat.values.size(), + fc->stat.flags, fc->featNameID, + fc->stat.min, fc->stat.max); + } + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAxisValueFlags(FeatParser::AxisValueFlagsContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + if ( ctx->AXIS_OSFA().size() != 0 ) + fc->stat.flags |= 0x1; + if ( ctx->AXIS_EAVN().size() != 0 ) + fc->stat.flags |= 0x2; + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitAxisValueLocation(FeatParser::AxisValueLocationContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + Tag t = fc->str2tag(TOK(ctx->tag())->getText()); + fc->stat.format = 1; + Fixed v = getFixed(ctx->fixedNum(0)); + if ( ctx->fixedNum().size() > 1 ) { + fc->stat.format = 3; + fc->stat.min = getFixed(ctx->fixedNum(1)); + } + if ( ctx->fixedNum().size() > 2 ) { + fc->stat.format = 2; + fc->stat.max = getFixed(ctx->fixedNum(2)); + } + if ( fc->stat.prev != 0 && (fc->stat.prev != 1 || fc->stat.format != fc->stat.prev) ) + fc->featMsg(hotERROR, "AxisValue with unsupported multiple location statements"); + fc->stat.axisTags.push_back(t); + fc->stat.values.push_back(v); + fc->stat.prev = fc->stat.format; + + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitElidedFallbackName(FeatParser::ElidedFallbackNameContext *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::nameEntryFile; + if ( stage == vExtract ) { + fc->featNameID = 0; + fc->addNameFn = &FeatCtx::addUserNameString; + } + + for (auto i : ctx->nameEntryStatement()) + visitNameEntryStatement(i); + + if ( stage == vExtract ) { + if ( !STATSetElidedFallbackNameID(fc->g, fc->featNameID) ) + fc->featMsg(hotERROR, "ElidedFallbackName already defined."); + fc->featNameID = 0; + } + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitElidedFallbackNameID(FeatParser::ElidedFallbackNameIDContext *ctx) { + if ( stage != vExtract ) + return nullptr; + + uint16_t v = getNum(TOK(ctx->genNum())->getText()); + if ( !STATSetElidedFallbackNameID(fc->g, v) ) + fc->featMsg(hotERROR, "ElidedFallbackName already defined."); + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitTable_OS_2(FeatParser::Table_OS_2Context *ctx) { + EntryPoint tmp_ep = include_ep; + include_ep = &FeatParser::os_2File; + if ( stage == vExtract ) { + fc->startTable(fc->str2tag(TOK(ctx->OS_2(0))->getText())); + } + + for (auto i : ctx->os_2Statement()) + visitOs_2Statement(i); + + include_ep = tmp_ep; + return nullptr; +} + +antlrcpp::Any FeatVisitor::visitOs_2(FeatParser::Os_2Context *ctx) { + if ( stage != vExtract ) + return nullptr; + + if ( ctx->num != nullptr ) { + int16_t v = getNum(TOK(ctx->num)->getText(), 10); + if ( ctx->TYPO_ASCENDER() != nullptr ) + fc->g->font.TypoAscender = v; + else if ( ctx->TYPO_DESCENDER() != nullptr ) + fc->g->font.TypoDescender = v; + else if ( ctx->TYPO_LINE_GAP() != nullptr ) + fc->g->font.TypoLineGap = v; + else if ( ctx->WIN_ASCENT() != nullptr ) + fc->g->font.winAscent = v; + else if ( ctx->WIN_DESCENT() != nullptr ) + fc->g->font.winDescent = v; + else if ( ctx->X_HEIGHT() != nullptr ) + fc->g->font.win.XHeight = v; + else { + assert(ctx->CAP_HEIGHT() != nullptr); + fc->g->font.win.CapHeight = v; + } + } else if ( ctx->unum != nullptr ) { + uint16_t v = getNum(TOK(ctx->unum)->getText(), 10); + if ( ctx->FS_TYPE() != nullptr || ctx->FS_TYPE_v() != nullptr ) + OS_2SetFSType(fc->g, v); + else if ( ctx->WEIGHT_CLASS() != nullptr ) + OS_2SetWeightClass(fc->g, v); + else if ( ctx->WIDTH_CLASS() != nullptr ) + OS_2SetWidthClass(fc->g, v); + else if ( ctx->OS2_LOWER_OP_SIZE() != nullptr ) + OS_2LowerOpticalPointSize(fc->g, v); + else { + assert(ctx->OS2_UPPER_OP_SIZE() != nullptr); + OS_2UpperOpticalPointSize(fc->g, v); + } + } else if ( ctx->gnum != nullptr ) { + assert(ctx->FAMILY_CLASS() != nullptr); + OS_2FamilyClass(fc->g, getNum(TOK(ctx->gnum)->getText())); + } else if ( ctx->STRVAL() != nullptr ) { + assert(ctx->VENDOR() != nullptr); + fc->addVendorString(TOK(ctx->STRVAL())->getText()); + } else if ( ctx->PANOSE() != nullptr ) { + assert(ctx->NUM().size() == 10); + uint8_t p[10]; + for (size_t i=0; i < 10; ++i) + p[i] = getNum(TOK(ctx->NUM(i))->getText(), 10); + OS_2SetPanose(fc->g, (char *) p); + } else if ( ctx->UNICODE_RANGE() != nullptr ) { + std::vector ur(kLenUnicodeList, FeatCtx::kCodePageUnSet); + size_t s = std::min(ctx->NUM().size(), (size_t)kLenUnicodeList); + for (size_t i=0; i < s; ++i) + ur[i] = getNum(TOK(ctx->NUM(i))->getText(), 10); + TOK(ctx->UNICODE_RANGE()); + fc->setUnicodeRange((short *) ur.data()); + } else { + assert(ctx->CODE_PAGE_RANGE() != nullptr); + std::vector cpr(kLenCodePageList, FeatCtx::kCodePageUnSet); + size_t s = std::min(ctx->NUM().size(), (size_t)kLenCodePageList); + for (size_t i=0; i < s; ++i) + cpr[i] = getNum(TOK(ctx->NUM(i))->getText(), 10); + TOK(ctx->CODE_PAGE_RANGE()); + fc->setCodePageRange((short *) cpr.data()); + } + + return nullptr; +} + +// -------------------------- Translation Visitors ---------------------------- + +void FeatVisitor::translateBaseScript(FeatParser::BaseScriptContext *ctx, + bool vert, size_t cnt) { + Tag script = fc->str2tag(TOK(ctx->script)->getText()); + Tag db = fc->str2tag(TOK(ctx->db)->getText()); + + std::vector sv; + sv.reserve(cnt); + + if ( ctx->NUM().size() != cnt ) { + if ( ctx->NUM().size() > cnt ) + sv.reserve(ctx->NUM().size()); + TOK(ctx); + fc->featMsg(hotERROR, "The number of coordinates is not equal to " + "the number of baseline tags"); + } + + for (auto n : ctx->NUM()) + sv.push_back(getNum(TOK(n)->getText(), 10)); + + BASEAddScript(fc->g, vert, script, db, sv.data()); +} + +void FeatVisitor::translateGdefLigCaret(FeatParser::LookupPatternContext *pctx, + std::vector nv, + unsigned short format) { + assert(stage == vExtract); + + GNode *pat = getLookupPattern(pctx, false); + if (pat->nextSeq != NULL) + fc->featMsg(hotERROR, "Only one glyph|glyphClass may be present per" + " LigatureCaret statement"); + + std::vector sv; + sv.reserve(nv.size()); + for (auto n : nv) + sv.push_back(getNum(TOK(n)->getText(), 10)); + + GNode *next = pat; + while ( next != nullptr ) { + addLigCaretEntryGDEF(fc->g, next, sv.data(), sv.size(), format); + next = next->nextCl; + } +} + +bool FeatVisitor::translateAnchor(FeatParser::AnchorContext *ctx, + int componentIndex) { + FeatCtx::AnchorDef a; + + if ( ctx->KNULL() != nullptr ) { + fc->addAnchorByValue(a, true, componentIndex); + return true; + } else if ( ctx->name != NULL ) { + fc->addAnchorByName(TOK(ctx->name)->getText(), componentIndex); + } else { + assert(ctx->xval != nullptr && ctx->yval != nullptr); + a.x = getNum(TOK(ctx->xval)->getText(), 10); + a.y = getNum(TOK(ctx->yval)->getText(), 10); + if ( ctx->cp != nullptr ) { + a.contourpoint = getNum(TOK(ctx->cp)->getText(), 10); + a.hasContour = true; + } + fc->addAnchorByValue(a, false, componentIndex); + } + return false; +} + +// --------------------------- Retrieval Visitors ----------------------------- + +void FeatVisitor::getValueRecord(FeatParser::ValueRecordContext *ctx, + MetricsInfo &mi) { + if ( ctx->valuename != nullptr ) + fc->getValueDef(TOK(ctx->valuename)->getText(), mi); + else + getValueLiteral(ctx->valueLiteral(), mi); +} + +void FeatVisitor::getValueLiteral(FeatParser::ValueLiteralContext *ctx, + MetricsInfo &mi) { + mi.cnt = ctx->NUM().size(); + assert(mi.cnt == 1 || mi.cnt == 4); + for (int16_t i = 0; i < mi.cnt; ++i) + mi.metrics[i] = getNum(TOK(ctx->NUM(i))->getText(), 10); +} + +GNode *FeatVisitor::getLookupPattern(FeatParser::LookupPatternContext *ctx, + bool markedOK) { + GNode *ret, **insert = &ret; + assert(stage == vExtract); + + for (auto &pe : ctx->lookupPatternElement()) { + *insert = getLookupPatternElement(pe, markedOK); + if ( (*insert)->flags & FEAT_LOOKUP_NODE ) { + (*insert)->flags &= ~FEAT_LOOKUP_NODE; + ret->flags |= FEAT_LOOKUP_NODE; + } + insert = &(*insert)->nextSeq; + } + return ret; +} + +GNode *FeatVisitor::getLookupPatternElement(FeatParser::LookupPatternElementContext *ctx, + bool markedOK) { + GNode *ret = getPatternElement(ctx->patternElement(), markedOK); + for (auto l : ctx->label()) { + int labelIndex = fc->getLabelIndex(TOK(l)->getText()); + ret->lookupLabels[ret->lookupLabelCount++] = labelIndex; + if ( ret->lookupLabelCount > 255 ) + fc->featMsg(hotFATAL, "Too many lookup references in one glyph position."); + // temporary tracking state will move to the head + ret->flags |= FEAT_LOOKUP_NODE; + } + return ret; +} + +GNode *FeatVisitor::concatenatePattern(GNode **loc, + FeatParser::PatternContext *ctx, + int flags) { + GNode *ret = *loc, **insert = loc; + bool first = true; + assert(stage == vExtract); + + if ( *insert != nullptr ) + insert = &(*insert)->nextSeq; + + for (auto &pe : ctx->patternElement()) { + ret = *insert = getPatternElement(pe, true); + if ( first && flags != 0 ) + ret->flags |= flags; + first = false; + insert = &(*insert)->nextSeq; + } + return ret; +} + +GNode *FeatVisitor::concatenatePatternElement(GNode **loc, + FeatParser::PatternElementContext *ctx) { + assert(stage == vExtract); + + if ( *loc != nullptr ) + loc = &(*loc)->nextSeq; + + *loc = getPatternElement(ctx, true); + return *loc; +} + +GNode *FeatVisitor::getPatternElement(FeatParser::PatternElementContext *ctx, + bool markedOK) { + GNode *ret; + + if ( ctx->glyph() != nullptr ) { + ret = fc->setNewNode(getGlyph(ctx->glyph(), false)); + } else { + assert(ctx->glyphClass() != nullptr); + ret = getGlyphClass(ctx->glyphClass(), false); + } + if ( ctx->MARKER() != nullptr ) { + if ( markedOK ) + ret->flags |= FEAT_MARKED; + else { + TOK(ctx->MARKER()); + fc->featMsg(hotERROR, "cannot mark a replacement glyph pattern"); + } + } + return ret; +} + +GNode *FeatVisitor::getGlyphClass(FeatParser::GlyphClassContext *ctx, + bool dontcopy) { + assert(stage == vExtract); + getGlyphClassAsCurrentGC(ctx, nullptr, dontcopy); + TOK(ctx); + return fc->finishCurrentGC(); +} + +GID FeatVisitor::getGlyph(FeatParser::GlyphContext *ctx, bool allowNotDef) { + assert(stage == vExtract); + if ( ctx->CID() != nullptr ) + return fc->cid2gid(TOK(ctx->CID())->getText()); + else { + assert(ctx->glyphName() != nullptr); + return fc->mapGName2GID(TOK(ctx->glyphName())->getText(), allowNotDef); + } +} + +// -------------------------------- Utility ---------------------------------- + +void FeatVisitor::getGlyphClassAsCurrentGC(FeatParser::GlyphClassContext *ctx, + antlr4::tree::TerminalNode *target_gc, + bool dontcopy) { + assert(stage == vExtract); + if ( ctx->GCLASS() != nullptr && dontcopy ) { + fc->openAsCurrentGC(TOK(ctx->GCLASS())->getText()); + return; + } + + TOK(ctx); + if ( target_gc != nullptr ) + fc->defineCurrentGC(TOK(target_gc)->getText()); + else + fc->resetCurrentGC(); + + if ( ctx->gcLiteral() != nullptr ) { + addGCLiteralToCurrentGC(ctx->gcLiteral()); + } else { + assert(ctx->GCLASS() != nullptr); + fc->addGlyphClassToCurrentGC(TOK(ctx->GCLASS())->getText()); + } + if ( fc->curGCHead != nullptr ) + fc->curGCHead->flags |= FEAT_GCLASS; +} + +void FeatVisitor::addGCLiteralToCurrentGC(FeatParser::GcLiteralContext *ctx) { + assert(stage == vExtract); + for (auto &gcle : ctx->gcLiteralElement()) { + if ( gcle->GCLASS() != nullptr ) { + fc->addGlyphClassToCurrentGC(TOK(gcle->GCLASS())->getText()); + } else { + assert(gcle->startg != nullptr); + /* The tokenizing stage doesn't separate a hyphen from a glyph + * name if there are no spaces. So startg could be something like + * "a-r". If it is then "a-r - z" is an error, so if endg is + * defined we just assume startg is a normal glyphname and let + * the calls handle any errors. + * + * XXX The grammar doesn't currently parse "a- z" as a range. + */ + if ( gcle->endg != nullptr ) { + GID sgid = getGlyph(gcle->startg, false); + GID egid = getGlyph(gcle->endg, false); + fc->addRangeToCurrentGC(sgid, egid, + TOK(gcle->startg)->getText(), + gcle->endg->getText()); + } else { + auto g = gcle->startg; + GID gid = getGlyph(g, true); + if ( gid == GID_UNDEF ) { // Could be a range + // Can't be a CID because that pattern doesn't have a hyphen + assert(g->CID() == nullptr && g->glyphName() != nullptr); + auto gn = TOK(g->glyphName())->getText(); + auto hpos = gn.find('-'); + if ( hpos == std::string::npos ) { + gid = getGlyph(g, false); // For error + assert(gid == GID_NOTDEF); + // Add notdef so processing can continue + fc->addGlyphToCurrentGC(gid); + return; + } + auto sgname = gn.substr(0, hpos); + auto egname = gn.substr(hpos+1, std::string::npos); + gid = fc->mapGName2GID(sgname, false); + GID egid = fc->mapGName2GID(egname, false); + // XXX Letting this call handle undefined glyphs + fc->addRangeToCurrentGC(gid, egid, sgname, egname); + } else + fc->addGlyphToCurrentGC(gid); + } + } + } +} + +Tag FeatVisitor::checkTag(FeatParser::TagContext *start, + FeatParser::TagContext *end) { + Tag stag = TAG_UNDEF, etag = TAG_UNDEF; + if ( start != NULL ) + stag = fc->str2tag(TOK(start)->getText()); + if ( end != NULL ) + etag = fc->str2tag(TOK(end)->getText()); + + if ( stag != etag ) + fc->featMsg(hotERROR, "End tag %c%c%c%c does not match " + "start tag %c%c%c%c.", + TAG_ARG(etag), TAG_ARG(stag)); + + return stag; +} + +void FeatVisitor::checkLabel(FeatParser::LabelContext *start, + FeatParser::LabelContext *end) { + if ( start == nullptr || end == nullptr || + start->getText() != end->getText() ) + fc->featMsg(hotERROR, "End label %s does not match start label %s.", + TOK(end)->getText().c_str(), start->getText().c_str()); +} + +template +T FeatVisitor::getNum(const std::string &str, int base) { + char *end; + + int64_t v = strtoll(str.c_str(), &end, base); + if ( end == str.c_str() ) + fc->featMsg(hotERROR, "Could not parse numeric string"); + + using NL = std::numeric_limits; + if ( v < NL::min() || v > NL::max() ) { + fc->featMsg(hotERROR, "Number not in range [%ld, %ld]", + (long) NL::min(), (long) NL::max()); + } + return (T) v; +} + +template +T FeatVisitor::getFixed(FeatParser::FixedNumContext *ctx, bool param) { + float mult = param ? 1.0 : 65536.0; + + if ( ctx->NUM() != nullptr ) + return (T) mult * getNum(TOK(ctx->NUM())->getText(), 10); + + mult = param ? 10.0 : 65536.0; + + assert(ctx->POINTNUM() != nullptr); + auto str = TOK(ctx->POINTNUM())->getText(); + char *end; + long v = (long)floor(0.5 + mult*strtod(str.c_str(), &end)); + if ( end == str.c_str() ) + fc->featMsg(hotERROR, "Could not parse numeric string"); + + using NL = std::numeric_limits; + if ( v < NL::min() || v > NL::max() ) { + if ( param ) + fc->featMsg(hotERROR, "Number not in range [%ld, %ld]", + (long) NL::min(), (long) NL::max()); + else + fc->featMsg(hotERROR, "Number not in range [-32768.0, 32767.99998]"); + } + return (T) v; +} diff --git a/c/makeotf/lib/hotconv/FeatVisitor.h b/c/makeotf/lib/hotconv/FeatVisitor.h new file mode 100644 index 000000000..be182e243 --- /dev/null +++ b/c/makeotf/lib/hotconv/FeatVisitor.h @@ -0,0 +1,246 @@ +/* Copyright 2021 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. + * This software is licensed as OpenSource, under the Apache License, Version 2.0. + * This license is available at: http://opensource.org/licenses/Apache-2.0. + */ + +#pragma once + +#include "FeatLexer.h" +#include "FeatParserBaseVisitor.h" +#include "FeatCtx.h" +#include "feat.h" + +#include "antlr4-runtime.h" +#include "assert.h" +#include "BaseErrorListener.h" +#include +#include +#include + +/* Include handling: + * + * There is one FeatVisitor object per top-level or included file, with the + * lexer, parser, and tree of that file. The top_ep variable stores the + * FeatParser method pointer to the parsing function for the context of the + * include directive in the "parent" file, which is passed in at construction + * time. + */ + +typedef antlr4::ParserRuleContext *(FeatParser::*FeatParsingEntry)(); + +class FeatVisitor : public FeatParserBaseVisitor { + friend class FeatCtx; + public: + typedef std::function EntryPoint; + + FeatVisitor() = delete; + FeatVisitor(FeatCtx *fc, const char *pathname, + FeatVisitor *parent = nullptr, + EntryPoint ep = &FeatParser::file, + int depth = 0) + : fc(fc), pathname(pathname), parent(parent), + top_ep(ep), depth(depth) { } + virtual ~FeatVisitor(); + + // Main entry functions + void Parse(bool do_includes = true); + void Translate(); + + // Console message reporting utilities + void newFileMsg(char **msg); + void tokenPositionMsg(char **msg, bool full = false); + const char *currentTokStr(); + + // Functions to mark the "current" token before calling into FeatCtx + inline antlr4::Token *TOK(antlr4::Token *t) { current_msg_token = t; return t; } + template ::value>::type* = nullptr> + inline T* TOK(T* t) { if (t) current_msg_token = t->getSymbol(); return t; } + template ::value>::type* = nullptr> + inline T* TOK(T* t) { if (t) current_msg_token = t->getStart(); return t; } + + private: + // Separate stages for parsing included files and extracting data from + // the tree + enum Stage { vInclude = 1, vExtract } stage; + + // Antlr 4 error reporting class + struct FeatErrorListener : public antlr4::BaseErrorListener { + FeatErrorListener() = delete; + explicit FeatErrorListener(FeatVisitor &v) : v(v) {}; + void syntaxError(antlr4::Recognizer *recognizer, antlr4::Token *symbol, + size_t line, size_t charPositionInLine, + const std::string &msg, std::exception_ptr e) override; + FeatVisitor &v; + }; + + // Grammar node visitors + + // Blocks + antlrcpp::Any visitFeatureBlock(FeatParser::FeatureBlockContext *ctx) override; + antlrcpp::Any visitAnonBlock(FeatParser::AnonBlockContext *ctx) override; + antlrcpp::Any visitLookupBlockTopLevel(FeatParser::LookupBlockTopLevelContext *ctx) override; + + // Top-level statements + antlrcpp::Any visitInclude(FeatParser::IncludeContext *ctx) override; + antlrcpp::Any visitLangsysAssign(FeatParser::LangsysAssignContext *ctx) override; + antlrcpp::Any visitValueRecordDef(FeatParser::ValueRecordDefContext *ctx) override; + antlrcpp::Any visitAnchorDef(FeatParser::AnchorDefContext *ctx) override; + antlrcpp::Any visitGlyphClassAssign(FeatParser::GlyphClassAssignContext *ctx) override; + + // Statements (in feature and lookup blocks) + antlrcpp::Any visitFeatureUse(FeatParser::FeatureUseContext *ctx) override; + antlrcpp::Any visitScriptAssign(FeatParser::ScriptAssignContext *ctx) override; + antlrcpp::Any visitLangAssign(FeatParser::LangAssignContext *ctx) override; + antlrcpp::Any visitLookupflagAssign(FeatParser::LookupflagAssignContext *ctx) override; + antlrcpp::Any visitIgnoreSubOrPos(FeatParser::IgnoreSubOrPosContext *ctx) override; + antlrcpp::Any visitSubstitute(FeatParser::SubstituteContext *ctx) override; + antlrcpp::Any visitMark_statement(FeatParser::Mark_statementContext *ctx) override; + antlrcpp::Any visitPosition(FeatParser::PositionContext *ctx) override; + antlrcpp::Any visitParameters(FeatParser::ParametersContext *ctx) override; + antlrcpp::Any visitSizemenuname(FeatParser::SizemenunameContext *ctx); + antlrcpp::Any visitFeatureNames(FeatParser::FeatureNamesContext *ctx) override; + antlrcpp::Any visitSubtable(FeatParser::SubtableContext *ctx) override; + + // Feature-specific + antlrcpp::Any visitLookupBlockOrUse(FeatParser::LookupBlockOrUseContext *ctx) override; + antlrcpp::Any visitCvParameterBlock(FeatParser::CvParameterBlockContext *ctx) override; + antlrcpp::Any visitCvParameter(FeatParser::CvParameterContext *ctx) override; + + // Tables + antlrcpp::Any visitTable_BASE(FeatParser::Table_BASEContext *ctx) override; + antlrcpp::Any visitAxisTags(FeatParser::AxisTagsContext *ctx) override; + antlrcpp::Any visitAxisScripts(FeatParser::AxisScriptsContext *ctx) override; + + antlrcpp::Any visitTable_GDEF(FeatParser::Table_GDEFContext *ctx) override; + antlrcpp::Any visitGdefGlyphClass(FeatParser::GdefGlyphClassContext *ctx) override; + antlrcpp::Any visitGdefAttach(FeatParser::GdefAttachContext *ctx) override; + antlrcpp::Any visitGdefLigCaretPos(FeatParser::GdefLigCaretPosContext *ctx) override; + antlrcpp::Any visitGdefLigCaretIndex(FeatParser::GdefLigCaretIndexContext *ctx) override; + + antlrcpp::Any visitTable_head(FeatParser::Table_headContext *ctx) override; + antlrcpp::Any visitHead(FeatParser::HeadContext *ctx) override; + + antlrcpp::Any visitTable_hhea(FeatParser::Table_hheaContext *ctx) override; + antlrcpp::Any visitHhea(FeatParser::HheaContext *ctx) override; + + antlrcpp::Any visitTable_vhea(FeatParser::Table_vheaContext *ctx) override; + antlrcpp::Any visitVhea(FeatParser::VheaContext *ctx) override; + + antlrcpp::Any visitTable_name(FeatParser::Table_nameContext *ctx) override; + antlrcpp::Any visitNameID(FeatParser::NameIDContext *ctx) override; + + antlrcpp::Any visitTable_vmtx(FeatParser::Table_vmtxContext *ctx) override; + antlrcpp::Any visitVmtx(FeatParser::VmtxContext *ctx) override; + + antlrcpp::Any visitTable_STAT(FeatParser::Table_STATContext *ctx) override; + antlrcpp::Any visitDesignAxis(FeatParser::DesignAxisContext *ctx) override; + antlrcpp::Any visitNameEntry(FeatParser::NameEntryContext *ctx); + antlrcpp::Any visitAxisValue(FeatParser::AxisValueContext *ctx) override; + antlrcpp::Any visitAxisValueFlags(FeatParser::AxisValueFlagsContext *ctx); + antlrcpp::Any visitAxisValueLocation(FeatParser::AxisValueLocationContext *ctx); + antlrcpp::Any visitElidedFallbackName(FeatParser::ElidedFallbackNameContext *ctx) override; + antlrcpp::Any visitElidedFallbackNameID(FeatParser::ElidedFallbackNameIDContext *ctx) override; + + antlrcpp::Any visitTable_OS_2(FeatParser::Table_OS_2Context *ctx) override; + antlrcpp::Any visitOs_2(FeatParser::Os_2Context *ctx) override; + + + // Translating visitors + void translateBaseScript(FeatParser::BaseScriptContext *ctx, bool vert, size_t cnt); + void translateGdefLigCaret(FeatParser::LookupPatternContext *pctx, + std::vector nv, + unsigned short format); + bool translateAnchor(FeatParser::AnchorContext *ctx, int componentIndex); + + + // Retrieval visitors + void getValueRecord(FeatParser::ValueRecordContext *ctx, MetricsInfo &mi); + void getValueLiteral(FeatParser::ValueLiteralContext *ctx, MetricsInfo &mi); + GNode *getLookupPattern(FeatParser::LookupPatternContext *ctx, bool markedOK); + GNode *getLookupPatternElement(FeatParser::LookupPatternElementContext *ctx, bool markedOK); + GNode *concatenatePattern(GNode **loc, FeatParser::PatternContext *ctx, int flags = 0); + GNode *concatenatePatternElement(GNode **loc, FeatParser::PatternElementContext *ctx); + GNode *getPatternElement(FeatParser::PatternElementContext *ctx, bool markedOK); + GNode *getGlyphClass(FeatParser::GlyphClassContext *ctx, bool dontcopy); + GID getGlyph(FeatParser::GlyphContext *ctx, bool allowNotDef); + + + // Utility + void getGlyphClassAsCurrentGC(FeatParser::GlyphClassContext *ctx, + antlr4::tree::TerminalNode *target_gc, + bool dontcopy); + void addGCLiteralToCurrentGC(FeatParser::GcLiteralContext *ctx); + Tag checkTag(FeatParser::TagContext *start, FeatParser::TagContext *end); + void checkLabel(FeatParser::LabelContext *start, FeatParser::LabelContext *end); + + template T getNum(const std::string &str, int base = 0); + template T getFixed(FeatParser::FixedNumContext *ctx, bool param = false); + + + // "Remove" default inherited visitors +#ifndef NDEBUG +#define DEBSTOP assert(false); return nullptr; + antlrcpp::Any visitCursiveElement(FeatParser::CursiveElementContext *) override { DEBSTOP } + antlrcpp::Any visitBaseToMarkElement(FeatParser::BaseToMarkElementContext *) override { DEBSTOP } + antlrcpp::Any visitLigatureMarkElement(FeatParser::LigatureMarkElementContext *) override { DEBSTOP } + antlrcpp::Any visitValuePattern(FeatParser::ValuePatternContext *) override { DEBSTOP } + antlrcpp::Any visitLookupflagElement(FeatParser::LookupflagElementContext *) override { DEBSTOP } + antlrcpp::Any visitValueRecord(FeatParser::ValueRecordContext *) override { DEBSTOP } + antlrcpp::Any visitValueLiteral(FeatParser::ValueLiteralContext *) override { DEBSTOP } + antlrcpp::Any visitAnchor(FeatParser::AnchorContext *) override { DEBSTOP } + antlrcpp::Any visitLookupPattern(FeatParser::LookupPatternContext *) override { DEBSTOP } + antlrcpp::Any visitLookupPatternElement(FeatParser::LookupPatternElementContext *) override { DEBSTOP } + antlrcpp::Any visitPattern(FeatParser::PatternContext *) override { DEBSTOP } + antlrcpp::Any visitPatternElement(FeatParser::PatternElementContext *) override { DEBSTOP } + antlrcpp::Any visitGlyphClassOptional(FeatParser::GlyphClassOptionalContext *) override { DEBSTOP } + antlrcpp::Any visitGlyphClass(FeatParser::GlyphClassContext *) override { DEBSTOP } + antlrcpp::Any visitGcLiteral(FeatParser::GcLiteralContext *) override { DEBSTOP } + antlrcpp::Any visitGcLiteralElement(FeatParser::GcLiteralElementContext *) override { DEBSTOP } + antlrcpp::Any visitGlyph(FeatParser::GlyphContext *) override { DEBSTOP } + antlrcpp::Any visitGlyphName(FeatParser::GlyphNameContext *) override { DEBSTOP } + antlrcpp::Any visitLabel(FeatParser::LabelContext *) override { DEBSTOP } + antlrcpp::Any visitTag(FeatParser::TagContext *) override { DEBSTOP } + antlrcpp::Any visitFixedNum(FeatParser::FixedNumContext *) override { DEBSTOP } + antlrcpp::Any visitGenNum(FeatParser::GenNumContext *) override { DEBSTOP } + antlrcpp::Any visitSubtok(FeatParser::SubtokContext *) override { DEBSTOP } + antlrcpp::Any visitRevtok(FeatParser::RevtokContext *) override { DEBSTOP } + antlrcpp::Any visitAnontok(FeatParser::AnontokContext *) override { DEBSTOP } + antlrcpp::Any visitEnumtok(FeatParser::EnumtokContext *) override { DEBSTOP } + antlrcpp::Any visitPostok(FeatParser::PostokContext *) override { DEBSTOP } + antlrcpp::Any visitMarkligtok(FeatParser::MarkligtokContext *) override { DEBSTOP } +#undef DEBSTOP +#endif + + // State + + FeatCtx *fc; + + // Feature filename and directory name + std::string pathname, dirname; + + // The including file object (or nullptr at the top-level) + FeatVisitor *parent; + + // Set by TOK() methods + antlr4::Token *current_msg_token {nullptr}; + + // State for included files + std::vector includes; + size_t current_include {0}; + EntryPoint top_ep, include_ep; + int depth; + bool need_file_msg {true}; + + /* Antlr 4 parse tree state + * + * It appears that the parse tree is only valid for the lifetime of + * the parser and the parser is only valid for the lifetime of just + * about everything else. Therefore we keep all of it around until the + * object is destroyed. + */ + antlr4::ANTLRInputStream *input {nullptr}; + FeatLexer *lexer {nullptr}; + antlr4::CommonTokenStream *tokens {nullptr}; + FeatParser *parser {nullptr}; + antlr4::tree::ParseTree *tree {nullptr}; +}; diff --git a/c/makeotf/makeotf_lib/source/hotconv/GDEF.c b/c/makeotf/lib/hotconv/GDEF.c similarity index 98% rename from c/makeotf/makeotf_lib/source/hotconv/GDEF.c rename to c/makeotf/lib/hotconv/GDEF.c index 02cafbdb8..2239a0169 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/GDEF.c +++ b/c/makeotf/lib/hotconv/GDEF.c @@ -87,7 +87,6 @@ static LOffset createMarkAttachClassDef(GDEFCtx h); static LOffset createMarkSetClassDef(GDEFCtx h, hotCtx g); static void writeAttachTable(hotCtx g, GDEFCtx h); static void writeLigCaretTable(hotCtx g, GDEFCtx h); -static void writeMarkSetClassDef(hotCtx g, GDEFCtx h); static void writeMarkSetClassTable(hotCtx g, GDEFCtx h); /* --------------------------- Context Definition -------------------------- */ @@ -116,11 +115,11 @@ void GDEFNew(hotCtx g) { /* Link contexts */ h->g = g; g->ctx.GDEF = h; - dnaINIT(g->dnaCtx, h->glyphClasses, 50, 200); - dnaINIT(g->dnaCtx, h->attachEntries, 50, 200); - dnaINIT(g->dnaCtx, h->ligCaretEntries, 50, 200); - dnaINIT(g->dnaCtx, h->markAttachClasses, 50, 200); - dnaINIT(g->dnaCtx, h->markSetClasses, 50, 200); + dnaINIT(g->DnaCTX, h->glyphClasses, 50, 200); + dnaINIT(g->DnaCTX, h->attachEntries, 50, 200); + dnaINIT(g->DnaCTX, h->ligCaretEntries, 50, 200); + dnaINIT(g->DnaCTX, h->markAttachClasses, 50, 200); + dnaINIT(g->DnaCTX, h->markSetClasses, 50, 200); h->offset = 0; h->tbl.GlyphClassDefOffset = 0; @@ -492,7 +491,7 @@ int addAttachEntryGDEF(hotCtx g, GNode *glyphNode, unsigned short contour) { unsigned short *indexEntry; attachEntry = dnaNEXT(h->attachEntries); attachEntry->gid = gid; - dnaINIT(g->dnaCtx, attachEntry->contourIndices, 10, 10); + dnaINIT(g->DnaCTX, attachEntry->contourIndices, 10, 10); indexEntry = dnaNEXT(attachEntry->contourIndices); *indexEntry = contour; } @@ -523,7 +522,7 @@ void addLigCaretEntryGDEF( lge->gid = gid; lge->CaretCount = caretCount; lge->format = format; - dnaINIT(g->dnaCtx, lge->caretTables, caretCount, caretCount); + dnaINIT(g->DnaCTX, lge->caretTables, caretCount, caretCount); for (i = 0; i < caretCount; i++) { CaretTable *ct; @@ -711,7 +710,6 @@ static void validateGlyphClasses(GDEFCtx h, GNode **classList, long numClasses) className2 = "mark attachment class 2"; } for (p1 = headNode1; p1 != NULL;) { - GNode *prev = NULL; for (p2 = headNode2; p2 != NULL;) { if (p1->gid == p2->gid) { hadConflictingClassDef = 1; @@ -720,7 +718,6 @@ static void validateGlyphClasses(GDEFCtx h, GNode **classList, long numClasses) hotMsg(g, hotWARNING, "GDEF MarkAttachment. Glyph '%s' gid '%d'. previous glyph class '%s' conflicts with new class '%s'.", g->note.array, p1->gid, className1, className2); } } - prev = p2; p2 = p2->nextCl; } p1 = p1->nextCl; @@ -783,7 +780,7 @@ static LOffset createMarkSetClassDef(GDEFCtx h, hotCtx g) { Offset size = (Offset)MARK_SET_TABLE_SIZE(h->markSetClasses.cnt); h->markSetClassTable.MarkSetTableFormat = 1; h->markSetClassTable.MarkSetCount = (unsigned short)h->markSetClasses.cnt; - dnaINIT(g->dnaCtx, h->markSetClassTable.markSetEntries, h->markSetClasses.cnt, 10); + dnaINIT(g->DnaCTX, h->markSetClassTable.markSetEntries, h->markSetClasses.cnt, 10); for (i = 0; i < h->markSetClasses.cnt; i++) { GNode *p; otlTbl otl; diff --git a/c/makeotf/makeotf_lib/source/hotconv/GDEF.h b/c/makeotf/lib/hotconv/GDEF.h similarity index 94% rename from c/makeotf/makeotf_lib/source/hotconv/GDEF.h rename to c/makeotf/lib/hotconv/GDEF.h index 3e2fe58f0..c998119a0 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/GDEF.h +++ b/c/makeotf/lib/hotconv/GDEF.h @@ -8,6 +8,10 @@ #include "common.h" #include "feat.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GDEF_ TAG('G', 'D', 'E', 'F') #define kMaxMarkAttachClasses 15 @@ -29,4 +33,8 @@ unsigned short addGlyphMarkClassGDEF(hotCtx g, GNode *markClass); unsigned short addMarkSetClassGDEF(hotCtx g, GNode *markClass); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_GDEF_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/GPOS.c b/c/makeotf/lib/hotconv/GPOS.c similarity index 94% rename from c/makeotf/makeotf_lib/source/hotconv/GPOS.c rename to c/makeotf/lib/hotconv/GPOS.c index d9e2b382c..63cb918c5 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/GPOS.c +++ b/c/makeotf/lib/hotconv/GPOS.c @@ -9,10 +9,11 @@ #include "OS_2.h" #include "otl.h" -#include "map.h" +#include "hotmap.h" #include "feat.h" #include "name.h" +#include #include #include @@ -90,7 +91,7 @@ typedef struct { GID gid; dnaDCL(AnchorMarkInfo, anchorMarkInfo); long componentIndex; /* order in mark to lig statement that this base glyph reference was encountered.*/ - long lineNum; + char *locDesc; } BaseGlyphRec; typedef union { @@ -145,7 +146,6 @@ typedef struct { /* New subtable data */ short pairFmt; /* Fmt (1 or 2) of GPOS pair */ unsigned short pairValFmt1; /* Fmt (1 or 2) of first value record of GPOS pair */ unsigned short pairValFmt2; /* Fmt (1 or 2) of second value record of GPOS pair */ - char *fileName; /* the current feature file name */ } SubtableInfo; struct GPOSCtx_ { @@ -174,7 +174,6 @@ struct GPOSCtx_ { /* Info for chaining contextual lookups */ dnaDCL(SubtableInfo, anonSubtable); /* Anon subtable accumulator */ dnaDCL(PosLookupRecord *, posLookup); /* Pointers to all records that need to be adjusted */ - dnaDCL(GNode *, prod); /* Tmp for cross product */ unsigned short maxContext; @@ -202,11 +201,11 @@ static void fillChain(hotCtx g, GPOSCtx h); static void writeChainPos(hotCtx g, GPOSCtx h, Subtable *sub); static void freeChain3(hotCtx g, GPOSCtx h, Subtable *sub); static void freeChain(hotCtx g, GPOSCtx h, Subtable *sub); -static void checkBaseAnchorConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long recCnt, char *fileName, int isMarkToLigature); +static void checkBaseAnchorConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long recCnt, int isMarkToLigature); static long findMarkClassIndex(SubtableInfo *si, GNode *markNode); -static int addMarkClass(hotCtx g, SubtableInfo *si, GNode *markNode, char *filename, int lineNum); -static void GPOSAdCursive(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, AnchorMarkInfo *anchorMarkInfo, char *fileName, long lineNum); -static void GPOSAddMark(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, AnchorMarkInfo *anchorMarkInfo, char *fileName, long lineNum); +static int addMarkClass(hotCtx g, SubtableInfo *si, GNode *markNode); +static void GPOSAdCursive(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, const AnchorMarkInfo *anchorMarkInfo, const char *locDesc); +static void GPOSAddMark(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, const AnchorMarkInfo *anchorMarkInfo, const char *locDesc); static void fillMarkToBase(hotCtx g, GPOSCtx h); static void writeMarkToBase(hotCtx g, GPOSCtx h, Subtable *sub); static void freeMarkToBase(hotCtx g, Subtable *sub); @@ -223,6 +222,15 @@ static SubtableInfo *addAnonPosRule(hotCtx g, GPOSCtx h, SubtableInfo *cur_si, u static void GPOSAddSingle(hotCtx g, SubtableInfo *si, GNode *targ, int xPlacement, int yPlacement, int xAdvance, int yAdvance); +static void copyStr(hotCtx g, char **dst, const char *src) { + if (src == NULL) { + *dst = NULL; + } else { + *dst = (char *) MEM_NEW(g, strlen(src) + 1); + strcpy(*dst, src); + } +} + #if HOT_DEBUG /* Initialize sub. Not needed; just for debug */ @@ -307,11 +315,11 @@ static void anonSubtableInit(void *ctx, long count, SubtableInfo *si) { hotCtx g = ctx; long i; for (i = 0; i < count; i++) { - dnaINIT(g->dnaCtx, si->rules, 50, 50); - dnaINIT(g->dnaCtx, si->single, 500, 1000); - dnaINIT(g->dnaCtx, si->markClassList, 8, 8); - dnaINIT(g->dnaCtx, si->baseList, 300, 300); - dnaINIT(g->dnaCtx, si->pairs, 1000, 500); + dnaINIT(g->DnaCTX, si->rules, 50, 50); + dnaINIT(g->DnaCTX, si->single, 500, 1000); + dnaINIT(g->DnaCTX, si->markClassList, 8, 8); + dnaINIT(g->DnaCTX, si->baseList, 300, 300); + dnaINIT(g->DnaCTX, si->pairs, 1000, 500); #if HOT_DEBUG si->single.func = initSingle; #endif @@ -324,30 +332,28 @@ void GPOSNew(hotCtx g) { GPOSCtx h = MEM_NEW(g, sizeof(struct GPOSCtx_)); h->new.script = h->new.language = h->new.feature = TAG_UNDEF; - h->new.fileName = NULL; - dnaINIT(g->dnaCtx, h->new.rules, 50, 200); - dnaINIT(g->dnaCtx, h->new.single, 500, 1000); - dnaINIT(g->dnaCtx, h->new.markClassList, 8, 8); - dnaINIT(g->dnaCtx, h->new.baseList, 300, 300); - dnaINIT(g->dnaCtx, h->new.pairs, 1000, 500); + dnaINIT(g->DnaCTX, h->new.rules, 50, 200); + dnaINIT(g->DnaCTX, h->new.single, 500, 1000); + dnaINIT(g->DnaCTX, h->new.markClassList, 8, 8); + dnaINIT(g->DnaCTX, h->new.baseList, 300, 300); + dnaINIT(g->DnaCTX, h->new.pairs, 1000, 500); #if HOT_DEBUG h->new.single.func = initSingle; #endif h->offset.subtable = h->offset.featParam = 0; h->offset.extension = h->offset.extensionSection = 0; - dnaINIT(g->dnaCtx, h->values, 1000, 500); - dnaINIT(g->dnaCtx, h->subtables, 10, 10); - dnaINIT(g->dnaCtx, h->anonSubtable, 3, 10); + dnaINIT(g->DnaCTX, h->values, 1000, 500); + dnaINIT(g->DnaCTX, h->subtables, 10, 10); + dnaINIT(g->DnaCTX, h->anonSubtable, 3, 10); h->anonSubtable.func = anonSubtableInit; - dnaINIT(g->dnaCtx, h->posLookup, 25, 100); - dnaINIT(g->dnaCtx, h->prod, 20, 100); + dnaINIT(g->DnaCTX, h->posLookup, 25, 100); h->startNewPairPosSubtbl = 0; - dnaINIT(g->dnaCtx, h->classDef[0].classInfo, 200, 500); - dnaINIT(g->dnaCtx, h->classDef[0].cov, 50, 100); - dnaINIT(g->dnaCtx, h->classDef[1].classInfo, 200, 500); - dnaINIT(g->dnaCtx, h->classDef[1].cov, 50, 100); + dnaINIT(g->DnaCTX, h->classDef[0].classInfo, 200, 500); + dnaINIT(g->DnaCTX, h->classDef[0].cov, 50, 100); + dnaINIT(g->DnaCTX, h->classDef[1].classInfo, 200, 500); + dnaINIT(g->DnaCTX, h->classDef[1].cov, 50, 100); h->featNameID = 0; h->maxContext = 0; @@ -371,9 +377,7 @@ int GPOSFill(hotCtx g) { hotMsg(g, hotFATAL, "aborting because of errors"); } -#if HOT_FEAT_SUPPORT createAnonLookups(g, h); -#endif /* HOT_FEAT_SUPPORT */ /* Add OTL features */ /* See GSUB.c::GSUBFill() for an explanation of the subtable order */ @@ -401,13 +405,11 @@ int GPOSFill(hotCtx g) { otlDumpSizes(g, h->otl, h->offset.subtable, h->offset.extension); #endif /* HOT_DEBUG */ -#if HOT_FEAT_SUPPORT /* setAnonLookupIndices marks as used not only the anonymous lookups, */ /* but also all lookups that were referenced from chain pos rules, */ /* including the stand-alone lookups. This is why */ /* checkStandAloneTablRefs has to follow setAnonLookupIndices. */ setAnonLookupIndices(g, h); -#endif /* HOT_FEAT_SUPPORT */ checkStandAloneTablRefs(g, h->otl); @@ -627,6 +629,7 @@ void GPOSFree(hotCtx g) { dnaFREE(h->new.markClassList); for (i = 0; i < h->new.baseList.cnt; i++) { dnaFREE(h->new.baseList.array[i].anchorMarkInfo); + MEM_FREE(g, h->new.baseList.array[i].locDesc); } dnaFREE(h->new.baseList); dnaFREE(h->new.single); @@ -639,7 +642,6 @@ void GPOSFree(hotCtx g) { } dnaFREE(h->anonSubtable); dnaFREE(h->posLookup); - dnaFREE(h->prod); dnaFREE(h->classDef[0].classInfo); dnaFREE(h->classDef[0].cov); @@ -1730,7 +1732,7 @@ static void addSpecPair(hotCtx g, GID first, GID second, short metricsCnt1, shor removed. Input GNodes are stored; they are recycled in this function (if fmt1), or at GPOSLookupEnd(?) (if fmt2). */ -void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char *filename, int lineNum) { +void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, const char *locDesc) { GPOSCtx h = g->ctx.GPOS; SubtableInfo *si = (SubtableInfo *)subtableInfo; short metricsCnt1 = 0; @@ -1742,22 +1744,22 @@ void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char unsigned valFmt1 = 0; unsigned valFmt2 = 0; - if (first->metricsInfo == NULL) { + if (first->metricsInfo.cnt == -1) { /* If the only metrics record is applied to the second glyph, then */ /* this is shorthand for applying a single kern value to the first */ /* glyph. The parser enforces that if first->metricsInfo == null, */ /* then the second value record must exist. */ first->metricsInfo = second->metricsInfo; - second->metricsInfo = NULL; - metricsCnt1 = first->metricsInfo->cnt; - values1 = first->metricsInfo->metrics; + second->metricsInfo = METRICSINFOEMPTY; + metricsCnt1 = first->metricsInfo.cnt; + values1 = first->metricsInfo.metrics; } else { /* first->metricsInfo exists, but second->metricsInfo may or may not exist */ - metricsCnt1 = first->metricsInfo->cnt; - values1 = first->metricsInfo->metrics; - if (second->metricsInfo != NULL) { - metricsCnt2 = second->metricsInfo->cnt; - values2 = second->metricsInfo->metrics; + metricsCnt1 = first->metricsInfo.cnt; + values1 = first->metricsInfo.metrics; + if (second->metricsInfo.cnt != -1) { + metricsCnt2 = second->metricsInfo.cnt; + values2 = second->metricsInfo.metrics; } } @@ -1766,13 +1768,14 @@ void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char /* The FEAT_GCLASS is essential for identifying a singleton gclass */ pairFmt = ((first->flags & FEAT_GCLASS || second->flags & FEAT_GCLASS) && !enumerate) ? 2 : 1; - if (first->metricsInfo->cnt == 1) { + if (first->metricsInfo.cnt == 1) { if (isVertFeature(h->new.feature)) { valFmt1 = (unsigned short) ValueYAdvance; } else { valFmt1 = (unsigned short) ValueXAdvance; } } else { + assert(first->metricsInfo.cnt == 4); valFmt1 = makeValueFormat(g, values1[0], values1[1], values1[2], values1[3]); if (valFmt1 == 0) { /* If someone has specified a value of <0 0 0 0>, then valFmt */ @@ -1787,14 +1790,15 @@ void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char } } - if (second->metricsInfo != NULL) { - if (second->metricsInfo->cnt == 1) { + if (second->metricsInfo.cnt != -1) { + if (second->metricsInfo.cnt == 1) { if (isVertFeature(h->new.feature)) { valFmt2 = (unsigned short) ValueYAdvance; } else { valFmt2 = (unsigned short) ValueXAdvance; } } else { + assert(second->metricsInfo.cnt == 4); valFmt2 = makeValueFormat(g, values2[0], values2[1], values2[2], values2[3]); if (valFmt2 == 0) { /* If someone has specified a value of <0 0 0 0>, then */ @@ -1844,19 +1848,12 @@ void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char if (si->pairFmt == 2) { recyclePairs(h); if (pairFmt == 1) { - char msg[1024]; - featGlyphDump(g, first->gid, ' ', 0); featGlyphDump(g, second->gid, '\0', 0); - if (filename != NULL) { - sprintf(msg, " [%s line %d]", filename, lineNum); - } else { - msg[0] = '\0'; - } hotMsg(g, hotWARNING, "Single kern pair occurring after " - "class kern pair in %s: %s%s", - g->error_id_text, g->note.array, msg); + "class kern pair in %s: %s", + g->error_id_text, g->note.array); } } } @@ -1873,22 +1870,19 @@ void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char first->nextSeq = second; if (first->nextCl == NULL && second->nextCl == NULL) { addSpecPair(g, first->gid, second->gid, metricsCnt1, values1, metricsCnt2, values2); - } -#if HOT_FEAT_SUPPORT - else { + } else { /* Enumerate */ unsigned i; unsigned length; - GNode ***prod; + GNode **prod; prod = featMakeCrossProduct(g, first, &length); for (i = 0; i < length; i++) { - GNode *specPair = (*prod)[i]; + GNode *specPair = prod[i]; addSpecPair(g, specPair->gid, specPair->nextSeq->gid, metricsCnt1, values1, metricsCnt2, values2); featRecycleNodes(g, specPair); } } -#endif /* HOT_FEAT_SUPPORT */ featRecycleNodes(g, first); } else { /* --- Add class pair --- */ @@ -1939,26 +1933,20 @@ void GPOSAddPair(hotCtx g, void *subtableInfo, GNode *first, GNode *second, char char msg[1024]; featGlyphClassDump(g, first, ' ', 0); featGlyphClassDump(g, second, '\0', 0); - if (filename != NULL) { - sprintf(msg, " [%s line %d]", filename, lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotWARNING, "Start of new pair positioning subtable forced by overlapping glyph classes in %s; " - "some pairs may never be accessed: %s%s", + "some pairs may never be accessed: %s", g->error_id_text, g->note.array, msg); h->startNewPairPosSubtbl = 1; - GPOSAddPair(g, si, first, second, filename, lineNum); + GPOSAddPair(g, si, first, second, locDesc); } } } -static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char *fileName, long lineNum, int anchorCount, AnchorMarkInfo *anchorMarkInfo) { +static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, const char *locDesc, int anchorCount, const AnchorMarkInfo *anchorMarkInfo) { PosRule *rule; unsigned short lkpType; @@ -1991,17 +1979,18 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char nextNode = nextNode->nextSeq; continue; } - if ((nextNode->metricsInfo == NULL) || (nextNode->metricsInfo->cnt == 0)) { + if (nextNode->metricsInfo.cnt == -1) { nextNode = nextNode->nextSeq; continue; } anon_si = addAnonPosRule(g, h, si, lkpType, nextNode); - if (nextNode->metricsInfo->cnt == 1) { + if (nextNode->metricsInfo.cnt == 1) { /* assume it is an xAdvance adjustment */ - GPOSAddSingle(g, anon_si, nextNode, 0, 0, nextNode->metricsInfo->metrics[0], 0); + GPOSAddSingle(g, anon_si, nextNode, 0, 0, nextNode->metricsInfo.metrics[0], 0); } else { - short *metrics = &nextNode->metricsInfo->metrics[0]; + assert(nextNode->metricsInfo.cnt == 4); + short *metrics = nextNode->metricsInfo.metrics; GPOSAddSingle(g, anon_si, nextNode, metrics[0], metrics[1], metrics[2], metrics[3]); @@ -2021,23 +2010,21 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char rule = dnaNEXT(si->rules); rule->targ = targ; } else { - if (targ->metricsInfo->cnt == 1) { + if (targ->metricsInfo.cnt == 1) { /* assume it is an xAdvance adjustment */ - GPOSAddSingle(g, si, targ, 0, 0, targ->metricsInfo->metrics[0], 0); + GPOSAddSingle(g, si, targ, 0, 0, targ->metricsInfo.metrics[0], 0); } else { - short *metrics = &targ->metricsInfo->metrics[0]; + assert(targ->metricsInfo.cnt == 4); + short *metrics = targ->metricsInfo.metrics; GPOSAddSingle(g, si, targ, metrics[0], metrics[1], metrics[2], metrics[3]); } } return; - } -#if HOT_FEAT_SUPPORT - else if (lkpType == GPOSPair) { + } else if (lkpType == GPOSPair) { /* metrics are now associated with the node they follow */ - GPOSAddPair(g, si, targ, targ->nextSeq, - fileName, lineNum); + GPOSAddPair(g, si, targ, targ->nextSeq, locDesc); return; } else if (lkpType == GPOSCursive) { /* Add BaseGlyphRec records, making sure that there is no overlap in anchor and markClass */ @@ -2056,7 +2043,7 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char } anon_si = addAnonPosRule(g, h, si, lkpType, nextNode); - GPOSAdCursive(g, anon_si, nextNode, anchorCount, anchorMarkInfo, fileName, lineNum); + GPOSAdCursive(g, anon_si, nextNode, anchorCount, anchorMarkInfo, locDesc); /* now add the nodes to the contextual rule list. */ si->parentLkpType = GPOSChain; /* So that this subtable will be processed as a chain at lookup end -> fill. */ @@ -2076,7 +2063,7 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char /* is contextual */ } else { /* isn't contextual */ - GPOSAdCursive(g, si, targ, anchorCount, anchorMarkInfo, fileName, lineNum); + GPOSAdCursive(g, si, targ, anchorCount, anchorMarkInfo, locDesc); featRecycleNodes(g, targ); /* I do this here rather than in feat.c; */ /* addPos, as I have to NOT recycle them if they are contextual */ } @@ -2100,7 +2087,7 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char anon_si = addAnonPosRule(g, h, si, lkpType, nextNode); - GPOSAddMark(g, anon_si, nextNode, anchorCount, anchorMarkInfo, fileName, lineNum); + GPOSAddMark(g, anon_si, nextNode, anchorCount, anchorMarkInfo, locDesc); /* now add the nodes to the contextual rule list. */ si->parentLkpType = GPOSChain; /* So that this subtable will be processed as a chain at lookup end -> fill. */ @@ -2118,7 +2105,7 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char } } else { /* isn't contextual */ - GPOSAddMark(g, si, targ, anchorCount, anchorMarkInfo, fileName, lineNum); + GPOSAddMark(g, si, targ, anchorCount, anchorMarkInfo, locDesc); featRecycleNodes(g, targ); /* I do this here rather than in feat.c; */ /* addPos, as I have to NOT recycle them if they are contextual */ } @@ -2127,25 +2114,23 @@ static void addPosRule(hotCtx g, GPOSCtx h, SubtableInfo *si, GNode *targ, char rule = dnaNEXT(si->rules); rule->targ = targ; } -#endif /* HOT_FEAT_SUPPORT */ } /* Add rule (enumerating if necessary) to subtable si */ -void GPOSRuleAdd(hotCtx g, int lkpType, GNode *targ, char *fileName, long lineNum, int anchorCount, AnchorMarkInfo *anchorMarkInfo) { +void GPOSRuleAdd(hotCtx g, int lkpType, GNode *targ, const char *locDesc, int anchorCount, const AnchorMarkInfo *anchorMarkInfo) { GPOSCtx h = g->ctx.GPOS; if (g->hadError) { return; } - h->new.fileName = fileName; if (targ->flags & FEAT_HAS_MARKED) { h->new.parentLkpType = lkpType; h->new.lkpType = GPOSChain; } - addPosRule(g, h, &h->new, targ, fileName, lineNum, anchorCount, anchorMarkInfo); + addPosRule(g, h, &h->new, targ, locDesc, anchorCount, anchorMarkInfo); } /* Compare kern pairs, fmt1. Pairs marked for deletion sink to bottom */ @@ -2574,7 +2559,6 @@ static Offset classDefMake(hotCtx g, GPOSCtx h, otlTbl t, int cdefInx, static void fillPairPos2(hotCtx g, GPOSCtx h) { int i; - int secondClVal; LOffset size; Subtable *sub = h->new.sub; /* startNewSubtable() called already. */ otlTbl otl = sub->extension.use ? sub->extension.otl : h->otl; @@ -2613,7 +2597,6 @@ static void fillPairPos2(hotCtx g, GPOSCtx h) { } /* --- Fill in Class1Record */ - secondClVal = 0; for (i = 0; i < h->new.pairs.cnt; i++) { KernRec *pair = &h->new.pairs.array[i]; unsigned cl1 = pair->first.gcl->gid; @@ -2775,13 +2758,6 @@ typedef struct { uint16 * (nBack) + uint16 * (nInput) + uint16 * (nLook) + \ POS_LOOKUP_RECORD_SIZE * (nPos)) -static void recycleProd(GPOSCtx h) { - long i; - for (i = 0; i < h->prod.cnt; i++) { - featRecycleNodes(h->g, h->prod.array[i]); - } -} - /* Tries to add rule to current anon subtbl. If successful, returns 1, else 0. If rule already exists in subtbl, recycles targ */ @@ -2790,9 +2766,9 @@ static int cmpWithPosRule(GNode *targ, SingleRec *cmpRec, int nFound) { GID gid2 = cmpRec->gid; int checkedMetrics = 0; int i; - short metricsCnt1 = targ->metricsInfo->cnt; + short metricsCnt1 = targ->metricsInfo.cnt; short metricsCnt2; - short *metrics1 = targ->metricsInfo->metrics; + short *metrics1 = targ->metricsInfo.metrics; short metrics2[4]; if (cmpRec->valFmt == ValueXAdvance) { @@ -2806,6 +2782,8 @@ static int cmpWithPosRule(GNode *targ, SingleRec *cmpRec, int nFound) { metrics2[3] = cmpRec->yAdv; } + assert(metricsCnt1 != -1); + for (; t1 != NULL; t1 = t1->nextCl) { if ((t1->gid == gid2) && (!(t1->flags & FEAT_MISC))) { if (!checkedMetrics) { @@ -2924,7 +2902,6 @@ static SubtableInfo *addAnonPosRule(hotCtx g, GPOSCtx h, SubtableInfo *cur_si, u si->useExtension = cur_si->useExtension; /* Use extension lookupType? */ si->lkpFlag = cur_si->lkpFlag; si->markSetIndex = cur_si->markSetIndex; - si->fileName = cur_si->fileName; /* the current feature file name */ /* Now for the new values that are specific to this table */ si->lkpType = lkpType; @@ -2946,7 +2923,6 @@ static void createAnonLookups(hotCtx g, GPOSCtx h) { SubtableInfo *newsi = &h->new; si->script = si->language = si->feature = TAG_UNDEF; /* so that these will sort to the end of the subtable array */ /* and will not be considered for adding to the FeatureList table */ - si->fileName = NULL; *newsi = *si; @@ -3455,7 +3431,6 @@ static void initAnchorArray(void *ctx, long count, AnchorMarkInfo *anchor) { } static void initAnchorListRec(void *ctx, long count, AnchorListRec *anchorListRec) { - long i; AnchorMarkInfo *anchor = &anchorListRec->anchor; initAnchorArray(ctx, count, anchor); return; @@ -3508,7 +3483,7 @@ typedef struct { } MarkLigaturePosFormat1; #define MARK_TO_LIGATURE_1_SIZE (uint16 * 6) -static int cmpAnchors(AnchorMarkInfo *first, AnchorMarkInfo *second) { +static int cmpAnchors(const AnchorMarkInfo *first, const AnchorMarkInfo *second) { if (first->componentIndex > second->componentIndex) { return 1; } else if (first->componentIndex < second->componentIndex) { @@ -3605,7 +3580,7 @@ static int CDECL cmpLigBaseRec(const void *first, const void *second) { return retVal; } -static void checkBaseAnchorConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long recCnt, char *fileName, int isMarkToLigature) { +static void checkBaseAnchorConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long recCnt, int isMarkToLigature) { BaseGlyphRec *prev, *cur, *last; if (recCnt < 2) { return; @@ -3620,15 +3595,9 @@ static void checkBaseAnchorConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long do { if (cur->gid == prev->gid) { /* For mark to base and mark to mark, only a single entry is allowed in the baseGlyphArray for a given GID. */ - char msg[1024]; featGlyphDump(g, cur->gid, '\0', 0); - if (fileName != NULL) { - sprintf(msg, " [%s current line %ld previous line %ld]", fileName, cur->lineNum, prev->lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotERROR, "MarkToBase or MarkToMark error in %s. Another statement has already defined the anchors and marks on glyph '%s'. %s", - g->error_id_text, g->note.array, msg); + hotMsg(g, hotERROR, "MarkToBase or MarkToMark error in %s. Another statement has already defined the anchors and marks on glyph '%s'. [current at %s, previous at %s]", + g->error_id_text, g->note.array, cur->locDesc, prev->locDesc); } else { /* For mark to ligature, each successive base glyph entry */ /* defines the next component. We just need to make sure that */ @@ -3640,7 +3609,7 @@ static void checkBaseAnchorConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long return; } -static void checkBaseLigatureConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long recCnt, char *fileName, int isMarkToLigature) { +static void checkBaseLigatureConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, long recCnt, int isMarkToLigature) { BaseGlyphRec *prev, *cur, *last; if (recCnt < 2) { return; @@ -3658,16 +3627,10 @@ static void checkBaseLigatureConflict(hotCtx g, BaseGlyphRec *baseGlyphArray, lo cpi1 = prev->anchorMarkInfo.array[0].componentIndex; cpi2 = cur->anchorMarkInfo.array[0].componentIndex; if (cpi1 == cpi2) { - char msg[1024]; featGlyphDump(g, cur->gid, '\0', 0); - if (fileName != NULL) { - sprintf(msg, " [%s current line %ld previous line %ld]", fileName, cur->lineNum, prev->lineNum); - } else { - msg[0] = '\0'; - } hotMsg(g, hotERROR, - "MarkToLigature error in %s. Two different statements referencing the ligature glyph '%s' have assigned the same mark class to the same ligature component. %s", - g->error_id_text, g->note.array, msg); + "MarkToLigature error in %s. Two different statements referencing the ligature glyph '%s' have assigned the same mark class to the same ligature component. [current at %s, previous at %s]", + g->error_id_text, g->note.array, cur->locDesc, prev->locDesc); } } else { prev = cur; @@ -3688,7 +3651,7 @@ static long findMarkClassIndex(SubtableInfo *si, GNode *markNode) { return -1; } -static int addMarkClass(hotCtx g, SubtableInfo *si, GNode *markNode, char *fileName, int lineNum) { +static int addMarkClass(hotCtx g, SubtableInfo *si, GNode *markNode) { GNode *nextClass = markNode; int ci = si->markClassList.cnt; int i; @@ -3701,16 +3664,10 @@ static int addMarkClass(hotCtx g, SubtableInfo *si, GNode *markNode, char *fileN GNode *curNode = si->markClassList.array[i].gnode; while (curNode != NULL) { if (curNode->gid == newGID) { - char msg[1024]; GNode *prevMarkNode = si->markClassList.array[i].gnode; featGlyphDump(g, newGID, '\0', 0); - if (fileName != NULL) { - sprintf(msg, " [%s line %d]", fileName, lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotERROR, "In %s, glyph '%s' occurs in two different mark classes. Previous mark class: %s. Current mark class: %s. %s", - g->error_id_text, g->note.array, prevMarkNode->markClassName, markNode->markClassName, msg); + hotMsg(g, hotERROR, "In %s, glyph '%s' occurs in two different mark classes. Previous mark class: %s. Current mark class: %s.", + g->error_id_text, g->note.array, prevMarkNode->markClassName, markNode->markClassName); ci = -1; } curNode = curNode->nextCl; @@ -3727,15 +3684,9 @@ static int addMarkClass(hotCtx g, SubtableInfo *si, GNode *markNode, char *fileN GNode *testNode = nextClass->nextCl; while (testNode != NULL) { if (testNode->gid == nextClass->gid) { - char msg[1024]; featGlyphDump(g, testNode->gid, '\0', 0); - if (fileName != NULL) { - sprintf(msg, " [%s line %d]", fileName, lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotERROR, "In %s, glyph '%s' is repeated in the current class definition. Mark class: %s. %s", - g->error_id_text, g->note.array, markNode->markClassName, msg); + hotMsg(g, hotERROR, "In %s, glyph '%s' is repeated in the current class definition. Mark class: %s.", + g->error_id_text, g->note.array, markNode->markClassName); ci = -1; } testNode = testNode->nextCl; @@ -3766,7 +3717,7 @@ static int CDECL cmpMarkRec(const void *first, const void *second) { } } -static LOffset getAnchoOffset(hotCtx g, AnchorMarkInfo *anchor, void *fmt) { +static LOffset getAnchoOffset(hotCtx g, const AnchorMarkInfo *anchor, void *fmt) { long i = 0; MarkBasePosFormat1 *localFmt = (MarkBasePosFormat1 *)fmt; AnchorListRec *anchorRec = NULL; @@ -3803,7 +3754,7 @@ static LOffset getAnchoOffset(hotCtx g, AnchorMarkInfo *anchor, void *fmt) { return anchorRec->offset; } -static void GPOSAddMark(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, AnchorMarkInfo *anchorMarkInfo, char *fileName, long lineNum) { +static void GPOSAddMark(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, const AnchorMarkInfo *anchorMarkInfo, const char *locDesc) { GNode *nextNode = targ; BaseGlyphRec *baseRec = NULL; @@ -3820,10 +3771,10 @@ static void GPOSAddMark(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount if (prevComponentIndex != anchorMarkInfo[j].componentIndex) { baseRec = dnaNEXT(si->baseList); - dnaINIT(g->dnaCtx, baseRec->anchorMarkInfo, 4, 4); + dnaINIT(g->DnaCTX, baseRec->anchorMarkInfo, 4, 4); baseRec->anchorMarkInfo.func = initAnchorArray; baseRec->gid = nextNode->gid; - baseRec->lineNum = lineNum; + copyStr(g, &baseRec->locDesc, locDesc); prevComponentIndex = anchorMarkInfo[j].componentIndex; } { @@ -3835,7 +3786,7 @@ static void GPOSAddMark(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount } markClassIndex = findMarkClassIndex(si, baseAR->markClass); if (markClassIndex < 0) { - markClassIndex = addMarkClass(g, si, baseAR->markClass, fileName, lineNum); + markClassIndex = addMarkClass(g, si, baseAR->markClass); } baseAR->markClassIndex = markClassIndex; } @@ -3849,7 +3800,6 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) { Subtable *sub; otlTbl otl; LOffset size = MARK_TO_BASE_1_SIZE; - LOffset markAnchorSize; unsigned short numMarkGlyphs = 0; MarkBasePosFormat1 *fmt = MEM_NEW(g, sizeof(MarkBasePosFormat1)); startNewSubtable(g); @@ -3858,7 +3808,7 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) { fmt->PosFormat = 1; fmt->ClassCount = (unsigned short)h->new.markClassList.cnt; - dnaINIT(g->dnaCtx, fmt->anchorList, 100, 100); + dnaINIT(g->DnaCTX, fmt->anchorList, 100, 100); fmt->anchorList.func = initAnchorListRec; /* Build mark coverage list from list of mark classes. Each mark class */ @@ -3869,7 +3819,6 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) { { int i; otlCoverageBegin(g, otl); - markAnchorSize = 0; for (i = 0; i < h->new.markClassList.cnt; i++) { GNode *nextNode = (h->new.markClassList.array)[i].gnode; while (nextNode != NULL) { @@ -3908,14 +3857,12 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) { /* Build base glyph coverage list from rules. First, we need to sort */ /* the base record list by GID, and make sure there are no errors Then */ /* we can simply step through it to make the base coverage table. */ - checkBaseAnchorConflict(g, h->new.baseList.array, h->new.baseList.cnt, h->new.fileName, 0); + checkBaseAnchorConflict(g, h->new.baseList.array, h->new.baseList.cnt, 0); { long numBaseGlyphs = 0; BaseRecord *nextRec; long baseArraySize; GID prevGID; - AnchorMarkInfo kDefaultAnchor = { - 0, 0, 0, 1, NULL, 0}; fmt->BaseArray = (Offset)size; /* offset from the start of the MarkToBase subtable = size of subtable + size of MarkArray table. */ fmt->BaseArray_.BaseRecord = nextRec = MEM_NEW(g, sizeof(BaseRecord) * h->new.baseList.cnt); @@ -3949,15 +3896,9 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) { for (j = 0; j < baseRec->anchorMarkInfo.cnt; j++) { if (nextRec->BaseAnchorArray[baseRec->anchorMarkInfo.array[j].markClassIndex] != 0xFFFFFFFFL) { /*it has already been filled in !*/ - char msg[1024]; featGlyphDump(g, prevGID, '\0', 0); - if (h->new.fileName != NULL) { - sprintf(msg, " [%s line %ld]", h->new.fileName, baseRec->lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotERROR, "MarkToBase or MarkToMark error in %s. Another statement has already assigned the current mark class to another anchor point on glyph '%s'. %s", - g->error_id_text, g->note.array, msg); + hotMsg(g, hotERROR, "MarkToBase or MarkToMark error in %s. Another statement has already assigned the current mark class to another anchor point on glyph '%s'. [previous at %s]", + g->error_id_text, g->note.array, baseRec->locDesc); } else { nextRec->BaseAnchorArray[baseRec->anchorMarkInfo.array[j].markClassIndex] = getAnchoOffset(g, &baseRec->anchorMarkInfo.array[j], fmt); /* offset from start of anchor list */ } @@ -3974,16 +3915,10 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) { for (j = 0; j < fmt->ClassCount; j++) { if (baseAnchorArray[j] == 0xFFFFFFFFL) { - char msg[1024]; baseAnchorArray[j] = 0xFFFFFFFFL; featGlyphDump(g, baseRec->gid, '\0', 0); - if (h->new.fileName != NULL) { - sprintf(msg, " [%s line %ld]", h->new.fileName, baseRec->lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotWARNING, "MarkToBase or MarkToMark error in %s. Glyph '%s' does not have an anchor point for a mark class that was used in a previous statement in the same lookup table. Setting the anchor point offset to 0.", - g->error_id_text, g->note.array, msg); + hotMsg(g, hotWARNING, "MarkToBase or MarkToMark error in %s. Glyph '%s' does not have an anchor point for a mark class that was used in a previous statement in the same lookup table. Setting the anchor point offset to 0. [previous at %s]", + g->error_id_text, g->note.array, baseRec->locDesc); } } } @@ -4108,7 +4043,6 @@ static void fillMarkToLigature(hotCtx g, GPOSCtx h) { Subtable *sub; otlTbl otl; LOffset size = MARK_TO_BASE_1_SIZE; - LOffset markhAnchorSize; long numMarkGlyphs = 0; MarkLigaturePosFormat1 *fmt = MEM_NEW(g, sizeof(MarkLigaturePosFormat1)); startNewSubtable(g); @@ -4117,7 +4051,7 @@ static void fillMarkToLigature(hotCtx g, GPOSCtx h) { fmt->PosFormat = 1; fmt->ClassCount = (unsigned short)h->new.markClassList.cnt; - dnaINIT(g->dnaCtx, fmt->anchorList, 100, 100); + dnaINIT(g->DnaCTX, fmt->anchorList, 100, 100); fmt->anchorList.func = initAnchorListRec; /* Build mark coverage list from list of mark classes. Each mark class */ @@ -4127,7 +4061,6 @@ static void fillMarkToLigature(hotCtx g, GPOSCtx h) { /* info to the mark record list. */ { otlCoverageBegin(g, otl); - markhAnchorSize = 0; for (i = 0; i < h->new.markClassList.cnt; i++) { GNode *nextNode = (h->new.markClassList.array)[i].gnode; while (nextNode != NULL) { @@ -4167,7 +4100,7 @@ static void fillMarkToLigature(hotCtx g, GPOSCtx h) { /* sort the base record list by GID, and make sure there are no errors */ /* Then we can simply step through it to make the base coverage table. */ /* sort the recs by base gid value, then by component index. */ - checkBaseLigatureConflict(g, h->new.baseList.array, h->new.baseList.cnt, h->new.fileName, 0); + checkBaseLigatureConflict(g, h->new.baseList.array, h->new.baseList.cnt, 0); { long numLigatureGlyphs = 0; unsigned short numComponents; @@ -4222,15 +4155,9 @@ static void fillMarkToLigature(hotCtx g, GPOSCtx h) { LOffset *ligatureAnchor = &nextRec->ComponentRecordList[componentIndex * fmt->ClassCount]; if (ligatureAnchor[baseRec->anchorMarkInfo.array[j].markClassIndex] != 0xFFFFFFFFL) { /*it has already been filled in !*/ - char msg[1024]; featGlyphDump(g, curGID, '\0', 0); - if (h->new.fileName != NULL) { - sprintf(msg, " [%s line %ld]", h->new.fileName, baseRec->lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotERROR, "MarkToLigature statement error in %s. Glyph '%s' contains a duplicate mark class assignment for one of the ligature components. %s", - g->error_id_text, g->note.array, msg); + hotMsg(g, hotERROR, "MarkToLigature statement error in %s. Glyph '%s' contains a duplicate mark class assignment for one of the ligature components. [previous at %s]", + g->error_id_text, g->note.array, baseRec->locDesc); } else { if (baseRec->anchorMarkInfo.array[j].format != 0) { /* Skip anchor if the format is 0 aka NULL anchor */ @@ -4378,13 +4305,13 @@ static void freeMarkToLigature(hotCtx g, Subtable *sub) { /* ------------------------ Cursive Attachment ------------------------ */ -static void GPOSAdCursive(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, AnchorMarkInfo *anchorMarkInfo, char *fileName, long lineNum) { +static void GPOSAdCursive(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCount, const AnchorMarkInfo *anchorMarkInfo, const char *locDesc) { GNode *nextNode = targ; while (nextNode != NULL) { int j; BaseGlyphRec *baseRec = dnaNEXT(si->baseList); - dnaINIT(g->dnaCtx, baseRec->anchorMarkInfo, 4, 4); + dnaINIT(g->DnaCTX, baseRec->anchorMarkInfo, 4, 4); baseRec->anchorMarkInfo.func = initAnchorArray; baseRec->gid = nextNode->gid; @@ -4392,7 +4319,7 @@ static void GPOSAdCursive(hotCtx g, SubtableInfo *si, GNode *targ, int anchorCou AnchorMarkInfo *baseAR = dnaNEXT(baseRec->anchorMarkInfo); *baseAR = anchorMarkInfo[j]; } - baseRec->lineNum = lineNum; + copyStr(g, &baseRec->locDesc, locDesc); nextNode = nextNode->nextCl; } } @@ -4410,7 +4337,7 @@ static void fillCursive(hotCtx g, GPOSCtx h) { otl = sub->extension.use ? sub->extension.otl : h->otl; fmt->PosFormat = 1; - dnaINIT(g->dnaCtx, fmt->anchorList, 100, 100); + dnaINIT(g->DnaCTX, fmt->anchorList, 100, 100); fmt->anchorList.func = initAnchorListRec; qsort(h->new.baseList.array, h->new.baseList.cnt, sizeof(BaseGlyphRec), cmpBaseRec); /* Get them in GID order, so the recs will match the Coverage order */ { @@ -4421,15 +4348,9 @@ static void fillCursive(hotCtx g, GPOSCtx h) { for (i = 0; i < h->new.baseList.cnt; i++) { BaseGlyphRec *baseRec = &(h->new.baseList.array[i]); if (prevRec && (prevRec->gid == baseRec->gid)) { - char msg[1024]; featGlyphDump(g, prevRec->gid, '\0', 0); - if (h->new.fileName != NULL) { - sprintf(msg, " [%s current line %ld line previous line %ld]", h->new.fileName, baseRec->lineNum, prevRec->lineNum); - } else { - msg[0] = '\0'; - } - hotMsg(g, hotERROR, "Cursive statement error in %s. A previous statement has already referenced glyph '%s'. %s", - g->error_id_text, g->note.array, msg); + hotMsg(g, hotERROR, "Cursive statement error in %s. A previous statement has already referenced glyph '%s'. [current at %s, previous at %s]", + g->error_id_text, g->note.array, baseRec->locDesc, prevRec->locDesc); } else { EntryExitRecord *fmtRec = &fmt->EntryExitRecord[numRecs]; AnchorMarkInfo *anchorInfo; diff --git a/c/makeotf/makeotf_lib/source/hotconv/GPOS.h b/c/makeotf/lib/hotconv/GPOS.h similarity index 87% rename from c/makeotf/makeotf_lib/source/hotconv/GPOS.h rename to c/makeotf/lib/hotconv/GPOS.h index 9b807a0aa..489d40f4d 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/GPOS.h +++ b/c/makeotf/lib/hotconv/GPOS.h @@ -8,6 +8,10 @@ #include "common.h" #include "feat.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GPOS_ TAG('G', 'P', 'O', 'S') /* Standard functions */ @@ -37,7 +41,7 @@ enum { GPOSFeatureParam, /* Treated like a lookup in the code */ }; -void GPOSRuleAdd(hotCtx g, int lkpType, GNode *targ, char *fileName, long lineNum, int anchorCount, AnchorMarkInfo *anchorMarkInfo); +void GPOSRuleAdd(hotCtx g, int lkpType, GNode *targ, const char *locDesc, int anchorCount, const AnchorMarkInfo *anchorMarkInfo); void GPOSLookupBegin(hotCtx g, unsigned lkpType, unsigned lkpFlag, Label label, short useExtension, unsigned short useMarkSetIndex); @@ -49,8 +53,10 @@ void GPOSSetSizeMenuNameID(hotCtx g, unsigned short nameID); int GPOSSubtableBreak(hotCtx g); -void GPOSAddPair(hotCtx g, void *si, GNode *first, GNode *second, char *filename, int lineNum); - void GPOSPrintAFMKernData(hotCtx g); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_GPOS_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/GSUB.c b/c/makeotf/lib/hotconv/GSUB.c similarity index 98% rename from c/makeotf/makeotf_lib/source/hotconv/GSUB.c rename to c/makeotf/lib/hotconv/GSUB.c index fcf2bf1e0..0ee266653 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/GSUB.c +++ b/c/makeotf/lib/hotconv/GSUB.c @@ -9,7 +9,7 @@ #include "GSUB.h" #include "OS_2.h" #include "otl.h" -#include "map.h" +#include "hotmap.h" #include "vmtx.h" #include "feat.h" #include "common.h" @@ -79,15 +79,6 @@ typedef struct { /* Subtable record */ unsigned short nameID; } FeatureNameParameterFormat; /* Special case format for subtable data. */ -typedef struct { /* Subtable record */ - unsigned short Format; - unsigned short FeatUILabelNameID; - unsigned short FeatUITooltipTextNameID; - unsigned short SampleTextNameID; - unsigned short NumNamedParameters; - unsigned short FirstParamUILabelNameID; - dnaDCL(unsigned long, charValues); -} CVParameterFormat; /* Special case format for subtable data. */ #define CV_PARAM_SIZE(p) ((uint16 * 7) + 3 * (p->charValues.cnt)) typedef struct { @@ -136,7 +127,6 @@ static void fillSingle(hotCtx g, GSUBCtx h); static void writeSingle(hotCtx g, GSUBCtx h, Subtable *sub); static void freeSingle(hotCtx g, GSUBCtx h, Subtable *sub); -#if HOT_FEAT_SUPPORT static void fillMultiple(hotCtx g, GSUBCtx h); static void writeMultiple(hotCtx g, GSUBCtx h, Subtable *sub); static void freeMultiple(hotCtx g, GSUBCtx h, Subtable *sub); @@ -160,8 +150,6 @@ static void freeReverseChain(hotCtx g, GSUBCtx h, Subtable *sub); static void createAnonLookups(hotCtx g, GSUBCtx h); static void setAnonLookupIndices(hotCtx g, GSUBCtx h); -#endif /* HOT_FEAT_SUPPORT */ - static ExtensionSubstFormat1 *fillExtension(hotCtx g, GSUBCtx h, unsigned ExtensionLookupType); static void writeExtension(hotCtx g, GSUBCtx h, Subtable *sub); @@ -185,7 +173,7 @@ static void subtableInit(void *ctx, long count, SubtableInfo *si) { hotCtx g = ctx; long i; for (i = 0; i < count; i++) { - dnaINIT(g->dnaCtx, si->rules, 10, 50); + dnaINIT(g->DnaCTX, si->rules, 10, 50); si++; } return; @@ -196,15 +184,15 @@ void GSUBNew(hotCtx g) { h->new.script = h->new.language = h->new.feature = TAG_UNDEF; - dnaINIT(g->dnaCtx, h->new.rules, 50, 200); + dnaINIT(g->DnaCTX, h->new.rules, 50, 200); h->offset.featParam = h->offset.subtable = 0; h->offset.extension = h->offset.extensionSection = 0; - dnaINIT(g->dnaCtx, h->subtables, 10, 10); - dnaINIT(g->dnaCtx, h->anonSubtable, 3, 10); + dnaINIT(g->DnaCTX, h->subtables, 10, 10); + dnaINIT(g->DnaCTX, h->anonSubtable, 3, 10); h->anonSubtable.func = subtableInit; - dnaINIT(g->dnaCtx, h->subLookup, 25, 100); - dnaINIT(g->dnaCtx, h->prod, 20, 100); - dnaINIT(g->dnaCtx, h->featNameID, 8, 8); + dnaINIT(g->DnaCTX, h->subLookup, 25, 100); + dnaINIT(g->DnaCTX, h->prod, 20, 100); + dnaINIT(g->DnaCTX, h->featNameID, 8, 8); h->maxContext = 0; h->otl = NULL; @@ -227,9 +215,7 @@ int GSUBFill(hotCtx g) { } } -#if HOT_FEAT_SUPPORT createAnonLookups(g, h); -#endif /* HOT_FEAT_SUPPORT */ /* Add OTL features */ @@ -291,7 +277,6 @@ int GSUBFill(hotCtx g) { otlDumpSizes(g, h->otl, h->offset.subtable, h->offset.extension); #endif /* HOT_DEBUG */ -#if HOT_FEAT_SUPPORT /* setAnonLookupIndices marks as used not only the anonymous lookups, */ /* but also all lookups that were referenced from chain sub rules, */ /* including the stand-alone lookups. This is why */ @@ -299,7 +284,6 @@ int GSUBFill(hotCtx g) { setAnonLookupIndices(g, h); checkStandAloneTablRefs(g, h->otl); -#endif /* HOT_FEAT_SUPPORT */ OS_2SetMaxContext(g, h->maxContext); @@ -365,7 +349,6 @@ void GSUBWrite(hotCtx g) { writeSingle(g, h, sub); break; -#if HOT_FEAT_SUPPORT case GSUBMultiple: writeMultiple(g, h, sub); break; @@ -393,7 +376,6 @@ void GSUBWrite(hotCtx g) { case GSUBContext: break; */ -#endif /* HOT_FEAT_SUPPORT */ } } @@ -415,7 +397,6 @@ void GSUBWrite(hotCtx g) { writeSingle(g, h, sub); break; -#if HOT_FEAT_SUPPORT case GSUBMultiple: writeMultiple(g, h, sub); break; @@ -440,7 +421,6 @@ void GSUBWrite(hotCtx g) { case GSUBContext: break; */ -#endif /* HOT_FEAT_SUPPORT */ } } } @@ -467,7 +447,6 @@ void GSUBReuse(hotCtx g) { freeSingle(g, h, sub); break; -#if HOT_FEAT_SUPPORT case GSUBMultiple: freeMultiple(g, h, sub); break; @@ -500,7 +479,6 @@ void GSUBReuse(hotCtx g) { case GSUBContext: break; */ -#endif /* HOT_FEAT_SUPPORT */ } } @@ -663,9 +641,7 @@ static void addRule(hotCtx g, GSUBCtx h, SubtableInfo *si, GNode *targ, rule->repl = repl; } return; - } -#if HOT_FEAT_SUPPORT - else if (si->lkpType == GSUBLigature) { + } else if (si->lkpType == GSUBLigature) { GNode *t; unsigned length = featGetPatternLen(g, targ); @@ -678,12 +654,12 @@ static void addRule(hotCtx g, GSUBCtx h, SubtableInfo *si, GNode *targ, if (t != NULL) { unsigned i; unsigned nSeq; - GNode ***prod = featMakeCrossProduct(g, targ, &nSeq); + GNode **prod = featMakeCrossProduct(g, targ, &nSeq); featRecycleNodes(g, targ); for (i = 0; i < nSeq; i++) { rule = dnaNEXT(si->rules); - rule->targ = (*prod)[i]; + rule->targ = prod[i]; rule->repl = i == 0 ? repl : featSetNewNode(g, repl->gid); rule->data = length; #if HOT_DEBUG @@ -706,7 +682,6 @@ static void addRule(hotCtx g, GSUBCtx h, SubtableInfo *si, GNode *targ, rule->targ = targ; rule->repl = repl; } -#endif /* HOT_FEAT_SUPPORT */ } /* Stores input GNodes; they are recycled at GSUBLookupEnd. */ @@ -758,7 +733,6 @@ void GSUBLookupEnd(hotCtx g, Tag feature) { fillSingle(g, h); break; -#if HOT_FEAT_SUPPORT case GSUBMultiple: fillMultiple(g, h); break; @@ -787,7 +761,6 @@ void GSUBLookupEnd(hotCtx g, Tag feature) { fillGSUBCVParam(g, h, h->new.sub); break; -#endif /* HOT_FEAT_SUPPORT */ default: /* Can't get here, but it is a useful check for future development. */ hotMsg(g, hotFATAL, "unknown GSUB lkpType <%d> in %s.", h->new.lkpType, g->error_id_text); @@ -954,7 +927,7 @@ void GSUBAddCVParam(hotCtx g, void *param) { new_param->NumNamedParameters = feat_param->NumNamedParameters; new_param->FirstParamUILabelNameID = feat_param->FirstParamUILabelNameID; - dnaINIT(g->dnaCtx, new_param->charValues, 20, 20); + dnaINIT(g->DnaCTX, new_param->charValues, 20, 20); i = 0; while (i < feat_param->charValues.cnt) { *dnaNEXT(new_param->charValues) = feat_param->charValues.array[i++]; @@ -1247,7 +1220,6 @@ static void freeSingle(hotCtx g, GSUBCtx h, Subtable *sub) { } } -#if HOT_FEAT_SUPPORT /* ------------------------- Multiple Substitution ------------------------- */ @@ -1289,7 +1261,7 @@ static void fillMultiple1(hotCtx g, GSUBCtx h, long beg, long end, long size, unsigned int nSubs) { otlTbl otl; Subtable *sub; - int isRTL; + // int isRTL; unsigned nSequences; GID *pSubs; long i; @@ -1307,7 +1279,7 @@ static void fillMultiple1(hotCtx g, GSUBCtx h, long beg, long end, long size, startNewSubtable(g); sub = h->new.sub; otl = sub->extension.use ? sub->extension.otl : h->otl; - isRTL = sub->lkpFlag & otlRightToLeft; + // isRTL = sub->lkpFlag & otlRightToLeft; fmt->SubstFormat = 1; fmt->SequenceCount = nSequences = end - beg + 1; @@ -1489,8 +1461,8 @@ typedef struct { #define ALTERNATE_SET_SIZE(nGlyphs) (uint16 + uint16 * (nGlyphs)) typedef struct { - unsigned short SubstFormat; /* =1 */ - LOffset Coverage; /* 32-bit for overflow check */ + unsigned short SubstFormat; /* =1 */ + LOffset Coverage; /* 32-bit for overflow check */ unsigned short AlternateSetCount; DCL_OFFSET_ARRAY(AlternateSet, AlternateSet); /* [AlternateSetCount] */ } AlternateSubstFormat1; @@ -2203,10 +2175,10 @@ static int addToAnonSubtbl(hotCtx g, GSUBCtx h, SubtableInfo *si, GNode *targ, } else if (si->lkpType == GSUBLigature) { unsigned i; unsigned nSeq; - GNode ***prod = featMakeCrossProduct(g, targ, &nSeq); + GNode **prod = featMakeCrossProduct(g, targ, &nSeq); dnaSET_CNT(h->prod, (long)nSeq); - COPY(&h->prod.array[0], *prod, nSeq); + COPY(&h->prod.array[0], prod, nSeq); for (i = 0; i < nSeq; i++) { long j; @@ -2716,8 +2688,6 @@ static void freeChain(hotCtx g, GSUBCtx h, Subtable *sub) { } } -#endif /* HOT_FEAT_SUPPORT */ - static int CDECL cmpNode(const void *first, const void *second) { GID a = (*(GNode **)first)->gid; GID b = (*(GNode **)second)->gid; @@ -2753,6 +2723,7 @@ void sortInputList(GSUBCtx h, GNode **list) { /* Fill chaining contextual subtable format 3 */ /* Compare glyph ids */ +#if 0 static int CDECL cmpGlyphIds(const void *first, const void *second) { GID a = *(GID *)first; GID b = *(GID *)second; @@ -2763,6 +2734,7 @@ static int CDECL cmpGlyphIds(const void *first, const void *second) { } return 0; } +#endif static void fillReverseChain1(hotCtx g, GSUBCtx h, otlTbl otl, Subtable *sub, long inx) { @@ -3008,10 +2980,6 @@ static void freeExtension(hotCtx g, GSUBCtx h, Subtable *sub) { /* This function just serves to suppress annoying "defined but not used" compiler messages when debugging */ static void CDECL dbuse(int arg, ...) { -#if HOT_FEAT_SUPPORT dbuse(0, rulesDump , fillChain1, fillChain2, aaltDump); -#else - dbuse(0, rulesDump); -#endif /* HOT_FEAT_SUPPORT */ } #endif diff --git a/c/makeotf/makeotf_lib/source/hotconv/GSUB.h b/c/makeotf/lib/hotconv/GSUB.h similarity index 97% rename from c/makeotf/makeotf_lib/source/hotconv/GSUB.h rename to c/makeotf/lib/hotconv/GSUB.h index 95b06baf8..836cc670d 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/GSUB.h +++ b/c/makeotf/lib/hotconv/GSUB.h @@ -8,6 +8,10 @@ #include "common.h" #include "feat.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GSUB_ TAG('G', 'S', 'U', 'B') /* Standard functions */ @@ -72,4 +76,8 @@ void GSUBAddCVParam(hotCtx g, void *param); GSUBFeatureEnd(g); */ +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_GSUB_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/OS_2.c b/c/makeotf/lib/hotconv/OS_2.c similarity index 99% rename from c/makeotf/makeotf_lib/source/hotconv/OS_2.c rename to c/makeotf/lib/hotconv/OS_2.c index 7ca2be183..84c0cf104 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/OS_2.c +++ b/c/makeotf/lib/hotconv/OS_2.c @@ -7,7 +7,7 @@ */ #include "OS_2.h" -#include "map.h" +#include "hotmap.h" #include #include diff --git a/c/makeotf/makeotf_lib/source/hotconv/OS_2.h b/c/makeotf/lib/hotconv/OS_2.h similarity index 95% rename from c/makeotf/makeotf_lib/source/hotconv/OS_2.h rename to c/makeotf/lib/hotconv/OS_2.h index 4cdb376bd..765c52e10 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/OS_2.h +++ b/c/makeotf/lib/hotconv/OS_2.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define OS_2_ TAG('O', 'S', '/', '2') /* Standard functions */ @@ -37,4 +41,8 @@ void OS_2LowerOpticalPointSize(hotCtx g, uint16_t opSize); void OS_2UpperOpticalPointSize(hotCtx g, uint16_t opSize); void OS_2FamilyClass(hotCtx g, uint16_t familyClass); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_OS_2_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/STAT.c b/c/makeotf/lib/hotconv/STAT.c similarity index 99% rename from c/makeotf/makeotf_lib/source/hotconv/STAT.c rename to c/makeotf/lib/hotconv/STAT.c index a93cb6571..fa3d9c71e 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/STAT.c +++ b/c/makeotf/lib/hotconv/STAT.c @@ -95,8 +95,8 @@ struct STATCtx_ { void STATNew(hotCtx g) { STATCtx h = MEM_NEW(g, sizeof(struct STATCtx_)); - dnaINIT(g->dnaCtx, h->designAxes, 5, 5); - dnaINIT(g->dnaCtx, h->axisValues, 5, 5); + dnaINIT(g->DnaCTX, h->designAxes, 5, 5); + dnaINIT(g->DnaCTX, h->axisValues, 5, 5); h->elidedFallbackNameID = 0; /* Link contexts */ @@ -301,7 +301,7 @@ void STATAddDesignAxis(hotCtx g, Tag tag, uint16_t nameID, uint16_t ordering) { // Currently registered tags are 'wght', 'wdth', 'opsz', 'ital', 'slnt' char tagString[4] = {TAG_ARG(tag)}; - const uint32_t *regTags[5] = { + const uint32_t regTags[5] = { TAG('i', 't', 'a', 'l'), TAG('o', 'p', 's', 'z'), TAG('s', 'l', 'n', 't'), diff --git a/c/makeotf/makeotf_lib/source/hotconv/STAT.h b/c/makeotf/lib/hotconv/STAT.h similarity index 93% rename from c/makeotf/makeotf_lib/source/hotconv/STAT.h rename to c/makeotf/lib/hotconv/STAT.h index 31e18166c..8b492ccd1 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/STAT.h +++ b/c/makeotf/lib/hotconv/STAT.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define STAT_ TAG('S', 'T', 'A', 'T') /* Standard functions */ @@ -24,4 +28,8 @@ void STATAddAxisValueTable(hotCtx g, uint16_t format, Tag *axisTags, uint16_t nameID, Fixed minValue, Fixed maxValue); bool STATSetElidedFallbackNameID(hotCtx g, uint16_t nameID); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_STAT_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/VORG.c b/c/makeotf/lib/hotconv/VORG.c similarity index 97% rename from c/makeotf/makeotf_lib/source/hotconv/VORG.c rename to c/makeotf/lib/hotconv/VORG.c index 136dbd955..14bda59cb 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/VORG.c +++ b/c/makeotf/lib/hotconv/VORG.c @@ -32,7 +32,7 @@ struct VORGCtx_ { void VORGNew(hotCtx g) { VORGCtx h = MEM_NEW(g, sizeof(struct VORGCtx_)); - dnaINIT(g->dnaCtx, h->tbl.vertOriginYMetrics, 300, 600); + dnaINIT(g->DnaCTX, h->tbl.vertOriginYMetrics, 300, 600); /* Link contexts */ h->g = g; diff --git a/c/makeotf/makeotf_lib/source/hotconv/VORG.h b/c/makeotf/lib/hotconv/VORG.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/VORG.h rename to c/makeotf/lib/hotconv/VORG.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/anon.c b/c/makeotf/lib/hotconv/anon.c similarity index 97% rename from c/makeotf/makeotf_lib/source/hotconv/anon.c rename to c/makeotf/lib/hotconv/anon.c index 87a1ab1d0..e87f54be0 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/anon.c +++ b/c/makeotf/lib/hotconv/anon.c @@ -26,7 +26,7 @@ struct anonCtx_ { void anonNew(hotCtx g) { anonCtx h = MEM_NEW(g, sizeof(struct anonCtx_)); - dnaINIT(g->dnaCtx, h->tbls, 5, 5); + dnaINIT(g->DnaCTX, h->tbls, 5, 5); h->iTbl = 0; /* Link contexts */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/anon.h b/c/makeotf/lib/hotconv/anon.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/anon.h rename to c/makeotf/lib/hotconv/anon.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/cmap.c b/c/makeotf/lib/hotconv/cmap.c similarity index 98% rename from c/makeotf/makeotf_lib/source/hotconv/cmap.c rename to c/makeotf/lib/hotconv/cmap.c index 0617ce705..178331245 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/cmap.c +++ b/c/makeotf/lib/hotconv/cmap.c @@ -10,7 +10,7 @@ #include "hotconv.h" #include "cmap.h" -#include "map.h" +#include "hotmap.h" #include "feat.h" #include "dynarr.h" @@ -221,10 +221,10 @@ void cmapNew(hotCtx g) { h->tbl.nEncodings = 0; h->lastUVS = 0; - dnaINIT(g->dnaCtx, h->tbl.encoding, 5, 2); - dnaINIT(g->dnaCtx, h->uvsList, 40, 40); - dnaINIT(g->dnaCtx, h->mapping, 9000, 2000); - dnaINIT(g->dnaCtx, h->codespace, 5, 10); + dnaINIT(g->DnaCTX, h->tbl.encoding, 5, 2); + dnaINIT(g->DnaCTX, h->uvsList, 40, 40); + dnaINIT(g->DnaCTX, h->mapping, 9000, 2000); + dnaINIT(g->DnaCTX, h->codespace, 5, 10); /* Link contexts */ h->g = g; @@ -288,7 +288,7 @@ static void CDECL cmapMsg(hotCtx g, int msgType, char *fmt, ...) { cmapCtx h = g->ctx.cmap; va_list ap; char msgVar[1024]; - char msg[1024]; + char msg[1536]; va_start(ap, fmt); VSPRINTF_S(msgVar, sizeof(msgVar), fmt, ap); @@ -371,8 +371,8 @@ void cmapAddUVSEntry(hotCtx g, unsigned int uvsFlags, unsigned long uv, unsigned if (h->lastUVS != uvs) { uvsRec = dnaNEXT(h->uvsList); - dnaINIT(g->dnaCtx, uvsRec->dfltUVS, 1000, 1000); - dnaINIT(g->dnaCtx, uvsRec->extUVS, 1000, 1000); + dnaINIT(g->DnaCTX, uvsRec->dfltUVS, 1000, 1000); + dnaINIT(g->DnaCTX, uvsRec->extUVS, 1000, 1000); h->lastUVS = uvsRec->uvs = uvs; } else { uvsRec = dnaINDEX(h->uvsList, h->uvsList.cnt - 1); @@ -650,8 +650,8 @@ static Format2 *makeFormat2(cmapCtx h) { Mapping *mapping = h->mapping.array; Format2 *fmt = MEM_NEW(h->g, sizeof(Format2)); - dnaINIT(h->g->dnaCtx, fmt->segment, 128, 32); - dnaINIT(h->g->dnaCtx, fmt->glyphId, 2000, 500); + dnaINIT(h->g->DnaCTX, fmt->segment, 128, 32); + dnaINIT(h->g->DnaCTX, fmt->glyphId, 2000, 500); fmt->glyphId.func = glyphIdInit; partitionSegments(h); @@ -823,6 +823,7 @@ static void makeSegment4(hotCtx g, Format4 *fmt, int nSegments, int segment, } } +#if 0 /* Make format 4 cmap */ static void doRemovePUAs(hotCtx g, cmapCtx h, int isMixedByte) { long i; @@ -844,6 +845,7 @@ static void doRemovePUAs(hotCtx g, cmapCtx h, int isMixedByte) { h->mapping.cnt -= nPUAs; } } +#endif static Format4 *makeFormat4(cmapCtx h, unsigned long *length) { hotCtx g = h->g; @@ -856,7 +858,7 @@ static Format4 *makeFormat4(cmapCtx h, unsigned long *length) { Mapping *mapping = h->mapping.array; Format4 *fmt = MEM_NEW(h->g, sizeof(Format4)); - dnaINIT(h->g->dnaCtx, fmt->glyphId, 256, 64); + dnaINIT(h->g->DnaCTX, fmt->glyphId, 256, 64); if (g->convertFlags & HOT_STUB_CMAP4) truncateCmap = 1; @@ -957,7 +959,7 @@ static Format12 *makeFormat12(cmapCtx h, unsigned long *length) { long iSegBeg = 0; /* Index of beginning of segment */ Format12 *fmt = MEM_NEW(h->g, sizeof(Format12)); - dnaINIT(h->g->dnaCtx, fmt->segment, 40, 80); /* xxx dynamic numbers? */ + dnaINIT(h->g->DnaCTX, fmt->segment, 40, 80); /* xxx dynamic numbers? */ for (i = 1; i <= h->mapping.cnt; i++) { if (i == h->mapping.cnt || mapping[i].code != mapping[i - 1].code + 1 || mapping[i].glyphId != mapping[i - 1].glyphId + 1) { @@ -1166,7 +1168,6 @@ int cmapEndEncoding(hotCtx g) { /* o InDesign 1.0 CoolType restrictions: supports only format 0 or 6 */ /* Mac cmap. */ - int format4Selected = 0; unsigned long format4Size = ULONG_MAX; /* Denotes fmt 4 not allowed */ Format4 *format4 = (h->platformId == cmap_MAC || h->platformId == cmap_CUSTOM) @@ -1184,7 +1185,6 @@ int cmapEndEncoding(hotCtx g) { #if HOT_DEBUG cmapMsg(g, hotNOTE, "format 4 cmap created"); #endif - format4Selected = 1; encoding->format = format4; } else { encoding->format = makeFormat6(h, &format6Size); diff --git a/c/makeotf/makeotf_lib/source/hotconv/cmap.h b/c/makeotf/lib/hotconv/cmap.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/cmap.h rename to c/makeotf/lib/hotconv/cmap.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/codepage.h b/c/makeotf/lib/hotconv/codepage.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/codepage.h rename to c/makeotf/lib/hotconv/codepage.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/common.h b/c/makeotf/lib/hotconv/common.h similarity index 95% rename from c/makeotf/makeotf_lib/source/hotconv/common.h rename to c/makeotf/lib/hotconv/common.h index 7b924a83d..9057d0faa 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/common.h +++ b/c/makeotf/lib/hotconv/common.h @@ -26,6 +26,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* --------------------------------- Macros -------------------------------- */ /* Define to supply Microsoft-specific function calling info, e.g. __cdecl */ @@ -70,12 +74,15 @@ typedef uint32_t Tag; #define TAG_ARG(t) (char)((t) >> 24 & 0xff), (char)((t) >> 16 & 0xff), \ (char)((t) >> 8 & 0xff), (char)((t)&0xff) +extern void *hotMemNew(hotCtx g, size_t s); +extern void *hotMemResize(hotCtx g, void *old, size_t s); +extern void hotMemFree(hotCtx g, void *ptr); /* Memory management. MEM_FREE() sets its argument to NULL after freeing */ -#define MEM_NEW(g, s) g->cb.malloc(g->cb.ctx, (s)) -#define MEM_RESIZE(g, p, s) g->cb.realloc(g->cb.ctx, (p), (s)) +#define MEM_NEW(g, s) hotMemNew((g), (s)) +#define MEM_RESIZE(g, p, s) hotMemResize((g), (p), (s)) #define MEM_FREE(g, p) \ do { \ - g->cb.free(g->cb.ctx, (p)); \ + hotMemFree((g), (p)); \ (p) = NULL; \ } while (0) @@ -324,7 +331,7 @@ typedef struct { /* Font information */ /* -------------------------------- Contexts ------------------------------- */ typedef struct mapCtx_ *mapCtx; -typedef struct featCtx_ *featCtx; +typedef void *featVCtx; typedef struct otlCtx_ *otlCtx; typedef struct BASECtx_ *BASECtx; typedef struct CFF_Ctx_ *CFF_Ctx; @@ -358,7 +365,7 @@ struct hotCtx_ { cffCtx cff; tcCtx tc; mapCtx map; - featCtx feat; + featVCtx feat; otlCtx otl; BASECtx BASE; CFF_Ctx CFF_; @@ -380,7 +387,7 @@ struct hotCtx_ { vheaCtx vhea; vmtxCtx vmtx; } ctx; - dnaCtx dnaCtx; + dnaCtx DnaCTX; dnaDCL(char, data); /* CFF data object buffer */ dnaDCL(char, tmp); /* Temporary conversion buffer */ dnaDCL(char, note); /* Buffer for accumulated messages */ @@ -390,7 +397,7 @@ struct hotCtx_ { }; /* Functions */ -void CDECL hotMsg(hotCtx g, int level, char *fmt, ...); +void CDECL hotMsg(hotCtx g, int level, const char *fmt, ...); void hotQuitOnError(hotCtx g); void hotOut2(hotCtx g, short value); @@ -404,10 +411,10 @@ void hotCalcSearchParams(unsigned unitSize, long nUnits, void hotWritePString(hotCtx g, char *string); char *hotGetString(hotCtx g, SID sid, unsigned *length); -void hotAddVertOriginY(hotCtx g, GID gid, short value, - char *filename, int linenum); -void hotAddVertAdvanceY(hotCtx g, GID gid, short value, - char *filename, int linenum); +void hotAddVertOriginY(hotCtx g, GID gid, short value); +void hotAddVertAdvanceY(hotCtx g, GID gid, short value); + +void setVendId_str(hotCtx g, const char *vend); #ifdef SUNOS char *bcopy(const void *src, void *dst, int len); @@ -417,4 +424,8 @@ char *bcopy(const void *src, void *dst, int len); #define OVERRIDE(field) ((field) != SHRT_MAX) +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_COMMON_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/feat.h b/c/makeotf/lib/hotconv/feat.h similarity index 79% rename from c/makeotf/makeotf_lib/source/hotconv/feat.h rename to c/makeotf/lib/hotconv/feat.h index 1a0eee48e..9c7173d4b 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/feat.h +++ b/c/makeotf/lib/hotconv/feat.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #if HOT_DEBUG #define DF_LEVEL ((g->font.debug & HOT_DB_FEAT_2) ? 2 : ((g->font.debug & HOT_DB_FEAT_1) ? 1 : 0)) #define DF(L, p) \ @@ -22,7 +26,7 @@ /* Preferred to 0 for proper otl sorting. This can't conflict with a valid tag since tag characters must be in ASCII 32-126. */ #define TAG_UNDEF 0xFFFFFFFF -#define TAG_STAND_ALONE 0x01010101 /* Feature, script. language tags used for stand-alone lookups */ +#define TAG_STAND_ALONE 0x01010101 // Feature, script. language tags used for stand-alone lookups #define MAX_FEAT_PARAM_NUM 256 @@ -58,23 +62,26 @@ typedef unsigned short Label; -/* --- Linked list support --- */ +typedef struct { /* Subtable record */ + unsigned short Format; + unsigned short FeatUILabelNameID; + unsigned short FeatUITooltipTextNameID; + unsigned short SampleTextNameID; + unsigned short NumNamedParameters; + unsigned short FirstParamUILabelNameID; + dnaDCL(unsigned long, charValues); +} CVParameterFormat; /* Special case format for subtable data. */ -typedef struct AnchorRec_ { - unsigned int format; - short x; - short y; - unsigned short pointIndex; -} AnchorRec; - -#define kMaxAnchors 16 typedef struct GNode_ GNode; typedef struct { - char cnt; + int8_t cnt; short metrics[4]; } MetricsInfo; +#define METRICSINFOEMPTY (MetricsInfo) { -1, { 0, 0, 0, 0 } } +#define METRICSINFOEMPTYPP { -1, { 0, 0, 0, 0 } } + typedef struct { short int x; short int y; @@ -108,7 +115,7 @@ struct GNode_ { GNode *nextCl; /* next element of class */ signed aaltIndex; /* index of contributing feature, in order of the aalt definitions. */ /* Used only within aalCreate. */ - MetricsInfo *metricsInfo; + MetricsInfo metricsInfo; int lookupLabelCount; int lookupLabels[255]; char *markClassName; @@ -118,11 +125,12 @@ struct GNode_ { /* --- Standard functions --- */ void featNew(hotCtx g); -int featFill(hotCtx g); +void featFill(hotCtx g); void featReuse(hotCtx g); void featFree(hotCtx g); /* --- Supplementary functions --- */ +void featMsgPrefix(hotCtx g, char **premsg, char **prefix); GNode *featSetNewNode(hotCtx g, GID gid); void featRecycleNodes(hotCtx g, GNode *node); GNode **featGlyphClassCopy(hotCtx g, GNode **dst, GNode *src); @@ -136,34 +144,16 @@ GNode **featPatternCopy(hotCtx g, GNode **dst, GNode *src, int num); void featExtendNodeToClass(hotCtx g, GNode *node, int num); int featGetGlyphClassCount(hotCtx g, GNode *gc); -#if HOT_FEAT_SUPPORT - -unsigned featGetPatternLen(hotCtx g, GNode *pat); +unsigned int featGetPatternLen(hotCtx g, GNode *pat); void featGlyphClassSort(hotCtx g, GNode **list, int unique, int reportDups); -GNode ***featMakeCrossProduct(hotCtx g, GNode *pat, unsigned *n); +GNode **featMakeCrossProduct(hotCtx g, GNode *pat, unsigned *n); Label featGetNextAnonLabel(hotCtx g); -Label featGetLookupLabel(hotCtx g, GNode *sub, unsigned lkpFlags); - -/* --- PCCTS scanner functions --- */ -int featOpenIncludeFile(hotCtx g, char *filename); -int featCloseIncludeFile(hotCtx g, int closeBase); -char *featTrimParensSpaces(char *text); -void featWrapUpFeatFile(void); -void featSetIncludeReturnMode(int mode); -int featGetIncludeReturnMode(void); -void featSetTagReturnMode(int mode); -int featGetTagReturnMode(void); -int featAddAnonDataChar(char ch, int isEOL); -void featAddNameStringChar(char ch); -void featUnexpectedEOF(void); -int featValidateGPOSChain(hotCtx g, GNode *targ, int lookupType); -#define kDEFAULT_BASECLASS_NAME "FDK_BASE_CLASS" -#define kDEFAULT_LIGATURECLASS_NAME "FDK_LIGATURE_CLASS" -#define kDEFAULT_MARKCLASS_NAME "FDK_DEFAULT_MARK_CLASS" -#define kDEFAULT_COMPONENTCLASS_NAME "FDK_DEFAULT_COMPONENT_CLASS" +int featValidateGPOSChain(hotCtx g, GNode *targ, int lookupType); -#endif /* HOT_FEAT_SUPPORT */ +#ifdef __cplusplus +} +#endif #endif /* HOTCONV_FEAT_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/head.c b/c/makeotf/lib/hotconv/head.c similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/head.c rename to c/makeotf/lib/hotconv/head.c diff --git a/c/makeotf/makeotf_lib/source/hotconv/head.h b/c/makeotf/lib/hotconv/head.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/head.h rename to c/makeotf/lib/hotconv/head.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/hhea.c b/c/makeotf/lib/hotconv/hhea.c similarity index 99% rename from c/makeotf/makeotf_lib/source/hotconv/hhea.c rename to c/makeotf/lib/hotconv/hhea.c index 6b6b60800..ec6ca4c15 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/hhea.c +++ b/c/makeotf/lib/hotconv/hhea.c @@ -9,7 +9,7 @@ #include "hhea.h" #include "hmtx.h" -#include "map.h" +#include "hotmap.h" #include #include diff --git a/c/makeotf/makeotf_lib/source/hotconv/hhea.h b/c/makeotf/lib/hotconv/hhea.h similarity index 90% rename from c/makeotf/makeotf_lib/source/hotconv/hhea.h rename to c/makeotf/lib/hotconv/hhea.h index 3c2d6ab22..42b07dce6 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/hhea.h +++ b/c/makeotf/lib/hotconv/hhea.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define hhea_ TAG('h', 'h', 'e', 'a') /* Standard functions */ @@ -19,4 +23,8 @@ void hheaFree(hotCtx g); /* Supplementary functions */ void hheaSetCaretOffset(hotCtx g, short caretOffset); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_HHEA_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/hmtx.c b/c/makeotf/lib/hotconv/hmtx.c similarity index 96% rename from c/makeotf/makeotf_lib/source/hotconv/hmtx.c rename to c/makeotf/lib/hotconv/hmtx.c index 0896cfc7f..cba827645 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/hmtx.c +++ b/c/makeotf/lib/hotconv/hmtx.c @@ -32,8 +32,8 @@ struct hmtxCtx_ { void hmtxNew(hotCtx g) { hmtxCtx h = MEM_NEW(g, sizeof(struct hmtxCtx_)); - dnaINIT(g->dnaCtx, h->tbl.hMetrics, 315, 14000); - dnaINIT(g->dnaCtx, h->tbl.leftSideBearing, 315, 14000); + dnaINIT(g->DnaCTX, h->tbl.hMetrics, 315, 14000); + dnaINIT(g->DnaCTX, h->tbl.leftSideBearing, 315, 14000); /* Link contexts */ h->g = g; diff --git a/c/makeotf/makeotf_lib/source/hotconv/hmtx.h b/c/makeotf/lib/hotconv/hmtx.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/hmtx.h rename to c/makeotf/lib/hotconv/hmtx.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/hot.c b/c/makeotf/lib/hotconv/hot.c similarity index 94% rename from c/makeotf/makeotf_lib/source/hotconv/hot.c rename to c/makeotf/lib/hotconv/hot.c index 8da50e3e7..4ab6b25a8 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/hot.c +++ b/c/makeotf/lib/hotconv/hot.c @@ -6,7 +6,7 @@ */ #include "sfnt.h" -#include "map.h" +#include "hotmap.h" #include "feat.h" #include "otl.h" #include "name.h" @@ -33,7 +33,7 @@ static void initCharName(void *ctx, long count, CharName *charname) { hotCtx g = ctx; long i; for (i = 0; i < count; i++) { - dnaINIT(g->dnaCtx, *charname, 16, 16); + dnaINIT(g->DnaCTX, *charname, 16, 16); charname++; } return; @@ -53,33 +53,30 @@ static void initOverrides(hotCtx g) { static ctlMemoryCallbacks hot_dna_memcb; static void *hot_manage(ctlMemoryCallbacks *cb, void *old, size_t size) { - hotCallbacks hcb = ((hotCtx)cb->ctx)->cb; + hotCtx h = (hotCtx)cb->ctx; void *p = NULL; if (size > 0) { if (old == NULL) { - p = hcb.malloc(hcb.ctx, size); + p = hotMemNew(h, size); return (p); } else { - p = hcb.realloc(hcb.ctx, old, size); + p = hotMemResize(h, old, size); return (p); } } else { if (old == NULL) { return NULL; } else { - hcb.free(hcb.ctx, old); + hotMemFree(h, old); return NULL; } } } hotCtx hotNew(hotCallbacks *hotcb) { - hotCtx g = hotcb->malloc(hotcb->ctx, sizeof(struct hotCtx_)); tcCallbacks tccb; time_t now; - - g->hadError = 0; - g->convertFlags = 0; + hotCtx g = malloc(sizeof(struct hotCtx_)); if (g == NULL) { if (hotcb->message != NULL) { @@ -88,6 +85,9 @@ hotCtx hotNew(hotCallbacks *hotcb) { hotcb->fatal(hotcb->ctx); } + g->hadError = 0; + g->convertFlags = 0; + /* Set version numbers. The hot library version serves to identify the */ /* software version that built an OTF font and is saved in the Version name */ /* in the name table. The font version serves to identify the OTF font data */ @@ -108,7 +108,7 @@ hotCtx hotNew(hotCallbacks *hotcb) { hot_dna_memcb.manage = hot_manage; /* Initialize contexts for safe freeing */ - g->dnaCtx = NULL; + g->DnaCTX = NULL; g->ctx.cff = NULL; g->ctx.tc = NULL; g->ctx.map = NULL; @@ -131,10 +131,10 @@ hotCtx hotNew(hotCallbacks *hotcb) { g->ctx.vmtx = NULL; g->ctx.VORG = NULL; - g->dnaCtx = dnaNew(&hot_dna_memcb, DNA_CHECK_ARGS); - dnaINIT(g->dnaCtx, g->data, 250, 500); - dnaINIT(g->dnaCtx, g->tmp, 250, 500); - dnaINIT(g->dnaCtx, g->note, 1024, 1024); + g->DnaCTX = dnaNew(&hot_dna_memcb, DNA_CHECK_ARGS); + dnaINIT(g->DnaCTX, g->data, 250, 500); + dnaINIT(g->DnaCTX, g->tmp, 250, 500); + dnaINIT(g->DnaCTX, g->note, 1024, 1024); /* Initialize font information */ #if HOT_DEBUG @@ -144,12 +144,12 @@ hotCtx hotNew(hotCallbacks *hotcb) { g->font.fsSelectionMask_on = -1; g->font.fsSelectionMask_off = -1; g->font.os2Version = 0; - dnaINIT(g->dnaCtx, g->font.FontName, 64, 32); - dnaINIT(g->dnaCtx, g->font.kern.pairs, 1500, 1000); - dnaINIT(g->dnaCtx, g->font.kern.values, 1500, 8500); - dnaINIT(g->dnaCtx, g->font.unenc, 30, 70); + dnaINIT(g->DnaCTX, g->font.FontName, 64, 32); + dnaINIT(g->DnaCTX, g->font.kern.pairs, 1500, 1000); + dnaINIT(g->DnaCTX, g->font.kern.values, 1500, 8500); + dnaINIT(g->DnaCTX, g->font.unenc, 30, 70); g->font.unenc.func = initCharName; - dnaINIT(g->dnaCtx, g->font.glyphs, 315, 350); + dnaINIT(g->DnaCTX, g->font.glyphs, 315, 350); initOverrides(g); @@ -157,9 +157,6 @@ hotCtx hotNew(hotCallbacks *hotcb) { tccb.ctx = hotcb->ctx; tccb.fatal = hotcb->fatal; tccb.message = hotcb->message; /* Suppress messages from library */ - tccb.malloc = hotcb->malloc; - tccb.realloc = hotcb->realloc; - tccb.free = hotcb->free; tccb.psId = hotcb->psId; tccb.psRefill = hotcb->psRefill; tccb.psSize = NULL; @@ -185,10 +182,10 @@ hotCtx hotNew(hotCallbacks *hotcb) { return g; } -void setVendId_str(hotCtx g, char *vend) { +void setVendId_str(hotCtx g, const char *vend) { char *id; - id = (char *)g->cb.malloc(g->cb.ctx, strlen(vend) + 1); + id = (char *)hotMemNew(g, strlen(vend) + 1); strcpy(id, vend); g->font.vendId = id; } @@ -283,13 +280,13 @@ static void cbMessage(void *ctx, int type, char *text) { /* [cffread callback] Allocate memory */ static void *cbMalloc(void *ctx, size_t size) { hotCtx g = ctx; - return g->cb.malloc(g->cb.ctx, size); + return hotMemNew(g, size); } /* [cffread callback] Free memory */ static void cbFree(void *ctx, void *ptr) { hotCtx g = ctx; - g->cb.free(g->cb.ctx, ptr); + hotMemFree(g, ptr); } /* [cffread callback] Seek to offset and return data. */ @@ -385,6 +382,7 @@ char *hotReadFont(hotCtx g, int flags, int *psinfo, hotReadFontOverrides *fontOv fi->FontName.length); g->font.FontName.array[fi->FontName.length] = '\0'; g->font.FontName.cnt = fi->FontName.length + 1; + hotMsg(g, hotHEADING, "processing font <%s>", g->font.FontName.array); /* Copy basic font information */ g->font.Notice = fi->Notice; @@ -453,8 +451,7 @@ char *hotReadFont(hotCtx g, int flags, int *psinfo, hotReadFontOverrides *fontOv } /* Add glyph's vertical origin y-value to glyph info. (Not an API.) */ -void hotAddVertOriginY(hotCtx g, GID gid, short value, - char *filename, int linenum) { +void hotAddVertOriginY(hotCtx g, GID gid, short value) { hotGlyphInfo *hotgi = &g->font.glyphs.array[gid]; /* gid already validated */ if (!(g->convertFlags & HOT_SEEN_VERT_ORIGIN_OVERRIDE)) { @@ -466,13 +463,11 @@ void hotAddVertOriginY(hotCtx g, GID gid, short value, if (hotgi->vOrigY == value) { hotMsg(g, hotNOTE, "Ignoring duplicate VertOriginY entry for " - "glyph %s [%s %d]", - g->note.array, filename, linenum); + "glyph %s", g->note.array); } else { hotMsg(g, hotFATAL, "VertOriginY redefined for " - "glyph %s [%s %d]", - g->note.array, filename, linenum); + "glyph %s", g->note.array); } } else { hotgi->vOrigY = value; @@ -480,8 +475,7 @@ void hotAddVertOriginY(hotCtx g, GID gid, short value, } /* Add glyph's vertical advance width to the glyph info. (Not an API.) */ -void hotAddVertAdvanceY(hotCtx g, GID gid, short value, - char *filename, int linenum) { +void hotAddVertAdvanceY(hotCtx g, GID gid, short value) { hotGlyphInfo *hotgi = &g->font.glyphs.array[gid]; /* gid already validated */ if (!(g->convertFlags & HOT_SEEN_VERT_ORIGIN_OVERRIDE)) { g->convertFlags |= HOT_SEEN_VERT_ORIGIN_OVERRIDE; @@ -492,13 +486,11 @@ void hotAddVertAdvanceY(hotCtx g, GID gid, short value, if (hotgi->vAdv == value) { hotMsg(g, hotNOTE, "Ignoring duplicate VertAdvanceY entry for " - "glyph %s [%s %d]", - g->note.array, filename, linenum); + "glyph %s", g->note.array); } else { hotMsg(g, hotFATAL, "VertAdvanceY redefined for " - "glyph %s [%s %d]", - g->note.array, filename, linenum); + "glyph %s", g->note.array); } } else { hotgi->vAdv = -value; @@ -894,7 +886,7 @@ void patch_cff_fontbbox(hotCtx g) { long count; char *data; long offset, top_dict_start, top_dict_end; - uint8_t b0; + uint8_t b0 = 0; data = g->cb.cffSeek(g->cb.ctx, 0, &count); @@ -1026,7 +1018,7 @@ void hotFree(hotCtx g) { } dnaFREE(g->font.unenc); } - + dnaFree(g->DnaCTX); MEM_FREE(g, g); } @@ -1080,7 +1072,7 @@ void hotAddMiscData(hotCtx g, /* Prepare Windows name by converting \-format numbers to UTF-8. Return 1 on syntax error else 0. */ -static int prepWinName(hotCtx g, signed char *src) { +static int prepWinName(hotCtx g, const char *src) { /* Next state table */ static unsigned char next[5][6] = { /* \ 0-9 a-f A-F * \0 index */ @@ -1110,7 +1102,7 @@ static int prepWinName(hotCtx g, signed char *src) { { E_, A_|H_, A_|H_, A_|H_, E_, E_ }, /* [4] */ }; - char *dst = dnaGROW(g->tmp, (long)strlen(src)); + char *dst = dnaGROW(g->tmp, (long)strlen((char *)src)); int state = 0; unsigned value = 0; @@ -1213,7 +1205,7 @@ static int prepWinName(hotCtx g, signed char *src) { /* Prepare Macintosh name by converting \-format numbers to bytes. Return 1 on syntax error else 0. */ -static int prepMacName(hotCtx g, signed char *src) { +static int prepMacName(hotCtx g, const char *src) { /* Next state table */ static unsigned char next[3][6] = { /* \ 0-9 a-f A-F * \0 index */ @@ -1239,7 +1231,7 @@ static int prepMacName(hotCtx g, signed char *src) { { E_, A_|H_, A_|H_, A_|H_, E_, E_ }, /* [2] */ }; - char *dst = dnaGROW(g->tmp, (long)strlen(src)); + char *dst = dnaGROW(g->tmp, (long)strlen((char *)src)); int state = 0; unsigned value = 0; @@ -1339,7 +1331,7 @@ static int prepMacName(hotCtx g, signed char *src) { int hotAddName(hotCtx g, unsigned short platformId, unsigned short platspecId, unsigned short languageId, unsigned short nameId, - signed char *str) { + const char *str) { if ((platformId == HOT_NAME_MS_PLATFORM) ? prepWinName(g, str) : prepMacName(g, str)) { return 1; } @@ -1414,6 +1406,24 @@ void hotAddAnonTable(hotCtx g, unsigned long tag, hotAnonRefill refill) { /* ---------------------------- Utility Functions --------------------------- */ +void *hotMemNew(hotCtx g, size_t size) { + void *ptr = malloc(size); + if ( ptr == NULL ) + hotMsg(g, hotFATAL, "out of memory"); + return ptr; +} + +void *hotMemResize(hotCtx g, void *old, size_t size) { + void *ptr = realloc(old, size); + if ( ptr == NULL ) + hotMsg(g, hotFATAL, "out of memory"); + return ptr; +} + +void hotMemFree(hotCtx g, void *ptr) { + free(ptr); +} + /* Call fatal if hadError is set (this is set by a hotMsg() hotERROR call) */ void hotQuitOnError(hotCtx g) { if (g->hadError) { @@ -1425,27 +1435,19 @@ void hotQuitOnError(hotCtx g) { hotCMapID should have some max num chars, or else can't predict how long message would be. */ /* Print note, error, warning, or fatal message (from note buffer is fmt is - NULL). If note used, handle reuse of g->note. Prepend FontName. */ -void CDECL hotMsg(hotCtx g, int level, char *fmt, ...) { - void (*fatal)(void *) = NULL; /* Suppress optimizer warning */ - void *ctx = NULL; /* Suppress optimizer warning */ - - if (level == hotFATAL) { - fatal = g->cb.fatal; - ctx = g->cb.ctx; - } - + NULL). If note used, handle reuse of g->note. */ +void CDECL hotMsg(hotCtx g, int level, const char *fmt, ...) { if (g->cb.message != NULL) { - int lenName = g->font.FontName.cnt + 2; + // int lenName = g->font.FontName.cnt + 2; if (fmt == NULL) { - if (g->font.FontName.cnt != 0) { + /*if (g->font.FontName.cnt != 0) { int lenNote = g->note.cnt; dnaEXTEND(g->note, lenName); MOVE(&g->note.array[lenName], g->note.array, lenNote); sprintf(g->note.array, "<%s>", g->font.FontName.array); g->note.array[lenName - 1] = ' '; - } + } */ g->cb.message(g->cb.ctx, level, g->note.array); } else { va_list ap; @@ -1455,12 +1457,26 @@ void CDECL hotMsg(hotCtx g, int level, char *fmt, ...) { size_t p_size; p_size = sizeof(message); - if ((g->font.FontName.cnt != 0) && (lenName < MAX_NOTE_LEN)) { + /* if ((g->font.FontName.cnt != 0) && (lenName < MAX_NOTE_LEN)) { sprintf(message, "<%s> ", g->font.FontName.array); p = &message[lenName]; p_size -= lenName; - } else { + } else { */ p = message; + // } + if ( level != hotHEADING ) { // Don't print headings for headings + char *premsg, *prefix; + featMsgPrefix(g, &premsg, &prefix); + // Usually information that the file has changed + if ( premsg != NULL ) + g->cb.message(g->cb.ctx, hotHEADING, premsg); + + if ( prefix != NULL ) { + // Usually feature file line and character numbers + int l = snprintf(p, p_size, "%s", prefix); + p += l; + p_size -= l; + } } /* xxx If note is used, crop it to MAX_NOTE_LEN. */ @@ -1478,12 +1494,10 @@ void CDECL hotMsg(hotCtx g, int level, char *fmt, ...) { } } - if (g->note.cnt != 0) { - g->note.cnt = 0; - } + g->note.cnt = 0; if (level == hotFATAL) { - fatal(ctx); /* hotFree called from within this */ + g->cb.fatal(g->cb.ctx); } else if (level == hotERROR && !g->hadError) { g->hadError = 1; } @@ -1553,6 +1567,7 @@ char *hotGetString(hotCtx g, SID sid, unsigned *length) { } /* Encode integer and return length */ +#if 0 static int encInteger(short i, unsigned char *cstr) { if (-107 <= i && i <= 107) { /* Single byte number */ @@ -1578,6 +1593,7 @@ static int encInteger(short i, unsigned char *cstr) { return 3; } } +#endif /* --------------------- Temporary Debugging Functions --------------------- */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/map.h b/c/makeotf/lib/hotconv/hotmap.h similarity index 85% rename from c/makeotf/makeotf_lib/source/hotconv/map.h rename to c/makeotf/lib/hotconv/hotmap.h index d190d332d..2450065db 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/map.h +++ b/c/makeotf/lib/hotconv/hotmap.h @@ -9,11 +9,15 @@ * Handles encodings */ -#ifndef MAP_H -#define MAP_H +#ifndef HOTMAP_H +#define HOTMAP_H #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Standard functions */ void mapNew(hotCtx g); int mapFill(hotCtx g); @@ -35,8 +39,8 @@ void mapPrintAFM(hotCtx g); hotGlyphInfo *mapUV2Glyph(hotCtx g, UV uv); GID mapUV2GID(hotCtx g, UV uv); -hotGlyphInfo *mapName2Glyph(hotCtx g, char *gname, char **useAliasDB); -GID mapName2GID(hotCtx g, char *gname, char **useAliasDB); +hotGlyphInfo *mapName2Glyph(hotCtx g, const char *gname, char **useAliasDB); +GID mapName2GID(hotCtx g, const char *gname, char **useAliasDB); void mapGID2Name(hotCtx g, GID gid, char *msg); @@ -52,4 +56,8 @@ GID mapWinANSI2GID(hotCtx g, int code); hotGlyphInfo *mapPlatEnc2Glyph(hotCtx g, int code); GID mapPlatEnc2GID(hotCtx g, int code); -#endif /* MAP_H */ +#ifdef __cplusplus +} +#endif + +#endif /* HOTMAP_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/map.c b/c/makeotf/lib/hotconv/map.c similarity index 98% rename from c/makeotf/makeotf_lib/source/hotconv/map.c rename to c/makeotf/lib/hotconv/map.c index 007b3dce0..351716478 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/map.c +++ b/c/makeotf/lib/hotconv/map.c @@ -7,7 +7,7 @@ * Assigns UVs, feeds cmap module */ -#include "map.h" +#include "hotmap.h" #include "OS_2.h" #include "cmap.h" #include "GPOS.h" @@ -306,28 +306,26 @@ static void mapInit(hotCtx g); void mapNew(hotCtx g) { mapCtx h = MEM_NEW(g, sizeof(struct mapCtx_)); - dnaINIT(g->dnaCtx, h->ps.buf, 35000, 50000); /* ? xxx */ + dnaINIT(g->DnaCTX, h->ps.buf, 35000, 50000); /* ? xxx */ h->ps.cb.ctx = g->cb.ctx; h->ps.cb.fatal = g->cb.fatal; - h->ps.cb.malloc = g->cb.malloc; - h->ps.cb.free = g->cb.free; h->ps.cb.buf = &h->ps.buf; h->ps.cb.message = g->cb.message; - dnaINIT(g->dnaCtx, h->cid.hor.range, 6970, 2000); /* Optimized for UniJIS-UCS2-[HV] */ - dnaINIT(g->dnaCtx, h->cid.ver.map, 180, 180); - dnaINIT(g->dnaCtx, h->cid.mac.codespace, 5, 10); - dnaINIT(g->dnaCtx, h->cid.mac.range, 225, 225); /* Optimized for 83pv-RKSJ-H */ + dnaINIT(g->DnaCTX, h->cid.hor.range, 6970, 2000); /* Optimized for UniJIS-UCS2-[HV] */ + dnaINIT(g->DnaCTX, h->cid.ver.map, 180, 180); + dnaINIT(g->DnaCTX, h->cid.mac.codespace, 5, 10); + dnaINIT(g->DnaCTX, h->cid.mac.range, 225, 225); /* Optimized for 83pv-RKSJ-H */ h->cid.hor.name = SINX_UNDEF; h->cid.ver.name = SINX_UNDEF; h->cid.mac.name = SINX_UNDEF; - dnaINIT(g->dnaCtx, h->uvs.entries, 15000, 500); /* Optimized for 83pv-RKSJ-H */ + dnaINIT(g->DnaCTX, h->uvs.entries, 15000, 500); /* Optimized for 83pv-RKSJ-H */ - dnaINIT(g->dnaCtx, h->sort.gname, 400, 7000); - dnaINIT(g->dnaCtx, h->sort.uv, 400, 6000); - dnaINIT(g->dnaCtx, h->sort.glyphAddlUV, 10, 60); + dnaINIT(g->DnaCTX, h->sort.gname, 400, 7000); + dnaINIT(g->DnaCTX, h->sort.uv, 400, 6000); + dnaINIT(g->DnaCTX, h->sort.glyphAddlUV, 10, 60); h->sort.firstAddlUV = UV_UNDEF; h->sort.lastAddlUV = 0; h->sort.nAddlUV = 0; @@ -336,7 +334,7 @@ void mapNew(hotCtx g) { h->minBmpUV = LONG_MAX; h->maxBmpUV = LONG_MIN; - dnaINIT(g->dnaCtx, h->str, 2400, 3600); + dnaINIT(g->DnaCTX, h->str, 2400, 3600); /* Link contexts */ h->g = g; @@ -387,6 +385,7 @@ GID mapCID2GID(hotCtx g, CID cid) { /* Sort GNAME_UNREC glyphs before others, and among the GNAME_UNREC glyphs, sort GNAME_UNREC_HAS_SUPP after the others. */ +#if 0 static int CDECL cmpUnrecGlyphName(const void *first, const void *second) { hotGlyphInfo *a = *(hotGlyphInfo **)first; hotGlyphInfo *b = *(hotGlyphInfo **)second; @@ -410,6 +409,7 @@ static int CDECL cmpUnrecGlyphName(const void *first, const void *second) { return 0; } } +#endif static int CDECL cmpGlyphName(const void *a, const void *b) { return strcmp((*(hotGlyphInfo **)a)->gname.str, @@ -424,9 +424,9 @@ static int CDECL matchGlyphName(const void *key, const void *value) { is present, it considers gname as an alias and uses the "real" name from the glyph alias db and sets *useAliasDB to that name. If useAliasDB is non-NULL and glyph alias db is not present, sets *useAliasDB to NULL. */ -hotGlyphInfo *mapName2Glyph(hotCtx g, char *gname, char **useAliasDB) { +hotGlyphInfo *mapName2Glyph(hotCtx g, const char *gname, char **useAliasDB) { mapCtx h = g->ctx.map; - char *realName = gname; + const char *realName = gname; hotGlyphInfo **found; if (IS_CID(g) && useAliasDB == NULL) { @@ -435,7 +435,7 @@ hotGlyphInfo *mapName2Glyph(hotCtx g, char *gname, char **useAliasDB) { if (useAliasDB != NULL) { if (g->cb.getFinalGlyphName != NULL) { - *useAliasDB = g->cb.getFinalGlyphName(g->cb.ctx, gname); + *useAliasDB = g->cb.getFinalGlyphName(g->cb.ctx, (char *)gname); if (strcmp(*useAliasDB, gname) == 0) *useAliasDB = NULL; else @@ -452,7 +452,7 @@ hotGlyphInfo *mapName2Glyph(hotCtx g, char *gname, char **useAliasDB) { return NULL; return mapCID2Glyph(g, cid); } - found = (hotGlyphInfo **)bsearch(realName, h->sort.gname.array, + found = (hotGlyphInfo **)bsearch((char *)realName, h->sort.gname.array, h->sort.gname.cnt, sizeof(hotGlyphInfo *), matchGlyphName); if (found != NULL) { @@ -463,24 +463,21 @@ hotGlyphInfo *mapName2Glyph(hotCtx g, char *gname, char **useAliasDB) { } void mapGID2Name(hotCtx g, GID gid, char *msg) { - int len; hotGlyphInfo *hGID = &g->font.glyphs.array[gid]; if (hGID->srcName == NULL) { sprintf(msg, "%s", hGID->gname.str); - len = strlen(msg); } else { if (g->convertFlags & HOT_CONVERT_FINAL_NAMES) sprintf(msg, "%s", hGID->gname.str); else sprintf(msg, "%s", hGID->srcName); - len = strlen(msg); } } /* Map glyph name to GID; using alias db if present (see mapName2Glyph comments for useAliasDB details) */ -GID mapName2GID(hotCtx g, char *gname, char **useAliasDB) { +GID mapName2GID(hotCtx g, const char *gname, char **useAliasDB) { hotGlyphInfo *gi = mapName2Glyph(g, gname, useAliasDB); return (gi != NULL) ? GET_GID(gi) : GID_UNDEF; } @@ -835,7 +832,7 @@ static void readRange(hotCtx g, psToken *last, char rangeType, int *isMac, if (codespace) { if (i == 0) { - dnaINIT(g->dnaCtx, tmpCodespace, 5, 10); + dnaINIT(g->DnaCTX, tmpCodespace, 5, 10); } if (*isMac != 1) { *isMac = (loLength == 1); @@ -1864,6 +1861,7 @@ static void setOS_2Fields(hotCtx g) { } /* Create a custom cmap which stores the custom PS encoding. */ +#if 0 static void makeCustomcmap(hotCtx g) { long i; uint8_t charset = g->font.win.CharSet; @@ -1892,6 +1890,7 @@ static void makeCustomcmap(hotCtx g) { } cmapEndEncoding(g); /* Custom */ } +#endif /* Check if Mac heuristic glyphs are present in the given encoding (don't check unencoded glyphs). Return codePage index if detected, -1 otherwise. (This @@ -2280,7 +2279,7 @@ static void AFMPrintCharMetrics(hotCtx g) { /* Caution: multiply encoded glyphs */ long nGlyphs = g->font.glyphs.cnt; dnaDCL(AFMChar, chars); - dnaINIT(g->dnaCtx, chars, 400, 7000); + dnaINIT(g->DnaCTX, chars, 400, 7000); for (i = 1; i < nGlyphs; i++) { cffSupCode *sup; @@ -2344,7 +2343,7 @@ static void AFMPrintKernData(hotCtx g) { int i; int nPairs = g->font.kern.pairs.cnt; dnaDCL(KernNamePair, pairs); - dnaINIT(g->dnaCtx, pairs, 1500, 1000); + dnaINIT(g->DnaCTX, pairs, 1500, 1000); if (nPairs == 0) { return; diff --git a/c/makeotf/makeotf_lib/source/hotconv/maxp.c b/c/makeotf/lib/hotconv/maxp.c similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/maxp.c rename to c/makeotf/lib/hotconv/maxp.c diff --git a/c/makeotf/makeotf_lib/source/hotconv/maxp.h b/c/makeotf/lib/hotconv/maxp.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/maxp.h rename to c/makeotf/lib/hotconv/maxp.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/name.c b/c/makeotf/lib/hotconv/name.c similarity index 99% rename from c/makeotf/makeotf_lib/source/hotconv/name.c rename to c/makeotf/lib/hotconv/name.c index 52aec9386..a48680016 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/name.c +++ b/c/makeotf/lib/hotconv/name.c @@ -118,6 +118,7 @@ static char *getName(nameCtx h, /* Get a name and checks characters for for 7-bit cleanliness. Return NULL if no name or not 7-bit clean, else name string. */ +#if 0 static char *get7BitCleanName(nameCtx h, unsigned short platformId, unsigned short platspecId, @@ -134,6 +135,7 @@ static char *get7BitCleanName(nameCtx h, } return str; } +#endif /* Get Windows default 7-bit clean name. */ static char *getWinDfltName(nameCtx h, unsigned short nameId) { @@ -149,6 +151,7 @@ static char *getWinDfltName(nameCtx h, unsigned short nameId) { } /* Get Macintosh default 7-bit clean name. */ +#if 0 static char *getMacDfltName(nameCtx h, unsigned short nameId) { return getName(h, HOT_NAME_MAC_PLATFORM, @@ -156,6 +159,7 @@ static char *getMacDfltName(nameCtx h, unsigned short nameId) { HOT_NAME_MAC_ENGLISH, nameId); } +#endif /* ----------------------------- Name Addition ----------------------------- */ @@ -243,10 +247,10 @@ void nameNew(hotCtx g) { nameCtx h = MEM_NEW(g, sizeof(struct nameCtx_)); h->userNameId = 256; - dnaINIT(g->dnaCtx, h->tmp, 250, 250); - dnaINIT(g->dnaCtx, h->addstrs, 1000, 1000); - dnaINIT(g->dnaCtx, h->tbl.record, 50, 20); - dnaINIT(g->dnaCtx, h->tbl.strings, 1000, 1000); + dnaINIT(g->DnaCTX, h->tmp, 250, 250); + dnaINIT(g->DnaCTX, h->addstrs, 1000, 1000); + dnaINIT(g->DnaCTX, h->tbl.record, 50, 20); + dnaINIT(g->DnaCTX, h->tbl.strings, 1000, 1000); /* Link contexts */ h->g = g; diff --git a/c/makeotf/makeotf_lib/source/hotconv/name.h b/c/makeotf/lib/hotconv/name.h similarity index 94% rename from c/makeotf/makeotf_lib/source/hotconv/name.h rename to c/makeotf/lib/hotconv/name.h index 373b283d8..dd9e5b687 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/name.h +++ b/c/makeotf/lib/hotconv/name.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define name_ TAG('n', 'a', 'm', 'e') #define MISSING_MAC_DEFAULT_NAME 0x0002 @@ -32,4 +36,8 @@ unsigned short nameReserveUserID(hotCtx g); int nameVerifyDefaultNames(hotCtx g, unsigned short nameId); bool nameVerifyIDExists(hotCtx g, unsigned short nameId); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_NAME_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/otl.c b/c/makeotf/lib/hotconv/otl.c similarity index 99% rename from c/makeotf/makeotf_lib/source/hotconv/otl.c rename to c/makeotf/lib/hotconv/otl.c index b15e3f45e..af4738269 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/otl.c +++ b/c/makeotf/lib/hotconv/otl.c @@ -413,7 +413,7 @@ static void coverageRecordInit(void *ctx, long count, CoverageRecord *rec) { hotCtx g = ctx; long i; for (i = 0; i < count; i++) { - dnaINIT(g->dnaCtx, rec->glyph, 50, 50); + dnaINIT(g->DnaCTX, rec->glyph, 50, 50); rec++; } return; @@ -422,7 +422,7 @@ static void coverageRecordInit(void *ctx, long count, CoverageRecord *rec) { /* Initialize coverage tables */ static void coverageNew(hotCtx g, otlTbl t) { t->coverage.offset = 0; - dnaINIT(g->dnaCtx, t->coverage.tables, 10, 5); + dnaINIT(g->DnaCTX, t->coverage.tables, 10, 5); t->coverage.tables.func = coverageRecordInit; } @@ -716,7 +716,7 @@ static void classRecordInit(void *ctx, long count, ClassRecord *rec) { hotCtx g = ctx; long i; for (i = 0; i < count; i++) { - dnaINIT(g->dnaCtx, rec->map, 50, 50); + dnaINIT(g->DnaCTX, rec->map, 50, 50); rec++; } return; @@ -724,7 +724,7 @@ static void classRecordInit(void *ctx, long count, ClassRecord *rec) { static void classNew(hotCtx g, otlTbl t) { t->class.offset = 0; - dnaINIT(g->dnaCtx, t->class.tables, 10, 5); + dnaINIT(g->DnaCTX, t->class.tables, 10, 5); t->class.tables.func = classRecordInit; } @@ -1007,9 +1007,9 @@ Offset otlClassEnd(hotCtx g, otlTbl t) { otlTbl otlTableNew(hotCtx g) { otlTbl t = MEM_NEW(g, sizeof(struct otlTbl_)); - dnaINIT(g->dnaCtx, t->subtable, 10, 5); - dnaINIT(g->dnaCtx, t->label, 50, 100); - dnaINIT(g->dnaCtx, t->refLabel, 50, 100); + dnaINIT(g->DnaCTX, t->subtable, 10, 5); + dnaINIT(g->DnaCTX, t->label, 50, 100); + dnaINIT(g->DnaCTX, t->refLabel, 50, 100); #if HOT_DEBUG t->subtable.func = initSubtable; @@ -1594,7 +1594,7 @@ static Offset fillFeatureList(hotCtx g, otlTbl t) { Subtable *sub = &t->subtable.array[iFeature]; FeatureRecord *rec = &t->tbl.FeatureList_.FeatureRecord[i]; Feature *feature = &rec->Feature_; - /* if ( sub->feature == (Tag)TAG_STAND_ALONE) */ + /* if ( sub->feature == TAG_STAND_ALONE) */ /* continue; */ /* Fill FeatureRecord */ @@ -2027,7 +2027,7 @@ void otlSubtableAdd(hotCtx g, otlTbl t, Tag script, Tag language, Tag feature, sub->fmt = fmt; sub->isFeatParam = isFeatParam; - if (feature == (Tag)TAG_STAND_ALONE) { + if (feature == TAG_STAND_ALONE) { sub->seenInFeature = 0; } else { sub->seenInFeature = 1; @@ -2036,7 +2036,7 @@ void otlSubtableAdd(hotCtx g, otlTbl t, Tag script, Tag language, Tag feature, if (script == TAG_UNDEF) { t->nAnonSubtables++; } - if (feature == (Tag)TAG_STAND_ALONE) { + if (feature == TAG_STAND_ALONE) { t->nStandAloneSubtables++; } diff --git a/c/makeotf/makeotf_lib/source/hotconv/otl.h b/c/makeotf/lib/hotconv/otl.h similarity index 98% rename from c/makeotf/makeotf_lib/source/hotconv/otl.h rename to c/makeotf/lib/hotconv/otl.h index 6ca9ca89b..36e2681fe 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/otl.h +++ b/c/makeotf/lib/hotconv/otl.h @@ -8,6 +8,10 @@ #include "common.h" #include "feat.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Module-wide functions */ void otlNew(hotCtx g); void otlFree(hotCtx g); @@ -84,7 +88,7 @@ void otlCoverageWrite(hotCtx g, otlTbl t); /* --- Class table --- */ void otlClassBegin(hotCtx g, otlTbl t); -void otlClassAddMapping(hotCtx g, otlTbl t, GID glyph, unsigned class); +void otlClassAddMapping(hotCtx g, otlTbl t, GID glyph, unsigned cls); Offset otlClassEnd(hotCtx g, otlTbl t); void otlClassWrite(hotCtx g, otlTbl t); @@ -99,4 +103,8 @@ void otlDeviceWrite(hotCtx g, otlTbl t); LOffset otlGetCoverageSize(otlTbl t); LOffset otlGetClassSize(otlTbl t); +#ifdef __cplusplus +} +#endif + #endif /* OTL_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/post.c b/c/makeotf/lib/hotconv/post.c similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/post.c rename to c/makeotf/lib/hotconv/post.c diff --git a/c/makeotf/makeotf_lib/source/hotconv/post.h b/c/makeotf/lib/hotconv/post.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/post.h rename to c/makeotf/lib/hotconv/post.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/schinese.h b/c/makeotf/lib/hotconv/schinese.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/schinese.h rename to c/makeotf/lib/hotconv/schinese.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/sfnt.c b/c/makeotf/lib/hotconv/sfnt.c similarity index 98% rename from c/makeotf/makeotf_lib/source/hotconv/sfnt.c rename to c/makeotf/lib/hotconv/sfnt.c index 75eac4989..49fb318d9 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/sfnt.c +++ b/c/makeotf/lib/hotconv/sfnt.c @@ -107,9 +107,9 @@ void sfntNew(hotCtx g) { g->ctx.sfnt = h; /* Initialize tables */ - dnaINIT(g->dnaCtx, h->tbl.directory, SFNT_TABLE_CNT, 5); + dnaINIT(g->DnaCTX, h->tbl.directory, SFNT_TABLE_CNT, 5); - dnaINIT(g->dnaCtx, h->funcs, SFNT_TABLE_CNT + 2, 5); + dnaINIT(g->DnaCTX, h->funcs, SFNT_TABLE_CNT + 2, 5); dnaSET_CNT(h->funcs, SFNT_TABLE_CNT); COPY(h->funcs.array, g_funcs, SFNT_TABLE_CNT); for (i = 0; i < SFNT_TABLE_CNT; i++) { diff --git a/c/makeotf/makeotf_lib/source/hotconv/sfnt.h b/c/makeotf/lib/hotconv/sfnt.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/sfnt.h rename to c/makeotf/lib/hotconv/sfnt.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/uniblock.h b/c/makeotf/lib/hotconv/uniblock.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/uniblock.h rename to c/makeotf/lib/hotconv/uniblock.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/vhea.c b/c/makeotf/lib/hotconv/vhea.c similarity index 99% rename from c/makeotf/makeotf_lib/source/hotconv/vhea.c rename to c/makeotf/lib/hotconv/vhea.c index 5b3e165a6..f36d945e9 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/vhea.c +++ b/c/makeotf/lib/hotconv/vhea.c @@ -9,7 +9,7 @@ #include "vhea.h" #include "vmtx.h" -#include "map.h" +#include "hotmap.h" #include diff --git a/c/makeotf/makeotf_lib/source/hotconv/vhea.h b/c/makeotf/lib/hotconv/vhea.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/vhea.h rename to c/makeotf/lib/hotconv/vhea.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/vmtx.c b/c/makeotf/lib/hotconv/vmtx.c similarity index 96% rename from c/makeotf/makeotf_lib/source/hotconv/vmtx.c rename to c/makeotf/lib/hotconv/vmtx.c index 87c78598b..02f41f323 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/vmtx.c +++ b/c/makeotf/lib/hotconv/vmtx.c @@ -38,8 +38,8 @@ struct vmtxCtx_ { void vmtxNew(hotCtx g) { vmtxCtx h = MEM_NEW(g, sizeof(struct vmtxCtx_)); - dnaINIT(g->dnaCtx, h->tbl.vMetrics, 14000, 14000); - dnaINIT(g->dnaCtx, h->tbl.topSideBearing, 14000, 14000); + dnaINIT(g->DnaCTX, h->tbl.vMetrics, 14000, 14000); + dnaINIT(g->DnaCTX, h->tbl.topSideBearing, 14000, 14000); /* Link contexts */ h->g = g; diff --git a/c/makeotf/makeotf_lib/source/hotconv/vmtx.h b/c/makeotf/lib/hotconv/vmtx.h similarity index 90% rename from c/makeotf/makeotf_lib/source/hotconv/vmtx.h rename to c/makeotf/lib/hotconv/vmtx.h index 94de5d0ae..beb59ebe4 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/vmtx.h +++ b/c/makeotf/lib/hotconv/vmtx.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define vmtx_ TAG('v', 'm', 't', 'x') /* Standard functions */ @@ -19,4 +23,8 @@ void vmtxFree(hotCtx g); /* Supplementary Functions */ int vmtxGetNLongVerMetrics(hotCtx g); +#ifdef __cplusplus +} +#endif + #endif /* HOTCONV_VMTX_H */ diff --git a/c/makeotf/makeotf_lib/source/hotconv/winansi.h b/c/makeotf/lib/hotconv/winansi.h similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/winansi.h rename to c/makeotf/lib/hotconv/winansi.h diff --git a/c/makeotf/makeotf_lib/source/hotconv/xxxx.c b/c/makeotf/lib/hotconv/xxxx.c similarity index 100% rename from c/makeotf/makeotf_lib/source/hotconv/xxxx.c rename to c/makeotf/lib/hotconv/xxxx.c diff --git a/c/makeotf/makeotf_lib/source/hotconv/xxxx.h b/c/makeotf/lib/hotconv/xxxx.h similarity index 89% rename from c/makeotf/makeotf_lib/source/hotconv/xxxx.h rename to c/makeotf/lib/hotconv/xxxx.h index 1eb356bc0..402adc390 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/xxxx.h +++ b/c/makeotf/lib/hotconv/xxxx.h @@ -7,6 +7,10 @@ #include "common.h" +#ifdef __cplusplus +extern "C" { +#endif + #define xxxx_ TAG('x', 'x', 'x', 'x') /* Standard functions */ @@ -18,4 +22,8 @@ void xxxxFree(hotCtx g); /* Supplementary functions */ +#ifdef __cplusplus +} +#endif + #endif /* XXXX_H */ diff --git a/c/makeotf/lib/pstoken/CMakeLists.txt b/c/makeotf/lib/pstoken/CMakeLists.txt new file mode 100644 index 000000000..2bb9e98e5 --- /dev/null +++ b/c/makeotf/lib/pstoken/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(makeotf_pstoken STATIC pstoken.c) + +target_compile_definitions(makeotf_pstoken PRIVATE PSTOKEN_DEBUG=1 CFF_DEBUG=1 CFF_T13_SUPPORT=0) diff --git a/c/makeotf/makeotf_lib/source/pstoken/pstoken.c b/c/makeotf/lib/pstoken/pstoken.c similarity index 99% rename from c/makeotf/makeotf_lib/source/pstoken/pstoken.c rename to c/makeotf/lib/pstoken/pstoken.c index dbcf25551..7194628d4 100644 --- a/c/makeotf/makeotf_lib/source/pstoken/pstoken.c +++ b/c/makeotf/lib/pstoken/pstoken.c @@ -202,7 +202,12 @@ void psSetPlain(psCtx h) { /* Begin new file parse */ psCtx psNew(psCallbacks *cb) { /* Allocate context */ - psCtx h = cb->malloc(cb->ctx, sizeof(struct psCtx_)); + psCtx h = malloc(sizeof(struct psCtx_)); + if ( h == NULL ) { + if (cb->message != NULL) + cb->message(cb->ctx, psFATAL, "out of memory"); + cb->fatal(cb->ctx); + } h->cb = *cb; h->left = 0; @@ -219,7 +224,7 @@ psCtx psNew(psCallbacks *cb) { /* End file parse */ void psFree(psCtx h) { - h->cb.free(h->cb.ctx, h); /* Free context */ + free(h); /* Free context */ } /* Skip over string token */ diff --git a/c/makeotf/lib/typecomp/CMakeLists.txt b/c/makeotf/lib/typecomp/CMakeLists.txt new file mode 100644 index 000000000..b3bc439af --- /dev/null +++ b/c/makeotf/lib/typecomp/CMakeLists.txt @@ -0,0 +1,54 @@ +add_library(typecomp STATIC + cdv1axis.h + charset.c + charset.h + common.h + cs.c + cs.h + dict.c + dict.h + encoding.c + encoding.h + eurosans.h + euroserf.h + fdselect.c + fdselect.h + fillinmm_sans.h + fillinmm_serif.h + font.h + igara0.h + igara1.h + igara2.h + igara3.h + igara4.h + isocenm.h + jenson.h + jimbo0.h + jimbo1.h + jimbo2.h + kepler.h + package.h + parse.c + parse.h + recode.c + recode.h + rgara0.h + rgara1.h + rgara2.h + rgara3.h + sindex.c + sindex.h + subr.c + subr.h + t13.c + t13.h + tc.c +) + +target_compile_definitions(typecomp PRIVATE + TC_HINT_CHECK=1 + TC_T13_SUPPORT=0 + TC_EURO_SUPPORT=1 + TC_SUBR_SUPPORT=1 + TC_DEBUG=1 +) diff --git a/c/makeotf/makeotf_lib/source/typecomp/cdv1axis.h b/c/makeotf/lib/typecomp/cdv1axis.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/cdv1axis.h rename to c/makeotf/lib/typecomp/cdv1axis.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/charset.c b/c/makeotf/lib/typecomp/charset.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/charset.c rename to c/makeotf/lib/typecomp/charset.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/charset.h b/c/makeotf/lib/typecomp/charset.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/charset.h rename to c/makeotf/lib/typecomp/charset.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/common.h b/c/makeotf/lib/typecomp/common.h similarity index 95% rename from c/makeotf/makeotf_lib/source/typecomp/common.h rename to c/makeotf/lib/typecomp/common.h index 62730afb5..0a1bb875b 100644 --- a/c/makeotf/makeotf_lib/source/typecomp/common.h +++ b/c/makeotf/lib/typecomp/common.h @@ -52,9 +52,12 @@ void CDECL tcWarning(tcCtx g, char *fmt, ...); void CDECL tcNote(tcCtx g, char *fmt, ...); /* --- Memory management --- */ -#define MEM_NEW(g, s) g->cb.malloc(g->cb.ctx, (s)) -#define MEM_RESIZE(g, p, s) g->cb.realloc(g->cb.ctx, (p), (s)) -#define MEM_FREE(g, p) g->cb.free(g->cb.ctx, (p)) +extern void *tcMemNew(tcCtx g, size_t s); +extern void *tcMemResize(tcCtx g, void *old, size_t s); +extern void tcMemFree(tcCtx g, void *ptr); +#define MEM_NEW(g, s) tcMemNew((g), (s)) +#define MEM_RESIZE(g, p, s) tcMemResize((g), (p), (s)) +#define MEM_FREE(g, p) tcMemFree((g), (p)) /* --- Output interface --- */ void tcOut2(tcCtx g, short value); diff --git a/c/makeotf/makeotf_lib/source/typecomp/cs.c b/c/makeotf/lib/typecomp/cs.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/cs.c rename to c/makeotf/lib/typecomp/cs.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/cs.h b/c/makeotf/lib/typecomp/cs.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/cs.h rename to c/makeotf/lib/typecomp/cs.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/dict.c b/c/makeotf/lib/typecomp/dict.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/dict.c rename to c/makeotf/lib/typecomp/dict.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/dict.h b/c/makeotf/lib/typecomp/dict.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/dict.h rename to c/makeotf/lib/typecomp/dict.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/encoding.c b/c/makeotf/lib/typecomp/encoding.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/encoding.c rename to c/makeotf/lib/typecomp/encoding.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/encoding.h b/c/makeotf/lib/typecomp/encoding.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/encoding.h rename to c/makeotf/lib/typecomp/encoding.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/eurosans.h b/c/makeotf/lib/typecomp/eurosans.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/eurosans.h rename to c/makeotf/lib/typecomp/eurosans.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/euroserf.h b/c/makeotf/lib/typecomp/euroserf.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/euroserf.h rename to c/makeotf/lib/typecomp/euroserf.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/fdselect.c b/c/makeotf/lib/typecomp/fdselect.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/fdselect.c rename to c/makeotf/lib/typecomp/fdselect.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/fdselect.h b/c/makeotf/lib/typecomp/fdselect.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/fdselect.h rename to c/makeotf/lib/typecomp/fdselect.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/fill_in_mm.cs b/c/makeotf/lib/typecomp/fill_in_mm.cs similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/fill_in_mm.cs rename to c/makeotf/lib/typecomp/fill_in_mm.cs diff --git a/c/makeotf/makeotf_lib/source/typecomp/fill_in_mm.uni_cs b/c/makeotf/lib/typecomp/fill_in_mm.uni_cs similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/fill_in_mm.uni_cs rename to c/makeotf/lib/typecomp/fill_in_mm.uni_cs diff --git a/c/makeotf/makeotf_lib/source/typecomp/fillinmm_sans.h b/c/makeotf/lib/typecomp/fillinmm_sans.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/fillinmm_sans.h rename to c/makeotf/lib/typecomp/fillinmm_sans.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/fillinmm_serif.h b/c/makeotf/lib/typecomp/fillinmm_serif.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/fillinmm_serif.h rename to c/makeotf/lib/typecomp/fillinmm_serif.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/font.h b/c/makeotf/lib/typecomp/font.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/font.h rename to c/makeotf/lib/typecomp/font.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/igara0.h b/c/makeotf/lib/typecomp/igara0.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/igara0.h rename to c/makeotf/lib/typecomp/igara0.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/igara1.h b/c/makeotf/lib/typecomp/igara1.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/igara1.h rename to c/makeotf/lib/typecomp/igara1.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/igara2.h b/c/makeotf/lib/typecomp/igara2.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/igara2.h rename to c/makeotf/lib/typecomp/igara2.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/igara3.h b/c/makeotf/lib/typecomp/igara3.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/igara3.h rename to c/makeotf/lib/typecomp/igara3.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/igara4.h b/c/makeotf/lib/typecomp/igara4.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/igara4.h rename to c/makeotf/lib/typecomp/igara4.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/isocenm.h b/c/makeotf/lib/typecomp/isocenm.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/isocenm.h rename to c/makeotf/lib/typecomp/isocenm.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/jenson.h b/c/makeotf/lib/typecomp/jenson.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/jenson.h rename to c/makeotf/lib/typecomp/jenson.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/jimbo0.h b/c/makeotf/lib/typecomp/jimbo0.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/jimbo0.h rename to c/makeotf/lib/typecomp/jimbo0.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/jimbo1.h b/c/makeotf/lib/typecomp/jimbo1.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/jimbo1.h rename to c/makeotf/lib/typecomp/jimbo1.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/jimbo2.h b/c/makeotf/lib/typecomp/jimbo2.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/jimbo2.h rename to c/makeotf/lib/typecomp/jimbo2.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/kepler.h b/c/makeotf/lib/typecomp/kepler.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/kepler.h rename to c/makeotf/lib/typecomp/kepler.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/package.h b/c/makeotf/lib/typecomp/package.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/package.h rename to c/makeotf/lib/typecomp/package.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/parse.c b/c/makeotf/lib/typecomp/parse.c similarity index 99% rename from c/makeotf/makeotf_lib/source/typecomp/parse.c rename to c/makeotf/lib/typecomp/parse.c index a61b10fee..963a20015 100644 --- a/c/makeotf/makeotf_lib/source/typecomp/parse.c +++ b/c/makeotf/lib/typecomp/parse.c @@ -2532,8 +2532,6 @@ void parseNew(tcCtx g) { /* Initialize PostScript callbacks */ h->psCB.ctx = g->cb.ctx; h->psCB.fatal = g->cb.fatal; - h->psCB.malloc = g->cb.malloc; - h->psCB.free = g->cb.free; h->psCB.psId = g->cb.psId; h->psCB.psRefill = g->cb.psRefill; h->psCB.buf = &h->buf; diff --git a/c/makeotf/makeotf_lib/source/typecomp/parse.h b/c/makeotf/lib/typecomp/parse.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/parse.h rename to c/makeotf/lib/typecomp/parse.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/recode.c b/c/makeotf/lib/typecomp/recode.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/recode.c rename to c/makeotf/lib/typecomp/recode.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/recode.h b/c/makeotf/lib/typecomp/recode.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/recode.h rename to c/makeotf/lib/typecomp/recode.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/rgara0.h b/c/makeotf/lib/typecomp/rgara0.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/rgara0.h rename to c/makeotf/lib/typecomp/rgara0.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/rgara1.h b/c/makeotf/lib/typecomp/rgara1.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/rgara1.h rename to c/makeotf/lib/typecomp/rgara1.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/rgara2.h b/c/makeotf/lib/typecomp/rgara2.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/rgara2.h rename to c/makeotf/lib/typecomp/rgara2.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/rgara3.h b/c/makeotf/lib/typecomp/rgara3.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/rgara3.h rename to c/makeotf/lib/typecomp/rgara3.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/sindex.c b/c/makeotf/lib/typecomp/sindex.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/sindex.c rename to c/makeotf/lib/typecomp/sindex.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/sindex.h b/c/makeotf/lib/typecomp/sindex.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/sindex.h rename to c/makeotf/lib/typecomp/sindex.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/subr.c b/c/makeotf/lib/typecomp/subr.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/subr.c rename to c/makeotf/lib/typecomp/subr.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/subr.h b/c/makeotf/lib/typecomp/subr.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/subr.h rename to c/makeotf/lib/typecomp/subr.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/t13.c b/c/makeotf/lib/typecomp/t13.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/t13.c rename to c/makeotf/lib/typecomp/t13.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/t13.h b/c/makeotf/lib/typecomp/t13.h similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/t13.h rename to c/makeotf/lib/typecomp/t13.h diff --git a/c/makeotf/makeotf_lib/source/typecomp/t13fail.c b/c/makeotf/lib/typecomp/t13fail.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/t13fail.c rename to c/makeotf/lib/typecomp/t13fail.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/t13supp.c b/c/makeotf/lib/typecomp/t13supp.c similarity index 100% rename from c/makeotf/makeotf_lib/source/typecomp/t13supp.c rename to c/makeotf/lib/typecomp/t13supp.c diff --git a/c/makeotf/makeotf_lib/source/typecomp/tc.c b/c/makeotf/lib/typecomp/tc.c similarity index 97% rename from c/makeotf/makeotf_lib/source/typecomp/tc.c rename to c/makeotf/lib/typecomp/tc.c index adc305007..32d6fa71f 100644 --- a/c/makeotf/makeotf_lib/source/typecomp/tc.c +++ b/c/makeotf/lib/typecomp/tc.c @@ -863,21 +863,20 @@ static ctlMemoryCallbacks tc_dna_memcb; static void *tc_manage(ctlMemoryCallbacks *cb, void *old, size_t size) { tcCtx h = (tcCtx)cb->ctx; - tcCallbacks tcb = h->cb; void *p = NULL; if (size > 0) { if (old == NULL) { - p = tcb.malloc(tcb.ctx, size); + p = tcMemNew(h, size); return (p); } else { - p = tcb.realloc(tcb.ctx, old, size); + p = tcMemResize(h, old, size); return (p); } } else { if (old == NULL) { return NULL; } else { - tcb.free(tcb.ctx, old); + tcMemFree(h, old); return NULL; } } @@ -885,8 +884,14 @@ static void *tc_manage(ctlMemoryCallbacks *cb, void *old, size_t size) { /* Create new context */ tcCtx tcNew(tcCallbacks *cb) { - tcCtx g = cb->malloc(cb->ctx, sizeof(struct tcCtx_)); tcprivCtx h; + tcCtx g = malloc(sizeof(struct tcCtx_)); + + if ( g == NULL ) { + if ( cb->message != NULL ) + cb->message(cb->ctx, tcFATAL, "out of memory"); + cb->fatal(cb->ctx); + } g->cb = *cb; @@ -984,7 +989,7 @@ void tcFree(tcCtx g) { dnaFREE(h->set); MEM_FREE(g, h); - g->cb.free(g->cb.ctx, g); /* Free context */ + free(g); /* Free context */ } /* Add font to set */ @@ -1050,6 +1055,26 @@ void tcCompactFont(tcCtx g, long flags) { tcCompactSet(g); } +/* ---------------------------- Utility Functions --------------------------- */ + +void *tcMemNew(tcCtx g, size_t size) { + void *ptr = malloc(size); + if ( ptr == NULL ) + g->cb.message(g->cb.ctx, tcFATAL, "out of memory"); + return ptr; +} + +void *tcMemResize(tcCtx g, void *old, size_t size) { + void *ptr = realloc(old, size); + if ( ptr == NULL ) + g->cb.message(g->cb.ctx, tcFATAL, "out of memory"); + return ptr; +} + +void tcMemFree(tcCtx g, void *ptr) { + free(ptr); +} + /* ----------------------------- Error handling ---------------------------- */ /* Report fatal error message (with source filename appended) and quit */ diff --git a/c/makeotf/makeotf_lib/build/cffread/linux/gcc/debug/Makefile b/c/makeotf/makeotf_lib/build/cffread/linux/gcc/debug/Makefile deleted file mode 100755 index 9a177f0d9..000000000 --- a/c/makeotf/makeotf_lib/build/cffread/linux/gcc/debug/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = debug - -# Library -ROOT_DIR = ../../../../.. -SRC_DIR = $(ROOT_DIR)/source/cffread -OBJECT_DIR = . -LIB_TARGET = $(LIB_DIR)/cffread.a - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/api \ - -I$(ROOT_DIR)/resource \ - -I$(ROOT_DIR)/../../public/lib/api \ - -I$(ROOT_DIR)/../../public/lib/resource \ - -DCFF_DEBUG=1 \ - -DCFF_T13_SUPPORT=0 \ - -g - -LIB_SRCS = $(SRC_DIR)/cffread.c - -LIB_OBJS = cffread.o - -# Standard definitions -include $(ROOT_DIR)/../../public/lib/config/linux/gcc/gcc.mak - - -# Lib Object rules -cffread.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cffread.c -o $@ - diff --git a/c/makeotf/makeotf_lib/build/cffread/linux/gcc/release/Makefile b/c/makeotf/makeotf_lib/build/cffread/linux/gcc/release/Makefile deleted file mode 100755 index 66e22123d..000000000 --- a/c/makeotf/makeotf_lib/build/cffread/linux/gcc/release/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = release - -# Library -ROOT_DIR = $(realpath ../../../../..) -SRC_DIR = $(ROOT_DIR)/source/cffread -OBJECT_DIR = . -LIB_TARGET = $(LIB_DIR)/cffread.a - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/api \ - -I$(ROOT_DIR)/resource \ - -I$(realpath $(ROOT_DIR)/../../public/lib/api) \ - -I$(realpath $(ROOT_DIR)/../../public/lib/resource) \ - -DCFF_T13_SUPPORT=0 - -LIB_SRCS = $(SRC_DIR)/cffread.c - -LIB_OBJS = cffread.o - -# Standard definitions -include $(realpath $(ROOT_DIR)/../../public/lib/config/linux/gcc/gcc.mak) - - -# Lib Object rules -cffread.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cffread.c -o $@ - diff --git a/c/makeotf/makeotf_lib/build/cffread/osx/xcode/cffread.xcodeproj/project.pbxproj b/c/makeotf/makeotf_lib/build/cffread/osx/xcode/cffread.xcodeproj/project.pbxproj deleted file mode 100644 index cc904cd6a..000000000 --- a/c/makeotf/makeotf_lib/build/cffread/osx/xcode/cffread.xcodeproj/project.pbxproj +++ /dev/null @@ -1,278 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - BD6157F50D2D580500C1E0CA /* cffread.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6157F30D2D580500C1E0CA /* cffread.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - BD6157F30D2D580500C1E0CA /* cffread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cffread.c; path = ../../../../source/cffread/cffread.c; sourceTree = SOURCE_ROOT; }; - BD6157F40D2D580500C1E0CA /* t13fail.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = t13fail.c; path = ../../../../source/cffread/t13fail.c; sourceTree = SOURCE_ROOT; }; - BD6157F90D2D587600C1E0CA /* debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../../../../config/xcconfig/debug.xcconfig; sourceTree = SOURCE_ROOT; }; - BD6157FA0D2D587600C1E0CA /* release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = release.xcconfig; path = ../../../../config/xcconfig/release.xcconfig; sourceTree = SOURCE_ROOT; }; - D2AAC046055464E500DB518D /* libcffread.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcffread.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D289987405E68DCB004EDB86 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* cffread */ = { - isa = PBXGroup; - children = ( - BD6157ED0D2D538200C1E0CA /* xconfig */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = cffread; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - BD6157F30D2D580500C1E0CA /* cffread.c */, - BD6157F40D2D580500C1E0CA /* t13fail.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - D2AAC046055464E500DB518D /* libcffread.a */, - ); - name = Products; - sourceTree = ""; - }; - BD6157ED0D2D538200C1E0CA /* xconfig */ = { - isa = PBXGroup; - children = ( - BD6157F90D2D587600C1E0CA /* debug.xcconfig */, - BD6157FA0D2D587600C1E0CA /* release.xcconfig */, - ); - name = xconfig; - sourceTree = ""; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D2AAC043055464E500DB518D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D2AAC045055464E500DB518D /* cffread */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cffread" */; - buildPhases = ( - D2AAC043055464E500DB518D /* Headers */, - D2AAC044055464E500DB518D /* Sources */, - D289987405E68DCB004EDB86 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = cffread; - productName = cffread; - productReference = D2AAC046055464E500DB518D /* libcffread.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1230; - }; - buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cffread" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* cffread */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D2AAC045055464E500DB518D /* cffread */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - D2AAC044055464E500DB518D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD6157F50D2D580500C1E0CA /* cffread.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB91EC08733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD6157F90D2D587600C1E0CA /* debug.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - COMBINE_HIDPI_IMAGES = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "CFF_T13_SUPPORT=0", - "CFFREAD_DEBUG=1", - ); - PRODUCT_NAME = cffread; - }; - name = Debug; - }; - 1DEB91ED08733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD6157FA0D2D587600C1E0CA /* release.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = YES; - COMBINE_HIDPI_IMAGES = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "CFF_T13_SUPPORT=0", - ); - PRODUCT_NAME = cffread; - }; - name = Release; - }; - 1DEB91F008733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD6157F90D2D587600C1E0CA /* debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "CFF_T13_SUPPORT=0", - "CFFREAD_DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = cffread; - }; - name = Debug; - }; - 1DEB91F108733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD6157FA0D2D587600C1E0CA /* release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "CFF_T13_SUPPORT=0", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = cffread; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cffread" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91EC08733DB70010E9CD /* Debug */, - 1DEB91ED08733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cffread" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91F008733DB70010E9CD /* Debug */, - 1DEB91F108733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj b/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj deleted file mode 100644 index a89c2dc81..000000000 --- a/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj +++ /dev/null @@ -1,140 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {00D7DB77-ABC2-440B-A2EB-7F8C51884E05} - cffread - 10.0.17134.0 - - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../lib/win/debug/ - $(Configuration)\ - ../../../../lib/win/release/ - $(Configuration)\ - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - - Disabled - ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - CDECL=__cdecl;CFF_DEBUG=1;CFF_T13_SUPPORT=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - EditAndContinue - - - %(ExportNamedFunctions) - - - - - Disabled - ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - CDECL=__cdecl;CFF_DEBUG=1;CFF_T13_SUPPORT=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - %(ExportNamedFunctions) - - - - - MaxSpeed - ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - CFF_T13_SUPPORT=0;CDECL=__cdecl;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - %(ExportNamedFunctions) - - - - - MaxSpeed - ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - CFF_T13_SUPPORT=0;CDECL=__cdecl;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - %(ExportNamedFunctions) - - - - - - - - - diff --git a/c/makeotf/makeotf_lib/build/hotconv/linux/gcc/debug/Makefile b/c/makeotf/makeotf_lib/build/hotconv/linux/gcc/debug/Makefile deleted file mode 100755 index 329c7aa8b..000000000 --- a/c/makeotf/makeotf_lib/build/hotconv/linux/gcc/debug/Makefile +++ /dev/null @@ -1,157 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = debug - -# Library -ROOT_DIR = ../../../../.. -SRC_DIR = $(ROOT_DIR)/source/hotconv -OBJECT_DIR = . -LIB_TARGET = $(LIB_DIR)/hotconv.a - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/api \ - -I$(ROOT_DIR)/resource \ - -I$(ROOT_DIR)/build/hotpccts/pccts/h \ - -I$(ROOT_DIR)/../../public/lib/api \ - -I$(ROOT_DIR)/../../public/lib/resource \ - -DHOT_FEAT_SUPPORT=1 \ - -g - -LIB_SRCS = \ - $(SRCDIR)/anon.c \ - $(SRCDIR)/BASE.c \ - $(SRCDIR)/CFF_.c \ - $(SRCDIR)/cmap.c \ - $(SRCDIR)/featerr.c \ - $(SRCDIR)/featgram.c \ - $(SRCDIR)/featscan.c \ - $(SRCDIR)/GDEF.c \ - $(SRCDIR)/GPOS.c \ - $(SRCDIR)/GSUB.c \ - $(SRCDIR)/head.c \ - $(SRCDIR)/hhea.c \ - $(SRCDIR)/hmtx.c \ - $(SRCDIR)/hot.c \ - $(SRCDIR)/map.c \ - $(SRCDIR)/maxp.c \ - $(SRCDIR)/name.c \ - $(SRCDIR)/OS_2.c \ - $(SRCDIR)/otl.c \ - $(SRCDIR)/post.c \ - $(SRCDIR)/sfnt.c \ - $(SRCDIR)/STAT.c \ - $(SRCDIR)/vhea.c \ - $(SRCDIR)/vmtx.c \ - $(SRCDIR)/VORG.c - -LIB_OBJS = \ - $(OBJECT_DIR)/anon.o \ - $(OBJECT_DIR)/BASE.o \ - $(OBJECT_DIR)/CFF_.o \ - $(OBJECT_DIR)/cmap.o \ - $(OBJECT_DIR)/featerr.o \ - $(OBJECT_DIR)/featgram.o \ - $(OBJECT_DIR)/featscan.o \ - $(OBJECT_DIR)/GDEF.o \ - $(OBJECT_DIR)/GPOS.o \ - $(OBJECT_DIR)/GSUB.o \ - $(OBJECT_DIR)/head.o \ - $(OBJECT_DIR)/hhea.o \ - $(OBJECT_DIR)/hmtx.o \ - $(OBJECT_DIR)/hot.o \ - $(OBJECT_DIR)/map.o \ - $(OBJECT_DIR)/maxp.o \ - $(OBJECT_DIR)/name.o \ - $(OBJECT_DIR)/OS_2.o \ - $(OBJECT_DIR)/otl.o \ - $(OBJECT_DIR)/post.o \ - $(OBJECT_DIR)/sfnt.o \ - $(OBJECT_DIR)/STAT.o \ - $(OBJECT_DIR)/vhea.o \ - $(OBJECT_DIR)/vmtx.o \ - $(OBJECT_DIR)/VORG.o - -# Standard definitions -include $(ROOT_DIR)/../../public/lib/config/linux/gcc/gcc.mak - - -# Lib Object rules -anon.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/anon.c -o $@ - -BASE.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/BASE.c -o $@ - -CFF_.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/CFF_.c -o $@ - -cmap.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cmap.c -o $@ - -featerr.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/featerr.c -o $@ - -featgram.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/featgram.c -o $@ - -featscan.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/featscan.c -o $@ - -GDEF.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/GDEF.c -o $@ - -GPOS.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/GPOS.c -o $@ - -GSUB.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/GSUB.c -o $@ - -head.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/head.c -o $@ - -hhea.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/hhea.c -o $@ - -hmtx.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/hmtx.c -o $@ - -hot.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/hot.c -o $@ - -map.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/map.c -o $@ - -maxp.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/maxp.c -o $@ - -name.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/name.c -o $@ - -OS_2.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/OS_2.c -o $@ - -otl.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/otl.c -o $@ - -post.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/post.c -o $@ - -sfnt.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/sfnt.c -o $@ - -STAT.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/STAT.c -o $@ - -vhea.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/vhea.c -o $@ - -vmtx.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/vmtx.c -o $@ - -VORG.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/VORG.c -o $@ diff --git a/c/makeotf/makeotf_lib/build/hotconv/linux/gcc/release/Makefile b/c/makeotf/makeotf_lib/build/hotconv/linux/gcc/release/Makefile deleted file mode 100755 index 85cd03dfa..000000000 --- a/c/makeotf/makeotf_lib/build/hotconv/linux/gcc/release/Makefile +++ /dev/null @@ -1,156 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = release - -# Library -ROOT_DIR = $(realpath ../../../../..) -SRC_DIR = $(ROOT_DIR)/source/hotconv -OBJECT_DIR = . -LIB_TARGET = $(LIB_DIR)/hotconv.a - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/api \ - -I$(ROOT_DIR)/resource \ - -I$(ROOT_DIR)/build/hotpccts/pccts/h \ - -I$(realpath $(ROOT_DIR)/../../public/lib/api) \ - -I$(realpath $(ROOT_DIR)/../../public/lib/resource) \ - -DHOT_FEAT_SUPPORT=1 - -LIB_SRCS = \ - $(SRCDIR)/anon.c \ - $(SRCDIR)/BASE.c \ - $(SRCDIR)/CFF_.c \ - $(SRCDIR)/cmap.c \ - $(SRCDIR)/featerr.c \ - $(SRCDIR)/featgram.c \ - $(SRCDIR)/featscan.c \ - $(SRCDIR)/GDEF.c \ - $(SRCDIR)/GPOS.c \ - $(SRCDIR)/GSUB.c \ - $(SRCDIR)/head.c \ - $(SRCDIR)/hhea.c \ - $(SRCDIR)/hmtx.c \ - $(SRCDIR)/hot.c \ - $(SRCDIR)/map.c \ - $(SRCDIR)/maxp.c \ - $(SRCDIR)/name.c \ - $(SRCDIR)/OS_2.c \ - $(SRCDIR)/otl.c \ - $(SRCDIR)/post.c \ - $(SRCDIR)/sfnt.c \ - $(SRCDIR)/STAT.c \ - $(SRCDIR)/vhea.c \ - $(SRCDIR)/vmtx.c \ - $(SRCDIR)/VORG.c - -LIB_OBJS = \ - $(OBJECT_DIR)/anon.o \ - $(OBJECT_DIR)/BASE.o \ - $(OBJECT_DIR)/CFF_.o \ - $(OBJECT_DIR)/cmap.o \ - $(OBJECT_DIR)/featerr.o \ - $(OBJECT_DIR)/featgram.o \ - $(OBJECT_DIR)/featscan.o \ - $(OBJECT_DIR)/GDEF.o \ - $(OBJECT_DIR)/GPOS.o \ - $(OBJECT_DIR)/GSUB.o \ - $(OBJECT_DIR)/head.o \ - $(OBJECT_DIR)/hhea.o \ - $(OBJECT_DIR)/hmtx.o \ - $(OBJECT_DIR)/hot.o \ - $(OBJECT_DIR)/map.o \ - $(OBJECT_DIR)/maxp.o \ - $(OBJECT_DIR)/name.o \ - $(OBJECT_DIR)/OS_2.o \ - $(OBJECT_DIR)/otl.o \ - $(OBJECT_DIR)/post.o \ - $(OBJECT_DIR)/sfnt.o \ - $(OBJECT_DIR)/STAT.o \ - $(OBJECT_DIR)/vhea.o \ - $(OBJECT_DIR)/vmtx.o \ - $(OBJECT_DIR)/VORG.o - -# Standard definitions -include $(ROOT_DIR)/../../public/lib/config/linux/gcc/gcc.mak - - -# Lib Object rules -anon.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/anon.c -o $@ - -BASE.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/BASE.c -o $@ - -CFF_.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/CFF_.c -o $@ - -cmap.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/cmap.c -o $@ - -featerr.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/featerr.c -o $@ - -featgram.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/featgram.c -o $@ - -featscan.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/featscan.c -o $@ - -GDEF.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/GDEF.c -o $@ - -GPOS.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/GPOS.c -o $@ - -GSUB.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/GSUB.c -o $@ - -head.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/head.c -o $@ - -hhea.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/hhea.c -o $@ - -hmtx.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/hmtx.c -o $@ - -hot.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/hot.c -o $@ - -map.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/map.c -o $@ - -maxp.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/maxp.c -o $@ - -name.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/name.c -o $@ - -OS_2.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/OS_2.c -o $@ - -otl.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/otl.c -o $@ - -post.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/post.c -o $@ - -sfnt.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/sfnt.c -o $@ - -STAT.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/STAT.c -o $@ - -vhea.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/vhea.c -o $@ - -vmtx.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/vmtx.c -o $@ - -VORG.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/VORG.c -o $@ diff --git a/c/makeotf/makeotf_lib/build/hotconv/osx/xcode/hotconv.xcodeproj/project.pbxproj b/c/makeotf/makeotf_lib/build/hotconv/osx/xcode/hotconv.xcodeproj/project.pbxproj deleted file mode 100644 index 4cf4aabba..000000000 --- a/c/makeotf/makeotf_lib/build/hotconv/osx/xcode/hotconv.xcodeproj/project.pbxproj +++ /dev/null @@ -1,536 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 29B88DDE244FA4DD006F259E /* STAT.h in Headers */ = {isa = PBXBuildFile; fileRef = 29B88DDC244FA4DC006F259E /* STAT.h */; }; - 29B88DE1244FA500006F259E /* STAT.c in Sources */ = {isa = PBXBuildFile; fileRef = 29B88DE0244FA500006F259E /* STAT.c */; }; - BD1F638E0E26B32700A4E4C9 /* GDEF.h in Headers */ = {isa = PBXBuildFile; fileRef = BD1F638D0E26B32700A4E4C9 /* GDEF.h */; }; - BD1F63900E26B33800A4E4C9 /* GDEF.c in Sources */ = {isa = PBXBuildFile; fileRef = BD1F638F0E26B33800A4E4C9 /* GDEF.c */; }; - BD6159A50D2DC53300C1E0CA /* post.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61598E0D2DC53300C1E0CA /* post.c */; }; - BD6159A60D2DC53300C1E0CA /* map.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61598F0D2DC53300C1E0CA /* map.c */; }; - BD6159A70D2DC53300C1E0CA /* VORG.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159900D2DC53300C1E0CA /* VORG.c */; }; - BD6159A80D2DC53300C1E0CA /* vmtx.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159910D2DC53300C1E0CA /* vmtx.c */; }; - BD6159A90D2DC53300C1E0CA /* vhea.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159920D2DC53300C1E0CA /* vhea.c */; }; - BD6159AA0D2DC53300C1E0CA /* featscan.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159930D2DC53300C1E0CA /* featscan.c */; }; - BD6159AB0D2DC53300C1E0CA /* hot.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159940D2DC53300C1E0CA /* hot.c */; }; - BD6159AC0D2DC53300C1E0CA /* hhea.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159950D2DC53300C1E0CA /* hhea.c */; }; - BD6159AE0D2DC53300C1E0CA /* maxp.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159970D2DC53300C1E0CA /* maxp.c */; }; - BD6159AF0D2DC53300C1E0CA /* head.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159980D2DC53300C1E0CA /* head.c */; }; - BD6159B00D2DC53300C1E0CA /* hmtx.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159990D2DC53300C1E0CA /* hmtx.c */; }; - BD6159B10D2DC53300C1E0CA /* GSUB.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61599A0D2DC53300C1E0CA /* GSUB.c */; }; - BD6159B30D2DC53300C1E0CA /* sfnt.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61599C0D2DC53300C1E0CA /* sfnt.c */; }; - BD6159B40D2DC53300C1E0CA /* OS_2.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61599D0D2DC53300C1E0CA /* OS_2.c */; }; - BD6159B50D2DC53300C1E0CA /* name.c in Sources */ = {isa = PBXBuildFile; fileRef = BD61599E0D2DC53300C1E0CA /* name.c */; }; - BD6159B70D2DC53300C1E0CA /* otl.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159A00D2DC53300C1E0CA /* otl.c */; }; - BD6159B80D2DC53300C1E0CA /* GPOS.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159A10D2DC53300C1E0CA /* GPOS.c */; }; - BD6159BA0D2DC53300C1E0CA /* featgram.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159A30D2DC53300C1E0CA /* featgram.c */; }; - BD6159BB0D2DC53300C1E0CA /* featerr.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159A40D2DC53300C1E0CA /* featerr.c */; }; - BD6159C00D2DC54200C1E0CA /* CFF_.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159BC0D2DC54200C1E0CA /* CFF_.c */; }; - BD6159C10D2DC54200C1E0CA /* cmap.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159BD0D2DC54200C1E0CA /* cmap.c */; }; - BD6159C20D2DC54200C1E0CA /* BASE.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159BE0D2DC54200C1E0CA /* BASE.c */; }; - BD6159C30D2DC54200C1E0CA /* anon.c in Sources */ = {isa = PBXBuildFile; fileRef = BD6159BF0D2DC54200C1E0CA /* anon.c */; }; - BD6159E90D2DC56500C1E0CA /* post.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159C50D2DC56500C1E0CA /* post.h */; }; - BD6159EA0D2DC56500C1E0CA /* otl.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159C60D2DC56500C1E0CA /* otl.h */; }; - BD6159EC0D2DC56500C1E0CA /* map.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159C80D2DC56500C1E0CA /* map.h */; }; - BD6159ED0D2DC56500C1E0CA /* vmtx.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159C90D2DC56500C1E0CA /* vmtx.h */; }; - BD6159EE0D2DC56500C1E0CA /* vhea.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159CA0D2DC56500C1E0CA /* vhea.h */; }; - BD6159EF0D2DC56500C1E0CA /* feattoks.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159CB0D2DC56500C1E0CA /* feattoks.h */; }; - BD6159F00D2DC56500C1E0CA /* hmtx.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159CC0D2DC56500C1E0CA /* hmtx.h */; }; - BD6159F10D2DC56500C1E0CA /* BASE.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159CD0D2DC56500C1E0CA /* BASE.h */; }; - BD6159F20D2DC56500C1E0CA /* CFF_.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159CE0D2DC56500C1E0CA /* CFF_.h */; }; - BD6159F30D2DC56500C1E0CA /* hhea.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159CF0D2DC56500C1E0CA /* hhea.h */; }; - BD6159F40D2DC56500C1E0CA /* dlgauto.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D00D2DC56500C1E0CA /* dlgauto.h */; }; - BD6159F50D2DC56500C1E0CA /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D10D2DC56500C1E0CA /* config.h */; }; - BD6159F60D2DC56500C1E0CA /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D20D2DC56500C1E0CA /* common.h */; }; - BD6159F70D2DC56500C1E0CA /* err.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D30D2DC56500C1E0CA /* err.h */; }; - BD6159F80D2DC56500C1E0CA /* dlgdef.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D40D2DC56500C1E0CA /* dlgdef.h */; }; - BD6159F90D2DC56500C1E0CA /* winansi.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D50D2DC56500C1E0CA /* winansi.h */; }; - BD6159FA0D2DC56500C1E0CA /* VORG.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D60D2DC56500C1E0CA /* VORG.h */; }; - BD6159FB0D2DC56500C1E0CA /* maxp.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D70D2DC56500C1E0CA /* maxp.h */; }; - BD6159FC0D2DC56500C1E0CA /* codepage.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D80D2DC56500C1E0CA /* codepage.h */; }; - BD6159FD0D2DC56500C1E0CA /* cmap.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159D90D2DC56500C1E0CA /* cmap.h */; }; - BD6159FE0D2DC56500C1E0CA /* head.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159DA0D2DC56500C1E0CA /* head.h */; }; - BD6159FF0D2DC56500C1E0CA /* feat.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159DB0D2DC56500C1E0CA /* feat.h */; }; - BD615A000D2DC56500C1E0CA /* GSUB.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159DC0D2DC56500C1E0CA /* GSUB.h */; }; - BD615A010D2DC56500C1E0CA /* antlr.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159DD0D2DC56500C1E0CA /* antlr.h */; }; - BD615A030D2DC56500C1E0CA /* uniblock.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159DF0D2DC56500C1E0CA /* uniblock.h */; }; - BD615A040D2DC56500C1E0CA /* sfnt.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E00D2DC56500C1E0CA /* sfnt.h */; }; - BD615A050D2DC56500C1E0CA /* schinese.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E10D2DC56500C1E0CA /* schinese.h */; }; - BD615A060D2DC56500C1E0CA /* name.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E20D2DC56500C1E0CA /* name.h */; }; - BD615A070D2DC56500C1E0CA /* anon.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E30D2DC56500C1E0CA /* anon.h */; }; - BD615A090D2DC56500C1E0CA /* OS_2.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E50D2DC56500C1E0CA /* OS_2.h */; }; - BD615A0A0D2DC56500C1E0CA /* GPOS.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E60D2DC56500C1E0CA /* GPOS.h */; }; - BD615A0C0D2DC56500C1E0CA /* featmode.h in Headers */ = {isa = PBXBuildFile; fileRef = BD6159E80D2DC56500C1E0CA /* featmode.h */; }; - BD9DCE1A0DB540DE00192F3D /* hotconv.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9DCE190DB540DE00192F3D /* hotconv.h */; }; - BD9F863518A0164300774127 /* pcctscfg.h in Headers */ = {isa = PBXBuildFile; fileRef = BD9F863418A0164300774127 /* pcctscfg.h */; }; - BDE662060D329ED5005FE583 /* feat.c in Sources */ = {isa = PBXBuildFile; fileRef = BDE662050D329ED5005FE583 /* feat.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 29B88DDC244FA4DC006F259E /* STAT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STAT.h; path = ../../../../source/hotconv/STAT.h; sourceTree = ""; }; - 29B88DE0244FA500006F259E /* STAT.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = STAT.c; path = ../../../../source/hotconv/STAT.c; sourceTree = ""; }; - BD1F638D0E26B32700A4E4C9 /* GDEF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDEF.h; path = ../../../../source/hotconv/GDEF.h; sourceTree = SOURCE_ROOT; }; - BD1F638F0E26B33800A4E4C9 /* GDEF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = GDEF.c; path = ../../../../source/hotconv/GDEF.c; sourceTree = SOURCE_ROOT; }; - BD61598E0D2DC53300C1E0CA /* post.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = post.c; path = ../../../../source/hotconv/post.c; sourceTree = SOURCE_ROOT; }; - BD61598F0D2DC53300C1E0CA /* map.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = map.c; path = ../../../../source/hotconv/map.c; sourceTree = SOURCE_ROOT; }; - BD6159900D2DC53300C1E0CA /* VORG.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = VORG.c; path = ../../../../source/hotconv/VORG.c; sourceTree = SOURCE_ROOT; }; - BD6159910D2DC53300C1E0CA /* vmtx.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = vmtx.c; path = ../../../../source/hotconv/vmtx.c; sourceTree = SOURCE_ROOT; }; - BD6159920D2DC53300C1E0CA /* vhea.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = vhea.c; path = ../../../../source/hotconv/vhea.c; sourceTree = SOURCE_ROOT; }; - BD6159930D2DC53300C1E0CA /* featscan.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = featscan.c; path = ../../../../source/hotconv/featscan.c; sourceTree = SOURCE_ROOT; }; - BD6159940D2DC53300C1E0CA /* hot.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = hot.c; path = ../../../../source/hotconv/hot.c; sourceTree = SOURCE_ROOT; }; - BD6159950D2DC53300C1E0CA /* hhea.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = hhea.c; path = ../../../../source/hotconv/hhea.c; sourceTree = SOURCE_ROOT; }; - BD6159970D2DC53300C1E0CA /* maxp.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = maxp.c; path = ../../../../source/hotconv/maxp.c; sourceTree = SOURCE_ROOT; }; - BD6159980D2DC53300C1E0CA /* head.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = head.c; path = ../../../../source/hotconv/head.c; sourceTree = SOURCE_ROOT; }; - BD6159990D2DC53300C1E0CA /* hmtx.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = hmtx.c; path = ../../../../source/hotconv/hmtx.c; sourceTree = SOURCE_ROOT; }; - BD61599A0D2DC53300C1E0CA /* GSUB.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = GSUB.c; path = ../../../../source/hotconv/GSUB.c; sourceTree = SOURCE_ROOT; }; - BD61599C0D2DC53300C1E0CA /* sfnt.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = sfnt.c; path = ../../../../source/hotconv/sfnt.c; sourceTree = SOURCE_ROOT; }; - BD61599D0D2DC53300C1E0CA /* OS_2.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = OS_2.c; path = ../../../../source/hotconv/OS_2.c; sourceTree = SOURCE_ROOT; }; - BD61599E0D2DC53300C1E0CA /* name.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = name.c; path = ../../../../source/hotconv/name.c; sourceTree = SOURCE_ROOT; }; - BD6159A00D2DC53300C1E0CA /* otl.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = otl.c; path = ../../../../source/hotconv/otl.c; sourceTree = SOURCE_ROOT; }; - BD6159A10D2DC53300C1E0CA /* GPOS.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = GPOS.c; path = ../../../../source/hotconv/GPOS.c; sourceTree = SOURCE_ROOT; }; - BD6159A30D2DC53300C1E0CA /* featgram.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = featgram.c; path = ../../../../source/hotconv/featgram.c; sourceTree = SOURCE_ROOT; }; - BD6159A40D2DC53300C1E0CA /* featerr.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = featerr.c; path = ../../../../source/hotconv/featerr.c; sourceTree = SOURCE_ROOT; }; - BD6159BC0D2DC54200C1E0CA /* CFF_.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = CFF_.c; path = ../../../../source/hotconv/CFF_.c; sourceTree = SOURCE_ROOT; }; - BD6159BD0D2DC54200C1E0CA /* cmap.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = cmap.c; path = ../../../../source/hotconv/cmap.c; sourceTree = SOURCE_ROOT; }; - BD6159BE0D2DC54200C1E0CA /* BASE.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = BASE.c; path = ../../../../source/hotconv/BASE.c; sourceTree = SOURCE_ROOT; }; - BD6159BF0D2DC54200C1E0CA /* anon.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = anon.c; path = ../../../../source/hotconv/anon.c; sourceTree = SOURCE_ROOT; }; - BD6159C50D2DC56500C1E0CA /* post.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = post.h; path = ../../../../source/hotconv/post.h; sourceTree = SOURCE_ROOT; }; - BD6159C60D2DC56500C1E0CA /* otl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = otl.h; path = ../../../../source/hotconv/otl.h; sourceTree = SOURCE_ROOT; }; - BD6159C80D2DC56500C1E0CA /* map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = map.h; path = ../../../../source/hotconv/map.h; sourceTree = SOURCE_ROOT; }; - BD6159C90D2DC56500C1E0CA /* vmtx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vmtx.h; path = ../../../../source/hotconv/vmtx.h; sourceTree = SOURCE_ROOT; }; - BD6159CA0D2DC56500C1E0CA /* vhea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vhea.h; path = ../../../../source/hotconv/vhea.h; sourceTree = SOURCE_ROOT; }; - BD6159CB0D2DC56500C1E0CA /* feattoks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = feattoks.h; path = ../../../../source/hotconv/feattoks.h; sourceTree = SOURCE_ROOT; }; - BD6159CC0D2DC56500C1E0CA /* hmtx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hmtx.h; path = ../../../../source/hotconv/hmtx.h; sourceTree = SOURCE_ROOT; }; - BD6159CD0D2DC56500C1E0CA /* BASE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BASE.h; path = ../../../../source/hotconv/BASE.h; sourceTree = SOURCE_ROOT; }; - BD6159CE0D2DC56500C1E0CA /* CFF_.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFF_.h; path = ../../../../source/hotconv/CFF_.h; sourceTree = SOURCE_ROOT; }; - BD6159CF0D2DC56500C1E0CA /* hhea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hhea.h; path = ../../../../source/hotconv/hhea.h; sourceTree = SOURCE_ROOT; }; - BD6159D00D2DC56500C1E0CA /* dlgauto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dlgauto.h; path = ../../../../source/hotconv/dlgauto.h; sourceTree = SOURCE_ROOT; }; - BD6159D10D2DC56500C1E0CA /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../../../../source/hotconv/config.h; sourceTree = SOURCE_ROOT; }; - BD6159D20D2DC56500C1E0CA /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = ../../../../source/hotconv/common.h; sourceTree = SOURCE_ROOT; }; - BD6159D30D2DC56500C1E0CA /* err.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = err.h; path = ../../../../source/hotconv/err.h; sourceTree = SOURCE_ROOT; }; - BD6159D40D2DC56500C1E0CA /* dlgdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dlgdef.h; path = ../../../../source/hotconv/dlgdef.h; sourceTree = SOURCE_ROOT; }; - BD6159D50D2DC56500C1E0CA /* winansi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = winansi.h; path = ../../../../source/hotconv/winansi.h; sourceTree = SOURCE_ROOT; }; - BD6159D60D2DC56500C1E0CA /* VORG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VORG.h; path = ../../../../source/hotconv/VORG.h; sourceTree = SOURCE_ROOT; }; - BD6159D70D2DC56500C1E0CA /* maxp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = maxp.h; path = ../../../../source/hotconv/maxp.h; sourceTree = SOURCE_ROOT; }; - BD6159D80D2DC56500C1E0CA /* codepage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codepage.h; path = ../../../../source/hotconv/codepage.h; sourceTree = SOURCE_ROOT; }; - BD6159D90D2DC56500C1E0CA /* cmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cmap.h; path = ../../../../source/hotconv/cmap.h; sourceTree = SOURCE_ROOT; }; - BD6159DA0D2DC56500C1E0CA /* head.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = head.h; path = ../../../../source/hotconv/head.h; sourceTree = SOURCE_ROOT; }; - BD6159DB0D2DC56500C1E0CA /* feat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = feat.h; path = ../../../../source/hotconv/feat.h; sourceTree = SOURCE_ROOT; }; - BD6159DC0D2DC56500C1E0CA /* GSUB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GSUB.h; path = ../../../../source/hotconv/GSUB.h; sourceTree = SOURCE_ROOT; }; - BD6159DD0D2DC56500C1E0CA /* antlr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = antlr.h; path = ../../../../source/hotconv/antlr.h; sourceTree = SOURCE_ROOT; }; - BD6159DF0D2DC56500C1E0CA /* uniblock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = uniblock.h; path = ../../../../source/hotconv/uniblock.h; sourceTree = SOURCE_ROOT; }; - BD6159E00D2DC56500C1E0CA /* sfnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sfnt.h; path = ../../../../source/hotconv/sfnt.h; sourceTree = SOURCE_ROOT; }; - BD6159E10D2DC56500C1E0CA /* schinese.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = schinese.h; path = ../../../../source/hotconv/schinese.h; sourceTree = SOURCE_ROOT; }; - BD6159E20D2DC56500C1E0CA /* name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = name.h; path = ../../../../source/hotconv/name.h; sourceTree = SOURCE_ROOT; }; - BD6159E30D2DC56500C1E0CA /* anon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = anon.h; path = ../../../../source/hotconv/anon.h; sourceTree = SOURCE_ROOT; }; - BD6159E50D2DC56500C1E0CA /* OS_2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OS_2.h; path = ../../../../source/hotconv/OS_2.h; sourceTree = SOURCE_ROOT; }; - BD6159E60D2DC56500C1E0CA /* GPOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPOS.h; path = ../../../../source/hotconv/GPOS.h; sourceTree = SOURCE_ROOT; }; - BD6159E80D2DC56500C1E0CA /* featmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = featmode.h; path = ../../../../source/hotconv/featmode.h; sourceTree = SOURCE_ROOT; }; - BD615A120D2DC5E700C1E0CA /* debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../../../../config/xcconfig/debug.xcconfig; sourceTree = SOURCE_ROOT; }; - BD615A130D2DC5E700C1E0CA /* release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = release.xcconfig; path = ../../../../config/xcconfig/release.xcconfig; sourceTree = SOURCE_ROOT; }; - BD9DCE190DB540DE00192F3D /* hotconv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hotconv.h; path = ../../../../api/hotconv.h; sourceTree = SOURCE_ROOT; }; - BD9F863418A0164300774127 /* pcctscfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pcctscfg.h; path = ../../../hotpccts/pccts/h/pcctscfg.h; sourceTree = ""; }; - BDE662050D329ED5005FE583 /* feat.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = feat.c; path = ../../../../source/hotconv/feat.c; sourceTree = SOURCE_ROOT; }; - D2AAC046055464E500DB518D /* libhotconv.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libhotconv.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D289987405E68DCB004EDB86 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* hotconv */ = { - isa = PBXGroup; - children = ( - BD61598D0D2DC50000C1E0CA /* xconfig */, - BD6159C40D2DC55D00C1E0CA /* Headers */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = hotconv; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 29B88DE0244FA500006F259E /* STAT.c */, - BD6159BC0D2DC54200C1E0CA /* CFF_.c */, - BD6159BE0D2DC54200C1E0CA /* BASE.c */, - BD6159BF0D2DC54200C1E0CA /* anon.c */, - BD61598E0D2DC53300C1E0CA /* post.c */, - BD6159BD0D2DC54200C1E0CA /* cmap.c */, - BD61598F0D2DC53300C1E0CA /* map.c */, - BD6159900D2DC53300C1E0CA /* VORG.c */, - BD6159910D2DC53300C1E0CA /* vmtx.c */, - BD6159920D2DC53300C1E0CA /* vhea.c */, - BD6159930D2DC53300C1E0CA /* featscan.c */, - BD6159940D2DC53300C1E0CA /* hot.c */, - BD6159950D2DC53300C1E0CA /* hhea.c */, - BD6159970D2DC53300C1E0CA /* maxp.c */, - BD6159980D2DC53300C1E0CA /* head.c */, - BD6159990D2DC53300C1E0CA /* hmtx.c */, - BD1F638F0E26B33800A4E4C9 /* GDEF.c */, - BD61599A0D2DC53300C1E0CA /* GSUB.c */, - BD61599C0D2DC53300C1E0CA /* sfnt.c */, - BD61599D0D2DC53300C1E0CA /* OS_2.c */, - BD61599E0D2DC53300C1E0CA /* name.c */, - BD6159A00D2DC53300C1E0CA /* otl.c */, - BD6159A10D2DC53300C1E0CA /* GPOS.c */, - BD6159A30D2DC53300C1E0CA /* featgram.c */, - BD6159A40D2DC53300C1E0CA /* featerr.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - D2AAC046055464E500DB518D /* libhotconv.a */, - ); - name = Products; - sourceTree = ""; - }; - BD61598D0D2DC50000C1E0CA /* xconfig */ = { - isa = PBXGroup; - children = ( - BD615A120D2DC5E700C1E0CA /* debug.xcconfig */, - BD615A130D2DC5E700C1E0CA /* release.xcconfig */, - ); - name = xconfig; - sourceTree = ""; - }; - BD6159C40D2DC55D00C1E0CA /* Headers */ = { - isa = PBXGroup; - children = ( - 29B88DDC244FA4DC006F259E /* STAT.h */, - BD9DCE190DB540DE00192F3D /* hotconv.h */, - BDE662050D329ED5005FE583 /* feat.c */, - BD6159C50D2DC56500C1E0CA /* post.h */, - BD6159C60D2DC56500C1E0CA /* otl.h */, - BD6159C80D2DC56500C1E0CA /* map.h */, - BD6159C90D2DC56500C1E0CA /* vmtx.h */, - BD6159CA0D2DC56500C1E0CA /* vhea.h */, - BD6159CB0D2DC56500C1E0CA /* feattoks.h */, - BD6159CC0D2DC56500C1E0CA /* hmtx.h */, - BD6159CD0D2DC56500C1E0CA /* BASE.h */, - BD9F863418A0164300774127 /* pcctscfg.h */, - BD6159CE0D2DC56500C1E0CA /* CFF_.h */, - BD6159CF0D2DC56500C1E0CA /* hhea.h */, - BD6159D00D2DC56500C1E0CA /* dlgauto.h */, - BD6159D10D2DC56500C1E0CA /* config.h */, - BD6159D20D2DC56500C1E0CA /* common.h */, - BD1F638D0E26B32700A4E4C9 /* GDEF.h */, - BD6159D30D2DC56500C1E0CA /* err.h */, - BD6159D40D2DC56500C1E0CA /* dlgdef.h */, - BD6159D50D2DC56500C1E0CA /* winansi.h */, - BD6159D60D2DC56500C1E0CA /* VORG.h */, - BD6159D70D2DC56500C1E0CA /* maxp.h */, - BD6159D80D2DC56500C1E0CA /* codepage.h */, - BD6159D90D2DC56500C1E0CA /* cmap.h */, - BD6159DA0D2DC56500C1E0CA /* head.h */, - BD6159DB0D2DC56500C1E0CA /* feat.h */, - BD6159DC0D2DC56500C1E0CA /* GSUB.h */, - BD6159DD0D2DC56500C1E0CA /* antlr.h */, - BD6159DF0D2DC56500C1E0CA /* uniblock.h */, - BD6159E00D2DC56500C1E0CA /* sfnt.h */, - BD6159E10D2DC56500C1E0CA /* schinese.h */, - BD6159E20D2DC56500C1E0CA /* name.h */, - BD6159E30D2DC56500C1E0CA /* anon.h */, - BD6159E50D2DC56500C1E0CA /* OS_2.h */, - BD6159E60D2DC56500C1E0CA /* GPOS.h */, - BD6159E80D2DC56500C1E0CA /* featmode.h */, - ); - name = Headers; - sourceTree = ""; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D2AAC043055464E500DB518D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 29B88DDE244FA4DD006F259E /* STAT.h in Headers */, - BD6159E90D2DC56500C1E0CA /* post.h in Headers */, - BD6159EA0D2DC56500C1E0CA /* otl.h in Headers */, - BD6159EC0D2DC56500C1E0CA /* map.h in Headers */, - BD6159ED0D2DC56500C1E0CA /* vmtx.h in Headers */, - BD6159EE0D2DC56500C1E0CA /* vhea.h in Headers */, - BD6159EF0D2DC56500C1E0CA /* feattoks.h in Headers */, - BD6159F00D2DC56500C1E0CA /* hmtx.h in Headers */, - BD6159F10D2DC56500C1E0CA /* BASE.h in Headers */, - BD6159F20D2DC56500C1E0CA /* CFF_.h in Headers */, - BD6159F30D2DC56500C1E0CA /* hhea.h in Headers */, - BD6159F40D2DC56500C1E0CA /* dlgauto.h in Headers */, - BD6159F50D2DC56500C1E0CA /* config.h in Headers */, - BD6159F60D2DC56500C1E0CA /* common.h in Headers */, - BD6159F70D2DC56500C1E0CA /* err.h in Headers */, - BD6159F80D2DC56500C1E0CA /* dlgdef.h in Headers */, - BD6159F90D2DC56500C1E0CA /* winansi.h in Headers */, - BD6159FA0D2DC56500C1E0CA /* VORG.h in Headers */, - BD6159FB0D2DC56500C1E0CA /* maxp.h in Headers */, - BD6159FC0D2DC56500C1E0CA /* codepage.h in Headers */, - BD6159FD0D2DC56500C1E0CA /* cmap.h in Headers */, - BD6159FE0D2DC56500C1E0CA /* head.h in Headers */, - BD6159FF0D2DC56500C1E0CA /* feat.h in Headers */, - BD615A000D2DC56500C1E0CA /* GSUB.h in Headers */, - BD615A010D2DC56500C1E0CA /* antlr.h in Headers */, - BD615A030D2DC56500C1E0CA /* uniblock.h in Headers */, - BD615A040D2DC56500C1E0CA /* sfnt.h in Headers */, - BD615A050D2DC56500C1E0CA /* schinese.h in Headers */, - BD615A060D2DC56500C1E0CA /* name.h in Headers */, - BD615A070D2DC56500C1E0CA /* anon.h in Headers */, - BD615A090D2DC56500C1E0CA /* OS_2.h in Headers */, - BD615A0A0D2DC56500C1E0CA /* GPOS.h in Headers */, - BD615A0C0D2DC56500C1E0CA /* featmode.h in Headers */, - BD9DCE1A0DB540DE00192F3D /* hotconv.h in Headers */, - BD1F638E0E26B32700A4E4C9 /* GDEF.h in Headers */, - BD9F863518A0164300774127 /* pcctscfg.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D2AAC045055464E500DB518D /* hotconv */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "hotconv" */; - buildPhases = ( - D2AAC043055464E500DB518D /* Headers */, - D2AAC044055464E500DB518D /* Sources */, - D289987405E68DCB004EDB86 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = hotconv; - productName = hotconv; - productReference = D2AAC046055464E500DB518D /* libhotconv.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1000; - }; - buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "hotconv" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* hotconv */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D2AAC045055464E500DB518D /* hotconv */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - D2AAC044055464E500DB518D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD6159A50D2DC53300C1E0CA /* post.c in Sources */, - BD6159A60D2DC53300C1E0CA /* map.c in Sources */, - BD6159A70D2DC53300C1E0CA /* VORG.c in Sources */, - BD6159A80D2DC53300C1E0CA /* vmtx.c in Sources */, - BD6159A90D2DC53300C1E0CA /* vhea.c in Sources */, - BD6159AA0D2DC53300C1E0CA /* featscan.c in Sources */, - BD6159AB0D2DC53300C1E0CA /* hot.c in Sources */, - BD6159AC0D2DC53300C1E0CA /* hhea.c in Sources */, - BD6159AE0D2DC53300C1E0CA /* maxp.c in Sources */, - BD6159AF0D2DC53300C1E0CA /* head.c in Sources */, - BD6159B00D2DC53300C1E0CA /* hmtx.c in Sources */, - BD6159B10D2DC53300C1E0CA /* GSUB.c in Sources */, - 29B88DE1244FA500006F259E /* STAT.c in Sources */, - BD6159B30D2DC53300C1E0CA /* sfnt.c in Sources */, - BD6159B40D2DC53300C1E0CA /* OS_2.c in Sources */, - BD6159B50D2DC53300C1E0CA /* name.c in Sources */, - BD6159B70D2DC53300C1E0CA /* otl.c in Sources */, - BD6159B80D2DC53300C1E0CA /* GPOS.c in Sources */, - BD6159BA0D2DC53300C1E0CA /* featgram.c in Sources */, - BD6159BB0D2DC53300C1E0CA /* featerr.c in Sources */, - BD6159C00D2DC54200C1E0CA /* CFF_.c in Sources */, - BD6159C10D2DC54200C1E0CA /* cmap.c in Sources */, - BD6159C20D2DC54200C1E0CA /* BASE.c in Sources */, - BD6159C30D2DC54200C1E0CA /* anon.c in Sources */, - BDE662060D329ED5005FE583 /* feat.c in Sources */, - BD1F63900E26B33800A4E4C9 /* GDEF.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB91EC08733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD615A120D2DC5E700C1E0CA /* debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_WEAK = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - "HOT_DEBUG=1", - "DEBUG=1", - ); - OTHER_CFLAGS = ( - "-Wno-parentheses-equality", - "-fno-inline", - ); - PRODUCT_NAME = hotconv; - WARNING_CFLAGS = ""; - }; - name = Debug; - }; - 1DEB91ED08733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD615A130D2DC5E700C1E0CA /* release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ENABLE_OBJC_WEAK = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - ); - OTHER_CFLAGS = ( - "-Wno-parentheses-equality", - "-fno-inline", - ); - PRODUCT_NAME = hotconv; - WARNING_CFLAGS = ""; - }; - name = Release; - }; - 1DEB91F008733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD615A120D2DC5E700C1E0CA /* debug.xcconfig */; - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - "HOT_DEBUG=1", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = hotconv; - }; - name = Debug; - }; - 1DEB91F108733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD615A120D2DC5E700C1E0CA /* debug.xcconfig */; - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - BRV_64BIT_TYPES, - "HOT_FEAT_SUPPORT=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = hotconv; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "hotconv" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91EC08733DB70010E9CD /* Debug */, - 1DEB91ED08733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "hotconv" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91F008733DB70010E9CD /* Debug */, - 1DEB91F108733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj b/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj deleted file mode 100644 index b46ad1cc4..000000000 --- a/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj +++ /dev/null @@ -1,164 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD} - hotconv - 10.0.17134.0 - - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ../../../../lib/win/debug/ - $(Configuration)\ - ../../../../lib/win/release/ - $(Configuration)\ - $(ProjectName) - $(ProjectName) - $(ProjectName) - $(ProjectName) - - - - Disabled - ../../../../api;../../../../resource;../../../hotpccts/pccts/h;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - CDECL=__cdecl;HOT_FEAT_SUPPORT=1;HOT_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - EditAndContinue - - - %(ExportNamedFunctions) - - - - - Disabled - ../../../../api;../../../../resource;../../../hotpccts/pccts/h;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - CDECL=__cdecl;HOT_FEAT_SUPPORT=1;HOT_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - %(ExportNamedFunctions) - - - - - MaxSpeed - ../../../../api;../../../../resource;../../../hotpccts/pccts/h;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - NDEBUG;CDECL=__cdecl;HOT_FEAT_SUPPORT=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - %(ExportNamedFunctions) - - - - - MaxSpeed - ../../../../api;../../../../resource;../../../hotpccts/pccts/h;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) - NDEBUG;CDECL=__cdecl;HOT_FEAT_SUPPORT=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - %(ExportNamedFunctions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/Makefile b/c/makeotf/makeotf_lib/build/hotpccts/Makefile deleted file mode 100644 index 7c3179fb9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -# This software is licensed as OpenSource, under the Apache License, Version 2.0. -# This license is available at: http://opensource.org/licenses/Apache-2.0. -# Install clang-format with 'brew install clang-format' -# Install cpplint with 'pip install cpplint' - -all: pccts -ROOT_DIR = ../.. -HOT = $(ROOT_DIR)/source/hotconv -# HOT = ../hotconv -PCCTS = pccts -PCCTS_BIN = ${PCCTS}/bin -ANTLR = ${PCCTS_BIN}/antlr -DLG = ${PCCTS_BIN}/dlg - -# -ga Generate ANSI-compatible code (default=FALSE) -# -o Directory where all output files should go (default=".") -# -f? Rename output files -ANTLR_FLAGS = -ga \ - -o ${HOT} \ - -fe featerr.c \ - -fl featpars.dlg \ - -fm featmode.h \ - -ft feattoks.h - -# -ga Generate ANSI-compatible code (default=FALSE) -# -C2 Compression level 2 -# -i Build interactive scanner -# -o Directory where all output files should go (default=".") -# -m Rename lexical mode output file -DLG_FLAGS = -ga -C2 -i \ - -o ${HOT} \ - -m featmode.h - -ANTLR_SPAWN = ${HOT}/featpars.dlg ${HOT}/featgram.c ${HOT}/feattoks.h \ - ${HOT}/featerr.c -DLG_SPAWN = ${HOT}/featscan.c ${HOT}/featmode.h - -pccts: ${ANTLR_SPAWN} ${DLG_SPAWN} - clang-format -i ${HOT}/featgram.c ${HOT}/featscan.c ${HOT}/featerr.c ${HOT}/feattoks.h - cpplint ${HOT}/featgram.c ${HOT}/featscan.c ${HOT}/featerr.c ${HOT}/feattoks.h - -${ANTLR_SPAWN}: featgram.g ${HOT}/feat.c ${HOT}/feat.h - ${ANTLR} ${ANTLR_FLAGS} featgram.g - -${DLG_SPAWN}: ${HOT}/featpars.dlg - ${DLG} ${DLG_FLAGS} ${HOT}/featpars.dlg ${HOT}/featscan.c - -scrub: - rm -f ${ANTLR_SPAWN} ${DLG_SPAWN} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/featgram.g b/c/makeotf/makeotf_lib/build/hotpccts/featgram.g deleted file mode 100644 index ef6c4f5da..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/featgram.g +++ /dev/null @@ -1,2374 +0,0 @@ -/***********************************************************************/ -/* */ -/* Copyright 2016 Adobe Systems Incorporated. */ -/* All rights reserved. */ -/***********************************************************************/ - -/* - * Feature file grammar - */ - -#header << -/* --- This section will be included in all feat*.c files created. --- */ - -#include /* For exit in err.h xxx */ -#include -#include -#include -#include - -#include "common.h" -#include "feat.h" -#include "OS_2.h" -#include "hhea.h" -#include "vmtx.h" -#include "dynarr.h" - -#define MAX_TOKEN 64 - -extern featCtx h; /* Not reentrant; see featNew() comments */ -extern hotCtx g; - -typedef union - { - int64_t lval; - uint64_t ulval; - char text[MAX_TOKEN]; - } Attrib; - -void zzcr_attr(Attrib *attr, int type, char *text); - ->> - -<< -void featureFile(void); - -#include "feat.c" - -featCtx h; /* Not reentrant; see featNew() comments */ -hotCtx g; -int sawSTAT = FALSE; -int sawFeatNames = FALSE; -int sawCVParams = FALSE; ->> - -/* ----------------------------- Tokens ------------------------------------ */ - -#lexclass TAG_MODE // -------------------------------------------------------- - -#token "[\ \t]+" <> -#token "\r\n" <> -#token "[\r\n]" <> - -#token K_include "include" - << - zzmode(INCLUDE_FILE); - featSetIncludeReturnMode(TAG_MODE); - zzskip(); - >> - -#token ";" <> // xxx - -#token T_TAG "[\0x21-\0x3a\0x3c-\0x7E]{[\0x21-\0x3a\0x3c-\0x7E]}{[\0x21-\0x3a\0x3c-\0x7E]}{[\0x21-\0x3a\0x3c-\0x7E]}" - <> - -#lexclass LABEL_MODE // ------------------------------------------------------- - -#token "[\ \t]+" <> -#token "\r\n" <> -#token "[\r\n]" <> - -#token T_LABEL "[A-Za-z_0-9.]+" - <> - -#lexclass INCLUDE_FILE // ----------------------------------------------------- - -#token "[\ \t]+" <> -#token "\r\n" <> -#token "[\r\n]" <> - -#token INCLFILE "\(~[\)]+\)[#; \t\r\n]" - << - zzmode(featGetIncludeReturnMode()); - DF(2, (stderr, "# in(%s)\n", zzlextext)); - zzskip(); - featOpenIncludeFile(g, featTrimParensSpaces(zzlextext)); - >> - -#lexclass ANON_HDR1_MODE // --------------------------------------------------- - -#token "@" <> - -#token "[\ \t]+" <> -#token "\r\n" <> -#token "[\r\n]" <> -#token "\{" <> - -#lexclass ANON_HDR2_MODE // --------------------------------------------------- - -#token "@" <> - -#token "#~[\r\n]*" <> -#token "[\ \t]+" <> -#token "\r\n" <> -#token "[\r\n]" <> - -#lexclass ANON_BODY_MODE // --------------------------------------------------- - -#token "@" <> - -#token "\r\n" << - if (featAddAnonDataChar(zzlextext[0], 0) || - featAddAnonDataChar(zzlextext[1], 1 /*eol*/)) - zzmode(START); - zzskip(); - zzline++; - >> -#token "[\r\n]" << - if (featAddAnonDataChar(zzlextext[0], 1 /*eol*/)) - zzmode(START); - zzskip(); - zzline++; - >> - -#token "~[]" <> - -#lexclass STRING_MODE // ------------------------------------------------------ - -#token "@" <> - -#token "\"" <> - -#token "\r\n" <> -#token "[\r\n]" <> - -#token "[\0x20-\0x7E\0x80-\0xF7]" <> - -#lexclass START // ------------------------------------------------------------ - -#token "#~[\r\n]*" <> -#token "[\ \t]+" <> -#token "\r\n" <> -#token "[\r\n]" <> - -/* Ordering of tokens: list keywords and more specific patterns first */ - -#token K_include "include" - <> - -#token K_feature "feature" <> -#token K_table "table" -#token K_script "script" <> -#token K_language "language" <> -#token K_languagesystem "languagesystem" <> -#token K_subtable "subtable" -#token K_lookup "lookup" <> -#token K_lookupflag "lookupflag" - -#token K_RightToLeft "RightToLeft" -#token K_IgnoreBaseGlyphs "IgnoreBaseGlyphs" -#token K_IgnoreLigatures "IgnoreLigatures" -#token K_IgnoreMarks "IgnoreMarks" -#token K_UseMarkFilteringSet "UseMarkFilteringSet" -#token K_MarkAttachmentType "MarkAttachmentType" - -#token K_anon "(anonymous|anon)" - <> - -#token K_includeDFLT "includeDFLT" -#token K_excludeDFLT "excludeDFLT" - -#token K_include_dflt "include_dflt" -#token K_exclude_dflt "exclude_dflt" - -#token K_useExtension "useExtension" -#token K_BeginValue "<" -#token K_EndValue ">" -#token K_enumerate "enumerate|enum" -#token K_except "except" -#token K_ignore "ignore" -#token K_substitute "substitute|sub" -#token K_reverse "reversesub|rsub" -#token K_by "by" -#token K_from "from" -#token K_position "position|pos" -#token K_parameters "parameters" -#token K_feat_names "featureNames" -#token K_cv_params "cvParameters" -#token K_cvUILabel "FeatUILabelNameID" -#token K_cvToolTip "FeatUITooltipTextNameID" -#token K_cvSampletext "SampleTextNameID" -#token K_cvParameterLabel "ParamUILabelNameID" -#token K_cvCharacter "Character" -#token K_sizemenuname "sizemenuname" -#token K_contourpoint "contourpoint" -#token K_device "device" -#token K_anchor "anchor" -#token K_anchordef "anchorDef" -#token K_valueRecordDef "valueRecordDef" -#token K_mark "mark" -#token K_markClass "markClass" -#token K_cursive "cursive" -#token K_markBase "base" -#token K_markLigature "ligature|lig" -#token K_LigatureComponent "ligComponent" -#token K_caret "caret" - -#token K_NULL "NULL" - -#token K_BASE "BASE" /* Added tag to list in zzcr_attr() */ -#token K_HorizAxis_BaseTagList "HorizAxis.BaseTagList" - <> -#token K_HorizAxis_BaseScriptList "HorizAxis.BaseScriptList" - <> -#token K_VertAxis_BaseTagList "VertAxis.BaseTagList" - <> -#token K_VertAxis_BaseScriptList "VertAxis.BaseScriptList" - <> - -#token K_GDEF "GDEF" /* Added tag to list in zzcr_attr() */ -#token K_GlyphClassDef "GlyphClassDef" -#token K_Attach "Attach" -#token K_GDEFMarkAttachClass "MarkAttachClass" -#token K_LigatureCaret1 "LigatureCaretByPos" -#token K_LigatureCaret2 "LigatureCaretByIndex" -#token K_LigatureCaret3 "LigatureCaretByDev" - -#token K_head "head" /* Added tag to list in zzcr_attr() */ -#token K_FontRevision "FontRevision" - -#token K_hhea "hhea" /* Added tag to list in zzcr_attr() */ -#token K_Ascender "Ascender" -#token K_Descender "Descender" -#token K_LineGap "LineGap" - -#token K_CaretOffset "CaretOffset" - -#token K_name "name" /* Added tag to list in zzcr_attr() */ -#token K_nameid "nameid" - -#token K_OS_2 "OS/2" /* Added tag to list in zzcr_attr() */ -#token K_FSType "FSType" -#token K_FSType2 "fsType" -#token K_LowerOpticalPointSize "LowerOpSize" -#token K_UpperOpticalPointSize "UpperOpSize" -#token K_Panose "Panose" -#token K_TypoAscender "TypoAscender" -#token K_TypoDescender "TypoDescender" -#token K_TypoLineGap "TypoLineGap" -#token K_winAscent "winAscent" -#token K_winDescent "winDescent" -#token K_XHeight "XHeight" -#token K_CapHeight "CapHeight" -#token K_UnicodeRange "UnicodeRange" -#token K_CodePageRange "CodePageRange" -#token K_WeightClass "WeightClass" -#token K_WidthClass "WidthClass" -#token K_Vendor "Vendor" -#token K_FamilyClass "FamilyClass" - -#token K_STAT "STAT" /* Added tag to list in zzcr_attr() */ -#token K_ElidedFallbackName "ElidedFallbackName" -#token K_ElidedFallbackNameID "ElidedFallbackNameID" -#token K_DesignAxis "DesignAxis" <> -#token K_AxisValue "AxisValue" -#token K_flag "flag" -#token K_location "location" <> -#token K_ElidableAxisValueName "ElidableAxisValueName" -#token K_OlderSiblingFontAttribute "OlderSiblingFontAttribute" - -#token K_vhea "vhea" /* Added tag to list in zzcr_attr() */ -#token K_VertTypoAscender "VertTypoAscender" -#token K_VertTypoDescender "VertTypoDescender" -#token K_VertTypoLineGap "VertTypoLineGap" - -#token K_vmtx "vmtx" /* Added tag to list in zzcr_attr() */ -#token K_VertOriginY "VertOriginY" -#token K_VertAdvanceY "VertAdvanceY" - -#token T_FONTREV "[0-9]+.[0-9]+" -#token T_NUMEXT "0x[0-9a-fA-F]+|0[0-7]+" -#token T_NUM "({\-}[1-9][0-9]*)|{\-}0" -#token T_FLOAT "\-[0-9]+.[0-9]+" - -#token T_GCLASS "\@[A-Za-z_0-9.\-]+" -#token T_CID "\\[0-9]+" -#token T_GNAME "{\\}[A-Za-z_\.]+[A-Za-z_0-9.\-\+\*:\~^!]*" -#token T_STRING "\"" <> - -#token Eof "@" << - if (featCloseIncludeFile(g, 0)) - zzskip(); /* For an included file */ - else - featWrapUpFeatFile(); /* For main feature file */ - >> - - -/* ----------------------------- Rules ------------------------------------- */ - -// ------- glyph class rules - -glyph[char *tok, int allowNotdef]>[GID gid] - : <<$gid = 0; /* Suppress optimizer warning */>> - gname:T_GNAME <<$gid = featMapGName2GID(g, $gname.text, allowNotdef); - if ($tok != NULL) - strcpy($tok, $gname.text);>> - | cid:T_CID <<$gid = cid2gid(g, (CID)($cid).lval);>> - ; - -/* Returns head of list; any named glyph classes references are copied, unless - dontcopy is true. - Note that FEAT_GCLASS is set only for a @CLASSNAME or [...] construct even - if it contains only a single glyph - this is essential for classifying - pair pos rules as specific or class pairs */ -glyphClass[bool named, bool dontcopy, char *gcname]>[GNode *gnode] - : << - $gnode = NULL; /* Suppress compiler warning */ - if ($named) - gcDefine(gcname); /* GNode class assignment */ - >> - - a:T_GCLASS - - << - if ($named) - { - $gnode = gcAddGlyphClass($a.text, 1); - gcEnd(named); - } - else if ($dontcopy) - $gnode = gcLookup($a.text); - else - featGlyphClassCopy(g, &($gnode), gcLookup($a.text)); - >> - | - ( - << - GNode *anonHead; - GNode *namedHead; - if (! $named) - h->gcInsert = &anonHead; /* Anon glyph class (inline) definition */ - >> - - "\[" - ( - <> - glyph[p, TRUE]>[gid] - <> - ( "\-" glyph[q, FALSE]>[endgid] - <> - | - <> - ) - | - b:T_GCLASS <> - )+ - "\]" - - << - namedHead = gcEnd(named); - $gnode = ($named) ? namedHead : anonHead; - ($gnode)->flags |= FEAT_GCLASS; - >> - ) - ; - -// ------- metrics -numUInt8>[unsigned char value] - : <<$value = 0; /* Suppress optimizer warning */>> - n:T_NUM << - if ($n.lval < 0 || $n.lval > 255) - zzerr("not in range 0 .. 255"); - $value = (unsigned char)($n).lval; - >> - ; - -numInt16>[short value] - : <<$value = 0; /* Suppress optimizer warning */>> - n:T_NUM << - if ($n.lval < -32767 || $n.lval > 32767) - zzerr("not in range -32767 .. 32767"); - $value = (short)($n).lval; - >> - ; - -numUInt16>[unsigned value] - : <<$value = 0; /* Suppress optimizer warning */>> - n:T_NUM << - if ($n.lval < 0 || $n.lval > 65535) - zzerr("not in range 0 .. 65535"); - $value = (unsigned)($n).lval; - >> - ; - -parameterValue>[short value] - : << - long retval = 0; - $value = 0; /* Suppress optimizer warning */ - >> - d:T_FONTREV << - /* This is actually for picking up fractional point values - i use the T_FONTREV - pattern as it works fine for fractional point values too. */ - retval = (long)(0.5 + 10*atof(d.text)); - if (retval < 0 || retval > 65535) - zzerr("not in range 0 .. 65535"); - $value = (short)retval; - >> - | - n:T_NUM << - if ($n.lval < 0 || $n.lval > 65535) - zzerr("not in range 0 .. 65535"); - $value = (short)($n).lval; - >> - ; - -/* Extended format: hex, oct also allowed */ -numUInt16Ext>[unsigned value] - : <<$value = 0; /* Suppress optimizer warning */ - h->linenum = zzline;>> - m:T_NUMEXT << - if ($m.lval < 0 || $m.lval > 65535) - zzerr("not in range 0 .. 65535"); - $value = (unsigned)($m).lval; - >> - | - n:T_NUM << - if ($n.lval < 0 || $n.lval > 65535) - zzerr("not in range 0 .. 65535"); - $value = (unsigned)($n).lval; - >> - ; - -/* Extended format: hex, oct also allowed */ -numUInt32Ext>[unsigned value] - : <<$value = 0; /* Suppress optimizer warning */ - h->linenum = zzline;>> - m:T_NUMEXT << - if ( $m.ulval > 0xFFFFFFFFu) - zzerr("not in range 0 .. ((1<<32) -1)"); - $value = (unsigned)($m).ulval; - >> - | - n:T_NUM << - if ($n.ulval > 0xFFFFFFFFu) - zzerr("not in range 0 .. ((1<<32) -1)"); - $value = (unsigned)($n).ulval; - >> - ; - -/* 32-bit signed fixed-point number (16.16) */ -numFixed>[Fixed value] - : << - int64_t retval = 0; - $value = 0; /* Suppress optimizer warning */ - h->linenum = zzline; - >> - ( - f:T_FLOAT <> - | - d:T_FONTREV <> - | - n:T_NUM <> - ) - << - if (retval < INT_MIN || retval > INT_MAX) - zzerr("not in range -32768.0 .. 32767.99998"); - $value = (Fixed)retval; - >> - ; - -metric>[short value] - : numInt16>[$value] - - <> /* Suppress compiler warning (xxx fit antlr) */ - ; - -/* xxx Produces gcc warning "label `fail' defined but not used". Modify antlr - to fix this. Or to shut up warning, put -Wno-unused after -Wall */ -deviceEntry - : << - unsigned short ppem; - short delta; - >> - numUInt16>[ppem] numInt16>[delta] <> - - <> /* Suppress compiler warning (xxx fit antlr) */ - ; - -/* A countour point without the enclosing <> */ -contourpoint>[unsigned short value] - : <<$value = 0;>> /* Suppress optimizer warning */ - - K_contourpoint numUInt16>[$value] - ; - -/* xxx Reads in and returns the offset to a */ -device>[unsigned short value] - : <<$value = 0;>> /* Suppress optimizer warning */ - - K_device - ( - "0" <<$value = 0;>> - | - <> - - deviceEntry ( "," deviceEntry )* - - <<$value = deviceEnd();>> - ) - ; - -/* xxx A caret value without the enclosing <> */ -caret - : << - short val; - unsigned short contPt; - Offset dev; - >> - K_caret - ( - metric>[val] - | - ( - K_BeginValue - ( - contourpoint>[contPt] - | - device>[dev] - ) - K_EndValue - ) - ) - ; - -/* A value record */ -valueRecordDef - : - << - short metrics[4]; - >> - K_valueRecordDef - ( - ( - K_BeginValue - metric>[metrics[0]] - metric>[metrics[1]] - metric>[metrics[2]] - metric>[metrics[3]] - K_EndValue - ) - | - ( - metric>[metrics[2]] - << - metrics[0] = 0; - metrics[1] = 0; - metrics[3] = 0; - >> - ) - ) - valName:T_GNAME - << - featAddValRecDef(metrics, $valName.text); - >> - ; - - -valueRecord[GNode* gnode] /* can be used when an anchor is not an alternative */ - : - << - short metrics[4]; - >> - ( - K_BeginValue - ( - valueDefName:T_GNAME << fillMetricsFromValueDef($valueDefName.text, metrics); >> - | - ( - metric>[metrics[0]] - metric>[metrics[1]] - metric>[metrics[2]] - metric>[metrics[3]] - ) - ) - K_EndValue - << if (gnode == NULL) - zzerr("Glyph or glyph class must precede a value record."); - $gnode->metricsInfo = getNextMetricsInfoRec(); - $gnode->metricsInfo->cnt = 4; - $gnode->metricsInfo->metrics[0] = metrics[0]; - $gnode->metricsInfo->metrics[1] = metrics[1]; - $gnode->metricsInfo->metrics[2] = metrics[2]; - $gnode->metricsInfo->metrics[3] = metrics[3]; - if(0)goto fail; /* Suppress compiler warning (xxx fit antlr) */ - >> - ) - ; - -valueRecord3[GNode* gnode] /* Used when a single metric value record is possible. */ - : << int val;>> - - metric>[val] - - << if (gnode == NULL) - zzerr("Glyph or glyph class must precede a value record."); - $gnode->metricsInfo = getNextMetricsInfoRec(); - $gnode->metricsInfo->cnt = 1; - $gnode->metricsInfo->metrics[0] = val; - if(0)goto fail; /* Suppress compiler warning (xxx fit antlr) */ - >> - ; - -anchorDef - : - << - short xVal, yVal; - unsigned short contourIndex; - int hasContour = 0; - >> - K_anchordef - metric>[xVal] - metric>[yVal] - ( - contourpoint>[contourIndex] - <> - )* - anchor:T_GNAME - << - featAddAnchorDef( xVal, yVal, contourIndex, hasContour, $anchor.text); - >> - ; - -anchor[int componentIndex]>[int anchorWasNULL] - : << - short xVal, yVal; - unsigned short contourIndex = 0; - int isNULL = 0; - int hasContour = 0; - char* anchorName = NULL; - $anchorWasNULL = 0; - >> - K_BeginValue - ( - K_anchor - << - xVal = 0; - yVal = 0; - isNULL = 0; - >> - ( - ( - metric>[xVal] - metric>[yVal] - ( - (contourpoint>[contourIndex] - <> - ) - | - ) - ) - | - K_NULL - <<$anchorWasNULL = 1; - isNULL = 1; - >> - | - anchorDefName:T_GNAME << anchorName = $anchorDefName.text; >> - - ) - K_EndValue - <> - ) - <> /* Suppress compiler warning (xxx fit antlr) */ - ; - - - - -// GSUB rules ----------------------------------------------------------------- - -/* Any sequence of glyphs and/or glyph classes */ -pattern[int markedOK]>[GNode *pat] - : <> - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - ) - { "'" - << - if ($markedOK) - { - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - } - else - zzerr("cannot mark a replacement glyph pattern"); - >> - } - ( - K_lookup - t:T_LABEL - << - { - int labelIndex; - if ((*insert) == NULL) - zzerr("Glyph or glyph class must precede a lookup reference in a contextual rule."); - - labelIndex = featGetLabelIndex($t.text); - (*insert)->lookupLabels[(*insert)->lookupLabelCount] = labelIndex; - (*insert)->lookupLabelCount++; - if ((*insert)->lookupLabelCount > 255) - zzerr("Too many lookup references in one glyph position."); - $pat->flags |= FEAT_LOOKUP_NODE; /* used to flag that lookup key was used. */ - } - >> - )* - <nextSeq; - >> - )+ - - <<(*insert) = NULL;>> - ; - -pattern2[GNode** headP]>[GNode *lastNode] - : << - GNode **insert; - insert = $headP; - if (*insert != NULL) - insert = &(*insert)->nextSeq; - >> - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - ) - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - insert = &(*insert)->nextSeq; - } - >> - )+ - - <<(*insert) = NULL;>> - ; - - -/* Single glyph or glyph class */ -pattern3[GNode** headP]>[GNode *lastNode] - : << - GNode **insert; - insert = $headP; - if (*insert != NULL) - insert = &(*insert)->nextSeq; - >> - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - ) - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - insert = &(*insert)->nextSeq; - } - >> - ) - - <<(*insert) = NULL;>> - ; - - -ignoresub_or_pos - : << - GNode *targ; - int doSub = 1; - unsigned int typeGSUB = GSUBChain; - h->metricsInfo.cnt = 0; - >> - - K_ignore (K_substitute | K_reverse <> | K_position <>) - pattern[1]>[targ] <flags |= FEAT_IGNORE_CLAUSE; - if (doSub) addSub(targ, NULL, typeGSUB, zzline); - else addPos(targ, 0, 0);>> - ( - "," - pattern[1]>[targ] <flags |= FEAT_IGNORE_CLAUSE; - if (doSub) addSub(targ, NULL, GSUBChain, zzline); - else addPos(targ, 0, 0);>> - )* - ; - -substitute - : << - GNode *targ; - GNode *repl = NULL; - int targLine; - int type = 0; - >> - - { - K_except <syntax.numExcept++;>> - pattern[1]>[targ] <flags |= FEAT_IGNORE_CLAUSE; - addSub(targ, NULL, type, zzline);>> - ( - "," pattern[1]>[targ] <flags |= FEAT_IGNORE_CLAUSE; - addSub(targ, NULL, type, zzline);>> - )* - } - - ( - ( - K_reverse <> - pattern[1]>[targ] <> - { - K_by - ( - K_NULL <> - | - pattern[0]>[repl] <> - ) - } - ) - | - ( - K_substitute - pattern[1]>[targ] <> - { - ( - K_by - | - K_from <> - ) - ( - K_NULL - | pattern[0]>[repl] - ) - } - <> - ) - ) - ; - -// GPOS rules ----------------------------------------------------------------- - - - -/* Any sequence of glyphs and/or glyph classes followed by an anchor*/ -mark_statement - : << - GNode *targ; - int isNull =0; - targ = NULL; - h->anchorMarkInfo.cnt = 0; - >> - K_markClass - ( - ( - /* require a glyph or glyph class*/ - <> - - glyph[NULL, FALSE]>[gid] - << - targ = newNode(h); - targ->gid = gid; - targ->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - targ = gc; - >> - ) - ) - - /* now require an anchor.*/ - anchor[0]>[isNull] - - /* now get the mark class label */ - ( - a:T_GCLASS - - << - featAddMark(targ, $a.text); - >> - ) - ; - - - -position - : << - /* This need to work for both single and pair pos lookups, and mark to base lookups. */ - GNode *lastNodeP = NULL; - GNode *targ = NULL; - GNode *ruleHead = NULL; - GNode *temp = NULL; - int enumerate = 0; - int labelIndex; - int type = 0; - int labelLine; - h->metricsInfo.cnt = 0; - h->anchorMarkInfo.cnt = 0; - >> - - { - K_enumerate <> /* valid only for pair pos rules */ - } - K_position - { - pattern2[&targ]>[lastNodeP] <> - } - ( /* group everything that follows the optional initial glyph or glyph class */ - - ( - ( - valueRecord3[ruleHead] /* simple number */ - | - valueRecord[ruleHead] /* < a b c d> */ - ) - <> /* Note that this is a first pass setting; could end up being GPOSPair */ - ( - pattern3[&ruleHead]>[lastNodeP] <> - { - valueRecord3[ruleHead] /* simple number */ - | - valueRecord[ruleHead] /* < a b c d> */ - } - )* - ) - | - ( - ( - K_lookup <> - t:T_LABEL - << - if (ruleHead == NULL) - zzerr("Glyph or glyph class must precede a lookup reference in a contextual rule."); - - labelIndex = featGetLabelIndex($t.text); - ruleHead->lookupLabels[ruleHead->lookupLabelCount] = labelIndex; - ruleHead->lookupLabelCount++; - if (ruleHead->lookupLabelCount > 255) - zzerr("Too many lookup references in one glyph position."); - type = 0; - ruleHead = lastNodeP; - type = GPOSChain; - >> - )+ - ( - pattern3[&ruleHead]>[lastNodeP] <> - ( - K_lookup <> - t2:T_LABEL - << - if (ruleHead == NULL) - zzerr("Glyph or glyph class must precede a lookup reference in a contextual rule."); - - labelIndex = featGetLabelIndex($t2.text); - ruleHead->lookupLabels[ruleHead->lookupLabelCount] = labelIndex; - ruleHead->lookupLabelCount++; - if (ruleHead->lookupLabelCount > 255) - zzerr("Too many lookup references in one glyph position."); - ruleHead = lastNodeP; - >> - )* - )* - ) - | - ( - K_cursive - cursive[&ruleHead]>[lastNodeP] - << - type = GPOSCursive; - >> - { - pattern2[&lastNodeP]>[lastNodeP] - } - ) - | - ( - K_markBase - baseToMark[&ruleHead]>[lastNodeP] - <> - { - pattern2[&lastNodeP]>[lastNodeP] - } - ) - | - ( - K_markLigature - ligatureMark[&ruleHead]>[lastNodeP] - <> - { - pattern2[&lastNodeP]>[lastNodeP] - } - ) - | - ( - K_mark - baseToMark[&ruleHead]>[lastNodeP] - <> - { - pattern2[&lastNodeP]>[lastNodeP] - } - ) - - ) /* end - group everything that follows the optional initial glyph or glyph class */ - << - if (targ == NULL) /* there was no contextual look-ahead */ - targ = ruleHead; - addPos(targ, type, enumerate); - >> - ; - -parameters - : << - short params[MAX_FEAT_PARAM_NUM]; /* allow for feature param size up to MAX_FEAT_PARAM_NUM params. */ - short value; - short index = 0; - h->featNameID = 0; - >> - - K_parameters parameterValue>[value] << params[index] = value; - index++; - >> - ( parameterValue>[value] << if (index == MAX_FEAT_PARAM_NUM) - zzerr("Too many size parameter values"); - params[index] = value; - index++; - >> - )+ - <> - ; - -nameEntry>[long plat, long spec, long lang] - : - << - $plat = -1; /* Suppress optimizer warning */ - $spec = -1; /* Suppress optimizer warning */ - $lang = -1; /* Suppress optimizer warning */ - - h->nameString.cnt = 0; - >> - ( - K_name - { - numUInt16Ext>[$plat] - << - if ($plat != HOT_NAME_MS_PLATFORM && - $plat != HOT_NAME_MAC_PLATFORM) - hotMsg(g, hotFATAL, - "platform id must be %d or %d [%s %d]", - HOT_NAME_MS_PLATFORM, HOT_NAME_MAC_PLATFORM, - INCL.file, h->linenum); - >> - { - numUInt16Ext>[$spec] - numUInt16Ext>[$lang] - } - } - T_STRING - ";" - ) - ; - -featureNameEntry - : - << long plat, spec, lang; >> - nameEntry>[plat, spec, lang] - << - sawFeatNames = TRUE; - addFeatureNameString(plat, spec, lang); - >> - ; - -featureNames - : - << - sawFeatNames = TRUE; - h->featNameID = nameReserveUserID(h->g); - >> - K_feat_names - "\{" - ( - (featureNameEntry)+ - ) - "\}" - << - addFeatureNameParam(h->g, h->featNameID); - >> - ; - - -cvParameterBlock - : - << - sawCVParams = TRUE; - h->cvParameters.FeatUILabelNameID = 0; - h->cvParameters.FeatUITooltipTextNameID = 0; - h->cvParameters.SampleTextNameID = 0; - h->cvParameters.NumNamedParameters = 0; - h->cvParameters.FirstParamUILabelNameID = 0; - h->cvParameters.charValues.cnt = 0; - h->featNameID = nameReserveUserID(h->g); - >> - K_cv_params - "\{" - { - K_cvUILabel - "\{" - ( - (featureNameEntry)+ - << - addCVNameID(h->featNameID, cvUILabelEnum); - >> - ) - "\}" - ";" - } - { - K_cvToolTip - "\{" - ( - (featureNameEntry)+ - << - addCVNameID(h->featNameID, cvToolTipEnum); - >> - ) - "\}" - ";" - } - { - K_cvSampletext - "\{" - ( - (featureNameEntry)+ - << - addCVNameID(h->featNameID, cvSampletextEnum); - >> - ) - "\}" - ";" - } - { - ( - K_cvParameterLabel - "\{" - ( - (featureNameEntry)+ - << - addCVNameID(h->featNameID, kCVParameterLabelEnum); - >> - ) - "\}" - ";" - )+ - } - { - ( - K_cvCharacter - ( - << - unsigned long uv = 0; - >> - numUInt32Ext>[uv] - << - addCVParametersCharValue(uv); - >> - ) - ";" - )+ - } - - "\}" - << - addCVParam(h->g); - >> - ; - -// Assignment rules ----------------------------------------------------------- - -/* This expects the cursive base glyph or glyph clase -followed by two anchors. -*/ -cursive[GNode** headP]>[GNode *lastNode] - : << - GNode **insert; - int isNull = 0; - insert = $headP; - if (*insert != NULL) - insert = &(*insert)->nextSeq; - >> - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - - ) - - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - (*insert)->flags |= FEAT_IS_BASE_NODE; - insert = &(*insert)->nextSeq; - } - >> - ) - /* now for the two anchors */ - anchor[0]>[isNull] - anchor[0]>[isNull] - <<(*insert) = NULL;>> - ; - -/* This expects the base to mark base glyph or glyph clase -followed by one anchor, follwed by none or more contextul glyph or glyph classes, then by 'mark' and mark class, then by more glyphs. -*/ -baseToMark[GNode** headP]>[GNode *lastNode] - : << - GNode **insert; - GNode **markInsert = NULL; /* This is used to hold the union of the mark classes, for use in contextual lookups */ - int isNull; - insert = $headP; - if (*insert != NULL) - insert = &(*insert)->nextSeq; - >> - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - - ) - - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - (*insert)->flags |= FEAT_IS_BASE_NODE; - insert = &(*insert)->nextSeq; - } - >> - ) - { /* This differs from teh bock above in that the glyphs are not flagged as being the base glyph. */ - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - - ) - - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - insert = &(*insert)->nextSeq; - } - >> - )+ - } - /* now for the anchor and mark sequences */ - ( - ( - anchor[0]>[isNull] - K_mark - a:T_GCLASS - << - addMarkClass($a.text); /* add mark class reference to current AnchorMarkInfo for this rule */ - >> - - { "'" - << - if (markInsert == NULL) - { - markInsert = featGlyphClassCopy(g,insert, gcLookup($a.text)); - (*insert)->flags |= FEAT_MARKED; - } - else - markInsert = featGlyphClassCopy(g, markInsert, gcLookup($a.text)); - /* Mark this node: */ - >> - } - - )+ - << - if (markInsert != NULL) - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - (*insert)->flags |= FEAT_IS_MARK_NODE; - insert = &(*insert)->nextSeq; - } - >> - ) - - ; - - -ligatureMark[GNode** headP]>[GNode *lastNode] - : << - GNode **insert; - GNode **markInsert = NULL; /* This is used to hold the union of the mark classes, for use in contextual lookups */ - int componentIndex = 0; - insert = $headP; - if (*insert != NULL) - insert = &(*insert)->nextSeq; - >> - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - - ) - - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - (*insert)->flags |= FEAT_IS_BASE_NODE; - insert = &(*insert)->nextSeq; - } - >> - ) - { /* This differs from the block above in that the glyphs are not flagged as being the base glyph. */ - ( - ( - ( - <> - - glyph[NULL, FALSE]>[gid] - << - *insert = newNode(h); - (*insert)->gid = gid; - (*insert)->nextCl = NULL; - >> - ) - | - ( - <> - - glyphClass[false, false, NULL]>[gc] - << - *insert = gc; - >> - ) - - ) - - { "'" - << - /* Mark this node: */ - (*insert)->flags |= FEAT_MARKED; - >> - } - << - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - insert = &(*insert)->nextSeq; - } - >> - )+ - } - /* now for the anchor and mark sequences */ - ( - ( - ( - << - int isNULL = 0; - int seenMark = 0; - >> - anchor[componentIndex]>[isNULL] - { - K_mark - a:T_GCLASS - << - addMarkClass($a.text); /* add mark class reference to current AnchorMarkInfo for this rule */ - seenMark = 1; - >> - } - << - if (!seenMark && !isNULL) - zzerr("In mark to ligature, non-null anchor must be followed by a mark class."); - >> - ) - { - K_LigatureComponent - <> - } - { "'" - << - /* For contextual rules, we need the union of all the mark glyphs as a glyph node in the context */ - if (markInsert == NULL) - { - markInsert = featGlyphClassCopy(g,insert, gcLookup($a.text)); - (*insert)->flags |= FEAT_MARKED; - } - else - markInsert = featGlyphClassCopy(g, markInsert, gcLookup($a.text)); - >> - } - )+ - << - if (markInsert != NULL) - { - GNode **lastPP = &$lastNode; - *lastPP = *insert; - (*insert)->flags |= FEAT_IS_MARK_NODE; - insert = &(*insert)->nextSeq; - } - >> - ) - - ; - - -glyphClassAssign - : <> - a:T_GCLASS "=" glyphClass[true, false, $a.text]>[tmp1] - ; - -scriptAssign - : K_script t:T_TAG <> - ; - -languageAssign - : << - int langChange; - int incDFLT = 1; - int oldFormatSeen = 0; - >> - K_language t:T_TAG <> - ( - K_excludeDFLT <> - | K_includeDFLT <> - | K_exclude_dflt <> - | K_include_dflt <> - | - ) - << - if (langChange != -1) - includeDFLT(incDFLT, langChange, oldFormatSeen); - >> - ; - -namedLookupFlagValue[unsigned short *val] - : - << - unsigned short umfIndex = 0; - unsigned short gdef_markclass_index = 0; - >> - /* This sets val from the named lookup and, if K_MarkAttachmentType, the class index. */ - K_RightToLeft <> - | - K_IgnoreBaseGlyphs <> - | - K_IgnoreLigatures <> - | - K_IgnoreMarks <> - | - K_UseMarkFilteringSet - ( - <> - glyphClass[false, true, NULL]>[gc] - << - getMarkSetIndex(gc, &umfIndex); - setLkpFlagAttribute(val,otlUseMarkFilteringSet, umfIndex); - >> - ) - | - ( - K_MarkAttachmentType - ( - numUInt8>[gdef_markclass_index] - | - ( - <> - glyphClass[false, true, NULL]>[gc] - << - getGDEFMarkClassIndex(gc, &gdef_markclass_index); - >> - ) - - ) - <> - ) - ; - -lookupflagAssign - : << - unsigned short val = 0; - >> - - K_lookupflag - ( - numUInt16>[val] /* Explicit value */ - | - namedLookupFlagValue[&val] - )+ - - << setLkpFlag(val); >> - ; - -featureUse - : K_feature t:T_TAG <> - ; - -subtable - : K_subtable <> - ; - -sizemenuname - : - << - long plat = -1; /* Suppress optimizer warning */ - long spec = -1; /* Suppress optimizer warning */ - long lang = -1; /* Suppress optimizer warning */ - - h->nameString.cnt = 0; - >> - ( - K_sizemenuname - { - numUInt16Ext>[plat] - << - if (plat != HOT_NAME_MS_PLATFORM && - plat != HOT_NAME_MAC_PLATFORM) - hotMsg(g, hotFATAL, - "platform id must be %d or %d [%s %d]", - HOT_NAME_MS_PLATFORM, HOT_NAME_MAC_PLATFORM, - INCL.file, h->linenum); - >> - { - numUInt16Ext>[spec] - numUInt16Ext>[lang] - } - } - T_STRING - ) - << addSizeNameString(plat, spec, lang);>> - - ; - -statement - : ( featureUse // e.g. feature vert; # only in 'aalt' - | scriptAssign // e.g. script kana; - | languageAssign // e.g. language DEU; - | lookupflagAssign // e.g. lookupflag RightToLeft; - - | glyphClassAssign // e.g. @vowels = [a e i o u]; - - | ignoresub_or_pos // e.g. ignore substitute @LET a, a @LET; - | substitute // e.g. sub f i by fi; - | mark_statement // e.g. mark one <-80 0 -160 0>; - | position // e.g. pos one <-80 0 -160 0>; - // pos A y -50; - | parameters // e.g. parameters 100 3 80 139; # only in 'size' - | sizemenuname // e.g. sizemenuname "MinionPro Caption"; # 'size' - - | featureNames - - | subtable // e.g. subtable; - - | // e.g. ; - ) ";" - ; - -lookupBlockOrUse - : <> - K_lookup t:T_LABEL <> - ( { - K_useExtension <> - } - "\{" << - checkLkpName($t.text, labelLine, 1, 0); - if (useExtension) - flagExtension(1); - >> - (statement)+ - "\}" <> - u:T_LABEL <> - | <> - ) - ";" - ; - -lookupBlockStandAlone - : <> - K_lookup t:T_LABEL <> - ( { - K_useExtension <> - } - "\{" << - checkLkpName($t.text, labelLine, 1,1 ); - if (useExtension) - flagExtension(1); - >> - (statement)+ - "\}" <> - u:T_LABEL <> - ) - ";" - ; - -featureBlock - : K_feature t:T_TAG <> - { - K_useExtension <> - } - "\{" - ( statement - | lookupBlockOrUse - | cvParameterBlock - )+ - "\}" <> - u:T_TAG <> - ";" - ; - -baseScript[int vert, long nTag] - : << - int num; - dnaDCL(short, coord); - dnaINIT(g->dnaCtx, coord, 5, 5); - >> - - s:T_TAG <> - d:T_TAG - ( - numInt16>[num] <<*dnaNEXT(coord) = num;>> - )+ - - << - if (coord.cnt != $nTag) - zzerr("number of coordinates not equal to number of " - "baseline tags"); - BASEAddScript(g, $vert, $s.ulval, $d.ulval, coord.array); - dnaFREE(coord); - >> - ; - -axisSpecs - : << - int vert = 0; - dnaDCL(Tag, tagList); - dnaINIT(g->dnaCtx, tagList, 5, 5); - >> - - (K_HorizAxis_BaseTagList | K_VertAxis_BaseTagList <>) - ( - t:T_TAG <<*dnaNEXT(tagList) = $t.ulval; - /* printf("<%c%c%c%c> ", TAG_ARG(t.ulval)); */ - zzmode(TAG_MODE);>> - )+ - <> - - ( - K_HorizAxis_BaseScriptList - <> - | K_VertAxis_BaseScriptList - <> - ) - - baseScript[vert, tagList.cnt] - ( - "," <> - baseScript[vert, tagList.cnt] - )* - - ";" - <> - ; - -table_BASE - : t:K_BASE <> - "\{" - axisSpecs - {axisSpecs} - "\}" <> - u:T_TAG <> - ";" - ; - -table_OS_2 - : t:K_OS_2 <> - "\{" - ( - ( - << - char panose[10]; - short valInt16; - unsigned short arrayIndex; - unsigned short valUInt16; - short codePageList[kLenCodePageList]; - short unicodeRangeList[kLenUnicodeList]; - h->nameString.cnt = 0; - >> - - K_TypoAscender numInt16>[valInt16] - <font.TypoAscender = valInt16;>> - | - K_TypoDescender numInt16>[valInt16] - <font.TypoDescender = valInt16;>> - | - K_TypoLineGap numInt16>[valInt16] - <font.TypoLineGap = valInt16;>> - | - K_winAscent numInt16>[valInt16] - <font.winAscent = valInt16;>> - | - K_winDescent numInt16>[valInt16] - <font.winDescent = valInt16;>> - | - K_XHeight metric>[valInt16] - <font.win.XHeight = valInt16;>> - | - K_CapHeight metric>[valInt16] - <font.win.CapHeight = valInt16;>> - | - K_Panose numUInt8>[panose[0]] - numUInt8>[panose[1]] - numUInt8>[panose[2]] - numUInt8>[panose[3]] - numUInt8>[panose[4]] - numUInt8>[panose[5]] - numUInt8>[panose[6]] - numUInt8>[panose[7]] - numUInt8>[panose[8]] - numUInt8>[panose[9]] <> - | - K_FSType numUInt16>[valUInt16] - <> - | - K_FSType2 numUInt16>[valUInt16] - <> - | - K_UnicodeRange - ( - <> - ( - numUInt16>[valUInt16] <> - )+ - <> - ) - | - K_CodePageRange - ( - <> - ( - numUInt16>[valUInt16] <> - )+ - <> - ) - | - K_WeightClass numUInt16>[valUInt16] - <> - | - K_WidthClass numUInt16>[valUInt16] - <> - | - K_LowerOpticalPointSize numUInt16>[valUInt16] - <> - | - K_UpperOpticalPointSize numUInt16>[valUInt16] - <> - | - K_FamilyClass numUInt16Ext>[valUInt16] - <> - | - (K_Vendor T_STRING) - <> - | - ) - ";" - )+ - "\}" <> - u:T_TAG <> - ";" - ; - -statNameEntry - : - << long plat, spec, lang; >> - nameEntry>[plat, spec, lang] - << addUserNameString(plat, spec, lang);>> - ; - -designAxis - : - << - uint16_t ordering; - h->featNameID = 0; - >> - K_DesignAxis t:T_TAG numUInt16>[ordering] - "\{" - (statNameEntry)+ - "\}" - << - STATAddDesignAxis(g, $t.ulval, h->featNameID, ordering); - h->featNameID = 0; - >> - ; - -axisValueFlag[uint16_t *flags] - : - K_OlderSiblingFontAttribute << *flags |= 0x0001; >> - | - K_ElidableAxisValueName << *flags |= 0x0002; >> - ; - -axisValueFlags>[uint16_t flags] - : - << $flags = 0; >> - K_flag (axisValueFlag[&$flags])+ - ";" - ; - -axisValueLocation>[uint16_t format, Tag tag, Fixed value, Fixed min, Fixed max] - : - K_location t:T_TAG << $tag = $t.ulval; >> numFixed>[$value] - ( ";" << $format = 1; >> - | numFixed>[$min] << $format = 3; >> - {numFixed>[$max] << $format = 2; >> } ";" - ) - ; - -axisValue - : - << - uint16_t flags = 0; - uint16_t format = 0, prev = 0; - dnaDCL(Tag, axisTags); - dnaDCL(Fixed, values); - Fixed value, min, max; - Tag axisTag; - h->featNameID = 0; - dnaINIT(g->dnaCtx, axisTags, 1, 5); - dnaINIT(g->dnaCtx, values, 1, 5); - >> - K_AxisValue - "\{" - ( statNameEntry - | axisValueFlags>[flags] - | axisValueLocation>[format, axisTag, value, min, max] - << - if (prev && (prev != 1 || format != prev)) - zzerr("AxisValue with unsupported multiple location statements"); - *dnaNEXT(axisTags) = axisTag; - *dnaNEXT(values) = value; - prev = format; - >> - )+ - "\}" - << - if (!format) - zzerr("AxisValue missing location statement"); - if (!h->featNameID) - zzerr("AxisValue missing name entry"); - STATAddAxisValueTable(g, format, axisTags.array, values.array, - values.cnt, flags, h->featNameID, - min, max); - dnaFREE(axisTags); - dnaFREE(values); - >> - ; - -elidedFallbackName - : - << - long plat, spec, lang; - h->featNameID = 0; - >> - K_ElidedFallbackName - "\{" - ( - nameEntry>[plat, spec, lang] - << addUserNameString(plat, spec, lang); >> - )+ - "\}" - << - if (!STATSetElidedFallbackNameID(g, h->featNameID)) - zzerr("ElidedFallbackName already defined."); - h->featNameID = 0; - >> - ; - -elidedFallbackNameID - : - << long nameID; >> - K_ElidedFallbackNameID numUInt16Ext>[nameID] - << - if (!STATSetElidedFallbackNameID(g, nameID)) - zzerr("ElidedFallbackName already defined."); - >> - ; - -table_STAT - : t:K_STAT <> - << - sawSTAT = TRUE; - >> - "\{" - ( - ( - designAxis - | - axisValue - | - elidedFallbackName - | - elidedFallbackNameID - | - ) - ";" - )+ - "\}" <> - u:T_TAG <> - ";" - ; - -glyphClassOptional>[GNode *gnode] - : <<$gnode = NULL;>> /* Suppress optimizer warning */ - - glyphClass[false, false, NULL]>[$gnode] - | <<$gnode = NULL;>> - ; - -table_GDEF - : t:K_GDEF <> - "\{" - ( - ( - <> - - K_GlyphClassDef glyphClassOptional>[gc[0]] "," - glyphClassOptional>[gc[1]] "," - glyphClassOptional>[gc[2]] "," - glyphClassOptional>[gc[3]] - <> - | - ( - K_Attach - pattern[0]>[gc[0]] - ( - metric>[val] - <> - )+ - ) - | - ( - K_LigatureCaret1 - pattern[0]>[gc[0]] - <> - ( - metric>[val] - <> - )+ - <> - ) - | - - ( - K_LigatureCaret2 - pattern[0]>[gc[0]] - <> - ( - metric>[val] - <> - )+ - <> - ) - | - ) - ";" - )* - "\}" <> - u:T_TAG <> - ";" - ; - -table_head - : t:K_head <> - "\{" - ( - K_FontRevision r:T_FONTREV <> - | - ) - ";" - "\}" <> - u:T_TAG <> - ";" - ; - -table_hhea - : t:K_hhea <> - "\{" - ( - ( - <> - - K_CaretOffset numInt16>[value] <> - | - K_Ascender numInt16>[value] <font.hheaAscender = value;>> - | - K_Descender numInt16>[value] <font.hheaDescender = value;>> - | - K_LineGap numInt16>[value] <font.hheaLineGap = value;>> - | - ) - ";" - )+ - "\}" <> - u:T_TAG <> - ";" - ; - -table_name - : t:K_name <> - "\{" - ( - << - int ignoreRec = 0; /* Suppress optimizer warning */ - long id = 0; /* Suppress optimizer warning */ - long plat = 0; /* Suppress optimizer warning */ - long spec = 0; /* Suppress optimizer warning */ - long lang = 0; /* Suppress optimizer warning */ - >> - ( - K_nameid << - h->nameString.cnt = 0; - plat = -1; - spec = -1; - lang = -1; - ignoreRec = 0; - >> - - numUInt16Ext>[id] - << - if (sawSTAT && id > 255) - hotMsg(g, hotFATAL, "name table should be defined before " - "STAT table with nameids above 255"); - if (sawCVParams && id > 255) - hotMsg(g, hotFATAL, "name table should be defined before " - "GSUB cvParameters with nameids above 255"); - if (sawFeatNames && id > 255) - hotMsg(g, hotFATAL, "name table should be defined before " - "GSUB featureNames with nameids above 255"); - >> - { - numUInt16Ext>[plat] - << - if (plat != HOT_NAME_MS_PLATFORM && - plat != HOT_NAME_MAC_PLATFORM) - hotMsg(g, hotFATAL, - "platform id must be %d or %d [%s %d]", - HOT_NAME_MS_PLATFORM, HOT_NAME_MAC_PLATFORM, - INCL.file, h->linenum); - >> - { - numUInt16Ext>[spec] - numUInt16Ext>[lang] - } - } - T_STRING - | - ) - ";" <> - )+ - "\}" <> - u:T_TAG <> - ";" - ; - -table_vhea - : t:K_vhea <> - "\{" - ( - ( - <> - - K_VertTypoAscender numInt16>[value] - <font.VertTypoAscender = value;>> - | - K_VertTypoDescender numInt16>[value] - <font.VertTypoDescender = value;>> - | - K_VertTypoLineGap numInt16>[value] - <font.VertTypoLineGap = value;>> - | - ) - ";" - )+ - "\}" <> - u:T_TAG <> - ";" - ; - -table_vmtx - : t:K_vmtx <> - "\{" - ( - ( - <> - - K_VertOriginY glyph[NULL, FALSE]>[gid] numInt16>[value] - << - hotAddVertOriginY(g, gid, value, INCL.file, zzline); - >> - | - K_VertAdvanceY glyph[NULL, FALSE]>[gid] numInt16>[value] - << - hotAddVertAdvanceY(g, gid, value, INCL.file, zzline); - >> - | - ) - ";" - )+ - "\}" <> - u:T_TAG <> - ";" - ; - - -tableBlock - : K_table - ( table_BASE - | table_GDEF - | table_head - | table_hhea - | table_name - | table_OS_2 - | table_STAT - | table_vhea - | table_vmtx - ) - ; - -languagesystemAssign - : K_languagesystem s:T_TAG <> t:T_TAG - <> - ; - -topLevelStatement - : ( glyphClassAssign - | languagesystemAssign - | mark_statement - | anchorDef - | valueRecordDef - | - ) - ";" - ; - -anonBlock - : K_anon t:T_TAG <anonData.tag = $t.ulval;>> - <> - ; - -featureFile - : ( topLevelStatement - | featureBlock - | tableBlock - | anonBlock - | lookupBlockStandAlone - )* - - <> - // Eof itself is intercepted by the tokenizer. - ; diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_131.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_131.txt deleted file mode 100644 index d5d6d0cab..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_131.txt +++ /dev/null @@ -1,522 +0,0 @@ -CHANGES FROM 1.31 - -This file contains the migration of PCCTS from 1.31 in the order that -changes were made. 1.32b7 is the last beta before full 1.32. -Terence Parr, Parr Research Corporation 1995. - - -====================================================================== -1.32b1 -Added Russell Quong to banner, changed banner for output slightly -Fixed it so that you have before / after actions for C++ in class def -Fixed bug in optimizer that made it sometimes forget to set internal - token pointers. Only showed up when a {...} was in the "wrong spot". - -====================================================================== -1.32b2 -Added fixes by Dave Seidel for PC compilers in 32 bit mode (config.h -and set.h). - -====================================================================== -1.32b3 -Fixed hideous bug in code generator for wildcard and for ~token op. - -from Dave Seidel - - Added pcnames.bat - 1. in antlr/main.c: change strcasecmp() to stricmp() - - 2. in dlg/output.c: use DLEXER_C instead on "DLexer.C" - - 3. in h/PBlackBox.h: use instead of - -====================================================================== -1.32b4 -When the -ft option was used, any path prefix screwed up -the gate on the .h files - -Fixed yet another bug due to the optimizer. - -The exception handling thing was a bit wacko: - -a : ( A B )? A B - | A C - ; - exception ... - -caused an exception if "A C" was the input. In other words, -it found that A C didn't match the (A B)? pred and caused -an exception rather than trying the next alt. All I did -was to change the zzmatch_wsig() macros. - -Fixed some problems in gen.c relating to the name of token -class bit sets in the output. - -Added the tremendously cool generalized predicate. For the -moment, I'll give this bried description. - -a : <>? blah - | foo - ; - -This implies that (assuming blah and foo are syntactically -ambiguous) "predicate" indicates the semantic validity of -applying "blah". If "predicate" is false, "foo" is attempted. - -Previously, you had to say: - -a : <>? ID - | ID - ; - -Now, you can simply use "predicate" without the ?: operator -if you turn on ANTLR command line option: "-prc on". This -tells ANTLR to compute that all by itself. It computes n -tokens of lookahead where LT(n) or LATEXT(n) is the farthest -ahead you look. - -If you give a predicate using "-prc on" that is followed -by a construct that can recognize more than one n-sequence, -you will get a warning from ANTLR. For example, - -a : <getText())>>? (ID|INT) - ; - -This is wrong because the predicate will be applied to INTs -as well as ID's. You should use this syntax to make -the predicate more specific: - -a : (ID)? => <getText())>>? (ID|INT) - ; - -which says "don't apply the predicate unless ID is the -current lookahead context". - -You cannot currently have anything in the "(context)? =>" -except sequences such as: - -( LPAREN ID | LPAREN SCOPE )? => <>? - -I haven't tested this THAT much, but it does work for the -C++ grammar. - -====================================================================== -1.32b5 - -Added getLine() to the ANTLRTokenBase and DLGBasedToken classes -left line() for backward compatibility. ----- -Removed SORCERER_TRANSFORM from the ast.h stuff. -------- -Fixed bug in code gen of ANTLR such that nested syn preds work more -efficiently now. The ANTLRTokenBuffer was getting very large -with nested predicates. ------- -Memory leak is now gone from ANTLRTokenBuf; all tokens are deleted. -For backward compatibility reasons, you have to say parser->deleteTokens() -or mytokenbuffer->deleteTokens() but later it will be the default mode. -Say this after the parser is constructed. E.g., - - ParserBlackBox p(stdin); - p.parser()->deleteTokens(); - p.parser()->start_symbol(); - - -============================== -1.32b6 - -Changed so that deleteTokens() will do a delete ((ANTLRTokenBase *)) -on the ptr. This gets the virtual destructor. - -Fixed some weird things in the C++ header files (a few return types). - -Made the AST routines correspond to the book and SORCERER stuff. - -New token stuff: See testcpp/14/test.g - -ANTLR accepts a #pragma gc_tokens which says -[1] Generate label = copy(LT(1)) instead of label=LT(1) for - all labeled token references. -[2] User now has to define ANTLRTokenPtr (as a class or a typedef - to just a pointer) as well as the ANTLRToken class itself. - See the example. - -To delete tokens in token buffer, use deleteTokens() message on parser. - - All tokens that fall off the ANTLRTokenBuffer get deleted - which is what currently happens when deleteTokens() message - has been sent to token buffer. - -We always generate ANTLRTokenPtr instead of 'ANTLRToken *' now. -Then if no pragma set, ANTLR generates a - - class ANTLRToken; - typedef ANTLRToken *ANTLRTokenPtr; - -in each file. - -Made a warning for x:rule_ref <<$x>>; still no warning for $i's, however. -class BB { - -a : x:b y:A <<$x -$y>> - ; - -b : B; - -} -generates -Antlr parser generator Version 1.32b6 1989-1995 -test.g, line 3: error: There are no token ptrs for rule references: '$x' - -=================== -1.32b7: - -[With respect to token object garbage collection (GC), 1.32b7 - backtracks from 1.32b6, but results in better and less intrusive GC. - This is the last beta version before full 1.32.] - -BIGGEST CHANGES: - -o The "#pragma gc_tokens" is no longer used. - -o .C files are now .cpp files (hence, makefiles will have to - be changed; or you can rerun genmk). This is a good move, - but causes some backward incompatibility problems. You can - avoid this by changing CPP_FILE_SUFFIX to ".C" in pccts/h/config.h. - -o The token object class hierarchy has been flattened to include - only three classes: ANTLRAbstractToken, ANTLRCommonToken, and - ANTLRCommonNoRefCountToken. The common token now does garbage - collection via ref counting. - -o "Smart" pointers are now used for garbage collection. That is, - ANTLRTokenPtr is used instead of "ANTLRToken *". - -o The antlr.1 man page has been cleaned up slightly. - -o The SUN C++ compiler now complains less about C++ support code. - -o Grammars which subclass ANTLRCommonToken must wrap all token - pointer references in mytoken(token_ptr). This is the only - serious backward incompatibility. See below. - - -MINOR CHANGES: - --------------------------------------------------------- -1 deleteTokens() - -The deleteTokens() message to the parser or token buffer has been changed -to one of: - - void noGarbageCollectTokens() { inputTokens->noGarbageCollectTokens(); } - void garbageCollectTokens() { inputTokens->garbageCollectTokens(); } - -The token buffer deletes all non-referenced tokens by default now. - --------------------------------------------------------- -2 makeToken() - -The makeToken() message returns a new type. The function should look -like: - - virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt, - ANTLRChar *txt, - int line) - { - ANTLRAbstractToken *t = new ANTLRCommonToken(tt,txt); - t->setLine(line); - return t; - } - --------------------------------------------------------- -3 TokenType - -Changed TokenType-> ANTLRTokenType (often forces changes in AST defs due -to #[] constructor called to AST(tokentype, string)). - --------------------------------------------------------- -4 AST() - -You must define AST(ANTLRTokenPtr t) now in your AST class definition. -You might also have to include ATokPtr.h above the definition; e.g., -if AST is defined in a separate file, such as AST.h, it's a good idea -to include ATOKPTR_H (ATokPtr.h). For example, - - #include ATOKPTR_H - class AST : public ASTBase { - protected: - ANTLRTokenPtr token; - public: - AST(ANTLRTokenPtr t) { token = t; } - void preorder_action() { - char *s = token->getText(); - printf(" %s", s); - } - }; - -Note the use of smart pointers rather than "ANTLRToken *". - --------------------------------------------------------- -5 SUN C++ - -From robertb oakhill.sps.mot.com Bob Bailey. Changed ANTLR C++ output -to avoid an error in Sun C++ 3.0.1. Made "public" return value -structs created to hold multiple return values public. - --------------------------------------------------------- -6 genmk - -Fixed genmk so that target List.* is not included anymore. It's -called SList.* anyway. - --------------------------------------------------------- -7 \r vs \n - -Scott Vorthmann fixed antlr.g in ANTLR so that \r -is allowed as the return character as well as \n. - --------------------------------------------------------- -8 Exceptions - -Bug in exceptions attached to labeled token/tokclass references. Didn't gen -code for exceptions. This didn't work: - -a : "help" x:ID - ; - exception[x] - catch MismatchedToken : <> - -Now ANTLR generates (which is kinda big, but necessary): - - if ( !_match_wsig(ID) ) { - if ( guessing ) goto fail; - _signal=MismatchedToken; - switch ( _signal ) { - case MismatchedToken : - printf("eh?\n"); - _signal = NoSignal; - break; - default : - goto _handler; - } - } - -which implies that you can recover and continue parsing after a missing/bad -token reference. - --------------------------------------------------------- -9 genmk - -genmk now correctly uses config file for CPP_FILE_SUFFIX stuff. - --------------------------------------------------------- -10 general cleanup / PURIFY - -Anthony Green suggested a bunch of good general -clean up things for the code; he also suggested a few things to -help out the "PURIFY" memory allocation checker. - --------------------------------------------------------- -11 $-variable references. - -Manuel ORNATO indicated that a $-variable outside of a rule caused -ANTLR to crash. I fixed this. - -12 Tom Moog suggestion - -Fail action of semantic predicate needs "{}" envelope. FIXED. - -13 references to LT(1). - -I have enclosed all assignments such as: - - _t22 = (ANTLRTokenPtr)LT(1); - -in "if ( !guessing )" so that during backtracking the reference count -for token objects is not increased. - - -TOKEN OBJECT GARBAGE COLLECTION - -1 INTRODUCTION - -The class ANTLRCommonToken is now garbaged collected through a "smart" -pointer called ANTLRTokenPtr using reference counting. Any token -object not referenced by your grammar actions is destroyed by the -ANTLRTokenBuffer when it must make room for more token objects. -Referenced tokens are then destroyed in your parser when local -ANTLRTokenPtr objects are deleted. For example, - -a : label:ID ; - -would be converted to something like: - -void yourclass::a(void) -{ - zzRULE; - ANTLRTokenPtr label=NULL; // used to be ANTLRToken *label; - zzmatch(ID); - label = (ANTLRTokenPtr)LT(1); - consume(); - ... -} - -When the "label" object is destroyed (it's just a pointer to your -input token object LT(1)), it decrements the reference count on the -object created for the ID. If the count goes to zero, the object -pointed by label is deleted. - -To correctly manage the garbage collection, you should use -ANTLRTokenPtr instead of "ANTLRToken *". Most ANTLR support code -(visible to the user) has been modified to use the smart pointers. - -*************************************************************** -Remember that any local objects that you create are not deleted when a -lonjmp() is executed. Unfortunately, the syntactic predicates (...)? -use setjmp()/longjmp(). There are some situations when a few tokens -will "leak". -*************************************************************** - -2 DETAILS - -o The default is to perform token object garbage collection. - You may use parser->noGarbageCollectTokens() to turn off - garbage collection. - - -o The type ANTLRTokenPtr is always defined now (automatically). - If you do not wish to use smart pointers, you will have to - redefined ANTLRTokenPtr by subclassing, changing the header - file or changing ANTLR's code generation (easy enough to - do in gen.c). - -o If you don't use ParserBlackBox, the new initialization sequence is: - - ANTLRTokenPtr aToken = new ANTLRToken; - scan.setToken(mytoken(aToken)); - - where mytoken(aToken) gets an ANTLRToken * from the smart pointer. - -o Define C++ preprocessor symbol DBG_REFCOUNTTOKEN to see a bunch of - debugging stuff for reference counting if you suspect something. - - -3 WHY DO I HAVE TO TYPECAST ALL MY TOKEN POINTERS NOW?????? - -If you subclass ANTLRCommonToken and then attempt to refer to one of -your token members via a token pointer in your grammar actions, the -C++ compiler will complain that your token object does not have that -member. For example, if you used to do this - -<< -class ANTLRToken : public ANTLRCommonToken { - int muck; - ... -}; ->> - -class Foo { -a : t:ID << t->muck = ...; >> ; -} - -Now, you must do change the t->muck reference to: - -a : t:ID << mytoken(t)->muck = ...; >> ; - -in order to downcast 't' to be an "ANTLRToken *" not the -"ANTLRAbstractToken *" resulting from ANTLRTokenPtr::operator->(). -The macro is defined as: - -/* - * Since you cannot redefine operator->() to return one of the user's - * token object types, we must down cast. This is a drag. Here's - * a macro that helps. template: "mytoken(a-smart-ptr)->myfield". - */ -#define mytoken(tp) ((ANTLRToken *)(tp.operator->())) - -You have to use macro mytoken(grammar-label) now because smart -pointers are not specific to a parser's token objects. In other -words, the ANTLRTokenPtr class has a pointer to a generic -ANTLRAbstractToken not your ANTLRToken; the ANTLR support code must -use smart pointers too, but be able to work with any kind of -ANTLRToken. Sorry about this, but it's C++'s fault not mine. Some -nebulous future version of the C++ compilers should obviate the need -to downcast smart pointers with runtime type checking (and by allowing -different return type of overridden functions). - -A way to have backward compatible code is to shut off the token object -garbage collection; i.e., use parser->noGarbageCollectTokens() and -change the definition of ANTLRTokenPtr (that's why you get source code -). - - -PARSER EXCEPTION HANDLING - -I've noticed some weird stuff with the exception handling. I intend -to give this top priority for the "book release" of ANTLR. - -========== -1.32 Full Release - -o Changed Token class hierarchy to be (Thanks to Tom Moog): - - ANTLRAbstractToken - ANTLRRefCountToken - ANTLRCommonToken - ANTLRNoRefCountCommonToken - -o Added virtual panic() to ANTLRAbstractToken. Made ANTLRParser::panic() - virtual also. - -o Cleaned up the dup() stuff in AST hierarchy to use shallowCopy() to - make node copies. John Farr at Medtronic suggested this. I.e., - if you want to use dup() with either ANTLR or SORCERER or -transform - mode with SORCERER, you must defined shallowCopy() as: - - virtual PCCTS_AST *shallowCopy() - { - return new AST; - p->setDown(NULL); - p->setRight(NULL); - return p; - } - - or - - virtual PCCTS_AST *shallowCopy() - { - return new AST(*this); - } - - if you have defined a copy constructor such as - - AST(const AST &t) // shallow copy constructor - { - token = t.token; - iconst = t.iconst; - setDown(NULL); - setRight(NULL); - } - -o Added a warning with -CC and -gk are used together. This is broken, - hence a warning is appropriate. - -o Added warning when #-stuff is used w/o -gt option. - -o Updated MPW installation. - -o "Miller, Philip W." suggested - that genmk be use RENAME_OBJ_FLAG RENAME_EXE_FLAG instead of - hardcoding "-o" in genmk.c. - -o made all exit() calls use EXIT_SUCCESS or EXIT_FAILURE. - -=========================================================================== -1.33 - -EXIT_FAILURE and EXIT_SUCCESS were not always defined. I had to modify -a bunch of files to use PCCTS_EXIT_XXX, which forces a new version. Sorry -about that. - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133.txt deleted file mode 100644 index 69e23c242..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133.txt +++ /dev/null @@ -1,2448 +0,0 @@ -======================================================================= -List of Implemented Fixes and Changes for Maintenance Releases of PCCTS -======================================================================= - - DISCLAIMER - - The software and these notes are provided "as is". They may include - typographical or technical errors and their authors disclaims all - liability of any kind or nature for damages due to error, fault, - defect, or deficiency regardless of cause. All warranties of any - kind, either express or implied, including, but not limited to, the - implied warranties of merchantability and fitness for a particular - purpose are disclaimed. - - - ------------------------------------------------------- - Note: Items #153 to #1 are now in a separate file named - CHANGES_FROM_133_BEFORE_MR13.txt - ------------------------------------------------------- - -#312. (Changed in MR33) Bug caused by change #299. - - In change #299 a warning message was suppressed when there was - no LT(1) in a semantic predicate and max(k,ck) was 1. The - changed caused the code which set a default predicate depth for - the semantic predicate to be left as 0 rather than set to 1. - - This manifested as an error at line #1559 of mrhost.c - - Reported by Peter Dulimov. - -#311. (Changed in MR33) Added sorcer/lib to Makefile. - - Reported by Dale Martin. - -#310. (Changed in MR32) In C mode zzastPush was spelled zzastpush in one case. - - Reported by Jean-Claude Durand - -#309. (Changed in MR32) Renamed baseName because of VMS name conflict - - Renamed baseName to pcctsBaseName to avoid library name conflict with - VMS library routine. Reported by Jean-François PIÉRONNE. - -#308. (Changed in MR32) Used "template" as name of formal in C routine - - In astlib.h routine ast_scan a formal was named "template". This caused - problems when the C code was compiled with a C++ compiler. Reported by - Sabyasachi Dey. - -#307. (Changed in MR31) Compiler dependent bug in function prototype generation - - The code which generated function prototypes contained a bug which - was compiler/optimization dependent. Under some circumstance an - extra character would be included in portions of a function prototype. - - Reported by David Cook. - -#306. (Changed in MR30) Validating predicate following a token - - A validating predicate which immediately followed a token match - consumed the token after the predicate rather than before. Prior - to this fix (in the following example) isValidTimeScaleValue() in - the predicate would test the text for TIMESCALE rather than for - NUMBER: - - time_scale : - TIMESCALE - <getText())>>? - ts:NUMBER - ( us:MICROSECOND << tVal = ...>> - | ns:NANOSECOND << tVal = ... >> - ) - - Reported by Adalbert Perbandt. - -#305. (Changed in MR30) Alternatives with guess blocks inside (...)* blocks. - - In MR14 change #175 fixed a bug in the prediction expressions for guess - blocks which were of the form (alpha)? beta. Unfortunately, this - resulted in a new bug as exemplified by the example below, which computed - the first set for r as {B} rather than {B C}: - - r : ( (A)? B - | C - )* - - This example doesn't make any sense as A is not a prefix of B, but it - illustrates the problem. This bug did not appear for: - - r : ( (A)? - | C - )* - - because it does not use the (alpha)? beta form. - - Item #175 fixed an asymmetry in ambiguity messages for the following - constructs which appear to have identical ambiguities (between repeating - the loop vs. exiting the loop). MR30 retains this fix, but the implementation - is slightly different. - - r_star : ( (A B)? )* A ; - r_plus : ( (A B)? )+ A ; - - Reported by Arpad Beszedes (beszedes inf.u-szeged.hu). - -#304. (Changed in MR30) Crash when mismatch between output value counts. - - For a rule such as: - - r1 : r2>[i,j]; - r2 >[int i, int j] : A; - - If there were extra actuals for the reference to rule r2 from rule r1 - there antlr would crash. This bug was introduced by change #276. - - Reported by Sinan Karasu. - -#303. (Changed in MR30) DLGLexerBase::replchar - - DLGLexerBase::replchar and the C mode routine zzreplchar did not work - properly when the new character was 0. - - Reported with fix by Philippe Laporte - -#302. (Changed in MR28) Fix significant problems in initial release of MR27. - -#301. (Changed in MR27) Default tab stops set to 2 spaces. - - To have antlr generate true tabs rather than spaces, use "antlr -tab 0". - To generate 4 spaces per tab stop use "antlr -tab 4" - -#300. (Changed in MR27) - - Consider the following methods of constructing an AST from ID: - - rule1! - : id:ID << #0 = #[id]; >> ; - - rule2! - : id:ID << #0 = #id; >> ; - - rule3 - : ID ; - - rule4 - : id:ID << #0 = #id; >> ; - - For rule_2, the AST corresponding to id would always be NULL. This - is because the user explicitly suppressed AST construction using the - "!" operator on the rule. In MR27 the use of an AST expression - such as #id overrides the "!" operator and forces construction of - the AST. - - This fix does not apply to C mode ASTs when the ASTs are referenced - using numbers rather than symbols. - - For C mode, this requires that the (optional) function/macro zzmk_ast - be defined. This functions copies information from an attribute into - a previously allocated AST. - - Reported by Jan Langer (jan langernetz.de) - -#299. (Changed in MR27) Don't warn if k=1 and semantic predicate missing LT(i) - - If a semantic does not have a reference to LT(i) or (C mode LATEXT(i)) - then pccts doesn't know how many lookahead tokens to use for context. - However, if max(k,ck) is 1 then there is really only one choice and - the warning is unnecessary. - -#298. (Changed in MR27) Removed "register" for lastpos in dlgauto.c zzgettok - -#297. (Changed in MR27) Incorrect prototypes when used with classic C - - There were a number of errors in function headers when antlr was - built with compilers that do not have __STDC__ or __cplusplus set. - - The functions which have variable length argument lists now use - PCCTS_USE_STDARG rather than __USE_PROTOTYPES__ to determine - whether to use stdargs or varargs. - -#296. (Changed in MR27) Complex return types in rules. - - The following return type was not properly handled when - unpacking a struct with containing multiple return values: - - rule > [int i, IIR_Bool (IIR_Decl::*constraint)()] : ... - - Instead of using "constraint", the program got lost and used - an empty string. - - Reported by P.A. Wilsey. - -#295. (Changed in MR27) Extra ";" following zzGUESS_DONE sometimes. - - Certain constructs with guess blocks in MR23 led to extra ";" - preceding the "else" clause of an "if". - - Reported by P.A. Wilsey. - -#294. (Changed in MR27) Infinite loop in antlr for nested blocks - - An oversight in detecting an empty alternative sometimes led - to an infinite loop in antlr when it encountered a rule with - nested blocks and guess blocks. - - Reported by P.A. Wilsey. - -#293. (Changed in MR27) Sorcerer optimization of _t->type() - - Sorcerer generated code may contain many calls to _t->type() in a - single statement. This change introduces a temporary variable - to eliminate unnnecesary function calls. - - Change implemented by Tom Molteno (tim videoscript.com). - -#292. (Changed in MR27) - - WARNING: Item #267 changes the signature of methods in the AST class. - - **** Be sure to revise your AST functions of the same name *** - -#291. (Changed in MR24) - - Fix to serious code generation error in MR23 for (...)+ block. - -#290. (Changed in MR23) - - Item #247 describes a change in the way {...} blocks handled - an error. Consider: - - r1 : {A} b ; - b : B; - - with input "C". - - Prior to change #247, the error would resemble "expected B - - found C". This is correct but incomplete, and therefore - misleading. In #247 it was changed to "expected A, B - found - C". This was fine, except for users of parser exception - handling because the exception was generated in the epilogue - for {...} block rather than in rule b. This made it difficult - for users of parser exception handling because B was not - expected in that context. Those not using parser exception - handling didn't notice the difference. - - The current change restores the behavior prior to #247 when - parser exceptions are present, but retains the revised behavior - otherwise. This change should be visible only when exceptions - are in use and only for {...} blocks and sub-blocks of the form - (something|something | something | epsilon) where epsilon represents - an empty production and it is the last alternative of a sub-block. - In contrast, (something | epsilon | something) should generate the - same code as before, even when exceptions are used. - - Reported by Philippe Laporte (philippe at transvirtual.com). - -#289. (Changed in MR23) Bug in matching complement of a #tokclass - - Prior to MR23 when a #tokclass was matched in both its complemented form - and uncomplemented form, the bit set generated for its first use was used - for both cases. However, the prediction expression was correctly computed - in both cases. This meant that the second case would never be matched - because, for the second appearance, the prediction expression and the - set to be matched would be complements of each other. - - Consider: - - #token A "a" - #token B "b" - #token C "c" - #tokclass AB {A B} - - r1 : AB /* alt 1x */ - | ~AB /* alt 1y */ - ; - - Prior to MR23, this resulted in alternative 1y being unreachable. Had it - been written: - - r2 : ~AB /* alt 2x */ - : AB /* alt 2y */ - - then alternative 2y would have become unreachable. - - This bug was only for the case of complemented #tokclass. For complemented - #token the proper code was generated. - -#288. (Changed in MR23) #errclass not restricted to choice points - - The #errclass directive is supposed to allow a programmer to define - print strings which should appear in syntax error messages as a replacement - for some combinations of tokens. For instance: - - #errclass Operator {PLUS MINUS TIMES DIVIDE} - - If a syntax message includes all four of these tokens, and there is no - "better" choice of error class, the word "Operator" will be used rather - than a list of the four token names. - - Prior to MR23 the #errclass definitions were used only at choice points - (which call the FAIL macro). In other cases where there was no choice - (e.g. where a single token or token class were matched) the #errclass - information was not used. - - With MR23 the #errclass declarations are used for syntax error messages - when matching a #tokclass, a wildcard (i.e. "*"), or the complement of a - #token or #tokclass (e.g. ~Operator). - - Please note that #errclass may now be defined using #tokclass names - (see Item #284). - - Reported by Philip A. Wilsey. - -#287. (Changed in MR23) Print name for #tokclass - - Item #148 describes how to give a print name to a #token so that,for - example, #token ID could have the expression "identifier" in syntax - error messages. This has been extended to #tokclass: - - #token ID("identifier") "[a-zA-Z]+" - #tokclass Primitive("primitive type") - {INT, FLOAT, CHAR, FLOAT, DOUBLE, BOOL} - - This is really a cosmetic change, since #tokclass names do not appear - in any error messages. - -#286. (Changed in MR23) Makefile change to use of cd - - In cases where a pccts subdirectory name matched a directory identified - in a $CDPATH environment variable the build would fail. All makefile - cd commands have been changed from "cd xyz" to "cd ./xyz" in order - to avoid this problem. - -#285. (Changed in MR23) Check for null pointers in some dlg structures - - An invalid regular expression can cause dlg to build an invalid - structure to represent the regular expression even while it issues - error messages. Additional pointer checks were added. - - Reported by Robert Sherry. - -#284. (Changed in MR23) Allow #tokclass in #errclass definitions - - Previously, a #tokclass reference in the definition of an - #errclass was not handled properly. Instead of being expanded - into the set of tokens represented by the #tokclass it was - treated somewhat like an #errclass. However, in a later phase - when all #errclass were expanded into the corresponding tokens - the #tokclass reference was not expanded (because it wasn't an - #errclass). In effect the reference was ignored. - - This has been fixed. - - Problem reported by Mike Dimmick (mike dimmick.demon.co.uk). - -#283. (Changed in MR23) Option -tmake invoke's parser's tmake - - When the string #(...) appears in an action antlr replaces it with - a call to ASTBase::tmake(...) to construct an AST. It is sometimes - useful to change the tmake routine so that it has access to information - in the parser - something which is not possible with a static method - in an application where they may be multiple parsers active. - - The antlr option -tmake replaces the call to ASTBase::tmake with a call - to a user supplied tmake routine. - -#282. (Changed in MR23) Initialization error for DBG_REFCOUNTTOKEN - - When the pre-processor symbol DBG_REFCOUNTTOKEN is defined - incorrect code is generated to initialize ANTLRRefCountToken::ctor and - dtor. - - Fix reported by Sven Kuehn (sven sevenkuehn.de). - -#281. (Changed in MR23) Addition of -noctor option for Sorcerer - - Added a -noctor option to suppress generation of the blank ctor - for users who wish to define their own ctor. - - Contributed by Jan Langer (jan langernetz.de). - -#280. (Changed in MR23) Syntax error message for EOF token - - The EOF token now receives special treatment in syntax error messages - because there is no text matched by the eof token. The token name - of the eof token is used unless it is "@" - in which case the string - "" is used. - - Problem reported by Erwin Achermann (erwin.achermann switzerland.org). - -#279. (Changed in MR23) Exception groups - - There was a bug in the way that exception groups were attached to - alternatives which caused problems when there was a block contained - in an alternative. For instance, in the following rule; - - statement : IF S { ELSE S } - exception .... - ; - - the exception would be attached to the {...} block instead of the - entire alternative because it was attached, in error, to the last - alternative instead of the last OPEN alternative. - - Reported by Ty Mordane (tymordane hotmail.com). - -#278. (Changed in MR23) makefile changes - - Contributed by Tomasz Babczynski (faster lab05-7.ict.pwr.wroc.pl). - - The -cfile option is not absolutely needed: when extension of - source file is one of the well-known C/C++ extensions it is - treated as C/C++ source - - The gnu make defines the CXX variable as the default C++ compiler - name, so I added a line to copy this (if defined) to the CCC var. - - Added a -sor option: after it any -class command defines the class - name for sorcerer, not for ANTLR. A file extended with .sor is - treated as sorcerer input. Because sorcerer can be called multiple - times, -sor option can be repeated. Any files and classes (one class - per group) after each -sor makes one tree parser. - - Not implemented: - - 1. Generate dependences for user c/c++ files. - 2. Support for -sor in c mode not. - - I have left the old genmk program in the directory as genmk_old.c. - -#277. (Changed in MR23) Change in macro for failed semantic predicates - - In the past, a semantic predicate that failed generated a call to - the macro zzfailed_pred: - - #ifndef zzfailed_pred - #define zzfailed_pred(_p) \ - if (guessing) { \ - zzGUESS_FAIL; \ - } else { \ - something(_p) - } - #endif - - If a user wished to use the failed action option for semantic predicates: - - rule : <>? [my_fail_action] A - | ... - - - the code for my_fail_action would have to contain logic for handling - the guess part of the zzfailed_pred macro. The user should not have - to be aware of the guess logic in writing the fail action. - - The zzfailed_pred has been rewritten to have three arguments: - - arg 1: the stringized predicate of the semantic predicate - arg 2: 0 => there is no user-defined fail action - 1 => there is a user-defined fail action - arg 3: the user-defined fail action (if defined) - otherwise a no-operation - - The zzfailed_pred macro is now defined as: - - #ifndef zzfailed_pred - #define zzfailed_pred(_p,_hasuseraction,_useraction) \ - if (guessing) { \ - zzGUESS_FAIL; \ - } else { \ - zzfailed_pred_action(_p,_hasuseraction,_useraction) \ - } - #endif - - - With zzfailed_pred_action defined as: - - #ifndef zzfailed_pred_action - #define zzfailed_pred_action(_p,_hasuseraction,_useraction) \ - if (_hasUserAction) { _useraction } else { failedSemanticPredicate(_p); } - #endif - - In C++ mode failedSemanticPredicate() is a virtual function. - In C mode the default action is a fprintf statement. - - Suggested by Erwin Achermann (erwin.achermann switzerland.org). - -#276. (Changed in MR23) Addition of return value initialization syntax - - In an attempt to reduce the problems caused by the PURIFY macro I have - added new syntax for initializing the return value of rules and the - antlr option "-nopurify". - - A rule with a single return argument: - - r1 > [Foo f = expr] : - - now generates code that resembles: - - Foo r1(void) { - Foo _retv = expr; - ... - } - - A rule with more than one return argument: - - r2 > [Foo f = expr1, Bar b = expr2 ] : - - generates code that resembles: - - struct _rv1 { - Foo f; - Bar b; - } - - _rv1 r2(void) { - struct _rv1 _retv; - _retv.f = expr1; - _retv.b = expr2; - ... - } - - C++ style comments appearing in the initialization list may cause problems. - -#275. (Changed in MR23) Addition of -nopurify option to antlr - - A long time ago the PURIFY macro was introduced to initialize - return value arguments and get rid of annying messages from program - that checked for unitialized variables. - - This has caused significant annoyance for C++ users that had - classes with virtual functions or non-trivial contructors because - it would zero the object, including the pointer to the virtual - function table. This could be defeated by redefining - the PURIFY macro to be empty, but it was a constant surprise to - new C++ users of pccts. - - I would like to remove it, but I fear that some existing programs - depend on it and would break. My temporary solution is to add - an antlr option -nopurify which disables generation of the PURIFY - macro call. - - The PURIFY macro should be avoided in favor of the new syntax - for initializing return arguments described in item #275. - - To avoid name clash, the PURIFY macro has been renamed PCCTS_PURIFY. - -#274. (Changed in MR23) DLexer.cpp renamed to DLexer.h - (Changed in MR23) ATokPtr.cpp renamed to ATokPtrImpl.h - - These two files had .cpp extensions but acted like .h files because - there were included in other files. This caused problems for many IDE. - I have renamed them. The ATokPtrImpl.h was necessary because there was - already an ATokPtr.h. - -#273. (Changed in MR23) Default win32 library changed to multi-threaded DLL - - The model used for building the Win32 debug and release libraries has changed - to multi-threaded DLL. - - To make this change in your MSVC 6 project: - - Project -> Settings - Select the C++ tab in the right pane of the dialog box - Select "Category: Code Generation" - Under "Use run-time library" select one of the following: - - Multi-threaded DLL - Debug Multi-threaded DLL - - Suggested by Bill Menees (bill.menees gogallagher.com) - -#272. (Changed in MR23) Failed semantic predicate reported via virtual function - - In the past, a failed semantic predicated reported the problem via a - macro which used fprintf(). The macro now expands into a call on - the virtual function ANTLRParser::failedSemanticPredicate(). - -#271. (Changed in MR23) Warning for LT(i), LATEXT(i) in token match actions - - An bug (or at least an oddity) is that a reference to LT(1), LA(1), - or LATEXT(1) in an action which immediately follows a token match - in a rule refers to the token matched, not the token which is in - the lookahead buffer. Consider: - - r : abc <> D <> E; - - In this case LT(1) in action alpha will refer to the next token in - the lookahead buffer ("D"), but LT(1) in action beta will refer to - the token matched by D - the preceding token. - - A warning has been added for users about this when an action - following a token match contains a reference to LT(1), LA(1), or LATEXT(1). - - This behavior should be changed, but it appears in too many programs - now. Another problem, perhaps more significant, is that the obvious - fix (moving the consume() call to before the action) could change the - order in which input is requested and output appears in existing programs. - - This problem was reported, along with a fix by Benjamin Mandel - (beny sd.co.il). However, I felt that changing the behavior was too - dangerous for existing code. - -#270. (Changed in MR23) Removed static objects from PCCTSAST.cpp - - There were some statically allocated objects in PCCTSAST.cpp - These were changed to non-static. - -#269. (Changed in MR23) dlg output for initializing static array - - The output from dlg contains a construct similar to the - following: - - struct XXX { - static const int size; - static int array1[5]; - }; - - const int XXX::size = 4; - int XXX::array1[size+1]; - - - The problem is that although the expression "size+1" used in - the definition of array1 is equal to 5 (the expression used to - declare array), it is not considered equivalent by some compilers. - - Reported with fix by Volker H. Simonis (simonis informatik.uni-tuebingen.de) - -#268. (Changed in MR23) syn() routine output when k > 1 - - The syn() routine is supposed to print out the text of the - token causing the syntax error. It appears that it always - used the text from the first lookahead token rather than the - appropriate one. The appropriate one is computed by comparing - the token codes of lookahead token i (for i = 1 to k) with - the FIRST(i) set. - - This has been corrected in ANTLRParser::syn(). - - Reported by Bill Menees (bill.menees gogallagher.com) - -#267. (Changed in MR23) AST traversal functions client data argument - - The AST traversal functions now take an extra (optional) parameter - which can point to client data: - - preorder_action(void* pData = NULL) - preorder_before_action(void* pData = NULL) - preorder_after_action(void* pData = NULL) - - **** Warning: this changes the AST signature. *** - **** Be sure to revise your AST functions of the same name *** - - Bill Menees (bill.menees gogallagher.com) - -#266. (Changed in MR23) virtual function printMessage() - - Bill Menees (bill.menees gogallagher.com) has completed the - tedious taks of replacing all calls to fprintf() with calls - to the virtual function printMessage(). For classes which - have a pointer to the parser it forwards the printMessage() - call to the parser's printMessage() routine. - - This should make it significanly easier to redirect pccts - error and warning messages. - -#265. (Changed in MR23) Remove "labase++" in C++ mode - - In C++ mode labase++ is called when a token is matched. - It appears that labase is not used in C++ mode at all, so - this code has been commented out. - -#264. (Changed in MR23) Complete rewrite of ParserBlackBox.h - - The parser black box (PBlackBox.h) was completely rewritten - by Chris Uzdavinis (chris atdesk.com) to improve its robustness. - -#263. (Changed in MR23) -preamble and -preamble_first rescinded - - Changes for item #253 have been rescinded. - -#262. (Changed in MR23) Crash with -alpha option during traceback - - Under some circumstances a -alpha traceback was started at the - "wrong" time. As a result, internal data structures were not - initialized. - - Reported by Arpad Beszedes (beszedes inf.u-szeged.hu). - -#261. (Changed in MR23) Defer token fetch for C++ mode - - Item #216 has been revised to indicate that use of the defer fetch - option (ZZDEFER_FETCH) requires dlg option -i. - -#260. (MR22) Raise default lex buffer size from 8,000 to 32,000 bytes. - - ZZLEXBUFSIZE is the size (in bytes) of the buffer used by dlg - generated lexers. The default value has been raised to 32,000 and - the value used by antlr, dlg, and sorcerer has also been raised to - 32,000. - -#259. (MR22) Default function arguments in C++ mode. - - If a rule is declared: - - rr [int i = 0] : .... - - then the declaration generated by pccts resembles: - - void rr(int i = 0); - - however, the definition must omit the default argument: - - void rr(int i) {...} - - In the past the default value was not omitted. In MR22 - the generated code resembles: - - void rr(int i /* = 0 */ ) {...} - - Implemented by Volker H. Simonis (simonis informatik.uni-tuebingen.de) - - - Note: In MR23 this was changed so that nested C style comments - ("/* ... */") would not cause problems. - -#258. (MR22) Using a base class for your parser - - In item #102 (MR10) the class statement was extended to allow one - to specify a base class other than ANTLRParser for the generated - parser. It turned out that this was less than useful because - the constructor still specified ANTLRParser as the base class. - - The class statement now uses the first identifier appearing after - the ":" as the name of the base class. For example: - - class MyParser : public FooParser { - - Generates in MyParser.h: - - class MyParser : public FooParser { - - Generates in MyParser.cpp something that resembles: - - MyParser::MyParser(ANTLRTokenBuffer *input) : - FooParser(input,1,0,0,4) - { - token_tbl = _token_tbl; - traceOptionValueDefault=1; // MR10 turn trace ON - } - - The base class constructor must have a signature similar to - that of ANTLRParser. - -#257. (MR21a) Removed dlg statement that -i has no effect in C++ mode. - - This was incorrect. - -#256. (MR21a) Malformed syntax graph causes crash after error message. - - In the past, certain kinds of errors in the very first grammar - element could cause the construction of a malformed graph - representing the grammar. This would eventually result in a - fatal internal error. The code has been changed to be more - resistant to this particular error. - -#255. (MR21a) ParserBlackBox(FILE* f) - - This constructor set openByBlackBox to the wrong value. - - Reported by Kees Bakker (kees_bakker tasking.nl). - -#254. (MR21a) Reporting syntax error at end-of-file - - When there was a syntax error at the end-of-file the syntax - error routine would substitute "" for the programmer's - end-of-file symbol. This substitution is now done only when - the programmer does not define his own end-of-file symbol - or the symbol begins with the character "@". - - Reported by Kees Bakker (kees_bakker tasking.nl). - -#253. (MR21) Generation of block preamble (-preamble and -preamble_first) - - *** This change was rescinded by item #263 *** - - The antlr option -preamble causes antlr to insert the code - BLOCK_PREAMBLE at the start of each rule and block. It does - not insert code before rules references, token references, or - actions. By properly defining the macro BLOCK_PREAMBLE the - user can generate code which is specific to the start of blocks. - - The antlr option -preamble_first is similar, but inserts the - code BLOCK_PREAMBLE_FIRST(PreambleFirst_123) where the symbol - PreambleFirst_123 is equivalent to the first set defined by - the #FirstSetSymbol described in Item #248. - - I have not investigated how these options interact with guess - mode (syntactic predicates). - -#252. (MR21) Check for null pointer in trace routine - - When some trace options are used when the parser is generated - without the trace enabled, the current rule name may be a - NULL pointer. A guard was added to check for this in - restoreState. - - Reported by Douglas E. Forester (dougf projtech.com). - -#251. (MR21) Changes to #define zzTRACE_RULES - - The macro zzTRACE_RULES was being use to pass information to - AParser.h. If this preprocessor symbol was not properly - set the first time AParser.h was #included, the declaration - of zzTRACEdata would be omitted (it is used by the -gd option). - Subsequent #includes of AParser.h would be skipped because of - the #ifdef guard, so the declaration of zzTracePrevRuleName would - never be made. The result was that proper compilation was very - order dependent. - - The declaration of zzTRACEdata was made unconditional and the - problem of removing unused declarations will be left to optimizers. - - Diagnosed by Douglas E. Forester (dougf projtech.com). - -#250. (MR21) Option for EXPERIMENTAL change to error sets for blocks - - The antlr option -mrblkerr turns on an experimental feature - which is supposed to provide more accurate syntax error messages - for k=1, ck=1 grammars. When used with k>1 or ck>1 grammars the - behavior should be no worse than the current behavior. - - There is no problem with the matching of elements or the computation - of prediction expressions in pccts. The task is only one of listing - the most appropriate tokens in the error message. The error sets used - in pccts error messages are approximations of the exact error set when - optional elements in (...)* or (...)+ are involved. While entirely - correct, the error messages are sometimes not 100% accurate. - - There is also a minor philosophical issue. For example, suppose the - grammar expects the token to be an optional A followed by Z, and it - is X. X, of course, is neither A nor Z, so an error message is appropriate. - Is it appropriate to say "Expected Z" ? It is correct, it is accurate, - but it is not complete. - - When k>1 or ck>1 the problem of providing the exactly correct - list of tokens for the syntax error messages ends up becoming - equivalent to evaluating the prediction expression for the - alternatives twice. However, for k=1 ck=1 grammars the prediction - expression can be computed easily and evaluated cheaply, so I - decided to try implementing it to satisfy a particular application. - This application uses the error set in an interactive command language - to provide prompts which list the alternatives available at that - point in the parser. The user can then enter additional tokens to - complete the command line. To do this required more accurate error - sets then previously provided by pccts. - - In some cases the default pccts behavior may lead to more robust error - recovery or clearer error messages then having the exact set of tokens. - This is because (a) features like -ge allow the use of symbolic names for - certain sets of tokens, so having extra tokens may simply obscure things - and (b) the error set is use to resynchronize the parser, so a good - choice is sometimes more important than having the exact set. - - Consider the following example: - - Note: All examples code has been abbreviated - to the absolute minimum in order to make the - examples concise. - - star1 : (A)* Z; - - The generated code resembles: - - old new (with -mrblkerr) - --//----------- -------------------- - for (;;) { for (;;) { - match(A); match(A); - } } - match(Z); if (! A and ! Z) then - FAIL(...{A,Z}...); - } - match(Z); - - - With input X - old message: Found X, expected Z - new message: Found X, expected A, Z - - For the example: - - star2 : (A|B)* Z; - - old new (with -mrblkerr) - ------------- -------------------- - for (;;) { for (;;) { - if (!A and !B) break; if (!A and !B) break; - if (...) { if (...) { - - } } - else { else { - FAIL(...{A,B,Z}...) FAIL(...{A,B}...); - } } - } } - match(B); if (! A and ! B and !Z) then - FAIL(...{A,B,Z}...); - } - match(B); - - With input X - old message: Found X, expected Z - new message: Found X, expected A, B, Z - With input A X - old message: Found X, expected Z - new message: Found X, expected A, B, Z - - This includes the choice of looping back to the - star block. - - The code for plus blocks: - - plus1 : (A)+ Z; - - The generated code resembles: - - old new (with -mrblkerr) - ------------- -------------------- - do { do { - match(A); match(A); - } while (A) } while (A) - match(Z); if (! A and ! Z) then - FAIL(...{A,Z}...); - } - match(Z); - - With input A X - old message: Found X, expected Z - new message: Found X, expected A, Z - - This includes the choice of looping back to the - plus block. - - For the example: - - plus2 : (A|B)+ Z; - - old new (with -mrblkerr) - ------------- -------------------- - do { do { - if (A) { - match(A); - } else if (B) { - match(B); - } else { - if (cnt > 1) break; - FAIL(...{A,B,Z}...) FAIL(...{A,B}...); - } } - cnt++; - } } - - match(Z); if (! A and ! B and !Z) then - FAIL(...{A,B,Z}...); - } - match(B); - - With input X - old message: Found X, expected A, B, Z - new message: Found X, expected A, B - With input A X - old message: Found X, expected Z - new message: Found X, expected A, B, Z - - This includes the choice of looping back to the - star block. - -#249. (MR21) Changes for DEC/VMS systems - - Jean-François Piéronne (jfp altavista.net) has updated some - VMS related command files and fixed some minor problems related - to building pccts under the DEC/VMS operating system. For DEC/VMS - users the most important differences are: - - a. Revised makefile.vms - b. Revised genMMS for genrating VMS style makefiles. - -#248. (MR21) Generate symbol for first set of an alternative - - pccts can generate a symbol which represents the tokens which may - appear at the start of a block: - - rr : #FirstSetSymbol(rr_FirstSet) ( Foo | Bar ) ; - - This will generate the symbol rr_FirstSet of type SetWordType with - elements Foo and Bar set. The bits can be tested using code similar - to the following: - - if (set_el(Foo, &rr_FirstSet)) { ... - - This can be combined with the C array zztokens[] or the C++ routine - tokenName() to get the print name of the token in the first set. - - The size of the set is given by the newly added enum SET_SIZE, a - protected member of the generated parser's class. The number of - elements in the generated set will not be exactly equal to the - value of SET_SIZE because of synthetic tokens created by #tokclass, - #errclass, the -ge option, and meta-tokens such as epsilon, and - end-of-file. - - The #FirstSetSymbol must appear immediately before a block - such as (...)+, (...)*, and {...}, and (...). It may not appear - immediately before a token, a rule reference, or action. However - a token or rule reference can be enclosed in a (...) in order to - make the use of #pragma FirstSetSymbol legal. - - rr_bad : #FirstSetSymbol(rr_bad_FirstSet) Foo; // Illegal - - rr_ok : #FirstSetSymbol(rr_ok_FirstSet) (Foo); // Legal - - Do not confuse FirstSetSymbol sets with the sets used for testing - lookahead. The sets used for FirstSetSymbol have one element per bit, - so the number of bytes is approximately the largest token number - divided by 8. The sets used for testing lookahead store 8 lookahead - sets per byte, so the length of the array is approximately the largest - token number. - - If there is demand, a similar routine for follow sets can be added. - -#247. (MR21) Misleading error message on syntax error for optional elements. - - =================================================== - The behavior has been revised when parser exception - handling is used. See Item #290 - =================================================== - - Prior to MR21, tokens which were optional did not appear in syntax - error messages if the block which immediately followed detected a - syntax error. - - Consider the following grammar which accepts Number, Word, and Other: - - rr : {Number} Word; - - For this rule the code resembles: - - if (LA(1) == Number) { - match(Number); - consume(); - } - match(Word); - - Prior to MR21, the error message for input "$ a" would be: - - line 1: syntax error at "$" missing Word - - With MR21 the message will be: - - line 1: syntax error at "$" expecting Word, Number. - - The generate code resembles: - - if ( (LA(1)==Number) ) { - zzmatch(Number); - consume(); - } - else { - if ( (LA(1)==Word) ) { - /* nothing */ - } - else { - FAIL(... message for both Number and Word ...); - } - } - match(Word); - - The code generated for optional blocks in MR21 is slightly longer - than the previous versions, but it should give better error messages. - - The code generated for: - - { a | b | c } - - should now be *identical* to: - - ( a | b | c | ) - - which was not the case prior to MR21. - - Reported by Sue Marvin (sue siara.com). - -#246. (Changed in MR21) Use of $(MAKE) for calls to make - - Calls to make from the makefiles were replaced with $(MAKE) - because of problems when using gmake. - - Reported with fix by Sunil K.Vallamkonda (sunil siara.com). - -#245. (Changed in MR21) Changes to genmk - - The following command line options have been added to genmk: - - -cfiles ... - - To add a user's C or C++ files into makefile automatically. - The list of files must be enclosed in apostrophes. This - option may be specified multiple times. - - -compiler ... - - The name of the compiler to use for $(CCC) or $(CC). The - default in C++ mode is "CC". The default in C mode is "cc". - - -pccts_path ... - - The value for $(PCCTS), the pccts directory. The default - is /usr/local/pccts. - - Contributed by Tomasz Babczynski (t.babczynski ict.pwr.wroc.pl). - -#244. (Changed in MR21) Rename variable "not" in antlr.g - - When antlr.g is compiled with a C++ compiler, a variable named - "not" causes problems. Reported by Sinan Karasu - (sinan.karasu boeing.com). - -#243 (Changed in MR21) Replace recursion with iteration in zzfree_ast - - Another refinement to zzfree_ast in ast.c to limit recursion. - - NAKAJIMA Mutsuki (muc isr.co.jp). - - -#242. (Changed in MR21) LineInfoFormatStr - - Added an #ifndef/#endif around LineInfoFormatStr in pcctscfg.h. - -#241. (Changed in MR21) Changed macro PURIFY to a no-op - - *********************** - *** NOT IMPLEMENTED *** - *********************** - - The PURIFY macro was changed to a no-op because it was causing - problems when passing C++ objects. - - The old definition: - - #define PURIFY(r,s) memset((char *) &(r),'\\0',(s)); - - The new definition: - - #define PURIFY(r,s) /* nothing */ -#endif - -#240. (Changed in MR21) sorcerer/h/sorcerer.h _MATCH and _MATCHRANGE - - Added test for NULL token pointer. - - Suggested by Peter Keller (keller ebi.ac.uk) - -#239. (Changed in MR21) C++ mode AParser::traceGuessFail - - If tracing is turned on when the code has been generated - without trace code, a failed guess generates a trace report - even though there are no other trace reports. This - make the behavior consistent with other parts of the - trace system. - - Reported by David Wigg (wiggjd sbu.ac.uk). - -#238. (Changed in MR21) Namespace version #include files - - Changed reference from CStdio to cstdio (and other - #include file names) in the namespace version of pccts. - Should have known better. - -#237. (Changed in MR21) ParserBlackBox(FILE*) - - In the past, ParserBlackBox would close the FILE in the dtor - even though it was not opened by ParserBlackBox. The problem - is that there were two constructors, one which accepted a file - name and did an fopen, the other which accepted a FILE and did - not do an fopen. There is now an extra member variable which - remembers whether ParserBlackBox did the open or not. - - Suggested by Mike Percy (mpercy scires.com). - -#236. (Changed in MR21) tmake now reports down pointer problem - - When ASTBase::tmake attempts to update the down pointer of - an AST it checks to see if the down pointer is NULL. If it - is not NULL it does not do the update and returns NULL. - An attempt to update the down pointer is almost always a - result of a user error. This can lead to difficult to find - problems during tree construction. - - With this change, the routine calls a virtual function - reportOverwriteOfDownPointer() which calls panic to - report the problem. Users who want the old behavior can - redefined the virtual function in their AST class. - - Suggested by Sinan Karasu (sinan.karasu boeing.com) - -#235. (Changed in MR21) Made ANTLRParser::resynch() virtual - - Suggested by Jerry Evans (jerry swsl.co.uk). - -#234. (Changed in MR21) Implicit int for function return value - - ATokenBuffer:bufferSize() did not specify a type for the - return value. - - Reported by Hai Vo-Ba (hai fc.hp.com). - -#233. (Changed in MR20) Converted to MSVC 6.0 - - Due to external circumstances I have had to convert to MSVC 6.0 - The MSVC 5.0 project files (.dsw and .dsp) have been retained as - xxx50.dsp and xxx50.dsw. The MSVC 6.0 files are named xxx60.dsp - and xxx60.dsw (where xxx is the related to the directory/project). - -#232. (Changed in MR20) Make setwd bit vectors protected in parser.h - - The access for the setwd array in the parser header was not - specified. As a result, it would depend on the code which - preceded it. In MR20 it will always have access "protected". - - Reported by Piotr Eljasiak (eljasiak zt.gdansk.tpsa.pl). - -#231. (Changed in MR20) Error in token buffer debug code. - - When token buffer debugging is selected via the pre-processor - symbol DEBUG_TOKENBUFFER there is an erroneous check in - AParser.cpp: - - #ifdef DEBUG_TOKENBUFFER - if (i >= inputTokens->bufferSize() || - inputTokens->minTokens() < LLk ) /* MR20 Was "<=" */ - ... - #endif - - Reported by David Wigg (wiggjd sbu.ac.uk). - -#230. (Changed in MR20) Fixed problem with #define for -gd option - - There was an error in setting zzTRACE_RULES for the -gd (trace) option. - - Reported by Gary Funck (gary intrepid.com). - -#229. (Changed in MR20) Additional "const" for literals - - "const" was added to the token name literal table. - "const" was added to some panic() and similar routine - -#228. (Changed in MR20) dlg crashes on "()" - - The following token defintion will cause DLG to crash. - - #token "()" - - When there is a syntax error in a regular expression - many of the dlg routines return a structure which has - null pointers. When this is accessed by callers it - generates the crash. - - I have attempted to fix the more common cases. - - Reported by Mengue Olivier (dolmen bigfoot.com). - -#227. (Changed in MR20) Array overwrite - - Steveh Hand (sassth unx.sas.com) reported a problem which - was traced to a temporary array which was not properly - resized for deeply nested blocks. This has been fixed. - -#226. (Changed in MR20) -pedantic conformance - - G. Hobbelt (i_a mbh.org) and THM made many, many minor - changes to create prototypes for all the functions and - bring antlr, dlg, and sorcerer into conformance with - the gcc -pedantic option. - - This may require uses to add pccts/h/pcctscfg.h to some - files or makefiles in order to have __USE_PROTOS defined. - -#225 (Changed in MR20) AST stack adjustment in C mode - - The fix in #214 for AST stack adjustment in C mode missed - some cases. - - Reported with fix by Ger Hobbelt (i_a mbh.org). - -#224 (Changed in MR20) LL(1) and LL(2) with #pragma approx - - This may take a record for the oldest, most trival, lexical - error in pccts. The regular expressions for LL(1) and LL(2) - lacked an escape for the left and right parenthesis. - - Reported by Ger Hobbelt (i_a mbh.org). - -#223 (Changed in MR20) Addition of IBM_VISUAL_AGE directory - - Build files for antlr, dlg, and sorcerer under IBM Visual Age - have been contributed by Anton Sergeev (ags mlc.ru). They have - been placed in the pccts/IBM_VISUAL_AGE directory. - -#222 (Changed in MR20) Replace __STDC__ with __USE_PROTOS - - Most occurrences of __STDC__ replaced with __USE_PROTOS due to - complaints from several users. - -#221 (Changed in MR20) Added #include for DLexerBase.h to PBlackBox. - - Added #include for DLexerBase.h to PBlackBox. - -#220 (Changed in MR19) strcat arguments reversed in #pred parse - - The arguments to strcat are reversed when creating a print - name for a hash table entry for use with #pred feature. - - Problem diagnosed and fix reported by Scott Harrington - (seh4 ix.netcom.com). - -#219. (Changed in MR19) C Mode routine zzfree_ast - - Changes to reduce use of recursion for AST trees with only right - links or only left links in the C mode routine zzfree_ast. - - Implemented by SAKAI Kiyotaka (ksakai isr.co.jp). - -#218. (Changed in MR19) Changes to support unsigned char in C mode - - Changes to antlr.h and err.h to fix omissions in use of zzchar_t - - Implemented by SAKAI Kiyotaka (ksakai isr.co.jp). - -#217. (Changed in MR19) Error message when dlg -i and -CC options selected - - *** This change was rescinded by item #257 *** - - The parsers generated by pccts in C++ mode are not able to support the - interactive lexer option (except, perhaps, when using the deferred fetch - parser option.(Item #216). - - DLG now warns when both -i and -CC are selected. - - This warning was suggested by David Venditti (07751870267-0001 t-online.de). - -#216. (Changed in MR19) Defer token fetch for C++ mode - - Implemented by Volker H. Simonis (simonis informatik.uni-tuebingen.de) - - Normally, pccts keeps the lookahead token buffer completely filled. - This requires max(k,ck) tokens of lookahead. For some applications - this can cause deadlock problems. For example, there may be cases - when the parser can't tell when the input has been completely consumed - until the parse is complete, but the parse can't be completed because - the input routines are waiting for additional tokens to fill the - lookahead buffer. - - When the ANTLRParser class is built with the pre-processor option - ZZDEFER_FETCH defined, the fetch of new tokens by consume() is deferred - until LA(i) or LT(i) is called. - - To test whether this option has been built into the ANTLRParser class - use "isDeferFetchEnabled()". - - Using the -gd trace option with the default tracein() and traceout() - routines will defeat the effort to defer the fetch because the - trace routines print out information about the lookahead token at - the start of the rule. - - Because the tracein and traceout routines are virtual it is - easy to redefine them in your parser: - - class MyParser { - << - virtual void tracein(ANTLRChar * ruleName) - { fprintf(stderr,"Entering: %s\n", ruleName); } - virtual void traceout(ANTLRChar * ruleName) - { fprintf(stderr,"Leaving: %s\n", ruleName); } - >> - - The originals for those routines are pccts/h/AParser.cpp - - This requires use of the dlg option -i (interactive lexer). - - This is implemented only for C++ mode. - - This is experimental. The interaction with guess mode (syntactic - predicates)is not known. - -#215. (Changed in MR19) Addition of reset() to DLGLexerBase - - There was no obvious way to reset the lexer for reuse. The - reset() method now does this. - - Suggested by David Venditti (07751870267-0001 t-online.de). - -#214. (Changed in MR19) C mode: Adjust AST stack pointer at exit - - In C mode the AST stack pointer needs to be reset if there will - be multiple calls to the ANTLRx macros. - - Reported with fix by Paul D. Smith (psmith baynetworks.com). - -#213. (Changed in MR18) Fatal error with -mrhoistk (k>1 hoisting) - - When rearranging code I forgot to un-comment a critical line of - code that handles hoisting of predicates with k>1 lookahead. This - is now fixed. - - Reported by Reinier van den Born (reinier vnet.ibm.com). - -#212. (Changed in MR17) Mac related changes by Kenji Tanaka - - Kenji Tanaka (kentar osa.att.ne.jp) has made a number of changes for - Macintosh users. - - a. The following Macintosh MPW files aid in installing pccts on Mac: - - pccts/MPW_Read_Me - - pccts/install68K.mpw - pccts/installPPC.mpw - - pccts/antlr/antlr.r - pccts/antlr/antlr68K.make - pccts/antlr/antlrPPC.make - - pccts/dlg/dlg.r - pccts/dlg/dlg68K.make - pccts/dlg/dlgPPC.make - - pccts/sorcerer/sor.r - pccts/sorcerer/sor68K.make - pccts/sorcerer/sorPPC.make - - They completely replace the previous Mac installation files. - - b. The most significant is a change in the MAC_FILE_CREATOR symbol - in pcctscfg.h: - - old: #define MAC_FILE_CREATOR 'MMCC' /* Metrowerks C/C++ Text files */ - new: #define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */ - - c. Added calls to special_fopen_actions() where necessary. - -#211. (Changed in MR16a) C++ style comment in dlg - - This has been fixed. - -#210. (Changed in MR16a) Sor accepts \r\n, \r, or \n for end-of-line - - A user requested that Sorcerer be changed to accept other forms - of end-of-line. - -#209. (Changed in MR16) Name of files changed. - - Old: CHANGES_FROM_1.33 - New: CHANGES_FROM_133.txt - - Old: KNOWN_PROBLEMS - New: KNOWN_PROBLEMS.txt - -#208. (Changed in MR16) Change in use of pccts #include files - - There were problems with MS DevStudio when mixing Sorcerer and - PCCTS in the same source file. The problem is caused by the - redefinition of setjmp in the MS header file setjmp.h. In - setjmp.h the pre-processor symbol setjmp was redefined to be - _setjmp. A later effort to execute #include resulted - in an effort to #include <_setjmp.h>. I'm not sure whether this - is a bug or a feature. In any case, I decided to fix it by - avoiding the use of pre-processor symbols in #include statements - altogether. This has the added benefit of making pre-compiled - headers work again. - - I've replaced statements: - - old: #include PCCTS_SETJMP_H - new: #include "pccts_setjmp.h" - - Where pccts_setjmp.h contains: - - #ifndef __PCCTS_SETJMP_H__ - #define __PCCTS_SETJMP_H__ - - #ifdef PCCTS_USE_NAMESPACE_STD - #include - #else - #include - #endif - - #endif - - A similar change has been made for other standard header files - required by pccts and sorcerer: stdlib.h, stdarg.h, stdio.h, etc. - - Reported by Jeff Vincent (JVincent novell.com) and Dale Davis - (DalDavis spectrace.com). - -#207. (Changed in MR16) dlg reports an invalid range for: [\0x00-\0xff] - - ----------------------------------------------------------------- - Note from MR23: This fix does not work. I am investigating why. - ----------------------------------------------------------------- - - dlg will report that this is an invalid range. - - Diagnosed by Piotr Eljasiak (eljasiak no-spam.zt.gdansk.tpsa.pl): - - I think this problem is not specific to unsigned chars - because dlg reports no error for the range [\0x00-\0xfe]. - - I've found that information on range is kept in field - letter (unsigned char) of Attrib struct. Unfortunately - the letter value internally is for some reasons increased - by 1, so \0xff is represented here as 0. - - That's why dlg complains about the range [\0x00-\0xff] in - dlg_p.g: - - if ($$.letter > $2.letter) { - error("invalid range ", zzline); - } - - The fix is: - - if ($$.letter > $2.letter && 255 != $$2.letter) { - error("invalid range ", zzline); - } - -#206. (Changed in MR16) Free zzFAILtext in ANTLRParser destructor - - The ANTLRParser destructor now frees zzFAILtext. - - Problem and fix reported by Manfred Kogler (km cast.uni-linz.ac.at). - -#205. (Changed in MR16) DLGStringReset argument now const - - Changed: void DLGStringReset(DLGChar *s) {...} - To: void DLGStringReset(const DLGChar *s) {...} - - Suggested by Dale Davis (daldavis spectrace.com) - -#204. (Changed in MR15a) Change __WATCOM__ to __WATCOMC__ in pcctscfg.h - - Reported by Oleg Dashevskii (olegdash my-dejanews.com). - -#203. (Changed in MR15) Addition of sorcerer to distribution kit - - I have finally caved in to popular demand. The pccts 1.33mr15 - kit will include sorcerer. The separate sorcerer kit will be - discontinued. - -#202. (Changed) in MR15) Organization of MS Dev Studio Projects in Kit - - Previously there was one workspace that contained projects for - all three parts of pccts: antlr, dlg, and sorcerer. Now each - part (and directory) has its own workspace/project and there - is an additional workspace/project to build a library from the - .cpp files in the pccts/h directory. - - The library build will create pccts_debug.lib or pccts_release.lib - according to the configuration selected. - - If you don't want to build pccts 1.33MR15 you can download a - ready-to-run kit for win32 from http://www.polhode.com/win32.zip. - The ready-to-run for win32 includes executables, a pre-built static - library for the .cpp files in the pccts/h directory, and a sample - application - - You will need to define the environment variable PCCTS to point to - the root of the pccts directory hierarchy. - -#201. (Changed in MR15) Several fixes by K.J. Cummings (cummings peritus.com) - - Generation of SETJMP rather than SETJMP_H in gen.c. - - (Sor B19) Declaration of ref_vars_inits for ref_var_inits in - pccts/sorcerer/sorcerer.h. - -#200. (Changed in MR15) Remove operator=() in AToken.h - - User reported that WatCom couldn't handle use of - explicit operator =(). Replace with equivalent - using cast operator. - -#199. (Changed in MR15) Don't allow use of empty #tokclass - - Change antlr.g to disallow empty #tokclass sets. - - Reported by Manfred Kogler (km cast.uni-linz.ac.at). - -#198. Revised ANSI C grammar due to efforts by Manuel Kessler - - Manuel Kessler (mlkessler cip.physik.uni-wuerzburg.de) - - Allow trailing ... in function parameter lists. - Add bit fields. - Allow old-style function declarations. - Support cv-qualified pointers. - Better checking of combinations of type specifiers. - Release of memory for local symbols on scope exit. - Allow input file name on command line as well as by redirection. - - and other miscellaneous tweaks. - - This is not part of the pccts distribution kit. It must be - downloaded separately from: - - http://www.polhode.com/ansi_mr15.zip - -#197. (Changed in MR14) Resetting the lookahead buffer of the parser - - Explanation and fix by Sinan Karasu (sinan.karasu boeing.com) - - Consider the code used to prime the lookahead buffer LA(i) - of the parser when init() is called: - - void - ANTLRParser:: - prime_lookahead() - { - int i; - for(i=1;i<=LLk; i++) consume(); - dirty=0; - //lap = 0; // MR14 - Sinan Karasu (sinan.karusu boeing.com) - //labase = 0; // MR14 - labase=lap; // MR14 - } - - When the parser is instantiated, lap=0,labase=0 is set. - - The "for" loop runs LLk times. In consume(), lap = lap +1 (mod LLk) is - computed. Therefore, lap(before the loop) == lap (after the loop). - - Now the only problem comes in when one does an init() of the parser - after an Eof has been seen. At that time, lap could be non zero. - Assume it was lap==1. Now we do a prime_lookahead(). If LLk is 2, - then - - consume() - { - NLA = inputTokens->getToken()->getType(); - dirty--; - lap = (lap+1)&(LLk-1); - } - - or expanding NLA, - - token_type[lap&(LLk-1)]) = inputTokens->getToken()->getType(); - dirty--; - lap = (lap+1)&(LLk-1); - - so now we prime locations 1 and 2. In prime_lookahead it used to set - lap=0 and labase=0. Now, the next token will be read from location 0, - NOT 1 as it should have been. - - This was never caught before, because if a parser is just instantiated, - then lap and labase are 0, the offending assignment lines are - basically no-ops, since the for loop wraps around back to 0. - -#196. (Changed in MR14) Problems with "(alpha)? beta" guess - - Consider the following syntactic predicate in a grammar - with 2 tokens of lookahead (k=2 or ck=2): - - rule : ( alpha )? beta ; - alpha : S t ; - t : T U - | T - ; - beta : S t Z ; - - When antlr computes the prediction expression with one token - of lookahead for alts 1 and 2 of rule t it finds an ambiguity. - - Because the grammar has a lookahead of 2 it tries to compute - two tokens of lookahead for alts 1 and 2 of t. Alt 1 clearly - has a lookahead of (T U). Alt 2 is one token long so antlr - tries to compute the follow set of alt 2, which means finding - the things which can follow rule t in the context of (alpha)?. - This cannot be computed, because alpha is only part of a rule, - and antlr can't tell what part of beta is matched by alpha and - what part remains to be matched. Thus it impossible for antlr - to properly determine the follow set of rule t. - - Prior to 1.33MR14, the follow of (alpha)? was computed as - FIRST(beta) as a result of the internal representation of - guess blocks. - - With MR14 the follow set will be the empty set for that context. - - Normally, one expects a rule appearing in a guess block to also - appear elsewhere. When the follow context for this other use - is "ored" with the empty set, the context from the other use - results, and a reasonable follow context results. However if - there is *no* other use of the rule, or it is used in a different - manner then the follow context will be inaccurate - it was - inaccurate even before MR14, but it will be inaccurate in a - different way. - - For the example given earlier, a reasonable way to rewrite the - grammar: - - rule : ( alpha )? beta - alpha : S t ; - t : T U - | T - ; - beta : alpha Z ; - - If there are no other uses of the rule appearing in the guess - block it will generate a test for EOF - a workaround for - representing a null set in the lookahead tests. - - If you encounter such a problem you can use the -alpha option - to get additional information: - - line 2: error: not possible to compute follow set for alpha - in an "(alpha)? beta" block. - - With the antlr -alpha command line option the following information - is inserted into the generated file: - - #if 0 - - Trace of references leading to attempt to compute the follow set of - alpha in an "(alpha)? beta" block. It is not possible for antlr to - compute this follow set because it is not known what part of beta has - already been matched by alpha and what part remains to be matched. - - Rules which make use of the incorrect follow set will also be incorrect - - 1 #token T alpha/2 line 7 brief.g - 2 end alpha alpha/3 line 8 brief.g - 2 end (...)? block at start/1 line 2 brief.g - - #endif - - At the moment, with the -alpha option selected the program marks - any rules which appear in the trace back chain (above) as rules with - possible problems computing follow set. - - Reported by Greg Knapen (gregory.knapen bell.ca). - -#195. (Changed in MR14) #line directive not at column 1 - - Under certain circunstances a predicate test could generate - a #line directive which was not at column 1. - - Reported with fix by David Kågedal (davidk lysator.liu.se) - (http://www.lysator.liu.se/~davidk/). - -#194. (Changed in MR14) (C Mode only) Demand lookahead with #tokclass - - In C mode with the demand lookahead option there is a bug in the - code which handles matches for #tokclass (zzsetmatch and - zzsetmatch_wsig). - - The bug causes the lookahead pointer to get out of synchronization - with the current token pointer. - - The problem was reported with a fix by Ger Hobbelt (hobbelt axa.nl). - -#193. (Changed in MR14) Use of PCCTS_USE_NAMESPACE_STD - - The pcctscfg.h now contains the following definitions: - - #ifdef PCCTS_USE_NAMESPACE_STD - #define PCCTS_STDIO_H - #define PCCTS_STDLIB_H - #define PCCTS_STDARG_H - #define PCCTS_SETJMP_H - #define PCCTS_STRING_H - #define PCCTS_ASSERT_H - #define PCCTS_ISTREAM_H - #define PCCTS_IOSTREAM_H - #define PCCTS_NAMESPACE_STD namespace std {}; using namespace std; - #else - #define PCCTS_STDIO_H - #define PCCTS_STDLIB_H - #define PCCTS_STDARG_H - #define PCCTS_SETJMP_H - #define PCCTS_STRING_H - #define PCCTS_ASSERT_H - #define PCCTS_ISTREAM_H - #define PCCTS_IOSTREAM_H - #define PCCTS_NAMESPACE_STD - #endif - - The runtime support in pccts/h uses these pre-processor symbols - consistently. - - Also, antlr and dlg have been changed to generate code which uses - these pre-processor symbols rather than having the names of the - #include files hard-coded in the generated code. - - This required the addition of "#include pcctscfg.h" to a number of - files in pccts/h. - - It appears that this sometimes causes problems for MSVC 5 in - combination with the "automatic" option for pre-compiled headers. - In such cases disable the "automatic" pre-compiled headers option. - - Suggested by Hubert Holin (Hubert.Holin Bigfoot.com). - -#192. (Changed in MR14) Change setText() to accept "const ANTLRChar *" - - Changed ANTLRToken::setText(ANTLRChar *) to setText(const ANTLRChar *). - This allows literal strings to be used to initialize tokens. Since - the usual token implementation (ANTLRCommonToken) makes a copy of the - input string, this was an unnecessary limitation. - - Suggested by Bob McWhirter (bob netwrench.com). - -#191. (Changed in MR14) HP/UX aCC compiler compatibility problem - - Needed to explicitly declare zzINF_DEF_TOKEN_BUFFER_SIZE and - zzINF_BUFFER_TOKEN_CHUNK_SIZE as ints in pccts/h/AParser.cpp. - - Reported by David Cook (dcook bmc.com). - -#190. (Changed in MR14) IBM OS/2 CSet compiler compatibility problem - - Name conflict with "_cs" in pccts/h/ATokenBuffer.cpp - - Reported by David Cook (dcook bmc.com). - -#189. (Changed in MR14) -gxt switch in C mode - - The -gxt switch in C mode didn't work because of incorrect - initialization. - - Reported by Sinan Karasu (sinan boeing.com). - -#188. (Changed in MR14) Added pccts/h/DLG_stream_input.h - - This is a DLG stream class based on C++ istreams. - - Contributed by Hubert Holin (Hubert.Holin Bigfoot.com). - -#187. (Changed in MR14) Rename config.h to pcctscfg.h - - The PCCTS configuration file has been renamed from config.h to - pcctscfg.h. The problem with the original name is that it led - to name collisions when pccts parsers were combined with other - software. - - All of the runtime support routines in pccts/h/* have been - changed to use the new name. Existing software can continue - to use pccts/h/config.h. The contents of pccts/h/config.h is - now just "#include "pcctscfg.h". - - I don't have a record of the user who suggested this. - -#186. (Changed in MR14) Pre-processor symbol DllExportPCCTS class modifier - - Classes in the C++ runtime support routines are now declared: - - class DllExportPCCTS className .... - - By default, the pre-processor symbol is defined as the empty - string. This if for use by MSVC++ users to create DLL classes. - - Suggested by Manfred Kogler (km cast.uni-linz.ac.at). - -#185. (Changed in MR14) Option to not use PCCTS_AST base class for ASTBase - - Normally, the ASTBase class is derived from PCCTS_AST which contains - functions useful to Sorcerer. If these are not necessary then the - user can define the pre-processor symbol "PCCTS_NOT_USING_SOR" which - will cause the ASTBase class to replace references to PCCTS_AST with - references to ASTBase where necessary. - - The class ASTDoublyLinkedBase will contain a pure virtual function - shallowCopy() that was formerly defined in class PCCTS_AST. - - Suggested by Bob McWhirter (bob netwrench.com). - -#184. (Changed in MR14) Grammars with no tokens generate invalid tokens.h - - Reported by Hubert Holin (Hubert.Holin bigfoot.com). - -#183. (Changed in MR14) -f to specify file with names of grammar files - - In DEC/VMS it is difficult to specify very long command lines. - The -f option allows one to place the names of the grammar files - in a data file in order to bypass limitations of the DEC/VMS - command language interpreter. - - Addition supplied by Bernard Giroud (b_giroud decus.ch). - -#182. (Changed in MR14) Output directory option for DEC/VMS - - Fix some problems with the -o option under DEC/VMS. - - Fix supplied by Bernard Giroud (b_giroud decus.ch). - -#181. (Changed in MR14) Allow chars > 127 in DLGStringInput::nextChar() - - Changed DLGStringInput to cast the character using (unsigned char) - so that languages with character codes greater than 127 work - without changes. - - Suggested by Manfred Kogler (km cast.uni-linz.ac.at). - -#180. (Added in MR14) ANTLRParser::getEofToken() - - Added "ANTLRToken ANTLRParser::getEofToken() const" to match the - setEofToken routine. - - Requested by Manfred Kogler (km cast.uni-linz.ac.at). - -#179. (Fixed in MR14) Memory leak for BufFileInput subclass of DLGInputStream - - The BufFileInput class described in Item #142 neglected to release - the allocated buffer when an instance was destroyed. - - Reported by Manfred Kogler (km cast.uni-linz.ac.at). - -#178. (Fixed in MR14) Bug in "(alpha)? beta" guess blocks first sets - - In 1.33 vanilla, and all maintenance releases prior to MR14 - there is a bug in the handling of guess blocks which use the - "long" form: - - (alpha)? beta - - inside a (...)*, (...)+, or {...} block. - - This problem does *not* apply to the case where beta is omitted - or when the syntactic predicate is on the leading edge of an - alternative. - - The problem is that both alpha and beta are stored in the - syntax diagram, and that some analysis routines would fail - to skip the alpha portion when it was not on the leading edge. - Consider the following grammar with -ck 2: - - r : ( (A)? B )* C D - - | A B /* forces -ck 2 computation for old antlr */ - /* reports ambig for alts 1 & 2 */ - - | B C /* forces -ck 2 computation for new antlr */ - /* reports ambig for alts 1 & 3 */ - ; - - The prediction expression for the first alternative should be - LA(1)={B C} LA(2)={B C D}, but previous versions of antlr - would compute the prediction expression as LA(1)={A C} LA(2)={B D} - - Reported by Arpad Beszedes (beszedes inf.u-szeged.hu) who provided - a very clear example of the problem and identified the probable cause. - -#177. (Changed in MR14) #tokdefs and #token with regular expression - - In MR13 the change described by Item #162 caused an existing - feature of antlr to fail. Prior to the change it was possible - to give regular expression definitions and actions to tokens - which were defined via the #tokdefs directive. - - This now works again. - - Reported by Manfred Kogler (km cast.uni-linz.ac.at). - -#176. (Changed in MR14) Support for #line in antlr source code - - Note: this was implemented by Arpad Beszedes (beszedes inf.u-szeged.hu). - - In 1.33MR14 it is possible for a pre-processor to generate #line - directives in the antlr source and have those line numbers and file - names used in antlr error messages and in the #line directives - generated by antlr. - - The #line directive may appear in the following forms: - - #line ll "sss" xx xx ... - - where ll represents a line number, "sss" represents the name of a file - enclosed in quotation marks, and xxx are arbitrary integers. - - The following form (without "line") is not supported at the moment: - - # ll "sss" xx xx ... - - The result: - - zzline - - is replaced with ll from the # or #line directive - - FileStr[CurFile] - - is updated with the contents of the string (if any) - following the line number - - Note - ---- - The file-name string following the line number can be a complete - name with a directory-path. Antlr generates the output files from - the input file name (by replacing the extension from the file-name - with .c or .cpp). - - If the input file (or the file-name from the line-info) contains - a path: - - "../grammar.g" - - the generated source code will be placed in "../grammar.cpp" (i.e. - in the parent directory). This is inconvenient in some cases - (even the -o switch can not be used) so the path information is - removed from the #line directive. Thus, if the line-info was - - #line 2 "../grammar.g" - - then the current file-name will become "grammar.g" - - In this way, the generated source code according to the grammar file - will always be in the current directory, except when the -o switch - is used. - -#175. (Changed in MR14) Bug when guess block appears at start of (...)* - - In 1.33 vanilla and all maintenance releases prior to 1.33MR14 - there is a bug when a guess block appears at the start of a (...)+. - Consider the following k=1 (ck=1) grammar: - - rule : - ( (STAR)? ZIP )* ID ; - - Prior to 1.33MR14, the generated code resembled: - - ... - zzGUESS_BLOCK - while ( 1 ) { - if ( ! LA(1)==STAR) break; - zzGUESS - if ( !zzrv ) { - zzmatch(STAR); - zzCONSUME; - zzGUESS_DONE - zzmatch(ZIP); - zzCONSUME; - ... - - Note that the routine uses STAR for the prediction expression - rather than ZIP. With 1.33MR14 the generated code resembles: - - ... - while ( 1 ) { - if ( ! LA(1)==ZIP) break; - ... - - This problem existed only with (...)* blocks and was caused - by the slightly more complicated graph which represents (...)* - blocks. This caused the analysis routine to compute the first - set for the alpha part of the "(alpha)? beta" rather than the - beta part. - - Both (...)+ and {...} blocks handled the guess block correctly. - - Reported by Arpad Beszedes (beszedes inf.u-szeged.hu) who provided - a very clear example of the problem and identified the probable cause. - -#174. (Changed in MR14) Bug when action precedes syntactic predicate - - In 1.33 vanilla, and all maintenance releases prior to MR14, - there was a bug when a syntactic predicate was immediately - preceded by an action. Consider the following -ck 2 grammar: - - rule : - <> - (alpha)? beta C - | A B - ; - - alpha : A ; - beta : A B; - - Prior to MR14, the code generated for the first alternative - resembled: - - ... - zzGUESS - if ( !zzrv && LA(1)==A && LA(2)==A) { - alpha(); - zzGUESS_DONE - beta(); - zzmatch(C); - zzCONSUME; - } else { - ... - - The prediction expression (i.e. LA(1)==A && LA(2)==A) is clearly - wrong because LA(2) should be matched to B (first[2] of beta is {B}). - - With 1.33MR14 the prediction expression is: - - ... - if ( !zzrv && LA(1)==A && LA(2)==B) { - alpha(); - zzGUESS_DONE - beta(); - zzmatch(C); - zzCONSUME; - } else { - ... - - This will only affect users in which alpha is shorter than - than max(k,ck) and there is an action immediately preceding - the syntactic predicate. - - This problem was reported by reported by Arpad Beszedes - (beszedes inf.u-szeged.hu) who provided a very clear example - of the problem and identified the presence of the init-action - as the likely culprit. - -#173. (Changed in MR13a) -glms for Microsoft style filenames with -gl - - With the -gl option antlr generates #line directives using the - exact name of the input files specified on the command line. - An oddity of the Microsoft C and C++ compilers is that they - don't accept file names in #line directives containing "\" - even though these are names from the native file system. - - With -glms option, the "\" in file names appearing in #line - directives is replaced with a "/" in order to conform to - Microsoft compiler requirements. - - Reported by Erwin Achermann (erwin.achermann switzerland.org). - -#172. (Changed in MR13) \r\n in antlr source counted as one line - - Some MS software uses \r\n to indicate a new line. Antlr - now recognizes this in counting lines. - - Reported by Edward L. Hepler (elh ece.vill.edu). - -#171. (Changed in MR13) #tokclass L..U now allowed - - The following is now allowed: - - #tokclass ABC { A..B C } - - Reported by Dave Watola (dwatola amtsun.jpl.nasa.gov) - -#170. (Changed in MR13) Suppression for predicates with lookahead depth >1 - - In MR12 the capability for suppression of predicates with lookahead - depth=1 was introduced. With MR13 this had been extended to - predicates with lookahead depth > 1 and released for use by users - on an experimental basis. - - Consider the following grammar with -ck 2 and the predicate in rule - "a" with depth 2: - - r1 : (ab)* "@" - ; - - ab : a - | b - ; - - a : (A B)? => <>? A B C - ; - - b : A B C - ; - - Normally, the predicate would be hoisted into rule r1 in order to - determine whether to call rule "ab". However it should *not* be - hoisted because, even if p is false, there is a valid alternative - in rule b. With "-mrhoistk on" the predicate will be suppressed. - - If "-info p" command line option is present the following information - will appear in the generated code: - - while ( (LA(1)==A) - #if 0 - - Part (or all) of predicate with depth > 1 suppressed by alternative - without predicate - - pred << p(LATEXT(2))>>? - depth=k=2 ("=>" guard) rule a line 8 t1.g - tree context: - (root = A - B - ) - - The token sequence which is suppressed: ( A B ) - The sequence of references which generate that sequence of tokens: - - 1 to ab r1/1 line 1 t1.g - 2 ab ab/1 line 4 t1.g - 3 to b ab/2 line 5 t1.g - 4 b b/1 line 11 t1.g - 5 #token A b/1 line 11 t1.g - 6 #token B b/1 line 11 t1.g - - #endif - - A slightly more complicated example: - - r1 : (ab)* "@" - ; - - ab : a - | b - ; - - a : (A B)? => <>? (A B | D E) - ; - - b : <>? D E - ; - - - In this case, the sequence (D E) in rule "a" which lies behind - the guard is used to suppress the predicate with context (D E) - in rule b. - - while ( (LA(1)==A || LA(1)==D) - #if 0 - - Part (or all) of predicate with depth > 1 suppressed by alternative - without predicate - - pred << q(LATEXT(2))>>? - depth=k=2 rule b line 11 t2.g - tree context: - (root = D - E - ) - - The token sequence which is suppressed: ( D E ) - The sequence of references which generate that sequence of tokens: - - 1 to ab r1/1 line 1 t2.g - 2 ab ab/1 line 4 t2.g - 3 to a ab/1 line 4 t2.g - 4 a a/1 line 8 t2.g - 5 #token D a/1 line 8 t2.g - 6 #token E a/1 line 8 t2.g - - #endif - && - #if 0 - - pred << p(LATEXT(2))>>? - depth=k=2 ("=>" guard) rule a line 8 t2.g - tree context: - (root = A - B - ) - - #endif - - (! ( LA(1)==A && LA(2)==B ) || p(LATEXT(2)) ) { - ab(); - ... - -#169. (Changed in MR13) Predicate test optimization for depth=1 predicates - - When the MR12 generated a test of a predicate which had depth 1 - it would use the depth >1 routines, resulting in correct but - inefficient behavior. In MR13, a bit test is used. - -#168. (Changed in MR13) Token expressions in context guards - - The token expressions appearing in context guards such as: - - (A B)? => <>? someRule - - are computed during an early phase of antlr processing. As - a result, prior to MR13, complex expressions such as: - - ~B - L..U - ~L..U - TokClassName - ~TokClassName - - were not computed properly. This resulted in incorrect - context being computed for such expressions. - - In MR13 these context guards are verified for proper semantics - in the initial phase and then re-evaluated after complex token - expressions have been computed in order to produce the correct - behavior. - - Reported by Arpad Beszedes (beszedes inf.u-szeged.hu). - -#167. (Changed in MR13) ~L..U - - Prior to MR13, the complement of a token range was - not properly computed. - -#166. (Changed in MR13) token expression L..U - - The token U was represented as an unsigned char, restricting - the use of L..U to cases where U was assigned a token number - less than 256. This is corrected in MR13. - -#165. (Changed in MR13) option -newAST - - To create ASTs from an ANTLRTokenPtr antlr usually calls - "new AST(ANTLRTokenPtr)". This option generates a call - to "newAST(ANTLRTokenPtr)" instead. This allows a user - to define a parser member function to create an AST object. - - Similar changes for ASTBase::tmake and ASTBase::link were not - thought necessary since they do not create AST objects, only - use existing ones. - -#164. (Changed in MR13) Unused variable _astp - - For many compilations, we have lived with warnings about - the unused variable _astp. It turns out that this varible - can *never* be used because the code which references it was - commented out. - - This investigation was sparked by a note from Erwin Achermann - (erwin.achermann switzerland.org). - -#163. (Changed in MR13) Incorrect makefiles for testcpp examples - - All the examples in pccts/testcpp/* had incorrect definitions - in the makefiles for the symbol "CCC". Instead of CCC=CC they - had CC=$(CCC). - - There was an additional problem in testcpp/1/test.g due to the - change in ANTLRToken::getText() to a const member function - (Item #137). - - Reported by Maurice Mass (maas cuci.nl). - -#162. (Changed in MR13) Combining #token with #tokdefs - - When it became possible to change the print-name of a - #token (Item #148) it became useful to give a #token - statement whose only purpose was to giving a print name - to the #token. Prior to this change this could not be - combined with the #tokdefs feature. - -#161. (Changed in MR13) Switch -gxt inhibits generation of tokens.h - -#160. (Changed in MR13) Omissions in list of names for remap.h - - When a user selects the -gp option antlr creates a list - of macros in remap.h to rename some of the standard - antlr routines from zzXXX to userprefixXXX. - - There were number of omissions from the remap.h name - list related to the new trace facility. This was reported, - along with a fix, by Bernie Solomon (bernard ug.eds.com). - -#159. (Changed in MR13) Violations of classic C rules - - There were a number of violations of classic C style in - the distribution kit. This was reported, along with fixes, - by Bernie Solomon (bernard ug.eds.com). - -#158. (Changed in MR13) #header causes problem for pre-processors - - A user who runs the C pre-processor on antlr source suggested - that another syntax be allowed. With MR13 such directives - such as #header, #pragma, etc. may be written as "\#header", - "\#pragma", etc. For escaping pre-processor directives inside - a #header use something like the following: - - \#header - << - \#include - >> - -#157. (Fixed in MR13) empty error sets for rules with infinite recursion - - When the first set for a rule cannot be computed due to infinite - left recursion and it is the only alternative for a block then - the error set for the block would be empty. This would result - in a fatal error. - - Reported by Darin Creason (creason genedax.com) - -#156. (Changed in MR13) DLGLexerBase::getToken() now public - -#155. (Changed in MR13) Context behind predicates can suppress - - With -mrhoist enabled the context behind a guarded predicate can - be used to suppress other predicates. Consider the following grammar: - - r0 : (r1)+; - - r1 : rp - | rq - ; - rp : <

>? B ; - rq : (A)? => <>? (A|B); - - In earlier versions both predicates "p" and "q" would be hoisted into - rule r0. With MR12c predicate p is suppressed because the context which - follows predicate q includes "B" which can "cover" predicate "p". In - other words, in trying to decide in r0 whether to call r1, it doesn't - really matter whether p is false or true because, either way, there is - a valid choice within r1. - -#154. (Changed in MR13) Making hoist suppression explicit using <> - - A common error, even among experienced pccts users, is to code - an init-action to inhibit hoisting rather than a leading action. - An init-action does not inhibit hoisting. - - This was coded: - - rule1 : <<;>> rule2 - - This is what was meant: - - rule1 : <<;>> <<;>> rule2 - - With MR13, the user can code: - - rule1 : <<;>> <> rule2 - - The following will give an error message: - - rule1 : <> rule2 - - If the <> appears as an init-action rather than a leading - action an error message is issued. The meaning of an init-action - containing "nohoist" is unclear: does it apply to just one - alternative or to all alternatives ? - - - - - - - - - ------------------------------------------------------- - Note: Items #153 to #1 are now in a separate file named - CHANGES_FROM_133_BEFORE_MR13.txt - ------------------------------------------------------- diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133_BEFORE_MR13.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133_BEFORE_MR13.txt deleted file mode 100644 index 4ecb881b0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_FROM_133_BEFORE_MR13.txt +++ /dev/null @@ -1,3666 +0,0 @@ - - ------------------------------------------------------------ - This is the second part of a two part file. - This is a list of changes to pccts 1.33 prior to MR13 - For more recent information see CHANGES_FROM_133.txt - ------------------------------------------------------------ - - DISCLAIMER - - The software and these notes are provided "as is". They may include - typographical or technical errors and their authors disclaims all - liability of any kind or nature for damages due to error, fault, - defect, or deficiency regardless of cause. All warranties of any - kind, either express or implied, including, but not limited to, the - implied warranties of merchantability and fitness for a particular - purpose are disclaimed. - - -#153. (Changed in MR12b) Bug in computation of -mrhoist suppression set - - Consider the following grammar with k=1 and "-mrhoist on": - - r1 : (A)? => ((p>>? x /* l1 */ - | r2 /* l2 */ - ; - r2 : A /* l4 */ - | (B)? => <>? y /* l5 */ - ; - - In earlier versions the mrhoist routine would see that both l1 and - l2 contained predicates and would assume that this prevented either - from acting to suppress the other predicate. In the example above - it didn't realize the A at line l4 is capable of suppressing the - predicate at l1 even though alt l2 contains (indirectly) a predicate. - - This is fixed in MR12b. - - Reported by Reinier van den Born (reinier@vnet.ibm.com) - -#153. (Changed in MR12a) Bug in computation of -mrhoist suppression set - - An oversight similar to that described in Item #152 appeared in - the computation of the set that "covered" a predicate. If a - predicate expression included a term such as p=AND(q,r) the context - of p was taken to be context(q) & context(r), when it should have - been context(q) | context(r). This is fixed in MR12a. - -#152. (Changed in MR12) Bug in generation of predicate expressions - - The primary purpose for MR12 is to make quite clear that MR11 is - obsolete and to fix the bug related to predicate expressions. - - In MR10 code was added to optimize the code generated for - predicate expression tests. Unfortunately, there was a - significant oversight in the code which resulted in a bug in - the generation of code for predicate expression tests which - contained predicates combined using AND: - - r0 : (r1)* "@" ; - r1 : (AAA)? => <

>? r2 ; - r2 : (BBB)? => <>? Q - | (BBB)? => <>? Q - ; - - In MR11 (and MR10 when using "-mrhoist on") the code generated - for r0 to predict r1 would be equivalent to: - - if ( LA(1)==Q && - (LA(1)==AAA && LA(1)==BBB) && - ( p && ( q || r )) ) { - - This is incorrect because it expresses the idea that LA(1) - *must* be AAA in order to attempt r1, and *must* be BBB to - attempt r2. The result was that r1 became unreachable since - both condition can not be simultaneously true. - - The general philosophy of code generation for predicates - can be summarized as follows: - - a. If the context is true don't enter an alt - for which the corresponding predicate is false. - - If the context is false then it is okay to enter - the alt without evaluating the predicate at all. - - b. A predicate created by ORing of predicates has - context which is the OR of their individual contexts. - - c. A predicate created by ANDing of predicates has - (surprise) context which is the OR of their individual - contexts. - - d. Apply these rules recursively. - - e. Remember rule (a) - - The correct code should express the idea that *if* LA(1) is - AAA then p must be true to attempt r1, but if LA(1) is *not* - AAA then it is okay to attempt r1, provided that *if* LA(1) is - BBB then one of q or r must be true. - - if ( LA(1)==Q && - ( !(LA(1)==AAA || LA(1)==BBB) || - ( ! LA(1) == AAA || p) && - ( ! LA(1) == BBB || q || r ) ) ) { - - I believe this is fixed in MR12. - - Reported by Reinier van den Born (reinier@vnet.ibm.com) - -#151a. (Changed in MR12) ANTLRParser::getLexer() - - As a result of several requests, I have added public methods to - get a pointer to the lexer belonging to a parser. - - ANTLRTokenStream *ANTLRParser::getLexer() const - - Returns a pointer to the lexer being used by the - parser. ANTLRTokenStream is the base class of - DLGLexer - - ANTLRTokenStream *ANTLRTokenBuffer::getLexer() const - - Returns a pointer to the lexer being used by the - ANTLRTokenBuffer. ANTLRTokenStream is the base - class of DLGLexer - - You must manually cast the ANTLRTokenStream to your program's - lexer class. Because the name of the lexer's class is not fixed. - Thus it is impossible to incorporate it into the DLGLexerBase - class. - -#151b.(Changed in MR12) ParserBlackBox member getLexer() - - The template class ParserBlackBox now has a member getLexer() - which returns a pointer to the lexer. - -#150. (Changed in MR12) syntaxErrCount and lexErrCount now public - - See Item #127 for more information. - -#149. (Changed in MR12) antlr option -info o (letter o for orphan) - - If there is more than one rule which is not referenced by any - other rule then all such rules are listed. This is useful for - alerting one to rules which are not used, but which can still - contribute to ambiguity. For example: - - start : a Z ; - unused: a A ; - a : (A)+ ; - - will cause an ambiguity report for rule "a" which will be - difficult to understand if the user forgets about rule "unused" - simply because it is not used in the grammar. - -#148. (Changed in MR11) #token names appearing in zztokens,token_tbl - - In a #token statement like the following: - - #token Plus "\+" - - the string "Plus" appears in the zztokens array (C mode) and - token_tbl (C++ mode). This string is used in most error - messages. In MR11 one has the option of using some other string, - (e.g. "+") in those tables. - - In MR11 one can write: - - #token Plus ("+") "\+" - #token RP ("(") "\(" - #token COM ("comment begin") "/\*" - - A #token statement is allowed to appear in more than one #lexclass - with different regular expressions. However, the token name appears - only once in the zztokens/token_tbl array. This means that only - one substitute can be specified for a given #token name. The second - attempt to define a substitute name (different from the first) will - result in an error message. - -#147. (Changed in MR11) Bug in follow set computation - - There is a bug in 1.33 vanilla and all maintenance releases - prior to MR11 in the computation of the follow set. The bug is - different than that described in Item #82 and probably more - common. It was discovered in the ansi.g grammar while testing - the "ambiguity aid" (Item #119). The search for a bug started - when the ambiguity aid was unable to discover the actual source - of an ambiguity reported by antlr. - - The problem appears when an optimization of the follow set - computation is used inappropriately. The result is that the - follow set used is the "worst case". In other words, the error - can lead to false reports of ambiguity. The good news is that - if you have a grammar in which you have addressed all reported - ambiguities you are ok. The bad news is that you may have spent - time fixing ambiguities that were not real, or used k=2 when - ck=2 might have been sufficient, and so on. - - The following grammar demonstrates the problem: - - ------------------------------------------------------------ - expr : ID ; - - start : stmt SEMI ; - - stmt : CASE expr COLON - | expr SEMI - | plain_stmt - ; - - plain_stmt : ID COLON ; - ------------------------------------------------------------ - - When compiled with k=1 and ck=2 it will report: - - warning: alts 2 and 3 of the rule itself ambiguous upon - { IDENTIFIER }, { COLON } - - When antlr analyzes "stmt" it computes the first[1] set of all - alternatives. It finds an ambiguity between alts 2 and 3 for ID. - It then computes the first[2] set for alternatives 2 and 3 to resolve - the ambiguity. In computing the first[2] set of "expr" (which is - only one token long) it needs to determine what could follow "expr". - Under a certain combination of circumstances antlr forgets that it - is trying to analyze "stmt" which can only be followed by SEMI and - adds to the first[2] set of "expr" the "global" follow set (including - "COLON") which could follow "expr" (under other conditions) in the - phrase "CASE expr COLON". - -#146. (Changed in MR11) Option -treport for locating "difficult" alts - - It can be difficult to determine which alternatives are causing - pccts to work hard to resolve an ambiguity. In some cases the - ambiguity is successfully resolved after much CPU time so there - is no message at all. - - A rough measure of the amount of work being peformed which is - independent of the CPU speed and system load is the number of - tnodes created. Using "-info t" gives information about the - total number of tnodes created and the peak number of tnodes. - - Tree Nodes: peak 1300k created 1416k lost 0 - - It also puts in the generated C or C++ file the number of tnodes - created for a rule (at the end of the rule). However this - information is not sufficient to locate the alternatives within - a rule which are causing the creation of tnodes. - - Using: - - antlr -treport 100000 .... - - causes antlr to list on stdout any alternatives which require the - creation of more than 100,000 tnodes, along with the lookahead sets - for those alternatives. - - The following is a trivial case from the ansi.g grammar which shows - the format of the report. This report might be of more interest - in cases where 1,000,000 tuples were created to resolve the ambiguity. - - ------------------------------------------------------------------------- - There were 0 tuples whose ambiguity could not be resolved - by full lookahead - There were 157 tnodes created to resolve ambiguity between: - - Choice 1: statement/2 line 475 file ansi.g - Choice 2: statement/3 line 476 file ansi.g - - Intersection of lookahead[1] sets: - - IDENTIFIER - - Intersection of lookahead[2] sets: - - LPARENTHESIS COLON AMPERSAND MINUS - STAR PLUSPLUS MINUSMINUS ONESCOMPLEMENT - NOT SIZEOF OCTALINT DECIMALINT - HEXADECIMALINT FLOATONE FLOATTWO IDENTIFIER - STRING CHARACTER - ------------------------------------------------------------------------- - -#145. (Documentation) Generation of Expression Trees - - Item #99 was misleading because it implied that the optimization - for tree expressions was available only for trees created by - predicate expressions and neglected to mention that it required - the use of "-mrhoist on". The optimization applies to tree - expressions created for grammars with k>1 and for predicates with - lookahead depth >1. - - In MR11 the optimized version is always used so the -mrhoist on - option need not be specified. - -#144. (Changed in MR11) Incorrect test for exception group - - In testing for a rule's exception group the label a pointer - is compared against '\0'. The intention is "*pointer". - - Reported by Jeffrey C. Fried (Jeff@Fried.net). - -#143. (Changed in MR11) Optional ";" at end of #token statement - - Fixes problem of: - - #token X "x" - - << - parser action - >> - - Being confused with: - - #token X "x" <> - -#142. (Changed in MR11) class BufFileInput subclass of DLGInputStream - - Alexey Demakov (demakov@kazbek.ispras.ru) has supplied class - BufFileInput derived from DLGInputStream which provides a - function lookahead(char *string) to test characters in the - input stream more than one character ahead. - - The default amount of lookahead is specified by the constructor - and defaults to 8 characters. This does *not* include the one - character of lookahead maintained internally by DLG in member "ch" - and which is not available for testing via BufFileInput::lookahead(). - - This is a useful class for overcoming the one-character-lookahead - limitation of DLG without resorting to a lexer capable of - backtracking (like flex) which is not integrated with antlr as is - DLG. - - There are no restrictions on copying or using BufFileInput.* except - that the authorship and related information must be retained in the - source code. - - The class is located in pccts/h/BufFileInput.* of the kit. - -#141. (Changed in MR11) ZZDEBUG_CONSUME for ANTLRParser::consume() - - A debug aid has been added to file ANTLRParser::consume() in - file AParser.cpp: - - #ifdef ZZDEBUG_CONSUME_ACTION - zzdebug_consume_action(); - #endif - - Suggested by Sramji Ramanathan (ps@kumaran.com). - -#140. (Changed in MR11) #pred to define predicates - - +---------------------------------------------------+ - | Note: Assume "-prc on" for this entire discussion | - +---------------------------------------------------+ - - A problem with predicates is that each one is regarded as - unique and capable of disambiguating cases where two - alternatives have identical lookahead. For example: - - rule : <>? A - | <>? A - ; - - will not cause any error messages or warnings to be issued - by earlier versions of pccts. To compare the text of the - predicates is an incomplete solution. - - In 1.33MR11 I am introducing the #pred statement in order to - solve some problems with predicates. The #pred statement allows - one to give a symbolic name to a "predicate literal" or a - "predicate expression" in order to refer to it in other predicate - expressions or in the rules of the grammar. - - The predicate literal associated with a predicate symbol is C - or C++ code which can be used to test the condition. A - predicate expression defines a predicate symbol in terms of other - predicate symbols using "!", "&&", and "||". A predicate symbol - can be defined in terms of a predicate literal, a predicate - expression, or *both*. - - When a predicate symbol is defined with both a predicate literal - and a predicate expression, the predicate literal is used to generate - code, but the predicate expression is used to check for two - alternatives with identical predicates in both alternatives. - - Here are some examples of #pred statements: - - #pred IsLabel <>? - #pred IsLocalVar <>? - #pred IsGlobalVar <>? - #pred IsVar <>? IsLocalVar || IsGlobalVar - #pred IsScoped <>? IsLabel || IsLocalVar - - I hope that the use of EBNF notation to describe the syntax of the - #pred statement will not cause problems for my readers (joke). - - predStatement : "#pred" - CapitalizedName - ( - "<>?" - | "<>?" predOrExpr - | predOrExpr - ) - ; - - predOrExpr : predAndExpr ( "||" predAndExpr ) * ; - - predAndExpr : predPrimary ( "&&" predPrimary ) * ; - - predPrimary : CapitalizedName - | "!" predPrimary - | "(" predOrExpr ")" - ; - - What is the purpose of this nonsense ? - - To understand how predicate symbols help, you need to realize that - predicate symbols are used in two different ways with two different - goals. - - a. Allow simplification of predicates which have been combined - during predicate hoisting. - - b. Allow recognition of identical predicates which can't disambiguate - alternatives with common lookahead. - - First we will discuss goal (a). Consider the following rule: - - rule0: rule1 - | ID - | ... - ; - - rule1: rule2 - | rule3 - ; - - rule2: <>? ID ; - rule3: <>? ID ; - - When the predicates in rule2 and rule3 are combined by hoisting - to create a prediction expression for rule1 the result is: - - if ( LA(1)==ID - && ( isX(LATEXT(1) || !isX(LATEXT(1) ) ) { rule1(); ... - - This is inefficient, but more importantly, can lead to false - assumptions that the predicate expression distinguishes the rule1 - alternative with some other alternative with lookahead ID. In - MR11 one can write: - - #pred IsX <>? - - ... - - rule2: <>? ID ; - rule3: <>? ID ; - - During hoisting MR11 recognizes this as a special case and - eliminates the predicates. The result is a prediction - expression like the following: - - if ( LA(1)==ID ) { rule1(); ... - - Please note that the following cases which appear to be equivalent - *cannot* be simplified by MR11 during hoisting because the hoisting - logic only checks for a "!" in the predicate action, not in the - predicate expression for a predicate symbol. - - *Not* equivalent and is not simplified during hoisting: - - #pred IsX <>? - #pred NotX <>? - ... - rule2: <>? ID ; - rule3: <>? ID ; - - *Not* equivalent and is not simplified during hoisting: - - #pred IsX <>? - #pred NotX !IsX - ... - rule2: <>? ID ; - rule3: <>? ID ; - - Now we will discuss goal (b). - - When antlr discovers that there is a lookahead ambiguity between - two alternatives it attempts to resolve the ambiguity by searching - for predicates in both alternatives. In the past any predicate - would do, even if the same one appeared in both alternatives: - - rule: <>? X - | <>? X - ; - - The #pred statement is a start towards solving this problem. - During ambiguity resolution (*not* predicate hoisting) the - predicates for the two alternatives are expanded and compared. - Consider the following example: - - #pred Upper <>? - #pred Lower <>? - #pred Alpha <>? Upper || Lower - - rule0: rule1 - | <>? ID - ; - - rule1: - | rule2 - | rule3 - ... - ; - - rule2: <>? ID; - rule3: <>? ID; - - The definition of #pred Alpha expresses: - - a. to test the predicate use the C code "isAlpha(LATEXT(1))" - - b. to analyze the predicate use the information that - Alpha is equivalent to the union of Upper and Lower, - - During ambiguity resolution the definition of Alpha is expanded - into "Upper || Lower" and compared with the predicate in the other - alternative, which is also "Upper || Lower". Because they are - identical MR11 will report a problem. - - ------------------------------------------------------------------------- - t10.g, line 5: warning: the predicates used to disambiguate rule rule0 - (file t10.g alt 1 line 5 and alt 2 line 6) - are identical when compared without context and may have no - resolving power for some lookahead sequences. - ------------------------------------------------------------------------- - - If you use the "-info p" option the output file will contain: - - +----------------------------------------------------------------------+ - |#if 0 | - | | - |The following predicates are identical when compared without | - | lookahead context information. For some ambiguous lookahead | - | sequences they may not have any power to resolve the ambiguity. | - | | - |Choice 1: rule0/1 alt 1 line 5 file t10.g | - | | - | The original predicate for choice 1 with available context | - | information: | - | | - | OR expr | - | | - | pred << Upper>>? | - | depth=k=1 rule rule2 line 14 t10.g | - | set context: | - | ID | - | | - | pred << Lower>>? | - | depth=k=1 rule rule3 line 15 t10.g | - | set context: | - | ID | - | | - | The predicate for choice 1 after expansion (but without context | - | information): | - | | - | OR expr | - | | - | pred << isUpper(LATEXT(1))>>? | - | depth=k=1 rule line 1 t10.g | - | | - | pred << isLower(LATEXT(1))>>? | - | depth=k=1 rule line 2 t10.g | - | | - | | - |Choice 2: rule0/2 alt 2 line 6 file t10.g | - | | - | The original predicate for choice 2 with available context | - | information: | - | | - | pred << Alpha>>? | - | depth=k=1 rule rule0 line 6 t10.g | - | set context: | - | ID | - | | - | The predicate for choice 2 after expansion (but without context | - | information): | - | | - | OR expr | - | | - | pred << isUpper(LATEXT(1))>>? | - | depth=k=1 rule line 1 t10.g | - | | - | pred << isLower(LATEXT(1))>>? | - | depth=k=1 rule line 2 t10.g | - | | - | | - |#endif | - +----------------------------------------------------------------------+ - - The comparison of the predicates for the two alternatives takes - place without context information, which means that in some cases - the predicates will be considered identical even though they operate - on disjoint lookahead sets. Consider: - - #pred Alpha - - rule1: <>? ID - | <>? Label - ; - - Because the comparison of predicates takes place without context - these will be considered identical. The reason for comparing - without context is that otherwise it would be necessary to re-evaluate - the entire predicate expression for each possible lookahead sequence. - This would require more code to be written and more CPU time during - grammar analysis, and it is not yet clear whether anyone will even make - use of the new #pred facility. - - A temporary workaround might be to use different #pred statements - for predicates you know have different context. This would avoid - extraneous warnings. - - The above example might be termed a "false positive". Comparison - without context will also lead to "false negatives". Consider the - following example: - - #pred Alpha - #pred Beta - - rule1: <>? A - | rule2 - ; - - rule2: <>? A - | <>? B - ; - - The predicate used for alt 2 of rule1 is (Alpha || Beta). This - appears to be different than the predicate Alpha used for alt1. - However, the context of Beta is B. Thus when the lookahead is A - Beta will have no resolving power and Alpha will be used for both - alternatives. Using the same predicate for both alternatives isn't - very helpful, but this will not be detected with 1.33MR11. - - To properly handle this the predicate expression would have to be - evaluated for each distinct lookahead context. - - To determine whether two predicate expressions are identical is - difficult. The routine may fail to identify identical predicates. - - The #pred feature also compares predicates to see if a choice between - alternatives which is resolved by a predicate which makes the second - choice unreachable. Consider the following example: - - #pred A <>? - #pred B <>? - #pred A_or_B A || B - - r : s - | t - ; - s : <>? ID - ; - t : <>? ID - ; - - ---------------------------------------------------------------------------- - t11.g, line 5: warning: the predicate used to disambiguate the - first choice of rule r - (file t11.g alt 1 line 5 and alt 2 line 6) - appears to "cover" the second predicate when compared without context. - The second predicate may have no resolving power for some lookahead - sequences. - ---------------------------------------------------------------------------- - -#139. (Changed in MR11) Problem with -gp in C++ mode - - The -gp option to add a prefix to rule names did not work in - C++ mode. This has been fixed. - - Reported by Alexey Demakov (demakov@kazbek.ispras.ru). - -#138. (Changed in MR11) Additional makefiles for non-MSVC++ MS systems - - Sramji Ramanathan (ps@kumaran.com) has supplied makefiles for - building antlr and dlg with Win95/NT development tools that - are not based on MSVC5. They are pccts/antlr/AntlrMS.mak and - pccts/dlg/DlgMS.mak. - - The first line of the makefiles require a definition of PCCTS_HOME. - - These are in additiion to the AntlrMSVC50.* and DlgMSVC50.* - supplied by Jeff Vincent (JVincent@novell.com). - -#137. (Changed in MR11) Token getType(), getText(), getLine() const members - - -------------------------------------------------------------------- - If you use ANTLRCommonToken this change probably does not affect you. - -------------------------------------------------------------------- - - For a long time it has bothered me that these accessor functions - in ANTLRAbstractToken were not const member functions. I have - refrained from changing them because it require users to modify - existing token class definitions which are derived directly - from ANTLRAbstractToken. I think it is now time. - - For those who are not used to C++, a "const member function" is a - member function which does not modify its own object - the thing - to which "this" points. This is quite different from a function - which does not modify its arguments - - Most token definitions based on ANTLRAbstractToken have something like - the following in order to create concrete definitions of the pure - virtual methods in ANTLRAbstractToken: - - class MyToken : public ANTLRAbstractToken { - ... - ANTLRTokenType getType() {return _type; } - int getLine() {return _line; } - ANTLRChar * getText() {return _text; } - ... - } - - The required change is simply to put "const" following the function - prototype in the header (.h file) and the definition file (.cpp if - it is not inline): - - class MyToken : public ANTLRAbstractToken { - ... - ANTLRTokenType getType() const {return _type; } - int getLine() const {return _line; } - ANTLRChar * getText() const {return _text; } - ... - } - - This was originally proposed a long time ago by Bruce - Guenter (bruceg@qcc.sk.ca). - -#136. (Changed in MR11) Added getLength() to ANTLRCommonToken - - Classes ANTLRCommonToken and ANTLRCommonTokenNoRefCountToken - now have a member function: - - int getLength() const { return strlen(getText()) } - - Suggested by Sramji Ramanathan (ps@kumaran.com). - -#135. (Changed in MR11) Raised antlr's own default ZZLEXBUFSIZE to 8k - -#134a. (ansi_mr10.zip) T.J. Parr's ANSI C grammar made 1.33MR11 compatible - - There is a typographical error in the definition of BITWISEOREQ: - - #token BITWISEOREQ "!=" should be "\|=" - - When this change is combined with the bugfix to the follow set cache - problem (Item #147) and a minor rearrangement of the grammar - (Item #134b) it becomes a k=1 ck=2 grammar. - -#134b. (ansi_mr10.zip) T.J. Parr's ANSI C grammar made 1.33MR11 compatible - - The following changes were made in the ansi.g grammar (along with - using -mrhoist on): - - ansi.g - ====== - void tracein(char *) ====> void tracein(const char *) - void traceout(char *) ====> void traceout(const char *) - - getType()==IDENTIFIER ? isTypeName(LT(1)->getText()) : 1>>? - ====> <getText())>>? - - <<(LT(1)->getType()==LPARENTHESIS && LT(2)->getType()==IDENTIFIER) ? \ - isTypeName(LT(2)->getText()) : 1>>? - ====> (LPARENTHESIS IDENTIFIER)? => <getText())>>? - - <<(LT(1)->getType()==LPARENTHESIS && LT(2)->getType()==IDENTIFIER) ? \ - isTypeName(LT(2)->getText()) : 1>>? - ====> (LPARENTHESIS IDENTIFIER)? => <getText())>>? - - added to init(): traceOptionValueDefault=0; - added to init(): traceOption(-1); - - change rule "statement": - - statement - : plain_label_statement - | case_label_statement - | <<;>> expression SEMICOLON - | compound_statement - | selection_statement - | iteration_statement - | jump_statement - | SEMICOLON - ; - - plain_label_statement - : IDENTIFIER COLON statement - ; - - case_label_statement - : CASE constant_expression COLON statement - | DEFAULT COLON statement - ; - - support.cpp - =========== - void tracein(char *) ====> void tracein(const char *) - void traceout(char *) ====> void traceout(const char *) - - added to tracein(): ANTLRParser::tracein(r); // call superclass method - added to traceout(): ANTLRParser::traceout(r); // call superclass method - - Makefile - ======== - added to AFLAGS: -mrhoist on -prc on - -#133. (Changed in 1.33MR11) Make trace options public in ANTLRParser - - In checking T.J. Parr's ANSI C grammar for compatibility with - 1.33MR11 discovered that it was inconvenient to have the - trace facilities with protected access. - -#132. (Changed in 1.33MR11) Recognition of identical predicates in alts - - Prior to 1.33MR11, there would be no ambiguity warning when the - very same predicate was used to disambiguate both alternatives: - - test: ref B - | ref C - ; - - ref : <>? A - - In 1.33MR11 this will cause the warning: - - warning: the predicates used to disambiguate rule test - (file v98.g alt 1 line 1 and alt 2 line 2) - are identical and have no resolving power - - ----------------- Note ----------------- - - This is different than the following case - - test: <>? A B - | <>? A C - ; - - In this case there are two distinct predicates - which have exactly the same text. In the first - example there are two references to the same - predicate. The problem represented by this - grammar will be addressed later. - -#131. (Changed in 1.33MR11) Case insensitive command line options - - Command line switches like "-CC" and keywords like "on", "off", - and "stdin" are no longer case sensitive in antlr, dlg, and sorcerer. - -#130. (Changed in 1.33MR11) Changed ANTLR_VERSION to int from string - - The ANTLR_VERSION was not an integer, making it difficult to - perform conditional compilation based on the antlr version. - - Henceforth, ANTLR_VERSION will be: - - (base_version * 10000) + release number - - thus 1.33MR11 will be: 133*100+11 = 13311 - - Suggested by Rainer Janssen (Rainer.Janssen@Informatik.Uni-Oldenburg.DE). - -#129. (Changed in 1.33MR11) Addition of ANTLR_VERSION to .h - - The following code is now inserted into .h amd - stdpccts.h: - - #ifndef ANTLR_VERSION - #define ANTLR_VERSION 13311 - #endif - - Suggested by Rainer Janssen (Rainer.Janssen@Informatik.Uni-Oldenburg.DE) - -#128. (Changed in 1.33MR11) Redundant predicate code in (<>? ...)+ - - Prior to 1.33MR11, the following grammar would generate - redundant tests for the "while" condition. - - rule2 : (<>? X)+ X - | B - ; - - The code would resemble: - - if (LA(1)==X) { - if (pred) { - do { - if (!pred) {zzfailed_pred(" pred");} - zzmatch(X); zzCONSUME; - } while (LA(1)==X && pred && pred); - } else {... - - With 1.33MR11 the redundant predicate test is omitted. - -#127. (Changed in 1.33MR11) - - Count Syntax Errors Count DLG Errors - ------------------- ---------------- - - C++ mode ANTLRParser:: DLGLexerBase:: - syntaxErrCount lexErrCount - C mode zzSyntaxErrCount zzLexErrCount - - The C mode variables are global and initialized to 0. - They are *not* reset to 0 automatically when antlr is - restarted. - - The C++ mode variables are public. They are initialized - to 0 by the constructors. They are *not* reset to 0 by the - ANTLRParser::init() method. - - Suggested by Reinier van den Born (reinier@vnet.ibm.com). - -#126. (Changed in 1.33MR11) Addition of #first <<...>> - - The #first <<...>> inserts the specified text in the output - files before any other #include statements required by pccts. - The only things before the #first text are comments and - a #define ANTLR_VERSION. - - Requested by and Esa Pulkkinen (esap@cs.tut.fi) and Alexin - Zoltan (alexin@inf.u-szeged.hu). - -#125. (Changed in 1.33MR11) Lookahead for (guard)? && <

>? predicates - - When implementing the new style of guard predicate (Item #113) - in 1.33MR10 I decided to temporarily ignore the problem of - computing the "narrowest" lookahead context. - - Consider the following k=1 grammar: - - start : a - | b - ; - - a : (A)? && <>? ab ; - b : (B)? && <>? ab ; - - ab : A | B ; - - In MR10 the context for both "a" and "b" was {A B} because this is - the first set of rule "ab". Normally, this is not a problem because - the predicate which follows the guard inhibits any ambiguity report - by antlr. - - In MR11 the first set for rule "a" is {A} and for rule "b" it is {B}. - -#124. A Note on the New "&&" Style Guarded Predicates - - I've been asked several times, "What is the difference between - the old "=>" style guard predicates and the new style "&&" guard - predicates, and how do you choose one over the other" ? - - The main difference is that the "=>" does not apply the - predicate if the context guard doesn't match, whereas - the && form always does. What is the significance ? - - If you have a predicate which is not on the "leading edge" - it cannot be hoisted. Suppose you need a predicate that - looks at LA(2). You must introduce it manually. The - classic example is: - - castExpr : - LP typeName RP - | .... - ; - - typeName : <>? ID - | STRUCT ID - ; - - The problem is that typeName isn't on the leading edge - of castExpr, so the predicate isTypeName won't be hoisted into - castExpr to help make a decision on which production to choose. - - The *first* attempt to fix it is this: - - castExpr : - <>? - LP typeName RP - | .... - ; - - Unfortunately, this won't work because it ignores - the problem of STRUCT. The solution is to apply - isTypeName() in castExpr if LA(2) is an ID and - don't apply it when LA(2) is STRUCT: - - castExpr : - (LP ID)? => <>? - LP typeName RP - | .... - ; - - In conclusion, the "=>" style guarded predicate is - useful when: - - a. the tokens required for the predicate - are not on the leading edge - b. there are alternatives in the expression - selected by the predicate for which the - predicate is inappropriate - - If (b) were false, then one could use a simple - predicate (assuming "-prc on"): - - castExpr : - <>? - LP typeName RP - | .... - ; - - typeName : <>? ID - ; - - So, when do you use the "&&" style guarded predicate ? - - The new-style "&&" predicate should always be used with - predicate context. The context guard is in ADDITION to - the automatically computed context. Thus it useful for - predicates which depend on the token type for reasons - other than context. - - The following example is contributed by Reinier van den Born - (reinier@vnet.ibm.com). - - +-------------------------------------------------------------------------+ - | This grammar has two ways to call functions: | - | | - | - a "standard" call syntax with parens and comma separated args | - | - a shell command like syntax (no parens and spacing separated args) | - | | - | The former also allows a variable to hold the name of the function, | - | the latter can also be used to call external commands. | - | | - | The grammar (simplified) looks like this: | - | | - | fun_call : ID "(" { expr ("," expr)* } ")" | - | /* ID is function name */ | - | | "@" ID "(" { expr ("," expr)* } ")" | - | /* ID is var containing fun name */ | - | ; | - | | - | command : ID expr* /* ID is function name */ | - | | path expr* /* path is external command name */ | - | ; | - | | - | path : ID /* left out slashes and such */ | - | | "@" ID /* ID is environment var */ | - | ; | - | | - | expr : .... | - | | "(" expr ")"; | - | | - | call : fun_call | - | | command | - | ; | - | | - | Obviously the call is wildly ambiguous. This is more or less how this | - | is to be resolved: | - | | - | A call begins with an ID or an @ followed by an ID. | - | | - | If it is an ID and if it is an ext. command name -> command | - | if followed by a paren -> fun_call | - | otherwise -> command | - | | - | If it is an @ and if the ID is a var name -> fun_call | - | otherwise -> command | - | | - | One can implement these rules quite neatly using && predicates: | - | | - | call : ("@" ID)? && <>? fun_call | - | | (ID)? && <>? command | - | | (ID "(")? fun_call | - | | command | - | ; | - | | - | This can be done better, so it is not an ideal example, but it | - | conveys the principle. | - +-------------------------------------------------------------------------+ - -#123. (Changed in 1.33MR11) Correct definition of operators in ATokPtr.h - - The return value of operators in ANTLRTokenPtr: - - changed: unsigned ... operator !=(...) - to: int ... operator != (...) - changed: unsigned ... operator ==(...) - to: int ... operator == (...) - - Suggested by R.A. Nelson (cowboy@VNET.IBM.COM) - -#122. (Changed in 1.33MR11) Member functions to reset DLG in C++ mode - - void DLGFileReset(FILE *f) { input = f; found_eof = 0; } - void DLGStringReset(DLGChar *s) { input = s; p = &input[0]; } - - Supplied by R.A. Nelson (cowboy@VNET.IBM.COM) - -#121. (Changed in 1.33MR11) Another attempt to fix -o (output dir) option - - Another attempt is made to improve the -o option of antlr, dlg, - and sorcerer. This one by JVincent (JVincent@novell.com). - - The current rule: - - a. If -o is not specified than any explicit directory - names are retained. - - b. If -o is specified than the -o directory name overrides any - explicit directory names. - - c. The directory name of the grammar file is *not* stripped - to create the main output file. However it is stil subject - to override by the -o directory name. - -#120. (Changed in 1.33MR11) "-info f" output to stdout rather than stderr - - Added option 0 (e.g. "-info 0") which is a noop. - -#119. (Changed in 1.33MR11) Ambiguity aid for grammars - - The user can ask for additional information on ambiguities reported - by antlr to stdout. At the moment, only one ambiguity report can - be created in an antlr run. - - This feature is enabled using the "-aa" (Ambiguity Aid) option. - - The following options control the reporting of ambiguities: - - -aa ruleName Selects reporting by name of rule - -aa lineNumber Selects reporting by line number - (file name not compared) - - -aam Selects "multiple" reporting for a token - in the intersection set of the - alternatives. - - For instance, the token ID may appear dozens - of times in various paths as the program - explores the rules which are reachable from - the point of an ambiguity. With option -aam - every possible path the search program - encounters is reported. - - Without -aam only the first encounter is - reported. This may result in incomplete - information, but the information may be - sufficient and much shorter. - - -aad depth Selects the depth of the search. - The default value is 1. - - The number of paths to be searched, and the - size of the report can grow geometrically - with the -ck value if a full search for all - contributions to the source of the ambiguity - is explored. - - The depth represents the number of tokens - in the lookahead set which are matched against - the set of ambiguous tokens. A depth of 1 - means that the search stops when a lookahead - sequence of just one token is matched. - - A k=1 ck=6 grammar might generate 5,000 items - in a report if a full depth 6 search is made - with the Ambiguity Aid. The source of the - problem may be in the first token and obscured - by the volume of data - I hesitate to call - it information. - - When the user selects a depth > 1, the search - is first performed at depth=1 for both - alternatives, then depth=2 for both alternatives, - etc. - - Sample output for rule grammar in antlr.g itself: - - +---------------------------------------------------------------------+ - | Ambiguity Aid | - | | - | Choice 1: grammar/70 line 632 file a.g | - | Choice 2: grammar/82 line 644 file a.g | - | | - | Intersection of lookahead[1] sets: | - | | - | "\}" "class" "#errclass" "#tokclass" | - | | - | Choice:1 Depth:1 Group:1 ("#errclass") | - | 1 in (...)* block grammar/70 line 632 a.g | - | 2 to error grammar/73 line 635 a.g | - | 3 error error/1 line 894 a.g | - | 4 #token "#errclass" error/2 line 895 a.g | - | | - | Choice:1 Depth:1 Group:2 ("#tokclass") | - | 2 to tclass grammar/74 line 636 a.g | - | 3 tclass tclass/1 line 937 a.g | - | 4 #token "#tokclass" tclass/2 line 938 a.g | - | | - | Choice:1 Depth:1 Group:3 ("class") | - | 2 to class_def grammar/75 line 637 a.g | - | 3 class_def class_def/1 line 669 a.g | - | 4 #token "class" class_def/3 line 671 a.g | - | | - | Choice:1 Depth:1 Group:4 ("\}") | - | 2 #token "\}" grammar/76 line 638 a.g | - | | - | Choice:2 Depth:1 Group:5 ("#errclass") | - | 1 in (...)* block grammar/83 line 645 a.g | - | 2 to error grammar/93 line 655 a.g | - | 3 error error/1 line 894 a.g | - | 4 #token "#errclass" error/2 line 895 a.g | - | | - | Choice:2 Depth:1 Group:6 ("#tokclass") | - | 2 to tclass grammar/94 line 656 a.g | - | 3 tclass tclass/1 line 937 a.g | - | 4 #token "#tokclass" tclass/2 line 938 a.g | - | | - | Choice:2 Depth:1 Group:7 ("class") | - | 2 to class_def grammar/95 line 657 a.g | - | 3 class_def class_def/1 line 669 a.g | - | 4 #token "class" class_def/3 line 671 a.g | - | | - | Choice:2 Depth:1 Group:8 ("\}") | - | 2 #token "\}" grammar/96 line 658 a.g | - +---------------------------------------------------------------------+ - - For a linear lookahead set ambiguity (where k=1 or for k>1 but - when all lookahead sets [i] with i>? A ; - c : A ; - - Prior to 1.33MR10 the code generated for "start" would resemble: - - while { - if (LA(1)==A && - (!LA(1)==A || isUpper())) { - a(); - } - }; - - This code is wrong because it makes rule "c" unreachable from - "start". The essence of the problem is that antlr fails to - recognize that there can be a valid alternative within "a" even - when the predicate <>? is false. - - In 1.33MR10 with -mrhoist the hoisting of the predicate into - "start" is suppressed because it recognizes that "c" can - cover all the cases where the predicate is false: - - while { - if (LA(1)==A) { - a(); - } - }; - - With the antlr "-info p" switch the user will receive information - about the predicate suppression in the generated file: - - -------------------------------------------------------------- - #if 0 - - Hoisting of predicate suppressed by alternative without predicate. - The alt without the predicate includes all cases where - the predicate is false. - - WITH predicate: line 7 v1.g - WITHOUT predicate: line 7 v1.g - - The context set for the predicate: - - A - - The lookahead set for the alt WITHOUT the semantic predicate: - - A - - The predicate: - - pred << isUpper(LATEXT(1))>>? - depth=k=1 rule b line 9 v1.g - set context: - A - tree context: null - - Chain of referenced rules: - - #0 in rule start (line 5 v1.g) to rule a - #1 in rule a (line 7 v1.g) - - #endif - -------------------------------------------------------------- - - A predicate can be suppressed by a combination of alternatives - which, taken together, cover a predicate: - - start : (a)* "@" ; - - a : b | ca | cb | cc ; - - b : <>? ( A | B | C ) ; - - ca : A ; - cb : B ; - cc : C ; - - Consider a more complex example in which "c" covers only part of - a predicate: - - start : (a)* "@" ; - - a : b - | c - ; - - b : <>? - ( A - | X - ); - - c : A - ; - - Prior to 1.33MR10 the code generated for "start" would resemble: - - while { - if ( (LA(1)==A || LA(1)==X) && - (! (LA(1)==A || LA(1)==X) || isUpper()) { - a(); - } - }; - - With 1.33MR10 and -mrhoist the predicate context is restricted to - the non-covered lookahead. The code resembles: - - while { - if ( (LA(1)==A || LA(1)==X) && - (! (LA(1)==X) || isUpper()) { - a(); - } - }; - - With the antlr "-info p" switch the user will receive information - about the predicate restriction in the generated file: - - -------------------------------------------------------------- - #if 0 - - Restricting the context of a predicate because of overlap - in the lookahead set between the alternative with the - semantic predicate and one without - Without this restriction the alternative without the predicate - could not be reached when input matched the context of the - predicate and the predicate was false. - - WITH predicate: line 11 v4.g - WITHOUT predicate: line 12 v4.g - - The original context set for the predicate: - - A X - - The lookahead set for the alt WITHOUT the semantic predicate: - - A - - The intersection of the two sets - - A - - The original predicate: - - pred << isUpper(LATEXT(1))>>? - depth=k=1 rule b line 15 v4.g - set context: - A X - tree context: null - - The new (modified) form of the predicate: - - pred << isUpper(LATEXT(1))>>? - depth=k=1 rule b line 15 v4.g - set context: - X - tree context: null - - #endif - -------------------------------------------------------------- - - The bad news about -mrhoist: - - (a) -mrhoist does not analyze predicates with lookahead - depth > 1. - - (b) -mrhoist does not look past a guarded predicate to - find context which might cover other predicates. - - For these cases you might want to use syntactic predicates. - When a semantic predicate fails during guess mode the guess - fails and the next alternative is tried. - - Limitation (a) is illustrated by the following example: - - start : (stmt)* EOF ; - - stmt : cast - | expr - ; - cast : <>? LP ID RP ; - - expr : LP ID RP ; - - This is not much different from the first example, except that - it requires two tokens of lookahead context to determine what - to do. This predicate is NOT suppressed because the current version - is unable to handle predicates with depth > 1. - - A predicate can be combined with other predicates during hoisting. - In those cases the depth=1 predicates are still handled. Thus, - in the following example the isUpper() predicate will be suppressed - by line #4 when hoisted from "bizarre" into "start", but will still - be present in "bizarre" in order to predict "stmt". - - start : (bizarre)* EOF ; // #1 - // #2 - bizarre : stmt // #3 - | A // #4 - ; - - stmt : cast - | expr - ; - - cast : <>? LP ID RP ; - - expr : LP ID RP ; - | <>? A - - Limitation (b) is illustrated by the following example of a - context guarded predicate: - - rule : (A)? <

>? // #1 - (A // #2 - |B // #3 - ) // #4 - | <> B // #5 - ; - - Recall that this means that when the lookahead is NOT A then - the predicate "p" is ignored and it attempts to match "A|B". - Ideally, the "B" at line #3 should suppress predicate "q". - However, the current version does not attempt to look past - the guard predicate to find context which might suppress other - predicates. - - In some cases -mrhoist will lead to the reporting of ambiguities - which were not visible before: - - start : (a)* "@"; - a : bc | d; - bc : b | c ; - - b : <>? A; - c : A ; - - d : A ; - - In this case there is a true ambiguity in "a" between "bc" and "d" - which can both match "A". Without -mrhoist the predicate in "b" - is hoisted into "a" and there is no ambiguity reported. However, - with -mrhoist, the predicate in "b" is suppressed by "c" (as it - should be) making the ambiguity in "a" apparent. - - The motivations for these changes were hoisting problems reported - by Reinier van den Born (reinier@vnet.ibm.com) and several others. - -#116. (Changed in 1.33MR10) C++ mode: tracein/traceout rule name is (const char *) - - The prototype for C++ mode routine tracein (and traceout) has changed from - "char *" to "const char *". - -#115. (Changed in 1.33MR10) Using guess mode with exception handlers in C mode - - The definition of the C mode macros zzmatch_wsig and zzsetmatch_wsig - neglected to consider guess mode. When control passed to the rule's - parse exception handler the routine would exit without ever closing the - guess block. This would lead to unpredictable behavior. - - In 1.33MR10 the behavior of exceptions in C mode and C++ mode should be - identical. - -#114. (Changed in 1.33MR10) difference in [zz]resynch() between C and C++ modes - - There was a slight difference in the way C and C++ mode resynchronized - following a parsing error. The C routine would sometimes skip an extra - token before attempting to resynchronize. - - The C routine was changed to match the C++ routine. - -#113. (Changed in 1.33MR10) new context guarded pred: (g)? && <

>? expr - - The existing context guarded predicate: - - rule : (guard)? => <

>? expr - | next_alternative - ; - - generates code which resembles: - - if (lookahead(expr) && (!guard || pred)) { - expr() - } else .... - - This is not suitable for some applications because it allows - expr() to be invoked when the predicate is false. This is - intentional because it is meant to mimic automatically computed - predicate context. - - The new context guarded predicate uses the guard information - differently because it has a different goal. Consider: - - rule : (guard)? && <

>? expr - | next_alternative - ; - - The new style of context guarded predicate is equivalent to: - - rule : <>? expr - | next_alternative - ; - - It generates code which resembles: - - if (lookahead(expr) && guard && pred) { - expr(); - } else ... - - Both forms of guarded predicates severely restrict the form of - the context guard: it can contain no rule references, no - (...)*, no (...)+, and no {...}. It may contain token and - token class references, and alternation ("|"). - - Addition for 1.33MR11: in the token expression all tokens must - be at the same height of the token tree: - - (A ( B | C))? && ... is ok (all height 2) - (A ( B | ))? && ... is not ok (some 1, some 2) - (A B C D | E F G H)? && ... is ok (all height 4) - (A B C D | E )? && ... is not ok (some 4, some 1) - - This restriction is required in order to properly compute the lookahead - set for expressions like: - - rule1 : (A B C)? && <>? rule2 ; - rule2 : (A|X) (B|Y) (C|Z); - - This addition was suggested by Rienier van den Born (reinier@vnet.ibm.com) - -#112. (Changed in 1.33MR10) failed validation predicate in C guess mode - - John Lilley (jlilley@empathy.com) suggested that failed validation - predicates abort a guess rather than reporting a failed error. - This was installed in C++ mode (Item #4). Only now was it noticed - that the fix was never installed for C mode. - -#111. (Changed in 1.33MR10) moved zzTRACEIN to before init action - - When the antlr -gd switch is present antlr generates calls to - zzTRACEIN at the start of a rule and zzTRACEOUT at the exit - from a rule. Prior to 1.33MR10 Tthe call to zzTRACEIN was - after the init-action, which could cause confusion because the - init-actions were reported with the name of the enclosing rule, - rather than the active rule. - -#110. (Changed in 1.33MR10) antlr command line copied to generated file - - The antlr command line is now copied to the generated file near - the start. - -#109. (Changed in 1.33MR10) improved trace information - - The quality of the trace information provided by the "-gd" - switch has been improved significantly. Here is an example - of the output from a test program. It shows the rule name, - the first token of lookahead, the call depth, and the guess - status: - - exit rule gusxx {"?"} depth 2 - enter rule gusxx {"?"} depth 2 - enter rule gus1 {"o"} depth 3 guessing - guess done - returning to rule gus1 {"o"} at depth 3 - (guess mode continues - an enclosing guess is still active) - guess done - returning to rule gus1 {"Z"} at depth 3 - (guess mode continues - an enclosing guess is still active) - exit rule gus1 {"Z"} depth 3 guessing - guess done - returning to rule gusxx {"o"} at depth 2 (guess mode ends) - enter rule gus1 {"o"} depth 3 - guess done - returning to rule gus1 {"o"} at depth 3 (guess mode ends) - guess done - returning to rule gus1 {"Z"} at depth 3 (guess mode ends) - exit rule gus1 {"Z"} depth 3 - line 1: syntax error at "Z" missing SC - ... - - Rule trace reporting is controlled by the value of the integer - [zz]traceOptionValue: when it is positive tracing is enabled, - otherwise it is disabled. Tracing during guess mode is controlled - by the value of the integer [zz]traceGuessOptionValue. When - it is positive AND [zz]traceOptionValue is positive rule trace - is reported in guess mode. - - The values of [zz]traceOptionValue and [zz]traceGuessOptionValue - can be adjusted by subroutine calls listed below. - - Depending on the presence or absence of the antlr -gd switch - the variable [zz]traceOptionValueDefault is set to 0 or 1. When - the parser is initialized or [zz]traceReset() is called the - value of [zz]traceOptionValueDefault is copied to [zz]traceOptionValue. - The value of [zz]traceGuessOptionValue is always initialzed to 1, - but, as noted earlier, nothing will be reported unless - [zz]traceOptionValue is also positive. - - When the parser state is saved/restored the value of the trace - variables are also saved/restored. If a restore causes a change in - reporting behavior from on to off or vice versa this will be reported. - - When the -gd option is selected, the macro "#define zzTRACE_RULES" - is added to appropriate output files. - - C++ mode - -------- - int traceOption(int delta) - int traceGuessOption(int delta) - void traceReset() - int traceOptionValueDefault - - C mode - -------- - int zzTraceOption(int delta) - int zzTraceGuessOption(int delta) - void zzTraceReset() - int zzTraceOptionValueDefault - - The argument "delta" is added to the traceOptionValue. To - turn on trace when inside a particular rule one: - - rule : <> - ( - rest-of-rule - ) - <> - ; /* fail clause */ <> - - One can use the same idea to turn *off* tracing within a - rule by using a delta of (-1). - - An improvement in the rule trace was suggested by Sramji - Ramanathan (ps@kumaran.com). - -#108. A Note on Deallocation of Variables Allocated in Guess Mode - - NOTE - ------------------------------------------------------ - This mechanism only works for heap allocated variables - ------------------------------------------------------ - - The rewrite of the trace provides the machinery necessary - to properly free variables or undo actions following a - failed guess. - - The macro zzUSER_GUESS_HOOK(guessSeq,zzrv) is expanded - as part of the zzGUESS macro. When a guess is opened - the value of zzrv is 0. When a longjmp() is executed to - undo the guess, the value of zzrv will be 1. - - The macro zzUSER_GUESS_DONE_HOOK(guessSeq) is expanded - as part of the zzGUESS_DONE macro. This is executed - whether the guess succeeds or fails as part of closing - the guess. - - The guessSeq is a sequence number which is assigned to each - guess and is incremented by 1 for each guess which becomes - active. It is needed by the user to associate the start of - a guess with the failure and/or completion (closing) of a - guess. - - Guesses are nested. They must be closed in the reverse - of the order that they are opened. - - In order to free memory used by a variable during a guess - a user must write a routine which can be called to - register the variable along with the current guess sequence - number provided by the zzUSER_GUESS_HOOK macro. If the guess - fails, all variables tagged with the corresponding guess - sequence number should be released. This is ugly, but - it would require a major rewrite of antlr 1.33 to use - some mechanism other than setjmp()/longjmp(). - - The order of calls for a *successful* guess would be: - - zzUSER_GUESS_HOOK(guessSeq,0); - zzUSER_GUESS_DONE_HOOK(guessSeq); - - The order of calls for a *failed* guess would be: - - zzUSER_GUESS_HOOK(guessSeq,0); - zzUSER_GUESS_HOOK(guessSeq,1); - zzUSER_GUESS_DONE_HOOK(guessSeq); - - The default definitions of these macros are empty strings. - - Here is an example in C++ mode. The zzUSER_GUESS_HOOK and - zzUSER_GUESS_DONE_HOOK macros and myGuessHook() routine - can be used without change in both C and C++ versions. - - ---------------------------------------------------------------------- - << - - #include "AToken.h" - - typedef ANTLRCommonToken ANTLRToken; - - #include "DLGLexer.h" - - int main() { - - { - DLGFileInput in(stdin); - DLGLexer lexer(&in,2000); - ANTLRTokenBuffer pipe(&lexer,1); - ANTLRCommonToken aToken; - P parser(&pipe); - - lexer.setToken(&aToken); - parser.init(); - parser.start(); - }; - - fclose(stdin); - fclose(stdout); - return 0; - } - - >> - - << - char *s=NULL; - - #undef zzUSER_GUESS_HOOK - #define zzUSER_GUESS_HOOK(guessSeq,zzrv) myGuessHook(guessSeq,zzrv); - #undef zzUSER_GUESS_DONE_HOOK - #define zzUSER_GUESS_DONE_HOOK(guessSeq) myGuessHook(guessSeq,2); - - void myGuessHook(int guessSeq,int zzrv) { - if (zzrv == 0) { - fprintf(stderr,"User hook: starting guess #%d\n",guessSeq); - } else if (zzrv == 1) { - free (s); - s=NULL; - fprintf(stderr,"User hook: failed guess #%d\n",guessSeq); - } else if (zzrv == 2) { - free (s); - s=NULL; - fprintf(stderr,"User hook: ending guess #%d\n",guessSeq); - }; - } - - >> - - #token A "a" - #token "[\t \ \n]" <> - - class P { - - start : (top)+ - ; - - top : (which) ? <> - | other <> - ; <> - - which : which2 - ; - - which2 : which3 - ; - which3 - : (label)? <> - | (global)? <> - | (exclamation)? <> - ; - - label : <getText());>> A ":" ; - - global : <getText());>> A "::" ; - - exclamation : <getText());>> A "!" ; - - other : <getText());>> "other" ; - - } - ---------------------------------------------------------------------- - - This is a silly example, but illustrates the idea. For the input - "a ::" with tracing enabled the output begins: - - ---------------------------------------------------------------------- - enter rule "start" depth 1 - enter rule "top" depth 2 - User hook: starting guess #1 - enter rule "which" depth 3 guessing - enter rule "which2" depth 4 guessing - enter rule "which3" depth 5 guessing - User hook: starting guess #2 - enter rule "label" depth 6 guessing - guess failed - User hook: failed guess #2 - guess done - returning to rule "which3" at depth 5 (guess mode continues - - an enclosing guess is still active) - User hook: ending guess #2 - User hook: starting guess #3 - enter rule "global" depth 6 guessing - exit rule "global" depth 6 guessing - guess done - returning to rule "which3" at depth 5 (guess mode continues - - an enclosing guess is still active) - User hook: ending guess #3 - enter rule "global" depth 6 guessing - exit rule "global" depth 6 guessing - exit rule "which3" depth 5 guessing - exit rule "which2" depth 4 guessing - exit rule "which" depth 3 guessing - guess done - returning to rule "top" at depth 2 (guess mode ends) - User hook: ending guess #1 - enter rule "which" depth 3 - ..... - ---------------------------------------------------------------------- - - Remember: - - (a) Only init-actions are executed during guess mode. - (b) A rule can be invoked multiple times during guess mode. - (c) If the guess succeeds the rule will be called once more - without guess mode so that normal actions will be executed. - This means that the init-action might need to distinguish - between guess mode and non-guess mode using the variable - [zz]guessing. - -#107. (Changed in 1.33MR10) construction of ASTs in guess mode - - Prior to 1.33MR10, when using automatic AST construction in C++ - mode for a rule, an AST would be constructed for elements of the - rule even while in guess mode. In MR10 this no longer occurs. - -#106. (Changed in 1.33MR10) guess variable confusion - - In C++ mode a guess which failed always restored the parser state - using zzGUESS_DONE as part of zzGUESS_FAIL. Prior to 1.33MR10, - C mode required an explicit call to zzGUESS_DONE after the - call to zzGUESS_FAIL. - - Consider: - - rule : (alpha)? beta - | ... - ; - - The generated code resembles: - - zzGUESS - if (!zzrv && LA(1)==ID) { <==== line #1 - alpha - zzGUESS_DONE - beta - } else { - if (! zzrv) zzGUESS_DONE <==== line #2a - .... - - However, in some cases line #2 was rendered: - - if (guessing) zzGUESS_DONE <==== line #2b - - This would work for simple test cases, but would fail in - some cases where there was a guess while another guess was active. - One kind of failure would be to match up the zzGUESS_DONE at line - #2b with the "outer" guess which was still active. The outer - guess would "succeed" when only the inner guess should have - succeeded. - - In 1.33MR10 the behavior of zzGUESS and zzGUESS_FAIL in C and - and C++ mode should be identical. - - The same problem appears in 1.33 vanilla in some places. For - example: - - start : { (sub)? } ; - - or: - - start : ( - B - | ( sub )? - | C - )+ - ; - - generates incorrect code. - - The general principle is: - - (a) use [zz]guessing only when deciding between a call to zzFAIL - or zzGUESS_FAIL - - (b) use zzrv in all other cases - - This problem was discovered while testing changes to item #105. - I believe this is now fixed. My apologies. - -#105. (Changed in 1.33MR10) guess block as single alt of (...)+ - - Prior to 1.33MR10 the following constructs: - - rule_plus : ( - (sub)? - )+ - ; - - rule_star : ( - (sub)? - )* - ; - - generated incorrect code for the guess block (which could result - in runtime errors) because of an incorrect optimization of a - block with only a single alternative. - - The fix caused some changes to the fix described in Item #49 - because there are now three code generation sequences for (...)+ - blocks containing a guess block: - - a. single alternative which is a guess block - b. multiple alternatives in which the last is a guess block - c. all other cases - - Forms like "rule_star" can have unexpected behavior when there - is a syntax error: if the subrule "sub" is not matched *exactly* - then "rule_star" will consume no tokens. - - Reported by Esa Pulkkinen (esap@cs.tut.fi). - -#104. (Changed in 1.33MR10) -o option for dlg - - There was problem with the code added by item #74 to handle the - -o option of dlg. This should fix it. - -#103. (Changed in 1.33MR10) ANDed semantic predicates - - Rescinded. - - The optimization was a mistake. - The resulting problem is described in Item #150. - -#102. (Changed in 1.33MR10) allow "class parser : .... {" - - The syntax of the class statement ("class parser-name {") - has been extended to allow for the specification of base - classes. An arbirtrary number of tokens may now appear - between the class name and the "{". They are output - again when the class declaration is generated. For - example: - - class Parser : public MyBaseClassANTLRparser { - - This was suggested by a user, but I don't have a record - of who it was. - -#101. (Changed in 1.33MR10) antlr -info command line switch - - -info - - p - extra predicate information in generated file - - t - information about tnode use: - at the end of each rule in generated file - summary on stderr at end of program - - m - monitor progress - prints name of each rule as it is started - flushes output at start of each rule - - f - first/follow set information to stdout - - 0 - no operation (added in 1.33MR11) - - The options may be combined and may appear in any order. - For example: - - antlr -info ptm -CC -gt -mrhoist on mygrammar.g - -#100a. (Changed in 1.33MR10) Predicate tree simplification - - When the same predicates can be referenced in more than one - alternative of a block large predicate trees can be formed. - - The difference that these optimizations make is so dramatic - that I have decided to use it even when -mrhoist is not selected. - - Consider the following grammar: - - start : ( all )* ; - - all : a - | d - | e - | f - ; - - a : c A B - | c A C - ; - - c : <>? - ; - - d : <>? B C - ; - - e : <>? B C - ; - - f : e X Y - ; - - In rule "a" there is a reference to rule "c" in both alternatives. - The length of the predicate AAA is k=2 and it can be followed in - alternative 1 only by (A B) while in alternative 2 it can be - followed only by (A C). Thus they do not have identical context. - - In rule "all" the alternatives which refer to rules "e" and "f" allow - elimination of the duplicate reference to predicate CCC. - - The table below summarized the kind of simplification performed by - 1.33MR10. In the table, X and Y stand for single predicates - (not trees). - - (OR X (OR Y (OR Z))) => (OR X Y Z) - (AND X (AND Y (AND Z))) => (AND X Y Z) - - (OR X (... (OR X Y) ... )) => (OR X (... Y ... )) - (AND X (... (AND X Y) ... )) => (AND X (... Y ... )) - (OR X (... (AND X Y) ... )) => (OR X (... ... )) - (AND X (... (OR X Y) ... )) => (AND X (... ... )) - - (AND X) => X - (OR X) => X - - In a test with a complex grammar for a real application, a predicate - tree with six OR nodes and 12 leaves was reduced to "(OR X Y Z)". - - In 1.33MR10 there is a greater effort to release memory used - by predicates once they are no longer in use. - -#100b. (Changed in 1.33MR10) Suppression of extra predicate tests - - The following optimizations require that -mrhoist be selected. - - It is relatively easy to optimize the code generated for predicate - gates when they are of the form: - - (AND X Y Z ...) - or (OR X Y Z ...) - - where X, Y, Z, and "..." represent individual predicates (leaves) not - predicate trees. - - If the predicate is an AND the contexts of the X, Y, Z, etc. are - ANDed together to create a single Tree context for the group and - context tests for the individual predicates are suppressed: - - -------------------------------------------------- - Note: This was incorrect. The contexts should be - ORed together. This has been fixed. A more - complete description is available in item #152. - --------------------------------------------------- - - Optimization 1: (AND X Y Z ...) - - Suppose the context for Xtest is LA(1)==LP and the context for - Ytest is LA(1)==LP && LA(2)==ID. - - Without the optimization the code would resemble: - - if (lookaheadContext && - !(LA(1)==LP && LA(1)==LP && LA(2)==ID) || - ( (! LA(1)==LP || Xtest) && - (! (LA(1)==LP || LA(2)==ID) || Xtest) - )) {... - - With the -mrhoist optimization the code would resemble: - - if (lookaheadContext && - ! (LA(1)==LP && LA(2)==ID) || (Xtest && Ytest) {... - - Optimization 2: (OR X Y Z ...) with identical contexts - - Suppose the context for Xtest is LA(1)==ID and for Ytest - the context is also LA(1)==ID. - - Without the optimization the code would resemble: - - if (lookaheadContext && - ! (LA(1)==ID || LA(1)==ID) || - (LA(1)==ID && Xtest) || - (LA(1)==ID && Ytest) {... - - With the -mrhoist optimization the code would resemble: - - if (lookaheadContext && - (! LA(1)==ID) || (Xtest || Ytest) {... - - Optimization 3: (OR X Y Z ...) with distinct contexts - - Suppose the context for Xtest is LA(1)==ID and for Ytest - the context is LA(1)==LP. - - Without the optimization the code would resemble: - - if (lookaheadContext && - ! (LA(1)==ID || LA(1)==LP) || - (LA(1)==ID && Xtest) || - (LA(1)==LP && Ytest) {... - - With the -mrhoist optimization the code would resemble: - - if (lookaheadContext && - (zzpf=0, - (LA(1)==ID && (zzpf=1) && Xtest) || - (LA(1)==LP && (zzpf=1) && Ytest) || - !zzpf) { - - These may appear to be of similar complexity at first, - but the non-optimized version contains two tests of each - context while the optimized version contains only one - such test, as well as eliminating some of the inverted - logic (" !(...) || "). - - Optimization 4: Computation of predicate gate trees - - When generating code for the gates of predicate expressions - antlr 1.33 vanilla uses a recursive procedure to generate - "&&" and "||" expressions for testing the lookahead. As each - layer of the predicate tree is exposed a new set of "&&" and - "||" expressions on the lookahead are generated. In many - cases the lookahead being tested has already been tested. - - With -mrhoist a lookahead tree is computed for the entire - lookahead expression. This means that predicates with identical - context or context which is a subset of another predicate's - context disappear. - - This is especially important for predicates formed by rules - like the following: - - uppperCaseVowel : <>? vowel; - vowel: : <>? LETTERS; - - These predicates are combined using AND since both must be - satisfied for rule upperCaseVowel. They have identical - context which makes this optimization very effective. - - The affect of Items #100a and #100b together can be dramatic. In - a very large (but real world) grammar one particular predicate - expression was reduced from an (unreadable) 50 predicate leaves, - 195 LA(1) terms, and 5500 characters to an (easily comprehensible) - 3 predicate leaves (all different) and a *single* LA(1) term. - -#99. (Changed in 1.33MR10) Code generation for expression trees - - Expression trees are used for k>1 grammars and predicates with - lookahead depth >1. This optimization must be enabled using - "-mrhoist on". (Clarification added for 1.33MR11). - - In the processing of expression trees, antlr can generate long chains - of token comparisons. Prior to 1.33MR10 there were many redundant - parenthesis which caused problems for compilers which could handle - expressions of only limited complexity. For example, to test an - expression tree (root R A B C D), antlr would generate something - resembling: - - (LA(1)==R && (LA(2)==A || (LA(2)==B || (LA(2)==C || LA(2)==D))))) - - If there were twenty tokens to test then there would be twenty - parenthesis at the end of the expression. - - In 1.33MR10 the generated code for tree expressions resembles: - - (LA(1)==R && (LA(2)==A || LA(2)==B || LA(2)==C || LA(2)==D)) - - For "complex" expressions the output is indented to reflect the LA - number being tested: - - (LA(1)==R - && (LA(2)==A || LA(2)==B || LA(2)==C || LA(2)==D - || LA(2)==E || LA(2)==F) - || LA(1)==S - && (LA(2)==G || LA(2)==H)) - - - Suggested by S. Bochnak (S.Bochnak@@microTool.com.pl), - -#98. (Changed in 1.33MR10) Option "-info p" - - When the user selects option "-info p" the program will generate - detailed information about predicates. If the user selects - "-mrhoist on" additional detail will be provided explaining - the promotion and suppression of predicates. The output is part - of the generated file and sandwiched between #if 0/#endif statements. - - Consider the following k=1 grammar: - - start : ( all ) * ; - - all : ( a - | b - ) - ; - - a : c B - ; - - c : <>? - | B - ; - - b : <>? X - ; - - Below is an excerpt of the output for rule "start" for the three - predicate options (off, on, and maintenance release style hoisting). - - For those who do not wish to use the "-mrhoist on" option for code - generation the option can be used in a "diagnostic" mode to provide - valuable information: - - a. where one should insert null actions to inhibit hoisting - b. a chain of rule references which shows where predicates are - being hoisted - - ====================================================================== - Example of "-info p" with "-mrhoist on" - ====================================================================== - #if 0 - - Hoisting of predicate suppressed by alternative without predicate. - The alt without the predicate includes all cases where the - predicate is false. - - WITH predicate: line 11 v36.g - WITHOUT predicate: line 12 v36.g - - The context set for the predicate: - - B - - The lookahead set for alt WITHOUT the semantic predicate: - - B - - The predicate: - - pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g - - set context: - B - tree context: null - - Chain of referenced rules: - - #0 in rule start (line 1 v36.g) to rule all - #1 in rule all (line 3 v36.g) to rule a - #2 in rule a (line 8 v36.g) to rule c - #3 in rule c (line 11 v36.g) - - #endif - && - #if 0 - - pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g - - set context: - X - tree context: null - - #endif - ====================================================================== - Example of "-info p" with the default -prc setting ( "-prc off") - ====================================================================== - #if 0 - - OR - pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g - - set context: - nil - tree context: null - - pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g - - set context: - nil - tree context: null - - #endif - ====================================================================== - Example of "-info p" with "-prc on" and "-mrhoist off" - ====================================================================== - #if 0 - - OR - pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g - - set context: - B - tree context: null - - pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g - - set context: - X - tree context: null - - #endif - ====================================================================== - -#97. (Fixed in 1.33MR10) "Predicate applied for more than one ... " - - In 1.33 vanilla, the grammar listed below produced this message for - the first alternative (only) of rule "b": - - warning: predicate applied for >1 lookahead 1-sequences - [you may only want one lookahead 1-sequence to apply. - Try using a context guard '(...)? =>' - - In 1.33MR10 the message is issued for both alternatives. - - top : (a)*; - a : b | c ; - - b : <>? ( AAA | BBB ) - | <>? ( XXX | YYY ) - ; - - c : AAA | XXX; - -#96. (Fixed in 1.33MR10) Guard predicates ignored when -prc off - - Prior to 1.33MR10, guard predicate code was not generated unless - "-prc on" was selected. - - This was incorrect, since "-prc off" (the default) is supposed to - disable only AUTOMATIC computation of predicate context, not the - programmer specified context supplied by guard predicates. - -#95. (Fixed in 1.33MR10) Predicate guard context length was k, not max(k,ck) - - Prior to 1.33MR10, predicate guards were computed to k tokens rather - than max(k,ck). Consider the following grammar: - - a : ( A B C)? => <>? (A|X) (B|Y) (C|Z) ; - - The code generated by 1.33 vanilla with "-k 1 -ck 3 -prc on" - for the predicate in "a" resembles: - - if ( (! LA(1)==A) || AAA(LATEXT(1))) {... - - With 1.33MR10 and the same options the code resembles: - - if ( (! (LA(1)==A && LA(2)==B && LA(3)==C) || AAA(LATEXT(1))) {... - -#94. (Fixed in 1.33MR10) Predicates followed by rule references - - Prior to 1.33MR10, a semantic predicate which referenced a token - which was off the end of the rule caused an incomplete context - to be computed (with "-prc on") for the predicate under some circum- - stances. In some cases this manifested itself as illegal C code - (e.g. "LA(2)==[Ep](1)" in the k=2 examples below: - - all : ( a ) *; - - a : <>? ID X - | <>? Y - | Z - ; - - This might also occur when the semantic predicate was followed - by a rule reference which was shorter than the length of the - semantic predicate: - - all : ( a ) *; - - a : <>? ID X - | <>? y - | Z - ; - - y : Y ; - - Depending on circumstance, the resulting context might be too - generous because it was too short, or too restrictive because - of missing alternatives. - -#93. (Changed in 1.33MR10) Definition of Purify macro - - Ofer Ben-Ami (gremlin@cs.huji.ac.il) has supplied a definition - for the Purify macro: - - #define PURIFY(r, s) memset((char *) &(r), '\0', (s)); - - Note: This may not be the right thing to do for C++ objects that - have constructors. Reported by Bonny Rais (bonny@werple.net.au). - - For those cases one should #define PURIFY to an empty macro in the - #header or #first actions. - -#92. (Fixed in 1.33MR10) Guarded predicates and hoisting - - When a guarded predicate participates in hoisting it is linked into - a predicate expression tree. Prior to 1.33MR10 this link was never - cleared and the next time the guard was used to construct a new - tree the link could contain a spurious reference to another element - which had previosly been joined to it in the semantic predicate tree. - - For example: - - start : ( all ) *; - all : ( a | b ) ; - - start2 : ( all2 ) *; - all2 : ( a ) ; - - a : (A)? => <>? A ; - b : (B)? => <>? B ; - - Prior to 1.33MR10 the code for "start2" would include a spurious - reference to the BBB predicate which was left from constructing - the predicate tree for rule "start" (i.e. or(AAA,BBB) ). - - In 1.33MR10 this problem is avoided by cloning the original guard - each time it is linked into a predicate tree. - -#91. (Changed in 1.33MR10) Extensive changes to semantic pred hoisting - - ============================================ - This has been rendered obsolete by Item #117 - ============================================ - -#90. (Fixed in 1.33MR10) Semantic pred with LT(i) and i>max(k,ck) - - There is a bug in antlr 1.33 vanilla and all maintenance releases - prior to 1.33MR10 which allows semantic predicates to reference - an LT(i) or LATEXT(i) where i is larger than max(k,ck). When - this occurs antlr will attempt to mark the ith element of an array - in which there are only max(k,ck) elements. The result cannot - be predicted. - - Using LT(i) or LATEXT(i) for i>max(k,ck) is reported as an error - in 1.33MR10. - -#89. Rescinded - -#88. (Fixed in 1.33MR10) Tokens used in semantic predicates in guess mode - - Consider the behavior of a semantic predicate during guess mode: - - rule : a:A ( - <>? b:B - | c:C - ); - - Prior to MR10 the assignment of the token or attribute to - $a did not occur during guess mode, which would cause the - semantic predicate to misbehave because $a would be null. - - In 1.33MR10 a semantic predicate with a reference to an - element label (such as $a) forces the assignment to take - place even in guess mode. - - In order to work, this fix REQUIRES use of the $label format - for token pointers and attributes referenced in semantic - predicates. - - The fix does not apply to semantic predicates using the - numeric form to refer to attributes (e.g. <>?). - The user will receive a warning for this case. - - Reported by Rob Trout (trout@mcs.cs.kent.edu). - -#87. (Fixed in 1.33MR10) Malformed guard predicates - - Context guard predicates may contain only references to - tokens. They may not contain references to (...)+ and - (...)* blocks. This is now checked. This replaces the - fatal error message in item #78 with an appropriate - (non-fatal) error messge. - - In theory, context guards should be allowed to reference - rules. However, I have not had time to fix this. - Evaluation of the guard takes place before all rules have - been read, making it difficult to resolve a forward reference - to rule "zzz" - it hasn't been read yet ! To postpone evaluation - of the guard until all rules have been read is too much - for the moment. - -#86. (Fixed in 1.33MR10) Unequal set size in set_sub - - Routine set_sub() in pccts/support/set/set.h did not work - correctly when the sets were of unequal sizes. Rewrote - set_equ to make it simpler and remove unnecessary and - expensive calls to set_deg(). This routine was not used - in 1.33 vanila. - -#85. (Changed in 1.33MR10) Allow redefinition of MaxNumFiles - - Raised the maximum number of input files to 99 from 20. - Put a #ifndef/#endif around the "#define MaxNumFiles 99". - -#84. (Fixed in 1.33MR10) Initialize zzBadTok in macro zzRULE - - Initialize zzBadTok to NULL in zzRULE macro of AParser.h. - in order to get rid of warning messages. - -#83. (Fixed in 1.33MR10) False warnings with -w2 for #tokclass - - When -w2 is selected antlr gives inappropriate warnings about - #tokclass names not having any associated regular expressions. - Since a #tokclass is not a "real" token it will never have an - associated regular expression and there should be no warning. - - Reported by Derek Pappas (derek.pappas@eng.sun.com) - -#82. (Fixed in 1.33MR10) Computation of follow sets with multiple cycles - - Reinier van den Born (reinier@vnet.ibm.com) reported a problem - in the computation of follow sets by antlr. The problem (bug) - exists in 1.33 vanilla and all maintenance releases prior to 1.33MR10. - - The problem involves the computation of follow sets when there are - cycles - rules which have mutual references. I believe the problem - is restricted to cases where there is more than one cycle AND - elements of those cycles have rules in common. Even when this - occurs it may not affect the code generated - but it might. It - might also lead to undetected ambiguities. - - There were no changes in antlr or dlg output from the revised version. - - The following fragment demonstates the problem by giving different - follow sets (option -pa) for var_access when built with k=1 and ck=2 on - 1.33 vanilla and 1.33MR10: - - echo_statement : ECHO ( echo_expr )* - ; - - echo_expr : ( command )? - | expression - ; - - command : IDENTIFIER - { concat } - ; - - expression : operand ( OPERATOR operand )* - ; - - operand : value - | START command END - ; - - value : concat - | TYPE operand - ; - - concat : var_access { CONCAT value } - ; - - var_access : IDENTIFIER { INDEX } - - ; -#81. (Changed in 1.33MR10) C mode use of attributes and ASTs - - Reported by Isaac Clark (irclark@mindspring.com). - - C mode code ignores attributes returned by rules which are - referenced using element labels when ASTs are enabled (-gt option). - - 1. start : r:rule t:Token <<$start=$r;>> - - The $r refrence will not work when combined with - the -gt option. - - 2. start : t:Token <<$start=$t;>> - - The $t reference works in all cases. - - 3. start : rule <<$0=$1;>> - - Numeric labels work in all cases. - - With MR10 the user will receive an error message for case 1 when - the -gt option is used. - -#80. (Fixed in 1.33MR10) (...)? as last alternative of block - - A construct like the following: - - rule : a - | (b)? - ; - - does not make sense because there is no alternative when - the guess block fails. This is now reported as a warning - to the user. - - Previously, there was a code generation error for this case: - the guess block was not "closed" when the guess failed. - This could cause an infinite loop or other problems. This - is now fixed. - - Example problem: - - #header<< - #include - #include "charptr.h" - >> - - << - #include "charptr.c" - main () - { - ANTLR(start(),stdin); - } - >> - - #token "[\ \t]+" << zzskip(); >> - #token "[\n]" << zzline++; zzskip(); >> - - #token Word "[a-z]+" - #token Number "[0-9]+" - - - start : (test1)? - | (test2)? - ; - test1 : (Word Word Word Word)? - | (Word Word Word Number)? - ; - test2 : (Word Word Number Word)? - | (Word Word Number Number)? - ; - - Test data which caused infinite loop: - - a 1 a a - -#79. (Changed in 1.33MR10) Use of -fh with multiple parsers - - Previously, antlr always used the pre-processor symbol - STDPCCTS_H as a gate for the file stdpccts.h. This - caused problems when there were multiple parsers defined - because they used the same gate symbol. - - In 1.33MR10, the -fh filename is used to generate the - gate file for stdpccts.h. For instance: - - antlr -fh std_parser1.h - - generates the pre-processor symbol "STDPCCTS_std_parser1_H". - - Reported by Ramanathan Santhanam (ps@kumaran.com). - -#78. (Changed in 1.33MR9) Guard predicates that refer to rules - - ------------------------ - Please refer to Item #87 - ------------------------ - - Guard predicates are processed during an early phase - of antlr (during parsing) before all data structures - are completed. - - There is an apparent bug in earlier versions of 1.33 - which caused guard predicates which contained references - to rules (rather than tokens) to reference a structure - which hadn't yet been initialized. - - In some cases (perhaps all cases) references to rules - in guard predicates resulted in the use of "garbage". - -#79. (Changed in 1.33MR9) Jeff Vincent (JVincent@novell.com) - - Previously, the maximum length file name was set - arbitrarily to 300 characters in antlr, dlg, and sorcerer. - - The config.h file now attempts to define the maximum length - filename using _MAX_PATH from stdlib.h before falling back - to using the value 300. - -#78. (Changed in 1.33MR9) Jeff Vincent (JVincent@novell.com) - - Put #ifndef/#endif around definition of ZZLEXBUFSIZE in - antlr. - -#77. (Changed in 1.33MR9) Arithmetic overflow for very large grammars - - In routine HandleAmbiguities() antlr attempts to compute the - number of possible elements in a set that is order of - number-of-tokens raised to the number-of-lookahead-tokens power. - For large grammars or large lookahead (e.g. -ck 7) this can - cause arithmetic overflow. - - With 1.33MR9, arithmetic overflow in this computation is reported - the first time it happens. The program continues to run and - the program branches based on the assumption that the computed - value is larger than any number computed by counting actual cases - because 2**31 is larger than the number of bits in most computers. - - Before 1.33MR9 overflow was not reported. The behavior following - overflow is not predictable by anyone but the original author. - - NOTE - - In 1.33MR10 the warning message is suppressed. - The code which detects the overflow allows the - computation to continue without an error. The - error message itself made made users worry. - -#76. (Changed in 1.33MR9) Jeff Vincent (JVincent@novell.com) - - Jeff Vincent has convinced me to make ANTLRCommonToken and - ANTLRCommonNoRefCountToken use variable length strings - allocated from the heap rather than fixed length strings. - By suitable definition of setText(), the copy constructor, - and operator =() it is possible to maintain "copy" semantics. - By "copy" semantics I mean that when a token is copied from - an existing token it receives its own, distinct, copy of the - text allocated from the heap rather than simply a pointer - to the original token's text. - - ============================================================ - W * A * R * N * I * N * G - ============================================================ - - It is possible that this may cause problems for some users. - For those users I have included the old version of AToken.h as - pccts/h/AToken_traditional.h. - -#75. (Changed in 1.33MR9) Bruce Guenter (bruceg@qcc.sk.ca) - - Make DLGStringInput const correct. Since this is infrequently - subclassed, it should affect few users, I hope. - -#74. (Changed in 1.33MR9) -o (output directory) option - - Antlr does not properly handle the -o output directory option - when the filename of the grammar contains a directory part. For - example: - - antlr -o outdir pccts_src/myfile.g - - causes antlr create a file called "outdir/pccts_src/myfile.cpp. - It SHOULD create outdir/myfile.cpp - - The suggested code fix has been installed in antlr, dlg, and - Sorcerer. - -#73. (Changed in 1.33MR9) Hoisting of semantic predicates and -mrhoist - - ============================================ - This has been rendered obsolete by Item #117 - ============================================ - -#72. (Changed in 1.33MR9) virtual saveState()/restoreState()/guess_XXX - - The following methods in ANTLRParser were made virtual at - the request of S. Bochnak (S.Bochnak@microTool.com.pl): - - saveState() and restoreState() - guess(), guess_fail(), and guess_done() - -#71. (Changed in 1.33MR9) Access to omitted command line argument - - If a switch requiring arguments is the last thing on the - command line, and the argument is omitted, antlr would core. - - antlr test.g -prc - - instead of - - antlr test.g -prc off - -#70. (Changed in 1.33MR9) Addition of MSVC .dsp and .mak build files - - The following MSVC .dsp and .mak files for pccts and sorcerer - were contributed by Stanislaw Bochnak (S.Bochnak@microTool.com.pl) - and Jeff Vincent (JVincent@novell.com) - - PCCTS Distribution Kit - ---------------------- - pccts/PCCTSMSVC50.dsw - - pccts/antlr/AntlrMSVC50.dsp - pccts/antlr/AntlrMSVC50.mak - - pccts/dlg/DlgMSVC50.dsp - pccts/dlg/DlgMSVC50.mak - - pccts/support/msvc.dsp - - Sorcerer Distribution Kit - ------------------------- - pccts/sorcerer/SorcererMSVC50.dsp - pccts/sorcerer/SorcererMSVC50.mak - - pccts/sorcerer/lib/msvc.dsp - -#69. (Changed in 1.33MR9) Change "unsigned int" to plain "int" - - Declaration of max_token_num in misc.c as "unsigned int" - caused comparison between signed and unsigned ints giving - warning message without any special benefit. - -#68. (Changed in 1.33MR9) Add void return for dlg internal_error() - - Get rid of "no return value" message in internal_error() - in file dlg/support.c and dlg/dlg.h. - -#67. (Changed in Sor) sor.g: lisp() has no return value - - Added a "void" for the return type. - -#66. (Added to Sor) sor.g: ZZLEXBUFSIZE enclosed in #ifndef/#endif - - A user needed to be able to change the ZZLEXBUFSIZE for - sor. Put the definition of ZZLEXBUFSIZE inside #ifndef/#endif - -#65. (Changed in 1.33MR9) PCCTSAST::deepCopy() and ast_dup() bug - - Jeff Vincent (JVincent@novell.com) found that deepCopy() - made new copies of only the direct descendents. No new - copies were made of sibling nodes, Sibling pointers are - set to zero by shallowCopy(). - - PCCTS_AST::deepCopy() has been changed to make a - deep copy in the traditional sense. - - The deepCopy() routine depends on the behavior of - shallowCopy(). In all sor examples I've found, - shallowCopy() zeroes the right and down pointers. - - Original Tree Original deepCopy() Revised deepCopy - ------------- ------------------- ---------------- - a->b->c A A - | | | - d->e->f D D->E->F - | | | - g->h->i G G->H->I - | | - j->k J->K - - While comparing deepCopy() for C++ mode with ast_dup for - C mode I found a problem with ast_dup(). - - Routine ast_dup() has been changed to make a deep copy - in the traditional sense. - - Original Tree Original ast_dup() Revised ast_dup() - ------------- ------------------- ---------------- - a->b->c A->B->C A - | | | - d->e->f D->E->F D->E->F - | | | - g->h->i G->H->I G->H->I - | | | - j->k J->K J->K - - - I believe this affects transform mode sorcerer programs only. - -#64. (Changed in 1.33MR9) anltr/hash.h prototype for killHashTable() - -#63. (Changed in 1.33MR8) h/charptr.h does not zero pointer after free - - The charptr.h routine now zeroes the pointer after free(). - - Reported by Jens Tingleff (jensting@imaginet.fr) - -#62. (Changed in 1.33MR8) ANTLRParser::resynch had static variable - - The static variable "consumed" in ANTLRParser::resynch was - changed into an instance variable of the class with the - name "resynchConsumed". - - Reported by S.Bochnak@microTool.com.pl - -#61. (Changed in 1.33MR8) Using rule>[i,j] when rule has no return values - - Previously, the following code would cause antlr to core when - it tried to generate code for rule1 because rule2 had no return - values ("upward inheritance"): - - rule1 : <> - rule2 > [i,j] - ; - - rule2 : Anything ; - - Reported by S.Bochnak@microTool.com.pl - - Verified correct operation of antlr MR8 when missing or extra - inheritance arguments for all combinations. When there are - missing or extra arguments code will still be generated even - though this might cause the invocation of a subroutine with - the wrong number of arguments. - -#60. (Changed in 1.33MR7) Major changes to exception handling - - There were significant problems in the handling of exceptions - in 1.33 vanilla. The general problem is that it can only - process one level of exception handler. For example, a named - exception handler, an exception handler for an alternative, or - an exception for a subrule always went to the rule's exception - handler if there was no "catch" which matched the exception. - - In 1.33MR7 the exception handlers properly "nest". If an - exception handler does not have a matching "catch" then the - nextmost outer exception handler is checked for an appropriate - "catch" clause, and so on until an exception handler with an - appropriate "catch" is found. - - There are still undesirable features in the way exception - handlers are implemented, but I do not have time to fix them - at the moment: - - The exception handlers for alternatives are outside the - block containing the alternative. This makes it impossible - to access variables declared in a block or to resume the - parse by "falling through". The parse can still be easily - resumed in other ways, but not in the most natural fashion. - - This results in an inconsistentcy between named exception - handlers and exception handlers for alternatives. When - an exception handler for an alternative "falls through" - it goes to the nextmost outer handler - not the "normal - action". - - A major difference between 1.33MR7 and 1.33 vanilla is - the default action after an exception is caught: - - 1.33 Vanilla - ------------ - In 1.33 vanilla the signal value is set to zero ("NoSignal") - and the code drops through to the code following the exception. - For named exception handlers this is the "normal action". - For alternative exception handlers this is the rule's handler. - - 1.33MR7 - ------- - In 1.33MR7 the signal value is NOT automatically set to zero. - - There are two cases: - - For named exception handlers: if the signal value has been - set to zero the code drops through to the "normal action". - - For all other cases the code branches to the nextmost outer - exception handler until it reaches the handler for the rule. - - The following macros have been defined for convenience: - - C/C++ Mode Name - -------------------- - (zz)suppressSignal - set signal & return signal arg to 0 ("NoSignal") - (zz)setSignal(intValue) - set signal & return signal arg to some value - (zz)exportSignal - copy the signal value to the return signal arg - - I'm not sure why PCCTS make a distinction between the local - signal value and the return signal argument, but I'm loathe - to change the code. The burden of copying the local signal - value to the return signal argument can be given to the - default signal handler, I suppose. - -#59. (Changed in 1.33MR7) Prototypes for some functions - - Added prototypes for the following functions to antlr.h - - zzconsumeUntil() - zzconsumeUntilToken() - -#58. (Changed in 1.33MR7) Added defintion of zzbufsize to dlgauto.h - -#57. (Changed in 1.33MR7) Format of #line directive - - Previously, the -gl directive for line 1234 would - resemble: "# 1234 filename.g". This caused problems - for some compilers/pre-processors. In MR7 it generates - "#line 1234 filename.g". - -#56. (Added in 1.33MR7) Jan Mikkelsen - - Move PURIFY macro invocaton to after rule's init action. - -#55. (Fixed in 1.33MR7) Unitialized variables in ANTLRParser - - Member variables inf_labase and inf_last were not initialized. - (See item #50.) - -#54. (Fixed in 1.33MR6) Brad Schick (schick@interacess.com) - - Previously, the following constructs generated the same - code: - - rule1 : (A B C)? - | something-else - ; - - rule2 : (A B C)? () - | something-else - ; - - In all versions of pccts rule1 guesses (A B C) and then - consume all three tokens if the guess succeeds. In MR6 - rule2 guesses (A B C) but consumes NONE of the tokens - when the guess succeeds because "()" matches epsilon. - -#53. (Explanation for 1.33MR6) What happens after an exception is caught ? - - The Book is silent about what happens after an exception - is caught. - - The following code fragment prints "Error Action" followed - by "Normal Action". - - test : Word ex:Number <> - exception[ex] - catch NoViableAlt: - <> - ; - - The reason for "Normal Action" is that the normal flow of the - program after a user-written exception handler is to "drop through". - In the case of an exception handler for a rule this results in - the exection of a "return" statement. In the case of an - exception handler attached to an alternative, rule, or token - this is the code that would have executed had there been no - exception. - - The user can achieve the desired result by using a "return" - statement. - - test : Word ex:Number <> - exception[ex] - catch NoViableAlt: - <> - ; - - The most powerful mechanism for recovery from parse errors - in pccts is syntactic predicates because they provide - backtracking. Exceptions allow "return", "break", - "consumeUntil(...)", "goto _handler", "goto _fail", and - changing the _signal value. - -#52. (Fixed in 1.33MR6) Exceptions without syntactic predicates - - The following generates bad code in 1.33 if no syntactic - predicates are present in the grammar. - - test : Word ex:Number <> - exception[ex] - catch NoViableAlt: - <> - - There is a reference to a guess variable. In C mode - this causes a compiler error. In C++ mode it generates - an extraneous check on member "guessing". - - In MR6 correct code is generated for both C and C++ mode. - -#51. (Added to 1.33MR6) Exception operator "@" used without exceptions - - In MR6 added a warning when the exception operator "@" is - used and no exception group is defined. This is probably - a case where "\@" or "@" is meant. - -#50. (Fixed in 1.33MR6) Gunnar Rxnning (gunnar@candleweb.no) - http://www.candleweb.no/~gunnar/ - - Routines zzsave_antlr_state and zzrestore_antlr_state don't - save and restore all the data needed when switching states. - - Suggested patch applied to antlr.h and err.h for MR6. - -#49. (Fixed in 1.33MR6) Sinan Karasu (sinan@boeing.com) - - Generated code failed to turn off guess mode when leaving a - (...)+ block which contained a guess block. The result was - an infinite loop. For example: - - rule : ( - (x)? - | y - )+ - - Suggested code fix implemented in MR6. Replaced - - ... else if (zzcnt>1) break; - - with: - - C++ mode: - ... else if (zzcnt>1) {if (!zzrv) zzGUESS_DONE; break;}; - C mode: - ... else if (zzcnt>1) {if (zzguessing) zzGUESS_DONE; break;}; - -#48. (Fixed in 1.33MR6) Invalid exception element causes core - - A label attached to an invalid construct can cause - pccts to crash while processing the exception associated - with the label. For example: - - rule : t:(B C) - exception[t] catch MismatchedToken: <> - - Version MR6 generates the message: - - reference in exception handler to undefined label 't' - -#47. (Fixed in 1.33MR6) Manuel Ornato - - Under some circumstances involving a k >1 or ck >1 - grammar and a loop block (i.e. (...)* ) pccts will - fail to detect a syntax error and loop indefinitely. - The problem did not exist in 1.20, but has existed - from 1.23 to the present. - - Fixed in MR6. - - --------------------------------------------------- - Complete test program - --------------------------------------------------- - #header<< - #include - #include "charptr.h" - >> - - << - #include "charptr.c" - main () - { - ANTLR(global(),stdin); - } - >> - - #token "[\ \t]+" << zzskip(); >> - #token "[\n]" << zzline++; zzskip(); >> - - #token B "b" - #token C "c" - #token D "d" - #token E "e" - #token LP "\(" - #token RP "\)" - - #token ANTLREOF "@" - - global : ( - (E liste) - | liste - | listed - ) ANTLREOF - ; - - listeb : LP ( B ( B | C )* ) RP ; - listec : LP ( C ( B | C )* ) RP ; - listed : LP ( D ( B | C )* ) RP ; - liste : ( listeb | listec )* ; - - --------------------------------------------------- - Sample data causing infinite loop - --------------------------------------------------- - e (d c) - --------------------------------------------------- - -#46. (Fixed in 1.33MR6) Robert Richter - (Robert.Richter@infotech.tu-chemnitz.de) - - This item from the list of known problems was - fixed by item #18 (below). - -#45. (Fixed in 1.33MR6) Brad Schick (schick@interaccess.com) - - The dependency scanner in VC++ mistakenly sees a - reference to an MPW #include file even though properly - #ifdef/#endif in config.h. The suggested workaround - has been implemented: - - #ifdef MPW - ..... - #define MPW_CursorCtl_Header - #include MPW_CursorCtl_Header - ..... - #endif - -#44. (Fixed in 1.33MR6) cast malloc() to (char *) in charptr.c - - Added (char *) cast for systems where malloc returns "void *". - -#43. (Added to 1.33MR6) Bruce Guenter (bruceg@qcc.sk.ca) - - Add setLeft() and setUp methods to ASTDoublyLinkedBase - for symmetry with setRight() and setDown() methods. - -#42. (Fixed in 1.33MR6) Jeff Katcher (jkatcher@nortel.ca) - - C++ style comment in antlr.c corrected. - -#41. (Added in 1.33MR6) antlr -stdout - - Using "antlr -stdout ..." forces the text that would - normally go to the grammar.c or grammar.cpp file to - stdout. - -#40. (Added in 1.33MR6) antlr -tab to change tab stops - - Using "antlr -tab number ..." changes the tab stops - for the grammar.c or grammar.cpp file. The number - must be between 0 and 8. Using 0 gives tab characters, - values between 1 and 8 give the appropriate number of - space characters. - -#39. (Fixed in 1.33MR5) Jan Mikkelsen - - Commas in function prototype still not correct under - some circumstances. Suggested code fix installed. - -#38. (Fixed in 1.33MR5) ANTLRTokenBuffer constructor - - Have ANTLRTokenBuffer ctor initialize member "parser" to null. - -#37. (Fixed in 1.33MR4) Bruce Guenter (bruceg@qcc.sk.ca) - - In ANTLRParser::FAIL(int k,...) released memory pointed to by - f[i] (as well as f itself. Should only free f itself. - -#36. (Fixed in 1.33MR3) Cortland D. Starrett (cort@shay.ecn.purdue.edu) - - Neglected to properly declare isDLGmaxToken() when fixing problem - reported by Andreas Magnusson. - - Undo "_retv=NULL;" change which caused problems for return values - from rules whose return values weren't pointers. - - Failed to create bin directory if it didn't exist. - -#35. (Fixed in 1.33MR2) Andreas Magnusson -(Andreas.Magnusson@mailbox.swipnet.se) - - Repair bug introduced by 1.33MR1 for #tokdefs. The original fix - placed "DLGmaxToken=9999" and "DLGminToken=0" in the TokenType enum - in order to fix a problem with an aggresive compiler assigning an 8 - bit enum which might be too narrow. This caused #tokdefs to assume - that there were 9999 real tokens. The repair to the fix causes antlr to - ignore TokenTypes "DLGmaxToken" and "DLGminToken" in a #tokdefs file. - -#34. (Added to 1.33MR1) Add public DLGLexerBase::set_line(int newValue) - - Previously there was no public function for changing the line - number maintained by the lexer. - -#33. (Fixed in 1.33MR1) Franklin Chen (chen@adi.com) - - Accidental use of EXIT_FAILURE rather than PCCTS_EXIT_FAILURE - in pccts/h/AParser.cpp. - -#32. (Fixed in 1.33MR1) Franklin Chen (chen@adi.com) - - In PCCTSAST.cpp lines 405 and 466: Change - - free (t) - to - free ( (char *)t ); - - to match prototype. - -#31. (Added to 1.33MR1) Pointer to parser in ANTLRTokenBuffer - Pointer to parser in DLGLexerBase - - The ANTLRTokenBuffer class now contains a pointer to the - parser which is using it. This is established by the - ANTLRParser constructor calling ANTLRTokenBuffer:: - setParser(ANTLRParser *p). - - When ANTLRTokenBuffer::setParser(ANTLRParser *p) is - called it saves the pointer to the parser and then - calls ANTLRTokenStream::setParser(ANTLRParser *p) - so that the lexer can also save a pointer to the - parser. - - There is also a function getParser() in each class - with the obvious purpose. - - It is possible that these functions will return NULL - under some circumstances (e.g. a non-DLG lexer is used). - -#30. (Added to 1.33MR1) function tokenName(int token) standard - - The generated parser class now includes the - function: - - static const ANTLRChar * tokenName(int token) - - which returns a pointer to the "name" corresponding - to the token. - - The base class (ANTLRParser) always includes the - member function: - - const ANTLRChar * parserTokenName(int token) - - which can be accessed by objects which have a pointer - to an ANTLRParser, but do not know the name of the - parser class (e.g. ANTLRTokenBuffer and DLGLexerBase). - -#29. (Added to 1.33MR1) Debugging DLG lexers - - If the pre-processor symbol DEBUG_LEXER is defined - then DLexerBase will include code for printing out - key information about tokens which are recognized. - - The debug feature of the lexer is controlled by: - - int previousDebugValue=lexer.debugLexer(newValue); - - a value of 0 disables output - a value of 1 enables output - - Even if the lexer debug code is compiled into DLexerBase - it must be enabled before any output is generated. For - example: - - DLGFileInput in(stdin); - MyDLG lexer(&in,2000); - - lexer.setToken(&aToken); - - #if DEBUG_LEXER - lexer.debugLexer(1); // enable debug information - #endif - -#28. (Added to 1.33MR1) More control over DLG header - - Version 1.33MR1 adds the following directives to PCCTS - for C++ mode: - - #lexprefix <> - - Adds source code to the DLGLexer.h file - after the #include "DLexerBase.h" but - before the start of the class definition. - - #lexmember <> - - Adds source code to the DLGLexer.h file - as part of the DLGLexer class body. It - appears immediately after the start of - the class and a "public: statement. - -#27. (Fixed in 1.33MR1) Comments in DLG actions - - Previously, DLG would not recognize comments as a special case. - Thus, ">>" in the comments would cause errors. This is fixed. - -#26. (Fixed in 1.33MR1) Removed static variables from error routines - - Previously, the existence of statically allocated variables - in some of the parser's member functions posed a danger when - there was more than one parser active. - - Replaced with dynamically allocated/freed variables in 1.33MR1. - -#25. (Fixed in 1.33MR1) Use of string literals in semantic predicates - - Previously, it was not possible to place a string literal in - a semantic predicate because it was not properly "stringized" - for the report of a failed predicate. - -#24. (Fixed in 1.33MR1) Continuation lines for semantic predicates - - Previously, it was not possible to continue semantic - predicates across a line because it was not properly - "stringized" for the report of a failed predicate. - - rule : <>?[ a very - long statement ] - -#23. (Fixed in 1.33MR1) {...} envelope for failed semantic predicates - - Previously, there was a code generation error for failed - semantic predicates: - - rule : <>?[ stmt1; stmt2; ] - - which generated code which resembled: - - if (! xyz()) stmt1; stmt2; - - It now puts the statements in a {...} envelope: - - if (! xyz()) { stmt1; stmt2; }; - -#22. (Fixed in 1.33MR1) Continuation of #token across lines using "\" - - Previously, it was not possible to continue a #token regular - expression across a line. The trailing "\" and newline caused - a newline to be inserted into the regular expression by DLG. - - Fixed in 1.33MR1. - -#21. (Fixed in 1.33MR1) Use of ">>" (right shift operator in DLG actions - - It is now possible to use the C++ right shift operator ">>" - in DLG actions by using the normal escapes: - - #token "shift-right" << value=value \>\> 1;>> - -#20. (Version 1.33/19-Jan-97 Karl Eccleson - P.A. Keller (P.A.Keller@bath.ac.uk) - - There is a problem due to using exceptions with the -gh option. - - Suggested fix now in 1.33MR1. - -#19. (Fixed in 1.33MR1) Tom Piscotti and John Lilley - - There were problems suppressing messages to stdin and stdout - when running in a window environment because some functions - which uses fprint were not virtual. - - Suggested change now in 1.33MR1. - - I believe all functions containing error messages (excluding those - indicating internal inconsistency) have been placed in functions - which are virtual. - -#18. (Version 1.33/ 22-Nov-96) John Bair (jbair@iftime.com) - - Under some combination of options a required "return _retv" is - not generated. - - Suggested fix now in 1.33MR1. - -#17. (Version 1.33/3-Sep-96) Ron House (house@helios.usq.edu.au) - - The routine ASTBase::predorder_action omits two "tree->" - prefixes, which results in the preorder_action belonging - to the wrong node to be invoked. - - Suggested fix now in 1.33MR1. - -#16. (Version 1.33/7-Jun-96) Eli Sternheim - - Routine consumeUntilToken() does not check for end-of-file - condition. - - Suggested fix now in 1.33MR1. - -#15. (Version 1.33/8 Apr 96) Asgeir Olafsson - - Problem with tree duplication of doubly linked ASTs in ASTBase.cpp. - - Suggested fix now in 1.33MR1. - -#14. (Version 1.33/28-Feb-96) Andreas.Magnusson@mailbox.swipnet.se - - Problem with definition of operator = (const ANTLRTokenPtr rhs). - - Suggested fix now in 1.33MR1. - -#13. (Version 1.33/13-Feb-96) Franklin Chen (chen@adi.com) - - Sun C++ Compiler 3.0.1 can't compile testcpp/1 due to goto in - block with destructors. - - Apparently fixed. Can't locate "goto". - -#12. (Version 1.33/10-Nov-95) Minor problems with 1.33 code - - The following items have been fixed in 1.33MR1: - - 1. pccts/antlr/main.c line 142 - - "void" appears in classic C code - - 2. no makefile in support/genmk - - 3. EXIT_FAILURE/_SUCCESS instead of PCCTS_EXIT_FAILURE/_SUCCESS - - pccts/h/PCCTSAST.cpp - pccts/h/DLexerBase.cpp - pccts/testcpp/6/test.g - - 4. use of "signed int" isn't accepted by AT&T cfront - - pccts/h/PCCTSAST.h line 42 - - 5. in call to ANTLRParser::FAIL the var arg err_k is passed as - "int" but is declared "unsigned int". - - 6. I believe that a failed validation predicate still does not - get put in a "{...}" envelope, despite the release notes. - - 7. The #token ">>" appearing in the DLG grammar description - causes DLG to generate the string literal "\>\>" which - is non-conforming and will cause some compilers to - complain (scan.c function act10 line 143 of source code). - -#11. (Version 1.32b6) Dave Kuhlman (dkuhlman@netcom.com) - - Problem with file close in gen.c. Already fixed in 1.33. - -#10. (Version 1.32b6/29-Aug-95) - - pccts/antlr/main.c contains a C++ style comments on lines 149 - and 176 which causes problems for most C compilers. - - Already fixed in 1.33. - -#9. (Version 1.32b4/14-Mar-95) dlgauto.h #include "config.h" - - The file pccts/h/dlgauto.h should probably contain a #include - "config.h" as it uses the #define symbol __USE_PROTOS. - - Added to 1.33MR1. - -#8. (Version 1.32b4/6-Mar-95) Michael T. Richter (mtr@igs.net) - - In C++ output mode anonymous tokens from in-line regular expressions - can create enum values which are too wide for the datatype of the enum - assigned by the C++ compiler. - - Fixed in 1.33MR1. - -#7. (Version 1.32b4/6-Mar-95) C++ does not imply __STDC__ - - In err.h the combination of # directives assumes that a C++ - compiler has __STDC__ defined. This is not necessarily true. - - This problem also appears in the use of __USE_PROTOS which - is appropriate for both Standard C and C++ in antlr/gen.c - and antlr/lex.c - - Fixed in 1.33MR1. - -#6. (Version 1.32 ?/15-Feb-95) Name conflict for "TokenType" - - Already fixed in 1.33. - -#5. (23-Jan-95) Douglas_Cuthbertson.JTIDS@jtids_qmail.hanscom.af.mil - - The fail action following a semantic predicate is not enclosed in - "{...}". This can lead to problems when the fail action contains - more than one statement. - - Fixed in 1.33MR1. - -#4 . (Version 1.33/31-Mar-96) jlilley@empathy.com (John Lilley) - - Put briefly, a semantic predicate ought to abort a guess if it fails. - - Correction suggested by J. Lilley has been added to 1.33MR1. - -#3 . (Version 1.33) P.A.Keller@bath.ac.uk - - Extra commas are placed in the K&R style argument list for rules - when using both exceptions and ASTs. - - Fixed in 1.33MR1. - -#2. (Version 1.32b6/2-Oct-95) Brad Schick - - Construct #[] generates zzastnew() in C++ mode. - - Already fixed in 1.33. - -#1. (Version 1.33) Bob Bailey (robert@oakhill.sps.mot.com) - - Previously, config.h assumed that all PC systems required - "short" file names. The user can now override that - assumption with "#define LONGFILENAMES". - - Added to 1.33MR1. diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_SUMMARY.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_SUMMARY.txt deleted file mode 100644 index 4dab59722..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/CHANGES_SUMMARY.txt +++ /dev/null @@ -1,2049 +0,0 @@ -====================================================================== - - CHANGES_SUMMARY.TXT - - A QUICK overview of changes from 1.33 in reverse order - - A summary of additions rather than bug fixes and minor code changes. - - Numbers refer to items in CHANGES_FROM_133*.TXT - which may contain additional information. - - DISCLAIMER - - The software and these notes are provided "as is". They may include - typographical or technical errors and their authors disclaims all - liability of any kind or nature for damages due to error, fault, - defect, or deficiency regardless of cause. All warranties of any - kind, either express or implied, including, but not limited to, the - implied warranties of merchantability and fitness for a particular - purpose are disclaimed. - -====================================================================== - -#258. You can specify a user-defined base class for your parser - - The base class must constructor must have a signature similar to - that of ANTLRParser. - -#253. Generation of block preamble (-preamble and -preamble_first) - - The antlr option -preamble causes antlr to insert the code - BLOCK_PREAMBLE at the start of each rule and block. - - The antlr option -preamble_first is similar, but inserts the - code BLOCK_PREAMBLE_FIRST(PreambleFirst_123) where the symbol - PreambleFirst_123 is equivalent to the first set defined by - the #FirstSetSymbol described in Item #248. - -#248. Generate symbol for first set of an alternative - - rr : #FirstSetSymbol(rr_FirstSet) ( Foo | Bar ) ; - -#216. Defer token fetch for C++ mode - - When the ANTLRParser class is built with the pre-processor option - ZZDEFER_FETCH defined, the fetch of new tokens by consume() is deferred - until LA(i) or LT(i) is called. - -#215. Use reset() to reset DLGLexerBase -#188. Added pccts/h/DLG_stream_input.h -#180. Added ANTLRParser::getEofToken() -#173. -glms for Microsoft style filenames with -gl -#170. Suppression for predicates with lookahead depth >1 - - Consider the following grammar with -ck 2 and the predicate in rule - "a" with depth 2: - - r1 : (ab)* "@" - ; - - ab : a - | b - ; - - a : (A B)? => <>? A B C - ; - - b : A B C - ; - - Normally, the predicate would be hoisted into rule r1 in order to - determine whether to call rule "ab". However it should *not* be - hoisted because, even if p is false, there is a valid alternative - in rule b. With "-mrhoistk on" the predicate will be suppressed. - - If "-info p" command line option is present the following information - will appear in the generated code: - - while ( (LA(1)==A) - #if 0 - - Part (or all) of predicate with depth > 1 suppressed by alternative - without predicate - - pred << p(LATEXT(2))>>? - depth=k=2 ("=>" guard) rule a line 8 t1.g - tree context: - (root = A - B - ) - - The token sequence which is suppressed: ( A B ) - The sequence of references which generate that sequence of tokens: - - 1 to ab r1/1 line 1 t1.g - 2 ab ab/1 line 4 t1.g - 3 to b ab/2 line 5 t1.g - 4 b b/1 line 11 t1.g - 5 #token A b/1 line 11 t1.g - 6 #token B b/1 line 11 t1.g - - #endif - - A slightly more complicated example: - - r1 : (ab)* "@" - ; - - ab : a - | b - ; - - a : (A B)? => <>? (A B | D E) - ; - - b : <>? D E - ; - - - In this case, the sequence (D E) in rule "a" which lies behind - the guard is used to suppress the predicate with context (D E) - in rule b. - - while ( (LA(1)==A || LA(1)==D) - #if 0 - - Part (or all) of predicate with depth > 1 suppressed by alternative - without predicate - - pred << q(LATEXT(2))>>? - depth=k=2 rule b line 11 t2.g - tree context: - (root = D - E - ) - - The token sequence which is suppressed: ( D E ) - The sequence of references which generate that sequence of tokens: - - 1 to ab r1/1 line 1 t2.g - 2 ab ab/1 line 4 t2.g - 3 to a ab/1 line 4 t2.g - 4 a a/1 line 8 t2.g - 5 #token D a/1 line 8 t2.g - 6 #token E a/1 line 8 t2.g - - #endif - && - #if 0 - - pred << p(LATEXT(2))>>? - depth=k=2 ("=>" guard) rule a line 8 t2.g - tree context: - (root = A - B - ) - - #endif - - (! ( LA(1)==A && LA(2)==B ) || p(LATEXT(2)) ) { - ab(); - ... - -#165. (Changed in MR13) option -newAST - - To create ASTs from an ANTLRTokenPtr antlr usually calls - "new AST(ANTLRTokenPtr)". This option generates a call - to "newAST(ANTLRTokenPtr)" instead. This allows a user - to define a parser member function to create an AST object. - -#161. (Changed in MR13) Switch -gxt inhibits generation of tokens.h - -#158. (Changed in MR13) #header causes problem for pre-processors - - A user who runs the C pre-processor on antlr source suggested - that another syntax be allowed. With MR13 such directives - such as #header, #pragma, etc. may be written as "\#header", - "\#pragma", etc. For escaping pre-processor directives inside - a #header use something like the following: - - \#header - << - \#include - >> - -#155. (Changed in MR13) Context behind predicates can suppress - - With -mrhoist enabled the context behind a guarded predicate can - be used to suppress other predicates. Consider the following grammar: - - r0 : (r1)+; - - r1 : rp - | rq - ; - rp : <

>? B ; - rq : (A)? => <>? (A|B); - - In earlier versions both predicates "p" and "q" would be hoisted into - rule r0. With MR12c predicate p is suppressed because the context which - follows predicate q includes "B" which can "cover" predicate "p". In - other words, in trying to decide in r0 whether to call r1, it doesn't - really matter whether p is false or true because, either way, there is - a valid choice within r1. - -#154. (Changed in MR13) Making hoist suppression explicit using <> - - A common error, even among experienced pccts users, is to code - an init-action to inhibit hoisting rather than a leading action. - An init-action does not inhibit hoisting. - - This was coded: - - rule1 : <<;>> rule2 - - This is what was meant: - - rule1 : <<;>> <<;>> rule2 - - With MR13, the user can code: - - rule1 : <<;>> <> rule2 - - The following will give an error message: - - rule1 : <> rule2 - - If the <> appears as an init-action rather than a leading - action an error message is issued. The meaning of an init-action - containing "nohoist" is unclear: does it apply to just one - alternative or to all alternatives ? - -#151a. Addition of ANTLRParser::getLexer(), ANTLRTokenStream::getLexer() - - You must manually cast the ANTLRTokenStream to your program's - lexer class. Because the name of the lexer's class is not fixed. - Thus it is impossible to incorporate it into the DLGLexerBase - class. - -#151b.(Changed in MR12) ParserBlackBox member getLexer() - -#150. (Changed in MR12) syntaxErrCount and lexErrCount now public - -#149. (Changed in MR12) antlr option -info o (letter o for orphan) - - If there is more than one rule which is not referenced by any - other rule then all such rules are listed. This is useful for - alerting one to rules which are not used, but which can still - contribute to ambiguity. - -#148. (Changed in MR11) #token names appearing in zztokens,token_tbl - - One can write: - - #token Plus ("+") "\+" - #token RP ("(") "\(" - #token COM ("comment begin") "/\*" - - The string in parenthesis will be used in syntax error messages. - -#146. (Changed in MR11) Option -treport for locating "difficult" alts - - It can be difficult to determine which alternatives are causing - pccts to work hard to resolve an ambiguity. In some cases the - ambiguity is successfully resolved after much CPU time so there - is no message at all. - - A rough measure of the amount of work being peformed which is - independent of the CPU speed and system load is the number of - tnodes created. Using "-info t" gives information about the - total number of tnodes created and the peak number of tnodes. - - Tree Nodes: peak 1300k created 1416k lost 0 - - It also puts in the generated C or C++ file the number of tnodes - created for a rule (at the end of the rule). However this - information is not sufficient to locate the alternatives within - a rule which are causing the creation of tnodes. - - Using: - - antlr -treport 100000 .... - - causes antlr to list on stdout any alternatives which require the - creation of more than 100,000 tnodes, along with the lookahead sets - for those alternatives. - - The following is a trivial case from the ansi.g grammar which shows - the format of the report. This report might be of more interest - in cases where 1,000,000 tuples were created to resolve the ambiguity. - - ------------------------------------------------------------------------- - There were 0 tuples whose ambiguity could not be resolved - by full lookahead - There were 157 tnodes created to resolve ambiguity between: - - Choice 1: statement/2 line 475 file ansi.g - Choice 2: statement/3 line 476 file ansi.g - - Intersection of lookahead[1] sets: - - IDENTIFIER - - Intersection of lookahead[2] sets: - - LPARENTHESIS COLON AMPERSAND MINUS - STAR PLUSPLUS MINUSMINUS ONESCOMPLEMENT - NOT SIZEOF OCTALINT DECIMALINT - HEXADECIMALINT FLOATONE FLOATTWO IDENTIFIER - STRING CHARACTER - ------------------------------------------------------------------------- - -#143. (Changed in MR11) Optional ";" at end of #token statement - - Fixes problem of: - - #token X "x" - - << - parser action - >> - - Being confused with: - - #token X "x" <> - -#142. (Changed in MR11) class BufFileInput subclass of DLGInputStream - - Alexey Demakov (demakov@kazbek.ispras.ru) has supplied class - BufFileInput derived from DLGInputStream which provides a - function lookahead(char *string) to test characters in the - input stream more than one character ahead. - The class is located in pccts/h/BufFileInput.* of the kit. - -#140. #pred to define predicates - - +---------------------------------------------------+ - | Note: Assume "-prc on" for this entire discussion | - +---------------------------------------------------+ - - A problem with predicates is that each one is regarded as - unique and capable of disambiguating cases where two - alternatives have identical lookahead. For example: - - rule : <>? A - | <>? A - ; - - will not cause any error messages or warnings to be issued - by earlier versions of pccts. To compare the text of the - predicates is an incomplete solution. - - In 1.33MR11 I am introducing the #pred statement in order to - solve some problems with predicates. The #pred statement allows - one to give a symbolic name to a "predicate literal" or a - "predicate expression" in order to refer to it in other predicate - expressions or in the rules of the grammar. - - The predicate literal associated with a predicate symbol is C - or C++ code which can be used to test the condition. A - predicate expression defines a predicate symbol in terms of other - predicate symbols using "!", "&&", and "||". A predicate symbol - can be defined in terms of a predicate literal, a predicate - expression, or *both*. - - When a predicate symbol is defined with both a predicate literal - and a predicate expression, the predicate literal is used to generate - code, but the predicate expression is used to check for two - alternatives with identical predicates in both alternatives. - - Here are some examples of #pred statements: - - #pred IsLabel <>? - #pred IsLocalVar <>? - #pred IsGlobalVar <>? - #pred IsVar <>? IsLocalVar || IsGlobalVar - #pred IsScoped <>? IsLabel || IsLocalVar - - I hope that the use of EBNF notation to describe the syntax of the - #pred statement will not cause problems for my readers (joke). - - predStatement : "#pred" - CapitalizedName - ( - "<>?" - | "<>?" predOrExpr - | predOrExpr - ) - ; - - predOrExpr : predAndExpr ( "||" predAndExpr ) * ; - - predAndExpr : predPrimary ( "&&" predPrimary ) * ; - - predPrimary : CapitalizedName - | "!" predPrimary - | "(" predOrExpr ")" - ; - - What is the purpose of this nonsense ? - - To understand how predicate symbols help, you need to realize that - predicate symbols are used in two different ways with two different - goals. - - a. Allow simplification of predicates which have been combined - during predicate hoisting. - - b. Allow recognition of identical predicates which can't disambiguate - alternatives with common lookahead. - - First we will discuss goal (a). Consider the following rule: - - rule0: rule1 - | ID - | ... - ; - - rule1: rule2 - | rule3 - ; - - rule2: <>? ID ; - rule3: <>? ID ; - - When the predicates in rule2 and rule3 are combined by hoisting - to create a prediction expression for rule1 the result is: - - if ( LA(1)==ID - && ( isX(LATEXT(1) || !isX(LATEXT(1) ) ) { rule1(); ... - - This is inefficient, but more importantly, can lead to false - assumptions that the predicate expression distinguishes the rule1 - alternative with some other alternative with lookahead ID. In - MR11 one can write: - - #pred IsX <>? - - ... - - rule2: <>? ID ; - rule3: <>? ID ; - - During hoisting MR11 recognizes this as a special case and - eliminates the predicates. The result is a prediction - expression like the following: - - if ( LA(1)==ID ) { rule1(); ... - - Please note that the following cases which appear to be equivalent - *cannot* be simplified by MR11 during hoisting because the hoisting - logic only checks for a "!" in the predicate action, not in the - predicate expression for a predicate symbol. - - *Not* equivalent and is not simplified during hoisting: - - #pred IsX <>? - #pred NotX <>? - ... - rule2: <>? ID ; - rule3: <>? ID ; - - *Not* equivalent and is not simplified during hoisting: - - #pred IsX <>? - #pred NotX !IsX - ... - rule2: <>? ID ; - rule3: <>? ID ; - - Now we will discuss goal (b). - - When antlr discovers that there is a lookahead ambiguity between - two alternatives it attempts to resolve the ambiguity by searching - for predicates in both alternatives. In the past any predicate - would do, even if the same one appeared in both alternatives: - - rule: <>? X - | <>? X - ; - - The #pred statement is a start towards solving this problem. - During ambiguity resolution (*not* predicate hoisting) the - predicates for the two alternatives are expanded and compared. - Consider the following example: - - #pred Upper <>? - #pred Lower <>? - #pred Alpha <>? Upper || Lower - - rule0: rule1 - | <>? ID - ; - - rule1: - | rule2 - | rule3 - ... - ; - - rule2: <>? ID; - rule3: <>? ID; - - The definition of #pred Alpha expresses: - - a. to test the predicate use the C code "isAlpha(LATEXT(1))" - - b. to analyze the predicate use the information that - Alpha is equivalent to the union of Upper and Lower, - - During ambiguity resolution the definition of Alpha is expanded - into "Upper || Lower" and compared with the predicate in the other - alternative, which is also "Upper || Lower". Because they are - identical MR11 will report a problem. - - ------------------------------------------------------------------------- - t10.g, line 5: warning: the predicates used to disambiguate rule rule0 - (file t10.g alt 1 line 5 and alt 2 line 6) - are identical when compared without context and may have no - resolving power for some lookahead sequences. - ------------------------------------------------------------------------- - - If you use the "-info p" option the output file will contain: - - +----------------------------------------------------------------------+ - |#if 0 | - | | - |The following predicates are identical when compared without | - | lookahead context information. For some ambiguous lookahead | - | sequences they may not have any power to resolve the ambiguity. | - | | - |Choice 1: rule0/1 alt 1 line 5 file t10.g | - | | - | The original predicate for choice 1 with available context | - | information: | - | | - | OR expr | - | | - | pred << Upper>>? | - | depth=k=1 rule rule2 line 14 t10.g | - | set context: | - | ID | - | | - | pred << Lower>>? | - | depth=k=1 rule rule3 line 15 t10.g | - | set context: | - | ID | - | | - | The predicate for choice 1 after expansion (but without context | - | information): | - | | - | OR expr | - | | - | pred << isUpper(LATEXT(1))>>? | - | depth=k=1 rule line 1 t10.g | - | | - | pred << isLower(LATEXT(1))>>? | - | depth=k=1 rule line 2 t10.g | - | | - | | - |Choice 2: rule0/2 alt 2 line 6 file t10.g | - | | - | The original predicate for choice 2 with available context | - | information: | - | | - | pred << Alpha>>? | - | depth=k=1 rule rule0 line 6 t10.g | - | set context: | - | ID | - | | - | The predicate for choice 2 after expansion (but without context | - | information): | - | | - | OR expr | - | | - | pred << isUpper(LATEXT(1))>>? | - | depth=k=1 rule line 1 t10.g | - | | - | pred << isLower(LATEXT(1))>>? | - | depth=k=1 rule line 2 t10.g | - | | - | | - |#endif | - +----------------------------------------------------------------------+ - - The comparison of the predicates for the two alternatives takes - place without context information, which means that in some cases - the predicates will be considered identical even though they operate - on disjoint lookahead sets. Consider: - - #pred Alpha - - rule1: <>? ID - | <>? Label - ; - - Because the comparison of predicates takes place without context - these will be considered identical. The reason for comparing - without context is that otherwise it would be necessary to re-evaluate - the entire predicate expression for each possible lookahead sequence. - This would require more code to be written and more CPU time during - grammar analysis, and it is not yet clear whether anyone will even make - use of the new #pred facility. - - A temporary workaround might be to use different #pred statements - for predicates you know have different context. This would avoid - extraneous warnings. - - The above example might be termed a "false positive". Comparison - without context will also lead to "false negatives". Consider the - following example: - - #pred Alpha - #pred Beta - - rule1: <>? A - | rule2 - ; - - rule2: <>? A - | <>? B - ; - - The predicate used for alt 2 of rule1 is (Alpha || Beta). This - appears to be different than the predicate Alpha used for alt1. - However, the context of Beta is B. Thus when the lookahead is A - Beta will have no resolving power and Alpha will be used for both - alternatives. Using the same predicate for both alternatives isn't - very helpful, but this will not be detected with 1.33MR11. - - To properly handle this the predicate expression would have to be - evaluated for each distinct lookahead context. - - To determine whether two predicate expressions are identical is - difficult. The routine may fail to identify identical predicates. - - The #pred feature also compares predicates to see if a choice between - alternatives which is resolved by a predicate which makes the second - choice unreachable. Consider the following example: - - #pred A <>? - #pred B <>? - #pred A_or_B A || B - - r : s - | t - ; - s : <>? ID - ; - t : <>? ID - ; - - ---------------------------------------------------------------------------- - t11.g, line 5: warning: the predicate used to disambiguate the - first choice of rule r - (file t11.g alt 1 line 5 and alt 2 line 6) - appears to "cover" the second predicate when compared without context. - The second predicate may have no resolving power for some lookahead - sequences. - ---------------------------------------------------------------------------- - -#132. (Changed in 1.33MR11) Recognition of identical predicates in alts - - Prior to 1.33MR11, there would be no ambiguity warning when the - very same predicate was used to disambiguate both alternatives: - - test: ref B - | ref C - ; - - ref : <>? A - - In 1.33MR11 this will cause the warning: - - warning: the predicates used to disambiguate rule test - (file v98.g alt 1 line 1 and alt 2 line 2) - are identical and have no resolving power - - ----------------- Note ----------------- - - This is different than the following case - - test: <>? A B - | <>? A C - ; - - In this case there are two distinct predicates - which have exactly the same text. In the first - example there are two references to the same - predicate. The problem represented by this - grammar will be addressed later. - - -#127. (Changed in 1.33MR11) - - Count Syntax Errors Count DLG Errors - ------------------- ---------------- - - C++ mode ANTLRParser:: DLGLexerBase:: - syntaxErrCount lexErrCount - C mode zzSyntaxErrCount zzLexErrCount - - The C mode variables are global and initialized to 0. - They are *not* reset to 0 automatically when antlr is - restarted. - - The C++ mode variables are public. They are initialized - to 0 by the constructors. They are *not* reset to 0 by the - ANTLRParser::init() method. - - Suggested by Reinier van den Born (reinier@vnet.ibm.com). - -#126. (Changed in 1.33MR11) Addition of #first <<...>> - - The #first <<...>> inserts the specified text in the output - files before any other #include statements required by pccts. - The only things before the #first text are comments and - a #define ANTLR_VERSION. - - Requested by and Esa Pulkkinen (esap@cs.tut.fi) and Alexin - Zoltan (alexin@inf.u-szeged.hu). - -#124. A Note on the New "&&" Style Guarded Predicates - - I've been asked several times, "What is the difference between - the old "=>" style guard predicates and the new style "&&" guard - predicates, and how do you choose one over the other" ? - - The main difference is that the "=>" does not apply the - predicate if the context guard doesn't match, whereas - the && form always does. What is the significance ? - - If you have a predicate which is not on the "leading edge" - it is cannot be hoisted. Suppose you need a predicate that - looks at LA(2). You must introduce it manually. The - classic example is: - - castExpr : - LP typeName RP - | .... - ; - - typeName : <>? ID - | STRUCT ID - ; - - The problem is that isTypeName() isn't on the leading edge - of typeName, so it won't be hoisted into castExpr to help - make a decision on which production to choose. - - The *first* attempt to fix it is this: - - castExpr : - <>? - LP typeName RP - | .... - ; - - Unfortunately, this won't work because it ignores - the problem of STRUCT. The solution is to apply - isTypeName() in castExpr if LA(2) is an ID and - don't apply it when LA(2) is STRUCT: - - castExpr : - (LP ID)? => <>? - LP typeName RP - | .... - ; - - In conclusion, the "=>" style guarded predicate is - useful when: - - a. the tokens required for the predicate - are not on the leading edge - b. there are alternatives in the expression - selected by the predicate for which the - predicate is inappropriate - - If (b) were false, then one could use a simple - predicate (assuming "-prc on"): - - castExpr : - <>? - LP typeName RP - | .... - ; - - typeName : <>? ID - ; - - So, when do you use the "&&" style guarded predicate ? - - The new-style "&&" predicate should always be used with - predicate context. The context guard is in ADDITION to - the automatically computed context. Thus it useful for - predicates which depend on the token type for reasons - other than context. - - The following example is contributed by Reinier van den Born - (reinier@vnet.ibm.com). - - +-------------------------------------------------------------------------+ - | This grammar has two ways to call functions: | - | | - | - a "standard" call syntax with parens and comma separated args | - | - a shell command like syntax (no parens and spacing separated args) | - | | - | The former also allows a variable to hold the name of the function, | - | the latter can also be used to call external commands. | - | | - | The grammar (simplified) looks like this: | - | | - | fun_call : ID "(" { expr ("," expr)* } ")" | - | /* ID is function name */ | - | | "@" ID "(" { expr ("," expr)* } ")" | - | /* ID is var containing fun name */ | - | ; | - | | - | command : ID expr* /* ID is function name */ | - | | path expr* /* path is external command name */ | - | ; | - | | - | path : ID /* left out slashes and such */ | - | | "@" ID /* ID is environment var */ | - | ; | - | | - | expr : .... | - | | "(" expr ")"; | - | | - | call : fun_call | - | | command | - | ; | - | | - | Obviously the call is wildly ambiguous. This is more or less how this | - | is to be resolved: | - | | - | A call begins with an ID or an @ followed by an ID. | - | | - | If it is an ID and if it is an ext. command name -> command | - | if followed by a paren -> fun_call | - | otherwise -> command | - | | - | If it is an @ and if the ID is a var name -> fun_call | - | otherwise -> command | - | | - | One can implement these rules quite neatly using && predicates: | - | | - | call : ("@" ID)? && <>? fun_call | - | | (ID)? && <>? command | - | | (ID "(")? fun_call | - | | command | - | ; | - | | - | This can be done better, so it is not an ideal example, but it | - | conveys the principle. | - +-------------------------------------------------------------------------+ - -#122. (Changed in 1.33MR11) Member functions to reset DLG in C++ mode - - void DLGFileReset(FILE *f) { input = f; found_eof = 0; } - void DLGStringReset(DLGChar *s) { input = s; p = &input[0]; } - - Supplied by R.A. Nelson (cowboy@VNET.IBM.COM) - -#119. (Changed in 1.33MR11) Ambiguity aid for grammars - - The user can ask for additional information on ambiguities reported - by antlr to stdout. At the moment, only one ambiguity report can - be created in an antlr run. - - This feature is enabled using the "-aa" (Ambiguity Aid) option. - - The following options control the reporting of ambiguities: - - -aa ruleName Selects reporting by name of rule - -aa lineNumber Selects reporting by line number - (file name not compared) - - -aam Selects "multiple" reporting for a token - in the intersection set of the - alternatives. - - For instance, the token ID may appear dozens - of times in various paths as the program - explores the rules which are reachable from - the point of an ambiguity. With option -aam - every possible path the search program - encounters is reported. - - Without -aam only the first encounter is - reported. This may result in incomplete - information, but the information may be - sufficient and much shorter. - - -aad depth Selects the depth of the search. - The default value is 1. - - The number of paths to be searched, and the - size of the report can grow geometrically - with the -ck value if a full search for all - contributions to the source of the ambiguity - is explored. - - The depth represents the number of tokens - in the lookahead set which are matched against - the set of ambiguous tokens. A depth of 1 - means that the search stops when a lookahead - sequence of just one token is matched. - - A k=1 ck=6 grammar might generate 5,000 items - in a report if a full depth 6 search is made - with the Ambiguity Aid. The source of the - problem may be in the first token and obscured - by the volume of data - I hesitate to call - it information. - - When the user selects a depth > 1, the search - is first performed at depth=1 for both - alternatives, then depth=2 for both alternatives, - etc. - - Sample output for rule grammar in antlr.g itself: - - +---------------------------------------------------------------------+ - | Ambiguity Aid | - | | - | Choice 1: grammar/70 line 632 file a.g | - | Choice 2: grammar/82 line 644 file a.g | - | | - | Intersection of lookahead[1] sets: | - | | - | "\}" "class" "#errclass" "#tokclass" | - | | - | Choice:1 Depth:1 Group:1 ("#errclass") | - | 1 in (...)* block grammar/70 line 632 a.g | - | 2 to error grammar/73 line 635 a.g | - | 3 error error/1 line 894 a.g | - | 4 #token "#errclass" error/2 line 895 a.g | - | | - | Choice:1 Depth:1 Group:2 ("#tokclass") | - | 2 to tclass grammar/74 line 636 a.g | - | 3 tclass tclass/1 line 937 a.g | - | 4 #token "#tokclass" tclass/2 line 938 a.g | - | | - | Choice:1 Depth:1 Group:3 ("class") | - | 2 to class_def grammar/75 line 637 a.g | - | 3 class_def class_def/1 line 669 a.g | - | 4 #token "class" class_def/3 line 671 a.g | - | | - | Choice:1 Depth:1 Group:4 ("\}") | - | 2 #token "\}" grammar/76 line 638 a.g | - | | - | Choice:2 Depth:1 Group:5 ("#errclass") | - | 1 in (...)* block grammar/83 line 645 a.g | - | 2 to error grammar/93 line 655 a.g | - | 3 error error/1 line 894 a.g | - | 4 #token "#errclass" error/2 line 895 a.g | - | | - | Choice:2 Depth:1 Group:6 ("#tokclass") | - | 2 to tclass grammar/94 line 656 a.g | - | 3 tclass tclass/1 line 937 a.g | - | 4 #token "#tokclass" tclass/2 line 938 a.g | - | | - | Choice:2 Depth:1 Group:7 ("class") | - | 2 to class_def grammar/95 line 657 a.g | - | 3 class_def class_def/1 line 669 a.g | - | 4 #token "class" class_def/3 line 671 a.g | - | | - | Choice:2 Depth:1 Group:8 ("\}") | - | 2 #token "\}" grammar/96 line 658 a.g | - +---------------------------------------------------------------------+ - - For a linear lookahead set ambiguity (where k=1 or for k>1 but - when all lookahead sets [i] with i>? A ; - c : A ; - - Prior to 1.33MR10 the code generated for "start" would resemble: - - while { - if (LA(1)==A && - (!LA(1)==A || isUpper())) { - a(); - } - }; - - This code is wrong because it makes rule "c" unreachable from - "start". The essence of the problem is that antlr fails to - recognize that there can be a valid alternative within "a" even - when the predicate <>? is false. - - In 1.33MR10 with -mrhoist the hoisting of the predicate into - "start" is suppressed because it recognizes that "c" can - cover all the cases where the predicate is false: - - while { - if (LA(1)==A) { - a(); - } - }; - - With the antlr "-info p" switch the user will receive information - about the predicate suppression in the generated file: - - -------------------------------------------------------------- - #if 0 - - Hoisting of predicate suppressed by alternative without predicate. - The alt without the predicate includes all cases where - the predicate is false. - - WITH predicate: line 7 v1.g - WITHOUT predicate: line 7 v1.g - - The context set for the predicate: - - A - - The lookahead set for the alt WITHOUT the semantic predicate: - - A - - The predicate: - - pred << isUpper(LATEXT(1))>>? - depth=k=1 rule b line 9 v1.g - set context: - A - tree context: null - - Chain of referenced rules: - - #0 in rule start (line 5 v1.g) to rule a - #1 in rule a (line 7 v1.g) - - #endif - -------------------------------------------------------------- - - A predicate can be suppressed by a combination of alternatives - which, taken together, cover a predicate: - - start : (a)* "@" ; - - a : b | ca | cb | cc ; - - b : <>? ( A | B | C ) ; - - ca : A ; - cb : B ; - cc : C ; - - Consider a more complex example in which "c" covers only part of - a predicate: - - start : (a)* "@" ; - - a : b - | c - ; - - b : <>? - ( A - | X - ); - - c : A - ; - - Prior to 1.33MR10 the code generated for "start" would resemble: - - while { - if ( (LA(1)==A || LA(1)==X) && - (! (LA(1)==A || LA(1)==X) || isUpper()) { - a(); - } - }; - - With 1.33MR10 and -mrhoist the predicate context is restricted to - the non-covered lookahead. The code resembles: - - while { - if ( (LA(1)==A || LA(1)==X) && - (! (LA(1)==X) || isUpper()) { - a(); - } - }; - - With the antlr "-info p" switch the user will receive information - about the predicate restriction in the generated file: - - -------------------------------------------------------------- - #if 0 - - Restricting the context of a predicate because of overlap - in the lookahead set between the alternative with the - semantic predicate and one without - Without this restriction the alternative without the predicate - could not be reached when input matched the context of the - predicate and the predicate was false. - - WITH predicate: line 11 v4.g - WITHOUT predicate: line 12 v4.g - - The original context set for the predicate: - - A X - - The lookahead set for the alt WITHOUT the semantic predicate: - - A - - The intersection of the two sets - - A - - The original predicate: - - pred << isUpper(LATEXT(1))>>? - depth=k=1 rule b line 15 v4.g - set context: - A X - tree context: null - - The new (modified) form of the predicate: - - pred << isUpper(LATEXT(1))>>? - depth=k=1 rule b line 15 v4.g - set context: - X - tree context: null - - #endif - -------------------------------------------------------------- - - The bad news about -mrhoist: - - (a) -mrhoist does not analyze predicates with lookahead - depth > 1. - - (b) -mrhoist does not look past a guarded predicate to - find context which might cover other predicates. - - For these cases you might want to use syntactic predicates. - When a semantic predicate fails during guess mode the guess - fails and the next alternative is tried. - - Limitation (a) is illustrated by the following example: - - start : (stmt)* EOF ; - - stmt : cast - | expr - ; - cast : <>? LP ID RP ; - - expr : LP ID RP ; - - This is not much different from the first example, except that - it requires two tokens of lookahead context to determine what - to do. This predicate is NOT suppressed because the current version - is unable to handle predicates with depth > 1. - - A predicate can be combined with other predicates during hoisting. - In those cases the depth=1 predicates are still handled. Thus, - in the following example the isUpper() predicate will be suppressed - by line #4 when hoisted from "bizarre" into "start", but will still - be present in "bizarre" in order to predict "stmt". - - start : (bizarre)* EOF ; // #1 - // #2 - bizarre : stmt // #3 - | A // #4 - ; - - stmt : cast - | expr - ; - - cast : <>? LP ID RP ; - - expr : LP ID RP ; - | <>? A - - Limitation (b) is illustrated by the following example of a - context guarded predicate: - - rule : (A)? <

>? // #1 - (A // #2 - |B // #3 - ) // #4 - | <> B // #5 - ; - - Recall that this means that when the lookahead is NOT A then - the predicate "p" is ignored and it attempts to match "A|B". - Ideally, the "B" at line #3 should suppress predicate "q". - However, the current version does not attempt to look past - the guard predicate to find context which might suppress other - predicates. - - In some cases -mrhoist will lead to the reporting of ambiguities - which were not visible before: - - start : (a)* "@"; - a : bc | d; - bc : b | c ; - - b : <>? A; - c : A ; - - d : A ; - - In this case there is a true ambiguity in "a" between "bc" and "d" - which can both match "A". Without -mrhoist the predicate in "b" - is hoisted into "a" and there is no ambiguity reported. However, - with -mrhoist, the predicate in "b" is suppressed by "c" (as it - should be) making the ambiguity in "a" apparent. - - The motivations for these changes were hoisting problems reported - by Reinier van den Born (reinier@vnet.ibm.com) and several others. - -#113. (Changed in 1.33MR10) new context guarded pred: (g)? && <

>? expr - - The existing context guarded predicate: - - rule : (guard)? => <

>? expr - | next_alternative - ; - - generates code which resembles: - - if (lookahead(expr) && (!guard || pred)) { - expr() - } else .... - - This is not suitable for some applications because it allows - expr() to be invoked when the predicate is false. This is - intentional because it is meant to mimic automatically computed - predicate context. - - The new context guarded predicate uses the guard information - differently because it has a different goal. Consider: - - rule : (guard)? && <

>? expr - | next_alternative - ; - - The new style of context guarded predicate is equivalent to: - - rule : <>? expr - | next_alternative - ; - - It generates code which resembles: - - if (lookahead(expr) && guard && pred) { - expr(); - } else ... - - Both forms of guarded predicates severely restrict the form of - the context guard: it can contain no rule references, no - (...)*, no (...)+, and no {...}. It may contain token and - token class references, and alternation ("|"). - - Addition for 1.33MR11: in the token expression all tokens must - be at the same height of the token tree: - - (A ( B | C))? && ... is ok (all height 2) - (A ( B | ))? && ... is not ok (some 1, some 2) - (A B C D | E F G H)? && ... is ok (all height 4) - (A B C D | E )? && ... is not ok (some 4, some 1) - - This restriction is required in order to properly compute the lookahead - set for expressions like: - - rule1 : (A B C)? && <>? rule2 ; - rule2 : (A|X) (B|Y) (C|Z); - - This addition was suggested by Rienier van den Born (reinier@vnet.ibm.com) - -#109. (Changed in 1.33MR10) improved trace information - - The quality of the trace information provided by the "-gd" - switch has been improved significantly. Here is an example - of the output from a test program. It shows the rule name, - the first token of lookahead, the call depth, and the guess - status: - - exit rule gusxx {"?"} depth 2 - enter rule gusxx {"?"} depth 2 - enter rule gus1 {"o"} depth 3 guessing - guess done - returning to rule gus1 {"o"} at depth 3 - (guess mode continues - an enclosing guess is still active) - guess done - returning to rule gus1 {"Z"} at depth 3 - (guess mode continues - an enclosing guess is still active) - exit rule gus1 {"Z"} depth 3 guessing - guess done - returning to rule gusxx {"o"} at depth 2 (guess mode ends) - enter rule gus1 {"o"} depth 3 - guess done - returning to rule gus1 {"o"} at depth 3 (guess mode ends) - guess done - returning to rule gus1 {"Z"} at depth 3 (guess mode ends) - exit rule gus1 {"Z"} depth 3 - line 1: syntax error at "Z" missing SC - ... - - Rule trace reporting is controlled by the value of the integer - [zz]traceOptionValue: when it is positive tracing is enabled, - otherwise it is disabled. Tracing during guess mode is controlled - by the value of the integer [zz]traceGuessOptionValue. When - it is positive AND [zz]traceOptionValue is positive rule trace - is reported in guess mode. - - The values of [zz]traceOptionValue and [zz]traceGuessOptionValue - can be adjusted by subroutine calls listed below. - - Depending on the presence or absence of the antlr -gd switch - the variable [zz]traceOptionValueDefault is set to 0 or 1. When - the parser is initialized or [zz]traceReset() is called the - value of [zz]traceOptionValueDefault is copied to [zz]traceOptionValue. - The value of [zz]traceGuessOptionValue is always initialzed to 1, - but, as noted earlier, nothing will be reported unless - [zz]traceOptionValue is also positive. - - When the parser state is saved/restored the value of the trace - variables are also saved/restored. If a restore causes a change in - reporting behavior from on to off or vice versa this will be reported. - - When the -gd option is selected, the macro "#define zzTRACE_RULES" - is added to appropriate output files. - - C++ mode - -------- - int traceOption(int delta) - int traceGuessOption(int delta) - void traceReset() - int traceOptionValueDefault - - C mode - -------- - int zzTraceOption(int delta) - int zzTraceGuessOption(int delta) - void zzTraceReset() - int zzTraceOptionValueDefault - - The argument "delta" is added to the traceOptionValue. To - turn on trace when inside a particular rule one: - - rule : <> - ( - rest-of-rule - ) - <> - ; /* fail clause */ <> - - One can use the same idea to turn *off* tracing within a - rule by using a delta of (-1). - - An improvement in the rule trace was suggested by Sramji - Ramanathan (ps@kumaran.com). - -#108. A Note on Deallocation of Variables Allocated in Guess Mode - - NOTE - ------------------------------------------------------ - This mechanism only works for heap allocated variables - ------------------------------------------------------ - - The rewrite of the trace provides the machinery necessary - to properly free variables or undo actions following a - failed guess. - - The macro zzUSER_GUESS_HOOK(guessSeq,zzrv) is expanded - as part of the zzGUESS macro. When a guess is opened - the value of zzrv is 0. When a longjmp() is executed to - undo the guess, the value of zzrv will be 1. - - The macro zzUSER_GUESS_DONE_HOOK(guessSeq) is expanded - as part of the zzGUESS_DONE macro. This is executed - whether the guess succeeds or fails as part of closing - the guess. - - The guessSeq is a sequence number which is assigned to each - guess and is incremented by 1 for each guess which becomes - active. It is needed by the user to associate the start of - a guess with the failure and/or completion (closing) of a - guess. - - Guesses are nested. They must be closed in the reverse - of the order that they are opened. - - In order to free memory used by a variable during a guess - a user must write a routine which can be called to - register the variable along with the current guess sequence - number provided by the zzUSER_GUESS_HOOK macro. If the guess - fails, all variables tagged with the corresponding guess - sequence number should be released. This is ugly, but - it would require a major rewrite of antlr 1.33 to use - some mechanism other than setjmp()/longjmp(). - - The order of calls for a *successful* guess would be: - - zzUSER_GUESS_HOOK(guessSeq,0); - zzUSER_GUESS_DONE_HOOK(guessSeq); - - The order of calls for a *failed* guess would be: - - zzUSER_GUESS_HOOK(guessSeq,0); - zzUSER_GUESS_HOOK(guessSeq,1); - zzUSER_GUESS_DONE_HOOK(guessSeq); - - The default definitions of these macros are empty strings. - - Here is an example in C++ mode. The zzUSER_GUESS_HOOK and - zzUSER_GUESS_DONE_HOOK macros and myGuessHook() routine - can be used without change in both C and C++ versions. - - ---------------------------------------------------------------------- - << - - #include "AToken.h" - - typedef ANTLRCommonToken ANTLRToken; - - #include "DLGLexer.h" - - int main() { - - { - DLGFileInput in(stdin); - DLGLexer lexer(&in,2000); - ANTLRTokenBuffer pipe(&lexer,1); - ANTLRCommonToken aToken; - P parser(&pipe); - - lexer.setToken(&aToken); - parser.init(); - parser.start(); - }; - - fclose(stdin); - fclose(stdout); - return 0; - } - - >> - - << - char *s=NULL; - - #undef zzUSER_GUESS_HOOK - #define zzUSER_GUESS_HOOK(guessSeq,zzrv) myGuessHook(guessSeq,zzrv); - #undef zzUSER_GUESS_DONE_HOOK - #define zzUSER_GUESS_DONE_HOOK(guessSeq) myGuessHook(guessSeq,2); - - void myGuessHook(int guessSeq,int zzrv) { - if (zzrv == 0) { - fprintf(stderr,"User hook: starting guess #%d\n",guessSeq); - } else if (zzrv == 1) { - free (s); - s=NULL; - fprintf(stderr,"User hook: failed guess #%d\n",guessSeq); - } else if (zzrv == 2) { - free (s); - s=NULL; - fprintf(stderr,"User hook: ending guess #%d\n",guessSeq); - }; - } - - >> - - #token A "a" - #token "[\t \ \n]" <> - - class P { - - start : (top)+ - ; - - top : (which) ? <> - | other <> - ; <> - - which : which2 - ; - - which2 : which3 - ; - which3 - : (label)? <> - | (global)? <> - | (exclamation)? <> - ; - - label : <getText());>> A ":" ; - - global : <getText());>> A "::" ; - - exclamation : <getText());>> A "!" ; - - other : <getText());>> "other" ; - - } - ---------------------------------------------------------------------- - - This is a silly example, but illustrates the idea. For the input - "a ::" with tracing enabled the output begins: - - ---------------------------------------------------------------------- - enter rule "start" depth 1 - enter rule "top" depth 2 - User hook: starting guess #1 - enter rule "which" depth 3 guessing - enter rule "which2" depth 4 guessing - enter rule "which3" depth 5 guessing - User hook: starting guess #2 - enter rule "label" depth 6 guessing - guess failed - User hook: failed guess #2 - guess done - returning to rule "which3" at depth 5 (guess mode continues - - an enclosing guess is still active) - User hook: ending guess #2 - User hook: starting guess #3 - enter rule "global" depth 6 guessing - exit rule "global" depth 6 guessing - guess done - returning to rule "which3" at depth 5 (guess mode continues - - an enclosing guess is still active) - User hook: ending guess #3 - enter rule "global" depth 6 guessing - exit rule "global" depth 6 guessing - exit rule "which3" depth 5 guessing - exit rule "which2" depth 4 guessing - exit rule "which" depth 3 guessing - guess done - returning to rule "top" at depth 2 (guess mode ends) - User hook: ending guess #1 - enter rule "which" depth 3 - ..... - ---------------------------------------------------------------------- - - Remember: - - (a) Only init-actions are executed during guess mode. - (b) A rule can be invoked multiple times during guess mode. - (c) If the guess succeeds the rule will be called once more - without guess mode so that normal actions will be executed. - This means that the init-action might need to distinguish - between guess mode and non-guess mode using the variable - [zz]guessing. - -#101. (Changed in 1.33MR10) antlr -info command line switch - - -info - - p - extra predicate information in generated file - - t - information about tnode use: - at the end of each rule in generated file - summary on stderr at end of program - - m - monitor progress - prints name of each rule as it is started - flushes output at start of each rule - - f - first/follow set information to stdout - - 0 - no operation (added in 1.33MR11) - - The options may be combined and may appear in any order. - For example: - - antlr -info ptm -CC -gt -mrhoist on mygrammar.g - -#100a. (Changed in 1.33MR10) Predicate tree simplification - - When the same predicates can be referenced in more than one - alternative of a block large predicate trees can be formed. - - The difference that these optimizations make is so dramatic - that I have decided to use it even when -mrhoist is not selected. - - Consider the following grammar: - - start : ( all )* ; - - all : a - | d - | e - | f - ; - - a : c A B - | c A C - ; - - c : <>? - ; - - d : <>? B C - ; - - e : <>? B C - ; - - f : e X Y - ; - - In rule "a" there is a reference to rule "c" in both alternatives. - The length of the predicate AAA is k=2 and it can be followed in - alternative 1 only by (A B) while in alternative 2 it can be - followed only by (A C). Thus they do not have identical context. - - In rule "all" the alternatives which refer to rules "e" and "f" allow - elimination of the duplicate reference to predicate CCC. - - The table below summarized the kind of simplification performed by - 1.33MR10. In the table, X and Y stand for single predicates - (not trees). - - (OR X (OR Y (OR Z))) => (OR X Y Z) - (AND X (AND Y (AND Z))) => (AND X Y Z) - - (OR X (... (OR X Y) ... )) => (OR X (... Y ... )) - (AND X (... (AND X Y) ... )) => (AND X (... Y ... )) - (OR X (... (AND X Y) ... )) => (OR X (... ... )) - (AND X (... (OR X Y) ... )) => (AND X (... ... )) - - (AND X) => X - (OR X) => X - - In a test with a complex grammar for a real application, a predicate - tree with six OR nodes and 12 leaves was reduced to "(OR X Y Z)". - - In 1.33MR10 there is a greater effort to release memory used - by predicates once they are no longer in use. - -#100b. (Changed in 1.33MR10) Suppression of extra predicate tests - - The following optimizations require that -mrhoist be selected. - - It is relatively easy to optimize the code generated for predicate - gates when they are of the form: - - (AND X Y Z ...) - or (OR X Y Z ...) - - where X, Y, Z, and "..." represent individual predicates (leaves) not - predicate trees. - - If the predicate is an AND the contexts of the X, Y, Z, etc. are - ANDed together to create a single Tree context for the group and - context tests for the individual predicates are suppressed: - - -------------------------------------------------- - Note: This was incorrect. The contexts should be - ORed together. This has been fixed. A more - complete description is available in item #152. - --------------------------------------------------- - - Optimization 1: (AND X Y Z ...) - - Suppose the context for Xtest is LA(1)==LP and the context for - Ytest is LA(1)==LP && LA(2)==ID. - - Without the optimization the code would resemble: - - if (lookaheadContext && - !(LA(1)==LP && LA(1)==LP && LA(2)==ID) || - ( (! LA(1)==LP || Xtest) && - (! (LA(1)==LP || LA(2)==ID) || Xtest) - )) {... - - With the -mrhoist optimization the code would resemble: - - if (lookaheadContext && - ! (LA(1)==LP && LA(2)==ID) || (Xtest && Ytest) {... - - Optimization 2: (OR X Y Z ...) with identical contexts - - Suppose the context for Xtest is LA(1)==ID and for Ytest - the context is also LA(1)==ID. - - Without the optimization the code would resemble: - - if (lookaheadContext && - ! (LA(1)==ID || LA(1)==ID) || - (LA(1)==ID && Xtest) || - (LA(1)==ID && Ytest) {... - - With the -mrhoist optimization the code would resemble: - - if (lookaheadContext && - (! LA(1)==ID) || (Xtest || Ytest) {... - - Optimization 3: (OR X Y Z ...) with distinct contexts - - Suppose the context for Xtest is LA(1)==ID and for Ytest - the context is LA(1)==LP. - - Without the optimization the code would resemble: - - if (lookaheadContext && - ! (LA(1)==ID || LA(1)==LP) || - (LA(1)==ID && Xtest) || - (LA(1)==LP && Ytest) {... - - With the -mrhoist optimization the code would resemble: - - if (lookaheadContext && - (zzpf=0, - (LA(1)==ID && (zzpf=1) && Xtest) || - (LA(1)==LP && (zzpf=1) && Ytest) || - !zzpf) { - - These may appear to be of similar complexity at first, - but the non-optimized version contains two tests of each - context while the optimized version contains only one - such test, as well as eliminating some of the inverted - logic (" !(...) || "). - - Optimization 4: Computation of predicate gate trees - - When generating code for the gates of predicate expressions - antlr 1.33 vanilla uses a recursive procedure to generate - "&&" and "||" expressions for testing the lookahead. As each - layer of the predicate tree is exposed a new set of "&&" and - "||" expressions on the lookahead are generated. In many - cases the lookahead being tested has already been tested. - - With -mrhoist a lookahead tree is computed for the entire - lookahead expression. This means that predicates with identical - context or context which is a subset of another predicate's - context disappear. - - This is especially important for predicates formed by rules - like the following: - - uppperCaseVowel : <>? vowel; - vowel: : <>? LETTERS; - - These predicates are combined using AND since both must be - satisfied for rule upperCaseVowel. They have identical - context which makes this optimization very effective. - - The affect of Items #100a and #100b together can be dramatic. In - a very large (but real world) grammar one particular predicate - expression was reduced from an (unreadable) 50 predicate leaves, - 195 LA(1) terms, and 5500 characters to an (easily comprehensible) - 3 predicate leaves (all different) and a *single* LA(1) term. - -#98. (Changed in 1.33MR10) Option "-info p" - - When the user selects option "-info p" the program will generate - detailed information about predicates. If the user selects - "-mrhoist on" additional detail will be provided explaining - the promotion and suppression of predicates. The output is part - of the generated file and sandwiched between #if 0/#endif statements. - - Consider the following k=1 grammar: - - start : ( all ) * ; - - all : ( a - | b - ) - ; - - a : c B - ; - - c : <>? - | B - ; - - b : <>? X - ; - - Below is an excerpt of the output for rule "start" for the three - predicate options (off, on, and maintenance release style hoisting). - - For those who do not wish to use the "-mrhoist on" option for code - generation the option can be used in a "diagnostic" mode to provide - valuable information: - - a. where one should insert null actions to inhibit hoisting - b. a chain of rule references which shows where predicates are - being hoisted - - ====================================================================== - Example of "-info p" with "-mrhoist on" - ====================================================================== - #if 0 - - Hoisting of predicate suppressed by alternative without predicate. - The alt without the predicate includes all cases where the - predicate is false. - - WITH predicate: line 11 v36.g - WITHOUT predicate: line 12 v36.g - - The context set for the predicate: - - B - - The lookahead set for alt WITHOUT the semantic predicate: - - B - - The predicate: - - pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g - - set context: - B - tree context: null - - Chain of referenced rules: - - #0 in rule start (line 1 v36.g) to rule all - #1 in rule all (line 3 v36.g) to rule a - #2 in rule a (line 8 v36.g) to rule c - #3 in rule c (line 11 v36.g) - - #endif - && - #if 0 - - pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g - - set context: - X - tree context: null - - #endif - ====================================================================== - Example of "-info p" with the default -prc setting ( "-prc off") - ====================================================================== - #if 0 - - OR - pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g - - set context: - nil - tree context: null - - pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g - - set context: - nil - tree context: null - - #endif - ====================================================================== - Example of "-info p" with "-prc on" and "-mrhoist off" - ====================================================================== - #if 0 - - OR - pred << LATEXT(1)>>? depth=k=1 rule c line 11 v36.g - - set context: - B - tree context: null - - pred << LATEXT(1)>>? depth=k=1 rule b line 15 v36.g - - set context: - X - tree context: null - - #endif - ====================================================================== - -#60. (Changed in 1.33MR7) Major changes to exception handling - - There were significant problems in the handling of exceptions - in 1.33 vanilla. The general problem is that it can only - process one level of exception handler. For example, a named - exception handler, an exception handler for an alternative, or - an exception for a subrule always went to the rule's exception - handler if there was no "catch" which matched the exception. - - In 1.33MR7 the exception handlers properly "nest". If an - exception handler does not have a matching "catch" then the - nextmost outer exception handler is checked for an appropriate - "catch" clause, and so on until an exception handler with an - appropriate "catch" is found. - - There are still undesirable features in the way exception - handlers are implemented, but I do not have time to fix them - at the moment: - - The exception handlers for alternatives are outside the - block containing the alternative. This makes it impossible - to access variables declared in a block or to resume the - parse by "falling through". The parse can still be easily - resumed in other ways, but not in the most natural fashion. - - This results in an inconsistentcy between named exception - handlers and exception handlers for alternatives. When - an exception handler for an alternative "falls through" - it goes to the nextmost outer handler - not the "normal - action". - - A major difference between 1.33MR7 and 1.33 vanilla is - the default action after an exception is caught: - - 1.33 Vanilla - ------------ - In 1.33 vanilla the signal value is set to zero ("NoSignal") - and the code drops through to the code following the exception. - For named exception handlers this is the "normal action". - For alternative exception handlers this is the rule's handler. - - 1.33MR7 - ------- - In 1.33MR7 the signal value is NOT automatically set to zero. - - There are two cases: - - For named exception handlers: if the signal value has been - set to zero the code drops through to the "normal action". - - For all other cases the code branches to the nextmost outer - exception handler until it reaches the handler for the rule. - - The following macros have been defined for convenience: - - C/C++ Mode Name - -------------------- - (zz)suppressSignal - set signal & return signal arg to 0 ("NoSignal") - (zz)setSignal(intValue) - set signal & return signal arg to some value - (zz)exportSignal - copy the signal value to the return signal arg - - I'm not sure why PCCTS make a distinction between the local - signal value and the return signal argument, but I'm loathe - to change the code. The burden of copying the local signal - value to the return signal argument can be given to the - default signal handler, I suppose. - -#53. (Explanation for 1.33MR6) What happens after an exception is caught ? - - The Book is silent about what happens after an exception - is caught. - - The following code fragment prints "Error Action" followed - by "Normal Action". - - test : Word ex:Number <> - exception[ex] - catch NoViableAlt: - <> - ; - - The reason for "Normal Action" is that the normal flow of the - program after a user-written exception handler is to "drop through". - In the case of an exception handler for a rule this results in - the exection of a "return" statement. In the case of an - exception handler attached to an alternative, rule, or token - this is the code that would have executed had there been no - exception. - - The user can achieve the desired result by using a "return" - statement. - - test : Word ex:Number <> - exception[ex] - catch NoViableAlt: - <> - ; - - The most powerful mechanism for recovery from parse errors - in pccts is syntactic predicates because they provide - backtracking. Exceptions allow "return", "break", - "consumeUntil(...)", "goto _handler", "goto _fail", and - changing the _signal value. - -#41. (Added in 1.33MR6) antlr -stdout - - Using "antlr -stdout ..." forces the text that would - normally go to the grammar.c or grammar.cpp file to - stdout. - -#40. (Added in 1.33MR6) antlr -tab to change tab stops - - Using "antlr -tab number ..." changes the tab stops - for the grammar.c or grammar.cpp file. The number - must be between 0 and 8. Using 0 gives tab characters, - values between 1 and 8 give the appropriate number of - space characters. - -#34. (Added to 1.33MR1) Add public DLGLexerBase::set_line(int newValue) - - Previously there was no public function for changing the line - number maintained by the lexer. - -#28. (Added to 1.33MR1) More control over DLG header - - Version 1.33MR1 adds the following directives to PCCTS - for C++ mode: - - #lexprefix <> - - Adds source code to the DLGLexer.h file - after the #include "DLexerBase.h" but - before the start of the class definition. - - #lexmember <> - - Adds source code to the DLGLexer.h file - as part of the DLGLexer class body. It - appears immediately after the start of - the class and a "public: statement. - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/antlr.icc b/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/antlr.icc deleted file mode 100644 index e52db9778..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/antlr.icc +++ /dev/null @@ -1,20 +0,0 @@ -option ProjectOptions = - define("USER_ZZSYN", ), - define("__USE_PROTOS", ), - incl(searchpath, "..\\h"), - incl(searchpath, "..\\support\\set"), - link(pmtype, vio) -{ - target "..\\bin\\antlr.exe" - { - option incl(searchpath, "..\\antlr") { source type("c") - "antlr.c","bits.c","build.c","dumpcycles.c", - "dumpnode.c","egman.c","main.c","err.c", - "fcache.c","fset.c","fset2.c","gen.c", - "globals.c","hash.c","lex.c","main.c", - "misc.c","mrhoist.c","pred.c","scan.c"} - - option incl(searchpath, "..\\support\\set") source type("c") - "set.c" - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/dlg.icc b/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/dlg.icc deleted file mode 100644 index fd7a8d18d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/dlg.icc +++ /dev/null @@ -1,22 +0,0 @@ -option ProjectOptions = - define("USER_ZZSYN", ), - define("__USE_PROTOS", ), - incl(searchpath, "..\\h"), - incl(searchpath, "..\\support\\set"), - link(pmtype, vio) -{ - target "..\\bin\\dlg.exe" - { - source type("c") - "..\\dlg\\automata.c", - "..\\dlg\\dlg_a.c", - "..\\dlg\\dlg_p.c", - "..\\dlg\\err.c", - "..\\dlg\\main.c", - "..\\dlg\\output.c", - "..\\dlg\\relabel.c", - "..\\dlg\\support.c", - - "..\\support\\set\\set.c" - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/sorcerer.icc b/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/sorcerer.icc deleted file mode 100644 index 241cf6c12..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/IBM_VISUAL_AGE_PROJECTS/sorcerer.icc +++ /dev/null @@ -1,21 +0,0 @@ -0ption ProjectOptions = - define("__USE_PROTOS", ), - incl(searchpath, "..\\sorcerer\\h"), - incl(searchpath, "..\\h"), - incl(searchpath, "..\\support\\set"), - link(pmtype, vio) -{ - target "..\\bin\\sorcerer.exe" - { - option incl(searchpath, "..\\sorcerer") { - source type("c") - -'sor.c','scan.c','err.c','main.c','globals.c','gen.c','hash.c','look.c','cpp.c' - } - - option incl(searchpath, "..\\support\\set") { - source type("c") - "set.c" - } - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/KNOWN_PROBLEMS.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/KNOWN_PROBLEMS.txt deleted file mode 100644 index c5c21b4db..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/KNOWN_PROBLEMS.txt +++ /dev/null @@ -1,241 +0,0 @@ - - ======================================================= - Known Problems In PCCTS - Last revised 14 November 1998 - ======================================================= - -#17. The dlg fix for handling characters up to 255 is incorrect. - - See item #207. - - Reported by Frank Hartmann. - -#16. A note about "&&" predicates (Mike Dimmick) - - Mike Dimmick has pointed out a potential pitfall in the use of the - "&&" style predicate. Consider: - - r0: (g)? => <

>? r1 - | ... - ; - r1: A | B; - - If the context guard g is not a subset of the lookahead context for r1 - (in other words g is neither A nor B) then the code may execute r1 - even when the lookahead context is not satisfied. This is an error - by the person coding the grammer, and the error should be reported to - the user, but it isn't. expect. Some examples I've run seem to - indicate that such an error actually results in the rule becoming - unreachable. - - When g is properly coded the code is correct, the problem is when g - is not properly coded. - - A second problem reported by Mike Dimmick is that the test for a - failed validation predicate is equivalent to a test on the predicate - along. In other words, if the "&&" has not been hoisted then it may - falsely report a validation error. - -#15. (Changed in MR23) Warning for LT(i), LATEXT(i) in token match actions - - An bug (or at least an oddity) is that a reference to LT(1), LA(1), - or LATEXT(1) in an action which immediately follows a token match - in a rule refers to the token matched, not the token which is in - the lookahead buffer. Consider: - - r : abc <> D <> E; - - In this case LT(1) in action alpha will refer to the next token in - the lookahead buffer ("D"), but LT(1) in action beta will refer to - the token matched by D - the preceding token. - - A warning has been added which warns users about this when an action - following a token match contains a reference to LT(1), LA(1), or LATEXT(1). - - This behavior should be changed, but it appears in too many programs - now. Another problem, perhaps more significant, is that the obvious - fix (moving the consume() call to before the action) could change the - order in which input is requested and output appears in existing programs. - - This problem was reported, along with a fix by Benjamin Mandel - (beny@sd.co.il). However, I felt that changing the behavior was too - dangerous for existing code. - -#14. Parsing bug in dlg - - THM: I have been unable to reproduce this problem. - - Reported by Rick Howard Mijenix Corporation (rickh@mijenix.com). - - The regular expression parser (in rexpr.c) fails while - trying to parse the following regular expression: - - {[a-zA-Z]:}(\\\\[a-zA-Z0-9]*)+ - - See my comment in the following excerpt from rexpr.c: - - /* - * ::= ( '|' {} )* - * - * Return -1 if syntax error - * Return 0 if none found - * Return 1 if a regExrp was found - */ - static - regExpr(g) - GraphPtr g; - { - Graph g1, g2; - - if ( andExpr(&g1) == -1 ) - { - return -1; - } - - while ( token == '|' ) - { - int a; - next(); - a = andExpr(&g2); - if ( a == -1 ) return -1; /* syntax error below */ - else if ( !a ) return 1; /* empty alternative */ - g1 = BuildNFA_AorB(g1, g2); - } - - if ( token!='\0' ) return -1; - ***** - ***** It appears to fail here becuause token is 125 - the closing '}' - ***** If I change it to: - ***** if ( token!='\0' && token!='}' && token!= ')' ) return -1; - ***** - ***** It succeeds, but I'm not sure this is the corrrect approach. - ***** - *g = g1; - return 1; - } - -#13. dlg reports an invalid range for: [\0x00-\0xff] - - Diagnosed by Piotr Eljasiak (eljasiak@no-spam.zt.gdansk.tpsa.pl): - - Fixed in MR16. - -#12. Strings containing comment actions - - Sequences that looked like C style comments appearing in string - literals are improperly parsed by antlr/dlg. - - << fprintf(out," /* obsolete */ "); - - For this case use: - - << fprintf(out," \/\* obsolete \*\/ "); - - Reported by K.J. Cummings (cummings@peritus.com). - -#11. User hook for deallocation of variables on guess fail - - The mechanism outlined in Item #108 works only for - heap allocated variables. - -#10. Label re-initialization in ( X {y:Y} )* - - If a label assignment is optional and appears in a - (...)* or (...)+ block it will not be reset to NULL - when it is skipped by a subsequent iteration. - - Consider the example: - - ( X { y:Y })* Z - - with input: - - X Y X Z - - The first time through the block Y will be matched and - y will be set to point to the token. On the second - iteration of the (...)* block there is no match for Y. - But y will not be reset to NULL, as the user might - expect, it will contain a reference to the Y that was - matched in the first iteration. - - The work-around is to manually reset y: - - ( X << y = NULL; >> { y:Y } )* Z - - or - - ( X ( y:Y | << y = NULL; >> /* epsilon */ ) )* Z - - Reported by Jeff Vincent (JVincent@novell.com). - -#9. PCCTAST.h PCCTSAST::setType() is a noop - -#8. #tokdefs with ~Token and . - - THM: I have been unable to reproduce this problem. - - When antlr uses #tokdefs to define tokens the fields of - #errclass and #tokclass do not get properly defined. - When it subsequently attempts to take the complement of - the set of tokens (using ~Token or .) it can refer to - tokens which don't have names, generating a fatal error. - -#7. DLG crashes on some invalid inputs - - THM: In MR20 have fixed the most common cases. - - The following token defintion will cause DLG to crash. - - #token "()" - - Reported by Mengue Olivier (dolmen@bigfoot.com). - -#6. On MS systems \n\r is treated as two new lines - - Fixed. - -#5. Token expressions in #tokclass - - #errclass does not support TOK1..TOK2 or ~TOK syntax. - #tokclass does not support ~TOKEN syntax - - A workaround for #errclass TOK1..TOK2 is to use a - #tokclass. - - Reported by Dave Watola (dwatola@amtsun.jpl.nasa.gov) - -#4. A #tokdef must appear "early" in the grammar file. - - The "early" section of the grammar file is the only - place where the following directives may appear: - - #header - #first - #tokdefs - #parser - - Any other kind of statement signifiies the end of the - "early" section. - -#3. Use of PURIFY macro for C++ mode - - Item #93 of the CHANGES_FROM_1.33 describes the use of - the PURIFY macro to zero arguments to be passed by - upward inheritance. - - #define PURIFY(r, s) memset((char *) &(r), '\0', (s)); - - This may not be the right thing to do for C++ objects that - have constructors. Reported by Bonny Rais (bonny@werple.net.au). - - For those cases one should #define PURIFY to be an empty macro - in the #header or #first actions. - -#2. Fixed in 1.33MR10 - See CHANGES_FROM_1.33 Item #80. - -#1. The quality of support for systems with 8.3 file names leaves - much to be desired. Since the kit is distributed using the - long file names and the make file uses long file names it requires - some effort to generate. This will probably not be changed due - to the large number of systems already written using the long - file names. diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/MPW_Read_Me b/c/makeotf/makeotf_lib/build/hotpccts/pccts/MPW_Read_Me deleted file mode 100644 index 14587fc39..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/MPW_Read_Me +++ /dev/null @@ -1,21 +0,0 @@ - -1. You can control the creator type of generated files by changing a value of - #if control statement. - - - pccts:h:pcctscfg.h - - line 225-231 - - #if 0 - #define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */ - #endif - #if 0 - #define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */ - #endif - #if 0 - #define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */ - #endif - -2. If you want to build 68K version. You must convert all source files to Macintosh - format before compile. diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.OS2 b/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.OS2 deleted file mode 100644 index df81b42e1..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.OS2 +++ /dev/null @@ -1,296 +0,0 @@ -14 April 94 -Version 1.20 of pccts - -At the moment this help file is available via anonymous FTP at - - Node: marvin.ecn.purdue.edu - File: pub/pccts/1.20/NOTES.OS2 - -Mail corrections or additions to Steve Robenalt -=============================================================================== -Notes on building PCCTS under OS/2 2.X with the C Set compilers. - -The supplied makefiles can be used to build PCCTS under OS/2 with minimal -trouble. First you need to edit the makefiles such that the Unix specific -defaults are commented out, then uncomment the lines which are specific -to OS/2 and C Set/2 compilers as originally set up by Ed Harfmann. Note -also that you need to use the target list which reflects the appropriate -naming conventions. Some of the lines now need to be changed to reflect -differences in conventions between the operating systems: 1) change forward -slashes in directories to backslashes, 2) change command line parameters -from -option to /option (note that this applies to C Set, not ANTLR and DLG -options), and 3) change rm to del for clean and scrub targets. - -To build ANTLR for the first time: - -note: I tried various combinations of "touch"ing files to try to prevent nmake - from using ANTLR to rebuild itself, and was unsuccessful. - -In the section labelled "Target list of PC machines", comment out the -scan.c and antlr.c dependencies. This prevents nmake from trying to invoke -ANTLR to build itself. After you have built ANTLR successfully for the first -time, you can uncomment these lines and it will build itself normally. (If you -had a working 1.10 installation before, you can also use the older binaries -when building the new ones.) - -An example of the resulting makefile, with all the extra baggage for Unix, DOS, -and OS/2 1.X is shown here: - ------ cut here ----- - -# -# Makefile for ANTLR 1.20 -# -# SOFTWARE RIGHTS -# -# We reserve no LEGAL rights to the Purdue Compiler Construction Tool -# Set (PCCTS) -- PCCTS is in the public domain. An individual or -# company may do whatever they wish with source code distributed with -# PCCTS or the code generated by PCCTS, including the incorporation of -# PCCTS, or its output, into commerical software. -# -# We encourage users to develop software with PCCTS. However, we do ask -# that credit is given to us for developing PCCTS. By "credit", -# we mean that if you incorporate our source code into one of your -# programs (commercial product, research project, or otherwise) that you -# acknowledge this fact somewhere in the documentation, research report, -# etc... If you like PCCTS and have developed a nice tool with the -# output, please mention that you developed it using PCCTS. In -# addition, we ask that this header remain intact in our source code. -# As long as these guidelines are kept, we expect to continue enhancing -# this system and expect to make other tools available as they are -# completed. -# -# ANTLR 1.20 -# Terence Parr -# Purdue University -# With AHPCRC, University of Minnesota -# 1989-1994 -# -# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by -# Ed Harfmann -# Micro Data Base Systems -# Lafayette, Indiana -# - With updates by Steve Robenalt 4/94 -# -SET=..\support\set -PCCTS_H=..\h - -# -# C-Set/2 for OS/2 -# -CC=icc -CFLAGS= /I. /I$(SET) /I$(PCCTS_H) /Sa /W3 /DUSER_ZZSYN -OUT_OBJ = /Fo -LIBS= -ANTLR=..\bin\antlr -DLG=..\bin\dlg -OBJ_EXT = obj - -antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \ - fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \ - misc.obj set.obj pred.obj dialog.obj - link386 @<< -$** /NOI -$@ /STACK:32768 - -$(LIBS: = +^ -) -$(DEF_FILE) $(LFLAGS) ; -<< - copy *.exe ..\bin - -# -# *********** Target list of PC machines *********** -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# -#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g -# $(ANTLR) antlr.g - -antlr.$(OBJ_EXT): antlr.c mode.h tokens.h - -scan.$(OBJ_EXT): scan.c mode.h tokens.h - -#scan.c mode.h: parser.dlg -# $(DLG) -C2 parser.dlg scan.c - -set.$(OBJ_EXT): $(SET)\set.c - $(CC) $(CFLAGS) /C $(OUT_OBJ)set.$(OBJ_EXT) $(SET)\set.c - -# -# what files does PCCTS generate (both ANTLR and DLG) -# - -PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h - -SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \ - hash.c lex.c main.c misc.c $(SET)\set.c pred.c dialog.c - -# -# ****** These next targets are common to UNIX and PC world ******** -# - -#clean up all the intermediate files -clean: - del *.$(OBJ_EXT) - -#remove everything in clean plus the PCCTS files generated -scrub: - del $(PCCTS_GEN) *.$(OBJ_EXT) - ------ cut here ----- - -To build DLG for the first time: - -Follow the same steps as were used to build ANTLR, changing the slashes and -commands, targets, and extensions for OS/2. Comment out the dependencies for -dlg_p.c and dlg_a.c to prevent nmake from trying to invoke ANTLR and DLG to -build DLG (unless you have 1.10 binaries). - -An example of the resulting makefile, with all the extra baggage for Unix, DOS, -and OS/2 1.X is shown here: - ------ cut here ----- - -# -# Makefile for DLG 1.20 -# Terence Parr -# Purdue University -# 1989-1993 -# -# Ported to IBM C-Set/2 and Microsoft 6.0 by -# Ed Harfmann -# Micro Data Base Systems -# Lafayette, Indiana -# - With updates by Steve Robenalt 4/94 -# -SET=..\support\set -PCCTS_H=..\h - -# -# C-Set/2 for OS/2 -# -CC=icc -CFLAGS= /I. /I$(SET) /I$(PCCTS_H) /Sa /W3 -OUT_OBJ = /Fo -LIBS= -ANTLR=..\bin\antlr -DLG=..\bin\dlg -OBJ_EXT=obj - -dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj \ - output.obj relabel.obj automata.obj - link386 @<< -$** /NOI -$@ /STACK:32768 - -$(LIBS: = +^ -) -$(DEF_FILE) $(LFLAGS) ; -<< - copy *.exe ..\bin - -SRC = dlg_p.c dlg_a.c main.c err.c $(SET)\set.c support.c output.c \ - relabel.c automata.c - -#dlg_p.c parser.dlg err.c tokens.h : dlg_p.g -# $(ANTLR) dlg_p.g - -#dlg_a.c mode.h : parser.dlg -# $(DLG) -C2 parser.dlg dlg_a.c - -dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h - $(CC) $(CFLAGS) /c dlg_p.c - -dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h - $(CC) $(CFLAGS) /c dlg_a.c - -main.$(OBJ_EXT) : main.c dlg.h - $(CC) $(CFLAGS) /c main.c - -set.$(OBJ_EXT) : $(SET)\set.c - $(CC) /c $(CFLAGS) $(SET)\set.c - -lint: - lint *.c - -#clean up all the intermediate files -clean: - del *.$(OBJ_EXT) - ------ cut here ----- - -Once you have built ANTLR and DLG successfully, you will also want to build -the genmk utility, located at ~\pccts\support\genmk. The makefile in this -directory is relatively simple to modify, so I won't repeat it here. - -At this point, you can test the executables by building one of the sample -programs, such as the Pascal or C example under ~pccts\lang. The prototype -makefile which is in these directories will work fine as a base, with OS/2 -specific modifications as noted above. Note that the /Sa flag defines the -ANSI C mode of the compiler which is not the default. The default mode -does not define __STDC__ and will lead to lots of errors. - -A sample pascal makefile is shown below: - ------ cut here ----- - -GRM =pascal.g -LEX_FILE =pscan.dlg -GSRC=pascal.c err.c pscan.c ttree.c adebug.c -GOBJ=pascal.obj err.obj pscan.obj ttree.obj adebug.obj - -PCCTS_GEN= pascal.c err.c $(LEX_FILE) pscan.c mode.h tokens.h - -SRC =$(GSRC) pmain.c sym.c -OBJ =$(GOBJ) pmain.obj sym.obj -INCL = ..\..\h -SYM = ..\..\support\sym -ANTLR = ..\..\bin\antlr -DLG = ..\..\bin\dlg - -CFLAGS=/I. /I$(INCL) /Sa -AFLAGS= -fl $(LEX_FILE) -gh - -pascal.exe : $(OBJ) - $(CC) $(CFLAGS) /Fopascal.exe $(OBJ) - -pascal.c $(LEX_FILE) : $(GRM) - $(ANTLR) $(AFLAGS) $(GRM) - -mode.h pscan.c : $(LEX_FILE) - $(DLG) -C2 $(LEX_FILE) pscan.c - -pmain.obj : pmain.c pascal.h - -pascal.obj : pascal.c mode.h tokens.h - -sym.obj : $(SYM)\sym.c - icc /c /Fo sym.obj $(CFLAGS) $(SYM)\sym.c - -err.obj : err.c - -clean: - del $(PCCTS_GEN) *.obj - - ------ cut here ----- - -The C example can be built in much the same way. - -If you have problems compiling anything, I would appreciate hearing about -it. I was able to get everything built and working without changing any -of the supplied or generated C code, so if you find that you need to make -changes to any code, I've probably written something up incorrectly. - -Please post comments to the mailing list for PCCTS at: - - pccts-users@ahpcrc.umn.edu - -since I am most likely to see them there. - -- Steve Robenalt - - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.bcc b/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.bcc deleted file mode 100644 index 8316ce507..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.bcc +++ /dev/null @@ -1,184 +0,0 @@ -March 95 -Version 1.32 of pccts - -At the moment this file is available via anonymous FTP at - - Node: marvin.ecn.purdue.edu - File: pub/pccts/1.32/NOTES.BCC - -Mail corrections or additions to David Seidel <71333.1575@compuserve.com> -=============================================================================== -Notes on Building PCCTS 1.32 with Borland C++ - -David Seidel, Innovative Data Concepts Incorporated -CompuServe: 71333,1575 -Internet: 71333.1575@compuserve.com - dseidel@delphi.com - -I have gotten ANTLR and DLG to succesfully build with BCC 4.0, but have found -from experience that ANTLR, in particular, is likely to run out of memory -with grammars over a certain size, or with larger values for the -k and -ck -options. Now that BCC 4.02 and the new Borland Power Pack for DOS is now -available, I feel that there is no excuse not to build these tools as -32-bit executables, as they ought to be. - -For people without the Power Pack, the makefiles below should be fairly easily -modified to build 16-bit real-mode executables, but I don't really recommend -it. As an alternative, you might consider the highly regarded DJGPP compiler -(a DOS port of the Gnu GCC compiler, with a DOS extender included). Hopefully -some other PCCTS who has DJGPP can provode whatever advice is necessary. The -Watcom compiler is also an excellent possibility (albeit a commercial one), -and I hope to make available Watcom makefiles in the near future. - -Here are the makefiles I am using. Both makefiles use a compiler configuration -file that contains compiler switches such as optimization settings. I call -this file bor32.cfg and keep a copy in both the ANTLR and DLG subdirectories. - -==== File: bor32.cfg (cut here) =============================================== --w- --RT- --x- --N- --k- --d --O2-e-l --Z --D__STDC__=1 -==== End of file bor32.cfg (cut here) ========================================= - -==== File: antlr\bor32.mak (cut here) ========================================= -# -# ANTLR 1.32 Makefile for Borland C++ 4.02 with DPMI 32-bit DOS extender by -# David Seidel -# Innovative Data Concepts Incorporated -# 71333.1575@compuserve.com (or) dseidel@delphi.com -# -# Notes: 1. Compiler switches (optimization etc.) are contained in the -# file bor32.cfg. -# 2. This makefile requires Borland C++ 4.02 or greater with -# the DOS Power Pack add-on package. -# 3. Change the BCCDIR macro below to the topmost directory in -# which BCC is installed on your system. -# - -BCCDIR = d:\bc4 -CC = bcc32 -SET = ..\support\set -PCCTS_H = ..\h -ANTLR = ..\bin\antlr -DLG = ..\bin\dlg -CFLAGS = -I$(BCCDIR)\include -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN \ - +bor32.cfg -LIBS = dpmi32 cw32 -OBJ_EXT = obj -OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj fset.obj \ - gen.obj globals.obj hash.obj lex.obj main.obj misc.obj pred.obj dialog.obj \ - set.obj - -.c.obj: - $(CC) -c $(CFLAGS) {$&.c } - -antlr.exe: $(OBJS) - tlink32 @&&| --Tpe -ax -c -s -L$(BCCDIR)\lib + -$(BCCDIR)\lib\c0x32 $** -$@ - -$(LIBS) -; -| - copy *.exe ..\bin - - -# *********** Target list of PC machines *********** -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# - -# leave this commented out for initial build! -#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g -# $(ANTLR) antlr.g - -antlr.$(OBJ_EXT): antlr.c mode.h tokens.h - -scan.$(OBJ_EXT): scan.c mode.h tokens.h - -# leave this commented out for initial build! -#scan.c mode.h: parser.dlg -# $(DLG) -C2 parser.dlg scan.c - -set.$(OBJ_EXT): $(SET)\set.c - $(CC) -c $(CFLAGS) $(SET)\set.c - -==== End of file antlr\bor32.mak (cut here) =================================== - -==== File: dlg\bor32.mak (cut here) =========================================== -# -# DLG 1.32 Makefile for Borland C++ 4.02 with DPMI 32-bit DOS extender by -# David Seidel -# Innovative Data Concepts Incorporated -# 71333.1575@compuserve.com (or) dseidel@delphi.com -# -# Notes: 1. Compiler switches (optimization etc.) are contained in the -# file bor32.cfg. -# 2. This makefile requires Borland C++ 4.02 or greater with -# the DOS Power Pack add-on package. -# 3. Change the BCCDIR macro below to the topmost directory in -# which BCC is installed on your system. -# - - -BCCDIR = d:\bc4 -CC = bcc32 -SET = ..\support\set -PCCTS_H = ..\h -ANTLR = ..\bin\antlr -DLG = ..\bin\dlg -CFLAGS = -I$(BCCDIR)\include -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN \ - +bor32.cfg -LIBS = dpmi32 cw32 -OBJ_EXT = obj -OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \ - output.obj relabel.obj automata.obj set.obj - -.c.obj: - $(CC) -c $(CFLAGS) {$&.c } - -dlg.exe : $(OBJS) - tlink32 @&&| --Tpe -ax -c -s -L$(BCCDIR)\lib + -c0x32 $** -$@ - -$(LIBS) -; -| - copy *.exe ..\bin - -dlg_p.obj: dlg_p.c - -dlg_a.obj: dlg_a.c - -main.obj: main.c - -err.obj: err.c - -support.obj: support.c - -output.obj: output.c - -relabel.obj: relabel.c - -automata.obj: automata.c - -set.$(OBJ_EXT): $(SET)\set.c - $(CC) -c $(CFLAGS) $(SET)\set.c - -==== End of file dlg\bor32.mak (cut here) ===================================== - - - - - - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.msvc b/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.msvc deleted file mode 100644 index 8e823f168..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.msvc +++ /dev/null @@ -1,189 +0,0 @@ - - Microsoft Visual C Stuff - - -[Tom Moog 2-Oct-98 - - Users of Microsoft Visual C++ should download a separate - ready-to-run zip file from my web site. It contains - binaries, static library, and a sample project. -] - -[ - Two notes added by Tom Moog 23-Sep-97. I believe the *.dsp and - *.mak files that were once at the end of this file are now obsolete. - - The following MSVC .dsp and .mak files for pccts and sorcerer - were contributed by Stanislaw Bochnak (S.Bochnak@microtool.com.pl) - and Jeff Vincent (jvincent@novell.com) - - PCCTS Distribution Kit - ---------------------- - pccts/antlr/AntlrMSVC50.dsp - pccts/antlr/AntlrMSVC50.mak - - pccts/dlg/DlgMSVC50.dsp - pccts/dlg/DlgMSVC50.mak - - pccts/support/genmk/watgenmk.mak - pccts/support/msvc.dsp - - Sorcerer Distribution Kit - ------------------------- - pccts/sorcerer/SorcererMSVC50.dsp - pccts/sorcerer/SorcererMSVC50.mak - - pccts/sorcerer/lib/msvc.dsp - - I do not have an MS based computer. If you discover problems - please report them so as to save trouble for others in the future. -] - -[ - Modified by Terence Parr (September 1995) to change .C to .cpp -] - -[ - This file contains notes on MSVC for Windows NT console execs by Dave - Seidel and an explanation of flags etc.. by John Hall; good luck, - Terence -] - -=============================================================================== -Date: Sat, 31 Dec 1994 11:40:36 -0500 (EST) -From: David Seidel <75342.2034@compuserve.com> - -I've succesfully build 1.31b3 with djgpp for DOS and MSVC 2.0 for Windows -NT. The only (minor) problem I had was that GNU make (version 3.71, in the -djgpp port) complained about "multiple targets" in both the antlr and dlg -makefiles. I got around the error by, in each makefile, commenting out the -$(SRC) dependency, for example: - - antlr: $(OBJ) #$(SRC) - -I don't know why this is happenning, since you haven't changed that part of -the makefile at all, and I think this used to work ok... - -Here are the makefiles I built from within the MSVC 2.0 environment for antlr -and dlg and Windows NT console executables. Please feel free to pass them -on. Of course, as soon as 1.31 "goes gold", I will send you nice new -binaries. I'm not going to bother to keep doing both Borland and djgpp for -DOS however. Instead, I'll just keep the djgpp version up to date and also -provide WinNT binaries. - -Dave -=============================================================================== - - How to port PCCTS 1.10 (and 1.32 hopefully) to Visual C++ - - By - - John Hall - -Here is how to compile an ANTLR grammar in Visual C++. These steps -describe how to have your ANTLR grammar parse the input file the user -selects when they choose File Open in your Windows application. (Even -if you aren't using Visual C++, the steps should be portable enough to -other compilers.) - - * Make sure that ANTLR and DLG generate ANSI code (use the -ga - switch). - - * Set the following compiler flags in Visual C++ (these are in the - Memory Model category of the compiler options in the Project - Options menu): - - FLAG MEANING - ==== ============================================================== - /AL Large memory model (multiple data segments; data items must be - smaller than 64K). - - /Gtn Allocates all items whose size is greater than or equal to n - in a new data segment. (I let n be 256: /Gt256.) - - /Gx- All references to data items are done with far addressing in - case they are placed in a far segment. - - * Add the following member variable to the attributes section of your - derived CDocument class (you will need to make sure you also - include stdio.h): - - FILE *fp; - - * Add the following method to your derived CDocument class: - - BOOL CAppDoc::OnOpenDocument(const char* pszPathName) - { - // Call CDocument's OnOpenDocument to do housekeeping for us - // DON'T add anything to the loading section of Serialize - if (!CDocument::OnOpenDocument(pszPathName)) - return FALSE; - - // Open input file - if ((fp = fopen(pszPathName, "r")) == NULL) - return FALSE; - - // Parse input file - ANTLR(start(), fp); - - // Close input file - fclose(fp); - return TRUE; - } - - (Note: additional code may be necessary, depending on your parser. - For example, if your parser uses PCCTS's symbol table library, you - will need to insert calls to zzs_init and zzs_done.) - - * Compile the generated C files as C++ files. (I renamed the files - to have a .CPP extension to fool Visual C++ into thinking they were - C++ files. One might also use the /Tp switch, but that switch - requires you separately include the filename.) [I used this step - as an easy out for all the external linking errors I was getting - that I couldn't fix by declaring things extern "C".] - - * Make sure the __STDC__ portion of the generated files gets - compiled. (Either define __STDC__ yourself or else change all - occurrences of __STDC__ to __cplusplus in the generated files. You - can define __STDC__ in the Preprocessor category of the compiler - options.) - - ================================================================ - = Note 23-Sep-97: This is probably not necessary any more. = - = With 1.33MRxxx the use of __STDC__ was replaced with the = - = macro __USE_PROTOS to control the compilation of prototypes. = - ================================================================ - -That last step is important for Visual C++, but may not apply to other -compilers. For C++ compilers, whether __STDC__ is defined is -implementation dependent (ARM, page 379). Apparently, Visual C++ does -not to define it; it also does not support "old style" C function -definitions (which is okay, according to page 404 of the ARM). Those -two things together caused problems when trying to port the code. -When it saw this: - -#ifdef __STDC__ -void -globals(AST **_root) -#else -globals(_root) -AST **_root; -#endif - -it skipped the __STDC__ section and tried to process the "old style" -function definition, where it choked. - -When you finally get your parser to compile and link without error, -you may get General Protection Fault errors at run time. The problem -I had was that a NULL was passed to a variable argument function -without an explicit cast. The function grabbed a pointer (32-bits) -off the stack using va_arg, but the NULL was passed silently as the -integer 0 (16 bits), making the resulting pointer was invalid. (This -was in PCCTS's sample C parser.) - -There is one other thing I might suggest to help you avoid a run-time -error. Make sure you redefine the default error reporting function, -zzsyn. To do this, put "#define USER_ZZSYN" in your #header section -and put your own zzsyn somewhere. You can then pop up a MessageBox or -print the error to some output window. -=============================================================================== diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.watcom b/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.watcom deleted file mode 100644 index 1120dca18..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/NOTES.watcom +++ /dev/null @@ -1,114 +0,0 @@ -From Tom Zougas, zougas@civ.utoronto.ca - -These are the changes I had to make to get ANTLR to compile under Watcom C -10.0 32-bit mode. I'm including the makefiles for antlr and dlg: - -[Warning from T. Parr: I think that I may have expanded the tabs by - mistake in this file. You might have to convert them back to - tabs to have this file work correctly.] - -antlr.mak: ------------------------------------------------------------------------ - -SET=..\support\set -PCCTS_H=..\h - -# -# Watcom -# -CC=wcl386 -ANTLR=..\bin\antlr -DLG=..\bin\dlg -CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC -OUT_OBJ = -o -OBJ_EXT = obj -LINK = wcl386 - -.c.obj : - $(CC) -c $[* $(CFLAGS) - -antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj & - fset.obj gen.obj globals.obj hash.obj lex.obj main.obj & - misc.obj set.obj pred.obj - $(LINK) -fe=antlr.exe *.obj -k14336 - copy *.exe ..\bin - -# *********** Target list of PC machines *********** -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# -antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g - $(ANTLR) antlr.g - -antlr.$(OBJ_EXT): antlr.c mode.h tokens.h - -scan.$(OBJ_EXT): scan.c mode.h tokens.h - -scan.c mode.h: parser.dlg - $(DLG) -C2 parser.dlg scan.c - -set.$(OBJ_EXT): $(SET)\set.c - $(CC) $(CFLAGS) -c set.$(OBJ_EXT) $(SET)\set.c - -# -# ****** These next targets are common to UNIX and PC world ******** -# - -#clean up all the intermediate files -clean: - del *.obj - -#remove everything in clean plus the PCCTS files generated -scrub: - del $(PCCTS_GEN) - del *.$(OBJ_EXT) ---------------------------------------------------------------------- -dlg.mak: ---------------------------------------------------------------------- -SET=..\support\set -PCCTS_H=..\h - -# -# Watcom -# -CC=wcl386 -ANTLR=..\bin\antlr -DLG=..\bin\dlg -CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC -LIBS= -OBJ_EXT = obj -LINK = wcl386 - -.c.obj : - $(CC) -c $[* $(CFLAGS) - -dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj & - output.obj relabel.obj automata.obj - $(LINK) -fe=dlg.exe *.obj -k14336 - copy *.exe ..\bin - -SRC = dlg_p.c dlg_a.c main.c err.c $(SET)\set.c support.c output.c & - relabel.c automata.c - -dlg_p.c parser.dlg err.c tokens.h : dlg_p.g - $(ANTLR) dlg_p.g - -dlg_a.c mode.h : parser.dlg - $(DLG) -C2 parser.dlg dlg_a.c - -dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h - $(CC) $(CFLAGS) -c dlg_p.c - -dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h - $(CC) $(CFLAGS) -c dlg_a.c - -main.$(OBJ_EXT) : main.c dlg.h - $(CC) $(CFLAGS) -c main.c - -set.$(OBJ_EXT) : $(SET)\set.c - $(CC) -c $(CFLAGS) $(SET)\set.c - -#clean up all the intermediate files -clean: - del *.$(OBJ_EXT) diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/README b/c/makeotf/makeotf_lib/build/hotpccts/pccts/README deleted file mode 100644 index 16bbff3db..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/README +++ /dev/null @@ -1,159 +0,0 @@ - - Parr Research Corporation - with - Purdue University Electrical Engineering - and - University of Minnesota, AHPCRC - - Terence Parr - Russell Quong - Will Cohen - Hank Dietz - - -A central place for information about PCCTS 1.33 is: - - http://www.polhode.com/pccts.html - -The maintenance release is available from: - - http://www.polhode.com/pccts133mr.zip - -There is a ready-to-run version for win32 for Microsoft Visual Studio -at the same site. It is available from: - - http://www.polhode.com/win32.zip - -New users should visit http://www.polhode.com/pccts.html in -order to get the following document: - - "Notes For New Users of PCCTS" - -This is a Postscript file of about 40 pages which is extremely -useful for someone starting out. It is a based on 1.33mr21 - -When you have a little more experience, be sure to review the -following documents in the distribution kit: - - CHANGES_FROM_133.txt - CHANGES_FROM_133_BEFORE_MR13.txt - KNOWN_PROBLEMS.txt - -------------------------------------------------------------------------- - INSTALLATION (Unix) -------------------------------------------------------------------------- -0. Download http://www.polhode.com/pccts133mr.zip - -1. Unzip the distribution kit to your preferred location. - If there are newline problems try using zip -a ... - -2. cd to the main pccts directory. - -3. make - - This will create: - - antlr - dlg - sorcerer - genmk - -4. Copy to /usr/local/bin or /usr/local/bin if you like. If you - don't wish to then add pccts/bin to your path. - -5. To get an up-to-date list of program options execute the - program with no command line options. To get up-to-date - documentation read CHANGES_FROM_133*.txt and KNOWN_PROBLEMS.txt - at: - - http://www.polhode.com/pccts.html - -6. You need not create a library. The makefile created by genmk - assumes that the files are not part of a library. - - If you wish to create a library from elements of pccts/h: - - If the first letter of the filename is lowercase (uppercase) it is - related to the code generated using the pccts C mode (C++ mode). - Some of the .c and .cpp files in the h directory are not meant to - be placed in a library and will not compile because they are meant - to be #include in pccts generated files which are grammar specific. - - For C++ users place the following elements in the library: - - AParser.cpp - ASTBase.cpp - ATokenBuffer.cpp - BufFileInput.cpp (optional) - DLexerBase.cpp - PCCTSAST.cpp - SList.cpp - -------------------------------------------------------------------------- - INSTALLATION (Win32) -------------------------------------------------------------------------- - -I've tried to keep the win32 kit to the minimum necessary to get -up and running. The complete kit contains additional information -(some historical), source code, and DevStudio projects for -rebuilding pccts from the source code. - -The kit is now distributed with both MSVC 5 and MSVC6 style projects. - -0. Download http://www.polhode.com/win32.zip. - - You may also wish to download: - - http://www.polhode.com/CHANGES_FROM_133.txt - http://www.polhode.com/CHANGES_FROM_133_BEFORE_MR13.txt - http://www.polhode.com/KNOWN_PROBLEMS.txt - -1. Unzip the distribution kit to your preferred location. - - This will create: - - a pccts directory tree - pccts/bin/*.exe - pccts/lib/*.lib - pccts/h/* - sorcerer/lib/* - sorcerer/h/* - - an example directory tree - pccts\example\calcAST\* - pccts\example\simple\* - -2. Define the environment variable PCCTS to point to the main - pccts directory. - -3. Try building the simple project: pccts\example\simple\simple50.dsw - or simple60.dsw. - -4. Try building the complex project: pccts\example\calcAST\calcAST50.dsw - or calcAST60.dsw. - -------------------------------------------------------------------------- - INSTALLATION (DEC/VMS) -------------------------------------------------------------------------- - -DEC/VMS support added by Piéronne Jean-François (jfp@altavista.net) - -0. Download http://www.polhode.com/pccts133mr.zip - -1. Unzip the distribution kit to your preferred location. - -2. set default to the main pccts directory. - -3. @makefile.vms - - This will create in directory [.bin]: - - antlr.exe - dlg.exe - sorcerer.exe - genmk.exe - -5. To get an up-to-date list of program options execute the - program with no command line options. To get up-to-date - documentation read CHANGES_FROM_133*.txt and KNOWN_PROBLEMS.txt - at http://www.polhode.com/pccts.html. diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/RIGHTS b/c/makeotf/makeotf_lib/build/hotpccts/pccts/RIGHTS deleted file mode 100644 index 5a3e2e76e..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/RIGHTS +++ /dev/null @@ -1,26 +0,0 @@ - -SOFTWARE RIGHTS - -We reserve no LEGAL rights to the Purdue Compiler Construction Tool -Set (PCCTS) -- PCCTS is in the public domain. An individual or -company may do whatever they wish with source code distributed with -PCCTS or the code generated by PCCTS, including the incorporation of -PCCTS, or its output, into commerical software. - -We encourage users to develop software with PCCTS. However, we do ask -that credit is given to us for developing PCCTS. By "credit", we mean -that if you incorporate our source code into one of your programs -(commercial product, research project, or otherwise) that you -acknowledge this fact somewhere in the documentation, research report, -etc... If you like PCCTS and have developed a nice tool with the -output, please mention that you developed it using PCCTS. In -addition, we ask that this header remain intact in our source code. -As long as these guidelines are kept, we expect to continue enhancing -this system and expect to make other tools available as they are -completed. - -ANTLR 1.33 -Terence Parr -Parr Research Corporation -with Purdue University and AHPCRC, University of Minnesota -1989-1995 diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMS.mak b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMS.mak deleted file mode 100644 index 56d061724..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMS.mak +++ /dev/null @@ -1,221 +0,0 @@ -# PCCTS directory - -PCCTS_HOME= -ANTLR_SRC=$(PCCTS_HOME)\antlr -PCCTS_H=$(PCCTS_HOME)\h - - -# Support directories -SET=$(PCCTS_HOME)\support\set - - -# Compiler stuff -CC = cl -CFLAGS = -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \ - -D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /Zi /W3 - -ANTLR_OBJS = antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \ - fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \ - misc.obj pred.obj egman.obj mrhoist.obj fcache.obj - -SUPPORT_OBJS = set.obj - -# Dependencies - -antlr.exe: $(ANTLR_OBJS) $(SUPPORT_OBJS) - $(CC) $(CFLAGS) -o antlr.exe $(ANTLR_OBJS) $(SUPPORT_OBJS) - del *.obj - - -antlr.obj: $(ANTLR_SRC)\antlr.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\mode.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - $(ANTLR_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\antlr.c - -scan.obj: $(ANTLR_SRC)\scan.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgauto.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\mode.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - $(ANTLR_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\scan.c - -err.obj: $(ANTLR_SRC)\err.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(PCCTS_H)\err.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - $(ANTLR_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\err.c - -bits.obj: $(ANTLR_SRC)\bits.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\bits.c - -build.obj: $(ANTLR_SRC)\build.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\build.c - -fset2.obj: $(ANTLR_SRC)\fset2.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fset2.c - -fset.obj: $(ANTLR_SRC)\fset.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fset.c - -gen.obj: $(ANTLR_SRC)\gen.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\gen.c - -globals.obj: $(ANTLR_SRC)\globals.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\globals.c - -hash.obj: $(ANTLR_SRC)\hash.c \ - $(PCCTS_H)\config.h \ - $(ANTLR_SRC)\hash.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\hash.c - -lex.obj: $(ANTLR_SRC)\lex.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\lex.c - -main.obj: $(ANTLR_SRC)\main.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\mode.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\stdpccts.h \ - $(ANTLR_SRC)\syn.h \ - $(ANTLR_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\main.c - -misc.obj: $(ANTLR_SRC)\misc.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\misc.c - -pred.obj: $(ANTLR_SRC)\pred.c \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\pred.c - -egman.obj: $(ANTLR_SRC)\egman.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\egman.c - -mrhoist.obj: $(ANTLR_SRC)\mrhoist.c \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\mrhoist.c - -fcache.obj: $(ANTLR_SRC)\fcache.c \ - $(ANTLR_SRC)\generic.h \ - $(ANTLR_SRC)\hash.h \ - $(ANTLR_SRC)\proto.h \ - $(ANTLR_SRC)\syn.h \ - - $(CC) -c $(CFLAGS) $(ANTLR_SRC)\fcache.c - -set.obj: $(SET)\set.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - - $(CC) -c $(CFLAGS) $(SET)\set.c diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsp deleted file mode 100644 index 7d99f4df2..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsp +++ /dev/null @@ -1,247 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ANTLR" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=ANTLR - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "AntlrMSVC50.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "AntlrMSVC50.mak" CFG="ANTLR - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ANTLR - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "ANTLR - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /O2 /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "NDEBUG" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"./Antlr.exe" -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Copy antlr to ..\bin directory -PostBuild_Cmds=mkdir ..\bin copy ..\bin\antlr.exe antlr_old.exe copy antlr.exe\ - ..\bin\. -# End Special Build Tool - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /Zi /Od /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -DUSER_ZZSYN -D__STDC__ -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"./Antlr.exe" /pdbtype:sept -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Copy antlr to ..\bin -PostBuild_Cmds=mkdir ..\bin copy ..\bin\antlr.exe antlr_old.exe copy antlr.exe\ - ..\bin\. -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "ANTLR - Win32 Release" -# Name "ANTLR - Win32 Debug" -# Begin Source File - -SOURCE=.\antlr.c -# End Source File -# Begin Source File - -SOURCE=.\antlr.g - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -# Begin Custom Build - Building ANTLR Parser from ANTLR Grammar -InputPath=.\antlr.g -InputName=antlr - -BuildCmds= \ - ../bin/antlr -gh $(InputName).g \ - ../bin/dlg -C2 parser.dlg scan.c \ - - -"antlr.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -# Begin Custom Build - Building ANTLR Parser from ANTLR Grammar -InputPath=.\antlr.g -InputName=antlr - -BuildCmds= \ - ..\bin\antlr -gh $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"antlr.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\bits.c -# End Source File -# Begin Source File - -SOURCE=.\build.c -# End Source File -# Begin Source File - -SOURCE=.\egman.c -# End Source File -# Begin Source File - -SOURCE=.\err.c - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\fcache.c -# End Source File -# Begin Source File - -SOURCE=.\fset.c -# End Source File -# Begin Source File - -SOURCE=.\fset2.c -# End Source File -# Begin Source File - -SOURCE=.\gen.c -# End Source File -# Begin Source File - -SOURCE=.\globals.c -# End Source File -# Begin Source File - -SOURCE=.\hash.c -# End Source File -# Begin Source File - -SOURCE=.\lex.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\misc.c -# End Source File -# Begin Source File - -SOURCE=.\mrhoist.c -# End Source File -# Begin Source File - -SOURCE=.\pred.c -# End Source File -# Begin Source File - -SOURCE=.\scan.c -# End Source File -# Begin Source File - -SOURCE=..\support\set\set.c -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsw deleted file mode 100644 index 02b4346c8..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "ANTLR"=.\AntlrMSVC50.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.mak b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.mak deleted file mode 100644 index 26b611e24..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC50.mak +++ /dev/null @@ -1,782 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on AntlrMSVC50.dsp -!IF "$(CFG)" == "" -CFG=ANTLR - Win32 Debug -!MESSAGE No configuration specified. Defaulting to ANTLR - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "ANTLR - Win32 Release" && "$(CFG)" != "ANTLR - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "AntlrMSVC50.mak" CFG="ANTLR - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ANTLR - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "ANTLR - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -OUTDIR=.\. -INTDIR=.\. -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "tokens.h" "scan.c" "parser.dlg" "mode.h" "err.c" "antlr.c"\ - "$(OUTDIR)\Antlr.exe" "$(OUTDIR)\AntlrMSVC50.bsc" - -!ELSE - -ALL : "tokens.h" "scan.c" "parser.dlg" "mode.h" "err.c" "antlr.c"\ - "$(OUTDIR)\Antlr.exe" "$(OUTDIR)\AntlrMSVC50.bsc" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\antlr.obj" - -@erase "$(INTDIR)\antlr.sbr" - -@erase "$(INTDIR)\bits.obj" - -@erase "$(INTDIR)\bits.sbr" - -@erase "$(INTDIR)\build.obj" - -@erase "$(INTDIR)\build.sbr" - -@erase "$(INTDIR)\egman.obj" - -@erase "$(INTDIR)\egman.sbr" - -@erase "$(INTDIR)\err.obj" - -@erase "$(INTDIR)\err.sbr" - -@erase "$(INTDIR)\fcache.obj" - -@erase "$(INTDIR)\fcache.sbr" - -@erase "$(INTDIR)\fset.obj" - -@erase "$(INTDIR)\fset.sbr" - -@erase "$(INTDIR)\fset2.obj" - -@erase "$(INTDIR)\fset2.sbr" - -@erase "$(INTDIR)\gen.obj" - -@erase "$(INTDIR)\gen.sbr" - -@erase "$(INTDIR)\globals.obj" - -@erase "$(INTDIR)\globals.sbr" - -@erase "$(INTDIR)\hash.obj" - -@erase "$(INTDIR)\hash.sbr" - -@erase "$(INTDIR)\lex.obj" - -@erase "$(INTDIR)\lex.sbr" - -@erase "$(INTDIR)\main.obj" - -@erase "$(INTDIR)\main.sbr" - -@erase "$(INTDIR)\misc.obj" - -@erase "$(INTDIR)\misc.sbr" - -@erase "$(INTDIR)\mrhoist.obj" - -@erase "$(INTDIR)\mrhoist.sbr" - -@erase "$(INTDIR)\pred.obj" - -@erase "$(INTDIR)\pred.sbr" - -@erase "$(INTDIR)\scan.obj" - -@erase "$(INTDIR)\scan.sbr" - -@erase "$(INTDIR)\set.obj" - -@erase "$(INTDIR)\set.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\Antlr.exe" - -@erase "$(OUTDIR)\AntlrMSVC50.bsc" - -@erase "antlr.c" - -@erase "err.c" - -@erase "mode.h" - -@erase "parser.dlg" - -@erase "scan.c" - -@erase "tokens.h" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "." /I "..\h" /I "..\support\set" /D\ - "NDEBUG" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D\ - "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=./ -CPP_SBRS=./ - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -RSC=rc.exe -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\AntlrMSVC50.bsc" -BSC32_SBRS= \ - "$(INTDIR)\antlr.sbr" \ - "$(INTDIR)\bits.sbr" \ - "$(INTDIR)\build.sbr" \ - "$(INTDIR)\egman.sbr" \ - "$(INTDIR)\err.sbr" \ - "$(INTDIR)\fcache.sbr" \ - "$(INTDIR)\fset.sbr" \ - "$(INTDIR)\fset2.sbr" \ - "$(INTDIR)\gen.sbr" \ - "$(INTDIR)\globals.sbr" \ - "$(INTDIR)\hash.sbr" \ - "$(INTDIR)\lex.sbr" \ - "$(INTDIR)\main.sbr" \ - "$(INTDIR)\misc.sbr" \ - "$(INTDIR)\mrhoist.sbr" \ - "$(INTDIR)\pred.sbr" \ - "$(INTDIR)\scan.sbr" \ - "$(INTDIR)\set.sbr" - -"$(OUTDIR)\AntlrMSVC50.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib /nologo /subsystem:console /incremental:no\ - /pdb:"$(OUTDIR)\Antlr.pdb" /machine:I386 /out:"$(OUTDIR)\Antlr.exe" -LINK32_OBJS= \ - "$(INTDIR)\antlr.obj" \ - "$(INTDIR)\bits.obj" \ - "$(INTDIR)\build.obj" \ - "$(INTDIR)\egman.obj" \ - "$(INTDIR)\err.obj" \ - "$(INTDIR)\fcache.obj" \ - "$(INTDIR)\fset.obj" \ - "$(INTDIR)\fset2.obj" \ - "$(INTDIR)\gen.obj" \ - "$(INTDIR)\globals.obj" \ - "$(INTDIR)\hash.obj" \ - "$(INTDIR)\lex.obj" \ - "$(INTDIR)\main.obj" \ - "$(INTDIR)\misc.obj" \ - "$(INTDIR)\mrhoist.obj" \ - "$(INTDIR)\pred.obj" \ - "$(INTDIR)\scan.obj" \ - "$(INTDIR)\set.obj" - -"$(OUTDIR)\Antlr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -SOURCE=$(InputPath) -PostBuild_Desc=Copy antlr to ..\bin directory -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "tokens.h" "scan.c" "parser.dlg" "mode.h" "err.c"\ - "antlr.c" "$(OUTDIR)\Antlr.exe" "$(OUTDIR)\AntlrMSVC50.bsc" - mkdir ..\bin - copy ..\bin\antlr.exe antlr_old.exe - copy antlr.exe ..\bin\. - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -OUTDIR=.\. -INTDIR=.\. -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "tokens.h" "scan.c" "parser.dlg" "mode.h" "err.c" "antlr.c"\ - "$(OUTDIR)\Antlr.exe" "$(OUTDIR)\AntlrMSVC50.bsc" - -!ELSE - -ALL : "tokens.h" "scan.c" "parser.dlg" "mode.h" "err.c" "antlr.c"\ - "$(OUTDIR)\Antlr.exe" "$(OUTDIR)\AntlrMSVC50.bsc" - -!ENDIF - -CLEAN : - -@erase "$(INTDIR)\antlr.obj" - -@erase "$(INTDIR)\antlr.sbr" - -@erase "$(INTDIR)\bits.obj" - -@erase "$(INTDIR)\bits.sbr" - -@erase "$(INTDIR)\build.obj" - -@erase "$(INTDIR)\build.sbr" - -@erase "$(INTDIR)\egman.obj" - -@erase "$(INTDIR)\egman.sbr" - -@erase "$(INTDIR)\err.obj" - -@erase "$(INTDIR)\err.sbr" - -@erase "$(INTDIR)\fcache.obj" - -@erase "$(INTDIR)\fcache.sbr" - -@erase "$(INTDIR)\fset.obj" - -@erase "$(INTDIR)\fset.sbr" - -@erase "$(INTDIR)\fset2.obj" - -@erase "$(INTDIR)\fset2.sbr" - -@erase "$(INTDIR)\gen.obj" - -@erase "$(INTDIR)\gen.sbr" - -@erase "$(INTDIR)\globals.obj" - -@erase "$(INTDIR)\globals.sbr" - -@erase "$(INTDIR)\hash.obj" - -@erase "$(INTDIR)\hash.sbr" - -@erase "$(INTDIR)\lex.obj" - -@erase "$(INTDIR)\lex.sbr" - -@erase "$(INTDIR)\main.obj" - -@erase "$(INTDIR)\main.sbr" - -@erase "$(INTDIR)\misc.obj" - -@erase "$(INTDIR)\misc.sbr" - -@erase "$(INTDIR)\mrhoist.obj" - -@erase "$(INTDIR)\mrhoist.sbr" - -@erase "$(INTDIR)\pred.obj" - -@erase "$(INTDIR)\pred.sbr" - -@erase "$(INTDIR)\scan.obj" - -@erase "$(INTDIR)\scan.sbr" - -@erase "$(INTDIR)\set.obj" - -@erase "$(INTDIR)\set.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(INTDIR)\vc50.pdb" - -@erase "$(OUTDIR)\Antlr.exe" - -@erase "$(OUTDIR)\Antlr.ilk" - -@erase "$(OUTDIR)\Antlr.pdb" - -@erase "$(OUTDIR)\AntlrMSVC50.bsc" - -@erase "antlr.c" - -@erase "err.c" - -@erase "mode.h" - -@erase "parser.dlg" - -@erase "scan.c" - -@erase "tokens.h" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "." /I "..\h" /I "..\support\set"\ - /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D\ - "WIN32" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=./ -CPP_SBRS=./ - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -RSC=rc.exe -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\AntlrMSVC50.bsc" -DUSER_ZZSYN -D__STDC__ -BSC32_SBRS= \ - "$(INTDIR)\antlr.sbr" \ - "$(INTDIR)\bits.sbr" \ - "$(INTDIR)\build.sbr" \ - "$(INTDIR)\egman.sbr" \ - "$(INTDIR)\err.sbr" \ - "$(INTDIR)\fcache.sbr" \ - "$(INTDIR)\fset.sbr" \ - "$(INTDIR)\fset2.sbr" \ - "$(INTDIR)\gen.sbr" \ - "$(INTDIR)\globals.sbr" \ - "$(INTDIR)\hash.sbr" \ - "$(INTDIR)\lex.sbr" \ - "$(INTDIR)\main.sbr" \ - "$(INTDIR)\misc.sbr" \ - "$(INTDIR)\mrhoist.sbr" \ - "$(INTDIR)\pred.sbr" \ - "$(INTDIR)\scan.sbr" \ - "$(INTDIR)\set.sbr" - -"$(OUTDIR)\AntlrMSVC50.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib /nologo /subsystem:console /incremental:yes\ - /pdb:"$(OUTDIR)\Antlr.pdb" /debug /machine:I386 /out:"$(OUTDIR)\Antlr.exe"\ - /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\antlr.obj" \ - "$(INTDIR)\bits.obj" \ - "$(INTDIR)\build.obj" \ - "$(INTDIR)\egman.obj" \ - "$(INTDIR)\err.obj" \ - "$(INTDIR)\fcache.obj" \ - "$(INTDIR)\fset.obj" \ - "$(INTDIR)\fset2.obj" \ - "$(INTDIR)\gen.obj" \ - "$(INTDIR)\globals.obj" \ - "$(INTDIR)\hash.obj" \ - "$(INTDIR)\lex.obj" \ - "$(INTDIR)\main.obj" \ - "$(INTDIR)\misc.obj" \ - "$(INTDIR)\mrhoist.obj" \ - "$(INTDIR)\pred.obj" \ - "$(INTDIR)\scan.obj" \ - "$(INTDIR)\set.obj" - -"$(OUTDIR)\Antlr.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -SOURCE=$(InputPath) -PostBuild_Desc=Copy antlr to ..\bin -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "tokens.h" "scan.c" "parser.dlg" "mode.h" "err.c"\ - "antlr.c" "$(OUTDIR)\Antlr.exe" "$(OUTDIR)\AntlrMSVC50.bsc" - mkdir ..\bin - copy ..\bin\antlr.exe antlr_old.exe - copy antlr.exe ..\bin\. - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ENDIF - - -!IF "$(CFG)" == "ANTLR - Win32 Release" || "$(CFG)" == "ANTLR - Win32 Debug" -SOURCE=.\antlr.c -DEP_CPP_ANTLR=\ - "..\h\antlr.h"\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\syn.h"\ - ".\tokens.h"\ - - -"$(INTDIR)\antlr.obj" "$(INTDIR)\antlr.sbr" : $(SOURCE) $(DEP_CPP_ANTLR)\ - "$(INTDIR)" "$(INTDIR)\tokens.h" "$(INTDIR)\mode.h" - - -SOURCE=.\antlr.g - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -InputPath=.\antlr.g -InputName=antlr - -"antlr.c" "err.c" "mode.h" "scan.c" "tokens.h" "parser.dlg" : $(SOURCE)\ - "$(INTDIR)" "$(OUTDIR)" - ../bin/antlr -gh $(InputName).g - ../bin/dlg -C2 parser.dlg scan.c - - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -InputPath=.\antlr.g -InputName=antlr - -"antlr.c" "err.c" "mode.h" "scan.c" "tokens.h" "parser.dlg" : $(SOURCE)\ - "$(INTDIR)" "$(OUTDIR)" - ..\bin\antlr -gh $(InputName).g - ..\bin\dlg -C2 parser.dlg scan.c - - -!ENDIF - -SOURCE=.\bits.c -DEP_CPP_BITS_=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\bits.obj" "$(INTDIR)\bits.sbr" : $(SOURCE) $(DEP_CPP_BITS_)\ - "$(INTDIR)" - - -SOURCE=.\build.c -DEP_CPP_BUILD=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\build.obj" "$(INTDIR)\build.sbr" : $(SOURCE) $(DEP_CPP_BUILD)\ - "$(INTDIR)" - - -SOURCE=.\egman.c -DEP_CPP_EGMAN=\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\egman.obj" "$(INTDIR)\egman.sbr" : $(SOURCE) $(DEP_CPP_EGMAN)\ - "$(INTDIR)" - - -SOURCE=.\err.c -DEP_CPP_ERR_C=\ - "..\h\antlr.h"\ - "..\h\dlgdef.h"\ - "..\h\err.h"\ - "..\h\pccts_stdarg.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -CPP_SWITCHES=/nologo /ML /W3 /GX /O2 /I "." /I "..\h" /I "..\support\set" /D\ - "NDEBUG" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D\ - "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\"\ - /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\err.obj" "$(INTDIR)\err.sbr" : $(SOURCE) $(DEP_CPP_ERR_C)\ - "$(INTDIR)" "$(INTDIR)\tokens.h" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -CPP_SWITCHES=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "." /I "..\h" /I\ - "..\support\set" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D\ - ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS"\ - /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c - -"$(INTDIR)\err.obj" "$(INTDIR)\err.sbr" : $(SOURCE) $(DEP_CPP_ERR_C)\ - "$(INTDIR)" "$(INTDIR)\tokens.h" - $(CPP) @<< - $(CPP_SWITCHES) $(SOURCE) -<< - - -!ENDIF - -SOURCE=.\fcache.c -DEP_CPP_FCACH=\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\fcache.obj" "$(INTDIR)\fcache.sbr" : $(SOURCE) $(DEP_CPP_FCACH)\ - "$(INTDIR)" - - -SOURCE=.\fset.c -DEP_CPP_FSET_=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\fset.obj" "$(INTDIR)\fset.sbr" : $(SOURCE) $(DEP_CPP_FSET_)\ - "$(INTDIR)" - - -SOURCE=.\fset2.c -DEP_CPP_FSET2=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\fset2.obj" "$(INTDIR)\fset2.sbr" : $(SOURCE) $(DEP_CPP_FSET2)\ - "$(INTDIR)" - - -SOURCE=.\gen.c -DEP_CPP_GEN_C=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\gen.obj" "$(INTDIR)\gen.sbr" : $(SOURCE) $(DEP_CPP_GEN_C)\ - "$(INTDIR)" - - -SOURCE=.\globals.c -DEP_CPP_GLOBA=\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\globals.obj" "$(INTDIR)\globals.sbr" : $(SOURCE) $(DEP_CPP_GLOBA)\ - "$(INTDIR)" - - -SOURCE=.\hash.c -DEP_CPP_HASH_=\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - ".\hash.h"\ - - -"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) $(DEP_CPP_HASH_)\ - "$(INTDIR)" - - -SOURCE=.\lex.c -DEP_CPP_LEX_C=\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\lex.obj" "$(INTDIR)\lex.sbr" : $(SOURCE) $(DEP_CPP_LEX_C)\ - "$(INTDIR)" - - -SOURCE=.\main.c -DEP_CPP_MAIN_=\ - "..\h\antlr.h"\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\stdpccts.h"\ - ".\syn.h"\ - ".\tokens.h"\ - - -"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" : $(SOURCE) $(DEP_CPP_MAIN_)\ - "$(INTDIR)" "$(INTDIR)\tokens.h" "$(INTDIR)\mode.h" - - -SOURCE=.\misc.c -DEP_CPP_MISC_=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\misc.obj" "$(INTDIR)\misc.sbr" : $(SOURCE) $(DEP_CPP_MISC_)\ - "$(INTDIR)" - - -SOURCE=.\mrhoist.c -DEP_CPP_MRHOI=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\mrhoist.obj" "$(INTDIR)\mrhoist.sbr" : $(SOURCE) $(DEP_CPP_MRHOI)\ - "$(INTDIR)" - - -SOURCE=.\pred.c -DEP_CPP_PRED_=\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\proto.h"\ - ".\syn.h"\ - - -"$(INTDIR)\pred.obj" "$(INTDIR)\pred.sbr" : $(SOURCE) $(DEP_CPP_PRED_)\ - "$(INTDIR)" - - -SOURCE=.\scan.c -DEP_CPP_SCAN_=\ - "..\h\antlr.h"\ - "..\h\dlgauto.h"\ - "..\h\dlgdef.h"\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - ".\generic.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\syn.h"\ - ".\tokens.h"\ - - -"$(INTDIR)\scan.obj" "$(INTDIR)\scan.sbr" : $(SOURCE) $(DEP_CPP_SCAN_)\ - "$(INTDIR)" "$(INTDIR)\tokens.h" "$(INTDIR)\mode.h" - - -SOURCE=..\support\set\set.c -DEP_CPP_SET_C=\ - "..\h\pccts_stdio.h"\ - "..\h\pccts_stdlib.h"\ - "..\h\pccts_string.h"\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - - -"$(INTDIR)\set.obj" "$(INTDIR)\set.sbr" : $(SOURCE) $(DEP_CPP_SET_C)\ - "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - - -!ENDIF - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsp deleted file mode 100644 index 103482170..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsp +++ /dev/null @@ -1,266 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ANTLR" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=ANTLR - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "AntlrMSVC60.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "AntlrMSVC60.mak" CFG="ANTLR - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "ANTLR - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "ANTLR - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "AntlrMSVC60" -# PROP Scc_LocalPath ".." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /O2 /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "NDEBUG" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"./Antlr.exe" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy antlr to ..\bin directory -PostBuild_Cmds=mkdir ..\bin copy ..\bin\antlr.exe antlr_old.exe copy antlr.exe ..\bin\. -# End Special Build Tool - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /ZI /Od /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -DUSER_ZZSYN -D__STDC__ -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"./Antlr.exe" /pdbtype:sept -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy antlr to ..\bin -PostBuild_Cmds=mkdir ..\bin copy ..\bin\antlr.exe antlr_old.exe copy antlr.exe ..\bin\. -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "ANTLR - Win32 Release" -# Name "ANTLR - Win32 Debug" -# Begin Source File - -SOURCE=.\antlr.c -# End Source File -# Begin Source File - -SOURCE=.\antlr.g - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -# Begin Custom Build - Building ANTLR Parser from ANTLR Grammar -InputPath=.\antlr.g -InputName=antlr - -BuildCmds= \ - ..\bin\antlr -gh $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"antlr.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -# Begin Custom Build - Building ANTLR Parser from ANTLR Grammar -InputPath=.\antlr.g -InputName=antlr - -BuildCmds= \ - ..\bin\antlr -gh $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"antlr.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\bits.c -# End Source File -# Begin Source File - -SOURCE=.\build.c -# End Source File -# Begin Source File - -SOURCE=.\dumpnode.c -# End Source File -# Begin Source File - -SOURCE=.\egman.c -# End Source File -# Begin Source File - -SOURCE=.\err.c - -!IF "$(CFG)" == "ANTLR - Win32 Release" - -!ELSEIF "$(CFG)" == "ANTLR - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\fcache.c -# End Source File -# Begin Source File - -SOURCE=.\fset.c -# End Source File -# Begin Source File - -SOURCE=.\fset2.c -# End Source File -# Begin Source File - -SOURCE=.\gen.c -# End Source File -# Begin Source File - -SOURCE=.\generic.h -# End Source File -# Begin Source File - -SOURCE=.\globals.c -# End Source File -# Begin Source File - -SOURCE=.\hash.c -# End Source File -# Begin Source File - -SOURCE=.\hash.h -# End Source File -# Begin Source File - -SOURCE=.\lex.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\misc.c -# End Source File -# Begin Source File - -SOURCE=.\mrhoist.c -# End Source File -# Begin Source File - -SOURCE=.\pred.c -# End Source File -# Begin Source File - -SOURCE=.\proto.h -# End Source File -# Begin Source File - -SOURCE=.\scan.c -# End Source File -# Begin Source File - -SOURCE=..\support\set\set.c -# End Source File -# Begin Source File - -SOURCE=.\syn.h -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsw deleted file mode 100644 index 4509bbff3..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/AntlrMSVC60.dsw +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "ANTLR"=.\AntlrMSVC60.dsp - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - AntlrMSVC60 - .. - end source code control -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/README b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/README deleted file mode 100644 index d6364eca8..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/README +++ /dev/null @@ -1,19 +0,0 @@ - ANTLR 1.33 - -This directory contains the files necessary to build ANTLR. - -If you do a "make scrub", ANTLR will have to run on antlr.g and DLG -will have to run on parser.dlg. Either - -(1) ANTLR uses the previous antlr in that directory to rebuild itself -(2) Needs to find antlr on the search path - -You will find that running "antlr -gh antlr.g" will result in about -10 ambiguity warnings. These are normal. Don't worry. - -If you do a "make clean" right after installation, ANTLR and DLG should -not need to run; only the C files will compile. - -Don't forget to go into the makefile to uncomment the appropriate -definitions for your OS/architecture/compiler or see the appropriate -NOTES.?? file. diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.1 b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.1 deleted file mode 100644 index 6ace1b2a9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.1 +++ /dev/null @@ -1,209 +0,0 @@ -.TH ANTLR 1 "September 1995" "ANTLR" "PCCTS Manual Pages" -.SH NAME -antlr \- ANother Tool for Language Recognition -.SH SYNTAX -.LP -\fBantlr\fR [\fIoptions\fR] \fIgrammar_files\fR -.SH DESCRIPTION -.PP -\fIAntlr\fP converts an extended form of context-free grammar into a -set of C functions which directly implement an efficient form of -deterministic recursive-descent LL(k) parser. Context-free grammars -may be augmented with predicates to allow semantics to influence -parsing; this allows a form of context-sensitive parsing. Selective -backtracking is also available to handle non-LL(k) and even -non-LALR(k) constructs. \fIAntlr\fP also produces a definition of a -lexer which can be automatically converted into C code for a DFA-based -lexer by \fIdlg\fR. Hence, \fIantlr\fR serves a function much like -that of \fIyacc\fR, however, it is notably more flexible and is more -integrated with a lexer generator (\fIantlr\fR directly generates -\fIdlg\fR code, whereas \fIyacc\fR and \fIlex\fR are given independent -descriptions). Unlike \fIyacc\fR which accepts LALR(1) grammars, -\fIantlr\fR accepts LL(k) grammars in an extended BNF notation \(em -which eliminates the need for precedence rules. -.PP -Like \fIyacc\fR grammars, \fIantlr\fR grammars can use -automatically-maintained symbol attribute values referenced as dollar -variables. Further, because \fIantlr\fR generates top-down parsers, -arbitrary values may be inherited from parent rules (passed like -function parameters). \fIAntlr\fP also has a mechanism for creating -and manipulating abstract-syntax-trees. -.PP -There are various other niceties in \fIantlr\fR, including the ability to -spread one grammar over multiple files or even multiple grammars in a single -file, the ability to generate a version of the grammar with actions stripped -out (for documentation purposes), and lots more. -.SH OPTIONS -.IP "\fB-ck \fIn\fR" -Use up to \fIn\fR symbols of lookahead when using compressed (linear -approximation) lookahead. This type of lookahead is very cheap to -compute and is attempted before full LL(k) lookahead, which is of -exponential complexity in the worst case. In general, the compressed -lookahead can be much deeper (e.g, \f(CW-ck 10\fP) than the full -lookahead (which usually must be less than 4). -.IP \fB-CC\fP -Generate C++ output from both ANTLR and DLG. -.IP \fB-cr\fP -Generate a cross-reference for all rules. For each rule, print a list -of all other rules that reference it. -.IP \fB-e1\fP -Ambiguities/errors shown in low detail (default). -.IP \fB-e2\fP -Ambiguities/errors shown in more detail. -.IP \fB-e3\fP -Ambiguities/errors shown in excruciating detail. -.IP "\fB-fe\fP file" -Rename \fBerr.c\fP to file. -.IP "\fB-fh\fP file" -Rename \fBstdpccts.h\fP header (turns on \fB-gh\fP) to file. -.IP "\fB-fl\fP file" -Rename lexical output, \fBparser.dlg\fP, to file. -.IP "\fB-fm\fP file" -Rename file with lexical mode definitions, \fBmode.h\fP, to file. -.IP "\fB-fr\fP file" -Rename file which remaps globally visible symbols, \fBremap.h\fP, to file. -.IP "\fB-ft\fP file" -Rename \fBtokens.h\fP to file. -.IP \fB-ga\fP -Generate ANSI-compatible code (default case). This has not been -rigorously tested to be ANSI XJ11 C compliant, but it is close. The -normal output of \fIantlr\fP is currently compilable under both K&R, -ANSI C, and C++\(emthis option does nothing because \fIantlr\fP -generates a bunch of #ifdef's to do the right thing depending on the -language. -.IP \fB-gc\fP -Indicates that \fIantlr\fP should generate no C code, i.e., only -perform analysis on the grammar. -.IP \fB-gd\fP -C code is inserted in each of the \fIantlr\fR generated parsing functions to -provide for user-defined handling of a detailed parse trace. The inserted -code consists of calls to the user-supplied macros or functions called -\fBzzTRACEIN\fR and \fBzzTRACEOUT\fP. The only argument is a -\fIchar *\fR pointing to a C-style string which is the grammar rule -recognized by the current parsing function. If no definition is given -for the trace functions, upon rule entry and exit, a message will be -printed indicating that a particular rule as been entered or exited. -.IP \fB-ge\fP -Generate an error class for each non-terminal. -.IP \fB-gh\fP -Generate \fBstdpccts.h\fP for non-ANTLR-generated files to include. -This file contains all defines needed to describe the type of parser -generated by \fIantlr\fP (e.g. how much lookahead is used and whether -or not trees are constructed) and contains the \fBheader\fP action -specified by the user. -.IP \fB-gk\fP -Generate parsers that delay lookahead fetches until needed. Without -this option, \fIantlr\fP generates parsers which always have \fIk\fP -tokens of lookahead available. -.IP \fB-gl\fP -Generate line info about grammar actions in C parser of the form -\fB#\ \fIline\fP\ "\fIfile\fP"\fR which makes error messages from -the C/C++ compiler make more sense as they will \*Qpoint\*U into the -grammar file not the resulting C file. Debugging is easier as well, -because you will step through the grammar not C file. -.IP \fB-gs\fR -Do not generate sets for token expression lists; instead generate a -\fB||\fP-separated sequence of \fBLA(1)==\fItoken_number\fR. The -default is to generate sets. -.IP \fB-gt\fP -Generate code for Abstract-Syntax Trees. -.IP \fB-gx\fP -Do not create the lexical analyzer files (dlg-related). This option -should be given when the user wishes to provide a customized lexical -analyzer. It may also be used in \fImake\fR scripts to cause only the -parser to be rebuilt when a change not affecting the lexical structure -is made to the input grammars. -.IP "\fB-k \fIn\fR" -Set k of LL(k) to \fIn\fR; i.e. set tokens of look-ahead (default==1). -.IP "\fB-o\fP dir -Directory where output files should go (default="."). This is very -nice for keeping the source directory clear of ANTLR and DLG spawn. -.IP \fB-p\fP -The complete grammar, collected from all input grammar files and -stripped of all comments and embedded actions, is listed to -\fBstdout\fP. This is intended to aid in viewing the entire grammar -as a whole and to eliminate the need to keep actions concisely stated -so that the grammar is easier to read. Hence, it is preferable to -embed even complex actions directly in the grammar, rather than to -call them as subroutines, since the subroutine call overhead will be -saved. -.IP \fB-pa\fP -This option is the same as \fB-p\fP except that the output is -annotated with the first sets determined from grammar analysis. -.IP "\fB-prc on\fR -Turn on the computation and hoisting of predicate context. -.IP "\fB-prc off\fR -Turn off the computation and hoisting of predicate context. This -option makes 1.10 behave like the 1.06 release with option \fB-pr\fR -on. Context computation is off by default. -.IP "\fB-rl \fIn\fR -Limit the maximum number of tree nodes used by grammar analysis to -\fIn\fP. Occasionally, \fIantlr\fP is unable to analyze a grammar -submitted by the user. This rare situation can only occur when the -grammar is large and the amount of lookahead is greater than one. A -nonlinear analysis algorithm is used by PCCTS to handle the general -case of LL(k) parsing. The average complexity of analysis, however, is -near linear due to some fancy footwork in the implementation which -reduces the number of calls to the full LL(k) algorithm. An error -message will be displayed, if this limit is reached, which indicates -the grammar construct being analyzed when \fIantlr\fP hit a -non-linearity. Use this option if \fIantlr\fP seems to go out to -lunch and your disk start thrashing; try \fIn\fP=10000 to start. Once -the offending construct has been identified, try to remove the -ambiguity that \fIantlr\fP was trying to overcome with large lookahead -analysis. The introduction of (...)? backtracking blocks eliminates -some of these problems\ \(em \fIantlr\fP does not analyze alternatives -that begin with (...)? (it simply backtracks, if necessary, at run -time). -.IP \fB-w1\fR -Set low warning level. Do not warn if semantic predicates and/or -(...)? blocks are assumed to cover ambiguous alternatives. -.IP \fB-w2\fR -Ambiguous parsing decisions yield warnings even if semantic predicates -or (...)? blocks are used. Warn if predicate context computed and -semantic predicates incompletely disambiguate alternative productions. -.IP \fB-\fR -Read grammar from standard input and generate \fBstdin.c\fP as the -parser file. -.SH "SPECIAL CONSIDERATIONS" -.PP -\fIAntlr\fP works... we think. There is no implicit guarantee of -anything. We reserve no \fBlegal\fP rights to the software known as -the Purdue Compiler Construction Tool Set (PCCTS) \(em PCCTS is in the -public domain. An individual or company may do whatever they wish -with source code distributed with PCCTS or the code generated by -PCCTS, including the incorporation of PCCTS, or its output, into -commercial software. We encourage users to develop software with -PCCTS. However, we do ask that credit is given to us for developing -PCCTS. By "credit", we mean that if you incorporate our source code -into one of your programs (commercial product, research project, or -otherwise) that you acknowledge this fact somewhere in the -documentation, research report, etc... If you like PCCTS and have -developed a nice tool with the output, please mention that you -developed it using PCCTS. As long as these guidelines are followed, -we expect to continue enhancing this system and expect to make other -tools available as they are completed. -.SH FILES -.IP *.c -output C parser. -.IP *.cpp -output C++ parser when C++ mode is used. -.IP \fBparser.dlg\fP -output \fIdlg\fR lexical analyzer. -.IP \fBerr.c\fP -token string array, error sets and error support routines. Not used in -C++ mode. -.IP \fBremap.h\fP -file that redefines all globally visible parser symbols. The use of -the #parser directive creates this file. Not used in -C++ mode. -.IP \fBstdpccts.h\fP -list of definitions needed by C files, not generated by PCCTS, that -reference PCCTS objects. This is not generated by default. Not used in -C++ mode. -.IP \fBtokens.h\fP -output \fI#defines\fR for tokens used and function prototypes for -functions generated for rules. -.SH "SEE ALSO" -.LP -dlg(1), pccts(1) diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.c deleted file mode 100644 index 083fea12f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.c +++ /dev/null @@ -1,3564 +0,0 @@ -/* - * A n t l r T r a n s l a t i o n H e a d e r - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - * - * ..\bin\antlr -gh antlr.g - * - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include "pcctscfg.h" -#include "set.h" -#include -#include "syn.h" -#include "hash.h" -#include "generic.h" -#define zzcr_attr(attr,tok,t) -#define zzSET_SIZE 20 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "mode.h" - -/* MR23 In order to remove calls to PURIFY use the antlr -nopurify option */ - -#ifndef PCCTS_PURIFY -#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\0',(s)); -#endif - -ANTLR_INFO - - -/* MR20 G. Hobbelt For Borland C++ 4.x & 5.x compiling with ALL warnings enabled */ -#if defined(__TURBOC__) -#pragma warn -aus /* unused assignment of 'xxx' */ -#endif - - -#ifdef __USE_PROTOS -static void chkToken(char *, char *, char *, int); -#else -static void chkToken(); -#endif - -#ifdef __USE_PROTOS -static int isDLGmaxToken(char *Token); /* MR3 */ -#else -static int isDLGmaxToken(); /* MR3 */ -#endif - -static int class_nest_level = 0; - -/* MR20 G. Hobbelt extern definitions moved to antlr.h */ - - - -void -#ifdef __USE_PROTOS -grammar(void) -#else -grammar() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - Graph g; - { - zzBLOCK(zztasp2); - zzMake0; - { - for (;;) { - if ( !((setwd1[LA(1)]&0x1))) break; - if ( (LA(1)==94) ) { - zzmatch(94); zzCONSUME; - zzmatch(Action); - - if ( HdrAction==NULL ) { - HdrAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(HdrAction!=NULL, "rule grammar: cannot allocate header action"); - strcpy(HdrAction, LATEXT(1)); - } - else warn("additional #header statement ignored"); - zzCONSUME; - - } - else { - if ( (LA(1)==95) ) { - zzmatch(95); zzCONSUME; - zzmatch(Action); - - if ( FirstAction==NULL ) { - FirstAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(FirstAction!=NULL, "rule grammar: cannot allocate #first action"); - strcpy(FirstAction, LATEXT(1)); - } else { - warn("additional #first statement ignored"); - }; - zzCONSUME; - - } - else { - if ( (LA(1)==96) ) { - zzmatch(96); zzCONSUME; - zzmatch(QuotedTerm); - - if ( GenCC ) { - warn("#parser meta-op incompatible with -CC; ignored"); - } - else { - if ( strcmp(ParserName,"zzparser")==0 ) { - ParserName=StripQuotes(mystrdup(LATEXT(1))); - if ( RulePrefix[0]!='\0' ) - { - warn("#parser meta-op incompatible with '-gp prefix'; '-gp' ignored"); - RulePrefix[0]='\0'; - } - } - else warn("additional #parser statement ignored"); - } - zzCONSUME; - - } - else { - if ( (LA(1)==97) ) { - zzmatch(97); zzCONSUME; - zzmatch(QuotedTerm); - { - char *fname; - zzantlr_state st; FILE *f; struct zzdlg_state dst; - UserTokenDefsFile = mystrdup(LATEXT(1)); - zzsave_antlr_state(&st); - zzsave_dlg_state(&dst); - fname = mystrdup(LATEXT(1)); - f = fopen(StripQuotes(fname), "r"); - if ( f==NULL ) {warn(eMsg1("cannot open token defs file '%s'", fname+1));} - else { - ANTLRm(enum_file(fname+1), f, PARSE_ENUM_FILE); - UserDefdTokens = 1; - } - zzrestore_antlr_state(&st); - zzrestore_dlg_state(&dst); - } - zzCONSUME; - - } - else break; /* MR6 code for exiting loop "for sure" */ - } - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - for (;;) { - if ( !((setwd1[LA(1)]&0x2))) break; - if ( (LA(1)==Action) ) { - zzmatch(Action); - { - UserAction *ua = newUserAction(LATEXT(1)); - ua->file = action_file; ua->line = action_line; - if ( class_nest_level>0 ) list_add(&class_before_actions, ua); - else list_add(&BeforeActions, ua); - } - zzCONSUME; - - } - else { - if ( (LA(1)==108) ) { - laction(); - } - else { - if ( (LA(1)==109) ) { - lmember(); - } - else { - if ( (LA(1)==110) ) { - lprefix(); - } - else { - if ( (LA(1)==116) ) { - aLexclass(); - } - else { - if ( (LA(1)==120) ) { - token(); - } - else { - if ( (LA(1)==117) ) { - error(); - } - else { - if ( (LA(1)==118) ) { - tclass(); - } - else { - if ( (LA(1)==111) ) { - aPred(); - } - else { - if ( (LA(1)==133) ) { - default_exception_handler(); - } - else { - if ( (LA(1)==99) ) { - class_def(); - } - else { - if ( (LA(1)==98) ) { - zzmatch(98); - - if ( class_nest_level==0 ) - warn("missing class definition for trailing '}'"); - class_nest_level--; - zzCONSUME; - - } - else break; /* MR6 code for exiting loop "for sure" */ - } - } - } - } - } - } - } - } - } - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - rule(); - g=zzaArg(zztasp1,3); SynDiag = (Junction *) zzaArg(zztasp1,3 ).left; - { - zzBLOCK(zztasp2); - zzMake0; - { - for (;;) { - if ( !((setwd1[LA(1)]&0x4))) break; - if ( (LA(1)==NonTerminal) ) { - rule(); - if ( zzaArg(zztasp2,1 ).left!=NULL ) { - g.right = NULL; - -/* MR21a */ /* Avoid use of a malformed graph when CannotContinue */ - /* MR21a */ /* is already set */ - /* MR21a */ - /* MR21a */ if (! (CannotContinue && g.left == NULL)) { - /* MR21a */ g = Or(g, zzaArg(zztasp2,1)); - /* MR21a */ } - /* MR21a */ } - } - else { - if ( (LA(1)==116) ) { - aLexclass(); - } - else { - if ( (LA(1)==120) ) { - token(); - } - else { - if ( (LA(1)==117) ) { - error(); - } - else { - if ( (LA(1)==118) ) { - tclass(); - } - else { - if ( (LA(1)==111) ) { - aPred(); - } - else { - if ( (LA(1)==99) ) { - class_def(); - } - else { - if ( (LA(1)==98) ) { - zzmatch(98); - - if ( class_nest_level==0 ) - warn("missing class definition for trailing '}'"); - class_nest_level--; - zzCONSUME; - - } - else break; /* MR6 code for exiting loop "for sure" */ - } - } - } - } - } - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - for (;;) { - if ( !((setwd1[LA(1)]&0x8))) break; - if ( (LA(1)==Action) ) { - zzmatch(Action); - { - UserAction *ua = newUserAction(LATEXT(1)); - ua->file = action_file; ua->line = action_line; - if ( class_nest_level>0 ) list_add(&class_after_actions, ua); - else list_add(&AfterActions, ua); - } - zzCONSUME; - - } - else { - if ( (LA(1)==108) ) { - laction(); - } - else { - if ( (LA(1)==109) ) { - lmember(); - } - else { - if ( (LA(1)==110) ) { - lprefix(); - } - else { - if ( (LA(1)==117) ) { - error(); - } - else { - if ( (LA(1)==118) ) { - tclass(); - } - else { - if ( (LA(1)==99) ) { - class_def(); - } - else { - if ( (LA(1)==111) ) { - aPred(); - } - else { - if ( (LA(1)==98) ) { - zzmatch(98); - - if ( class_nest_level==0 ) - warn("missing class definition for trailing '}'"); - class_nest_level--; - zzCONSUME; - - } - else break; /* MR6 code for exiting loop "for sure" */ - } - } - } - } - } - } - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(Eof); zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x10); - } -} - -void -#ifdef __USE_PROTOS -class_def(void) -#else -class_def() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int go=1; char name[MaxRuleName+1]; - zzmatch(99); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==NonTerminal) ) { - zzmatch(NonTerminal); - if(go) strncpy(name,LATEXT(1),MaxRuleName); - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - if(go) strncpy(name,LATEXT(1),MaxRuleName); - zzCONSUME; - - } - else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - if ( CurrentClassName[0]!='\0' && strcmp(CurrentClassName,name)!=0 - && GenCC ) { - err("only one grammar class allowed in this release"); - go = 0; - } - else strcpy(CurrentClassName, name); - if ( !GenCC ) { err("class meta-op used without C++ option"); } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (setwd1[LA(1)]&0x20) ) { - zzsetmatch(zzerr2, zzerr3); - if (ClassDeclStuff == NULL) { - /* MR10 */ ClassDeclStuff=(char *)calloc(MaxClassDeclStuff+1,sizeof(char)); - /* MR10 */ }; - /* MR10 */ strncat(ClassDeclStuff," ",MaxClassDeclStuff); - /* MR10 */ strncat(ClassDeclStuff,LATEXT(1),MaxClassDeclStuff); - /* MR22 */ do { - /* MR22 */ if (0 == strcmp(LATEXT(1),"public")) break; - /* MR22 */ if (0 == strcmp(LATEXT(1),"private")) break; - /* MR22 */ if (0 == strcmp(LATEXT(1),"protected")) break; - /* MR22 */ if (0 == strcmp(LATEXT(1),"virtual")) break; - /* MR22 */ if (0 == strcmp(LATEXT(1),",")) break; - /* MR22 */ if (0 == strcmp(LATEXT(1),":")) break; - /* MR22 */ if (BaseClassName != NULL) break; - /* MR22 */ BaseClassName=(char *)calloc(strlen(LATEXT(1))+1,sizeof(char)); - /* MR22 */ require(BaseClassName!=NULL, "rule grammar: cannot allocate base class name"); - /* MR22 */ strcpy(BaseClassName,LATEXT(1)); - /* MR22 */ } while (0); - /* MR10 */ - zzCONSUME; - - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(102); - - no_classes_found = 0; - if ( class_nest_level>=1 ) {warn("cannot have nested classes");} - else class_nest_level++; - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x40); - } -} - -void -#ifdef __USE_PROTOS -rule(void) -#else -rule() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - - - ExceptionGroup *eg; - RuleEntry *q; Junction *p; Graph r; int f, l; ECnode *e; - set toksrefd, rulesrefd; - char *pdecl=NULL, *ret=NULL, *a; CurRetDef = CurParmDef = NULL; - CurExGroups = NULL; - CurElementLabels = NULL; - CurAstLabelsInActions = NULL; /* MR27 */ - /* We want a new element label hash table for each rule */ - if ( Elabel!=NULL ) killHashTable(Elabel); - Elabel = newHashTable(); - attribsRefdFromAction = empty; - zzmatch(NonTerminal); - q=NULL; - if ( hash_get(Rname, LATEXT(1))!=NULL ) { - err(eMsg1("duplicate rule definition: '%s'",LATEXT(1))); - CannotContinue=TRUE; - } - else - { - q = (RuleEntry *)hash_add(Rname, - LATEXT(1), - (Entry *)newRuleEntry(LATEXT(1))); - CurRule = q->str; - } - CurRuleNode = q; - f = CurFile; l = zzline; - NumRules++; - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==103) ) { - zzmatch(103); - if ( q!=NULL ) q->noAST = TRUE; - zzCONSUME; - - } - else { - if ( (setwd1[LA(1)]&0x80) ) { - } - else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - ; - if ( (setwd2[LA(1)]&0x1) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==104) ) { - zzmatch(104); zzCONSUME; - } - else { - if ( (LA(1)==PassAction) ) { - } - else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - zzmatch(PassAction); - pdecl = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(pdecl!=NULL, "rule rule: cannot allocate param decl"); - strcpy(pdecl, LATEXT(1)); - CurParmDef = pdecl; - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x2) ) { - } - else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==105) ) { - zzmatch(105); zzCONSUME; - zzmatch(PassAction); - ret = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(ret!=NULL, "rule rule: cannot allocate ret type"); - strcpy(ret, LATEXT(1)); - CurRetDef = ret; - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - if ( q!=NULL ) q->egroup=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==106) ) { - } - else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - if ( GenEClasseForRules && q!=NULL ) { - e = newECnode; - require(e!=NULL, "cannot allocate error class node"); - if ( q->egroup == NULL ) {a = q->str; a[0] = (char)toupper(a[0]);} - else a = q->egroup; - if ( Tnum( a ) == 0 ) - { - e->tok = addTname( a ); - list_add(&eclasses, (char *)e); - if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]); - /* refers to itself */ - list_add(&(e->elist), mystrdup(q->str)); - } - else { - warn(eMsg1("default errclass for '%s' would conflict with token/errclass/tokclass",a)); - if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]); - free((char *)e); - } - } - BlkLevel++; - if (BlkLevel >= MAX_BLK_LEVEL) fatal("Blocks nested too deeply"); - /* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID; - /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - zzmatch(106); - inAlt=1; - zzCONSUME; - - block( &toksrefd, &rulesrefd ); - r = makeBlk(zzaArg(zztasp1,7),0, NULL /* pFirstSetSymbol */ ); - CurRuleBlk = (Junction *)r.left; - CurRuleBlk->blockid = CurBlockID; - CurRuleBlk->jtype = RuleBlk; - if ( q!=NULL ) CurRuleBlk->rname = q->str; - CurRuleBlk->file = f; - CurRuleBlk->line = l; - CurRuleBlk->pdecl = pdecl; - CurRuleBlk->ret = ret; - CurRuleBlk->lock = makelocks(); - CurRuleBlk->pred_lock = makelocks(); - CurRuleBlk->tokrefs = toksrefd; - CurRuleBlk->rulerefs = rulesrefd; - p = newJunction(); /* add EndRule Node */ - ((Junction *)r.right)->p1 = (Node *)p; - r.right = (Node *) p; - p->jtype = EndRule; - p->lock = makelocks(); - p->pred_lock = makelocks(); - CurRuleBlk->end = p; - if ( q!=NULL ) q->rulenum = NumRules; - zzaArg(zztasp1,7) = r; - - /* MR23 */ CurBlockID_array[BlkLevel] = (-1); - /* MR23 */ CurAltNum_array[BlkLevel] = (-1); - --BlkLevel; - altFixup();leFixup();egFixup(); - zzmatch(107); - inAlt=0; - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==Action) ) { - zzmatch(Action); - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule rule: cannot allocate error action"); - strcpy(a, LATEXT(1)); - CurRuleBlk->erraction = a; - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr9,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==133) ) { - eg = exception_group(); - - if ( eg!=NULL ) { - list_add(&CurExGroups, (void *)eg); - if (eg->label == NULL || *eg->label=='\0' ) q->has_rule_exception = 1; - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - if ( q==NULL ) zzaArg(zztasp1,0 ).left = NULL; else zzaArg(zztasp1,0) = zzaArg(zztasp1,7); - CurRuleBlk->exceptions = CurExGroups; - CurRuleBlk->el_labels = CurElementLabels; - CurRuleNode->ast_labels_in_actions = CurAstLabelsInActions; - CurRuleNode = NULL; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x10); - } -} - -void -#ifdef __USE_PROTOS -laction(void) -#else -laction() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - char *a; - zzmatch(108); zzCONSUME; - zzmatch(Action); - - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule laction: cannot allocate action"); - strcpy(a, LATEXT(1)); - list_add(&LexActions, a); - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x20); - } -} - -void -#ifdef __USE_PROTOS -lmember(void) -#else -lmember() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - char *a; - zzmatch(109); zzCONSUME; - zzmatch(Action); - - /* MR1 */ if (! GenCC) { - /* MR1 */ err("Use #lexmember only in C++ mode (to insert code in DLG class header"); - /* MR1 */ } else { - /* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - /* MR1 */ require(a!=NULL, "rule lmember: cannot allocate action"); - /* MR1 */ strcpy(a, LATEXT(1)); - /* MR1 */ list_add(&LexMemberActions, a); - /* MR1 */ }; - /* MR1 */ - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x40); - } -} - -void -#ifdef __USE_PROTOS -lprefix(void) -#else -lprefix() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - char *a; - zzmatch(110); zzCONSUME; - zzmatch(Action); - - /* MR1 */ if (! GenCC) { - /* MR1 */ err("Use #lexprefix only in C++ mode (to insert code in DLG class header"); - /* MR1 */ } else { - /* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - /* MR1 */ require(a!=NULL, "rule lprefix: cannot allocate action"); - /* MR1 */ strcpy(a, LATEXT(1)); - /* MR1 */ list_add(&LexPrefixActions, a); - /* MR1 */ }; - /* MR1 */ - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x80); - } -} - -void -#ifdef __USE_PROTOS -aPred(void) -#else -aPred() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - PredEntry *predEntry=NULL; - char *name=NULL; - Predicate *predExpr=NULL; - char *predLiteral=NULL; - int save_file; - int save_line; - int predExprPresent=0; - zzmatch(111); - - MR_usingPredNames=1; /* will need to use -mrhoist version of genPredTree */ - zzCONSUME; - - zzmatch(TokenTerm); - name=mystrdup(LATEXT(1)); - zzCONSUME; - - - /* don't free - referenced in predicates */ - - CurPredName=(char *)calloc(1,strlen(name) + 10); - strcat(CurPredName,"#pred "); - strcat(CurPredName,name); - - predEntry=(PredEntry *) hash_get(Pname,name); - if (predEntry != NULL) { - warnFL(eMsg1("#pred %s previously defined - ignored",name), - FileStr[action_file],action_line); - name=NULL; -}; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==Pred) ) { - zzmatch(Pred); - predLiteral=mystrdup(LATEXT(1)); - save_line=action_line; - save_file=action_file; - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (setwd3[LA(1)]&0x1) ) { - predExpr = predOrExpr(); - - predExprPresent=1; - } - else { - if ( (setwd3[LA(1)]&0x2) ) { - } - else {zzFAIL(1,zzerr10,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - if (predLiteral != NULL && name != NULL) { - - /* - * predExpr may be NULL due to syntax errors - * or simply omitted by the user - */ - - predEntry=newPredEntry(name); - predEntry->file=save_file; - predEntry->line=save_line; - predExpr=MR_predFlatten(predExpr); - predEntry->predLiteral=predLiteral; - if (! predExprPresent || predExpr == NULL) { - predExpr=new_pred(); - predExpr->expr=predLiteral; - predExpr->source=newActionNode(); - predExpr->source->action=predExpr->expr; - predExpr->source->rname=CurPredName; - predExpr->source->line=action_line; - predExpr->source->file=action_file; - predExpr->source->is_predicate=1; - predExpr->k=predicateLookaheadDepth(predExpr->source); - }; - predEntry->pred=predExpr; - hash_add(Pname,name,(Entry *)predEntry); - predExpr=NULL; - }; - predicate_free(predExpr); - } - else { - if ( (setwd3[LA(1)]&0x4) ) { - save_line=zzline; save_file=CurFile; - predExpr = predOrExpr(); - - if (predExpr != NULL && name != NULL) { - predEntry=newPredEntry(name); - predEntry->file=CurFile; - predEntry->line=zzline; - predExpr=MR_predFlatten(predExpr); - predEntry->pred=predExpr; - hash_add(Pname,name,(Entry *)predEntry); - predExpr=NULL; - }; - predicate_free(predExpr); - } - else {zzFAIL(1,zzerr11,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==107) ) { - zzmatch(107); zzCONSUME; - } - else { - if ( (setwd3[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr12,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - predicate_free(predExpr); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x10); - } -} - -Predicate * -#ifdef __USE_PROTOS -predOrExpr(void) -#else -predOrExpr() -#endif -{ - Predicate * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(Predicate * )) - zzMake0; - { - Predicate *ORnode; - Predicate *predExpr; - Predicate **tail=NULL; - predExpr = predAndExpr(); - - - ORnode=new_pred(); - ORnode->expr=PRED_OR_LIST; - if (predExpr != NULL) { - ORnode->down=predExpr; - tail=&predExpr->right; - }; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==112) ) { - zzmatch(112); zzCONSUME; - predExpr = predAndExpr(); - - - if (predExpr != NULL) { - *tail=predExpr; - tail=&predExpr->right; - }; - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - - _retv=ORnode; - ORnode=NULL; - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - predicate_free(ORnode); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x20); - return _retv; - } -} - -Predicate * -#ifdef __USE_PROTOS -predAndExpr(void) -#else -predAndExpr() -#endif -{ - Predicate * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(Predicate * )) - zzMake0; - { - Predicate *ANDnode; - Predicate *predExpr; - Predicate **tail=NULL; - predExpr = predPrimary(); - - - ANDnode=new_pred(); - ANDnode->expr=PRED_AND_LIST; - if (predExpr != NULL) { - ANDnode->down=predExpr; - tail=&predExpr->right; - }; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==113) ) { - zzmatch(113); zzCONSUME; - predExpr = predPrimary(); - - - if (predExpr != NULL) { - *tail=predExpr; - tail=&predExpr->right; - }; - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - - _retv=ANDnode; - ANDnode=NULL; - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - predicate_free(ANDnode); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x40); - return _retv; - } -} - -Predicate * -#ifdef __USE_PROTOS -predPrimary(void) -#else -predPrimary() -#endif -{ - Predicate * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(Predicate * )) - zzMake0; - { - - char *name=NULL; - PredEntry *predEntry=NULL; - Predicate *predExpr=NULL; - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - name=mystrdup(LATEXT(1)); - zzCONSUME; - - - predEntry=(PredEntry *) hash_get(Pname,name); - if (predEntry == NULL) { - warnFL(eMsg1("no previously defined #pred with name \"%s\"",name), - FileStr[CurFile],zzline); - name=NULL; - _retv=NULL; - } else { - predExpr=predicate_dup(predEntry->pred); - predExpr->predEntry=predEntry; - _retv=predExpr; - }; - } - else { - if ( (LA(1)==114) ) { - zzmatch(114); zzCONSUME; - predExpr = predOrExpr(); - - zzmatch(115); - - _retv=predExpr; - zzCONSUME; - - } - else { - if ( (LA(1)==103) ) { - zzmatch(103); zzCONSUME; - predExpr = predPrimary(); - - - predExpr->inverted=!predExpr->inverted; - _retv=predExpr; - } - else {zzFAIL(1,zzerr13,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - - predicate_free(predExpr); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x80); - return _retv; - } -} - -void -#ifdef __USE_PROTOS -aLexclass(void) -#else -aLexclass() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - zzmatch(116); zzCONSUME; - zzmatch(TokenTerm); - lexclass(mystrdup(LATEXT(1))); - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd4, 0x1); - } -} - -void -#ifdef __USE_PROTOS -error(void) -#else -error() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - char *t=NULL; ECnode *e; int go=1; TermEntry *p; - zzmatch(117); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - ; - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else {zzFAIL(1,zzerr14,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - e = newECnode; - require(e!=NULL, "cannot allocate error class node"); - e->lexclass = CurrentLexClass; - if ( Tnum( (t=StripQuotes(t)) ) == 0 ) - { - if ( hash_get(Texpr, t) != NULL ) - warn(eMsg1("errclass name conflicts with regular expression '%s'",t)); - e->tok = addTname( t ); - set_orel(e->tok, &imag_tokens); - require((p=(TermEntry *)hash_get(Tname, t)) != NULL, - "hash table mechanism is broken"); - p->classname = 1; /* entry is errclass name, not token */ - list_add(&eclasses, (char *)e); - } - else - { - warn(eMsg1("redefinition of errclass or conflict w/token or tokclass '%s'; ignored",t)); - free( (char *)e ); - go=0; -} - zzmatch(102); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==NonTerminal) ) { - zzmatch(NonTerminal); - if ( go ) t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - if ( go ) t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - if ( go ) t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else {zzFAIL(1,zzerr15,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp2); - } - } - if ( go ) list_add(&(e->elist), t); - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (setwd4[LA(1)]&0x2) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==NonTerminal) ) { - zzmatch(NonTerminal); - if ( go ) t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - if ( go ) t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - if ( go ) t=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else {zzFAIL(1,zzerr16,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - if ( go ) list_add(&(e->elist), t); - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(98); zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd4, 0x4); - } -} - -void -#ifdef __USE_PROTOS -tclass(void) -#else -tclass() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - char *t=NULL; TCnode *e; int go=1,tok,totok; TermEntry *p, *term, *toterm; - char *akaString=NULL; int save_file; int save_line; - char *totext=NULL; - zzmatch(118); zzCONSUME; - zzmatch(TokenTerm); - t=mystrdup(LATEXT(1)); - zzCONSUME; - - e = newTCnode; - require(e!=NULL, "cannot allocate token class node"); - e->lexclass = CurrentLexClass; - if ( Tnum( t ) == 0 ) - { - e->tok = addTname( t ); - set_orel(e->tok, &imag_tokens); - set_orel(e->tok, &tokclasses); - require((p=(TermEntry *)hash_get(Tname, t)) != NULL, - "hash table mechanism is broken"); - p->classname = 1; /* entry is class name, not token */ - p->tclass = e; /* save ptr to this tclass def */ - list_add(&tclasses, (char *)e); - } - else - { - warn(eMsg1("redefinition of tokclass or conflict w/token '%s'; ignored",t)); - free( (char *)e ); - go=0; -} - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==114) ) { - zzmatch(114); zzCONSUME; - zzmatch(QuotedTerm); - akaString=mystrdup(StripQuotes(LATEXT(1))); - /* MR11 */ save_file=CurFile;save_line=zzline; - /* MR23 */ - zzCONSUME; - - zzmatch(115); zzCONSUME; - } - else { - if ( (LA(1)==102) ) { - } - else {zzFAIL(1,zzerr17,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - /* MR23 */ if (p!= NULL && akaString != NULL) { - /* MR23 */ if (p->akaString != NULL) { - /* MR23 */ if (strcmp(p->akaString,akaString) != 0) { - /* MR23 */ warnFL(eMsg2("this #tokclass statment conflicts with a previous #tokclass %s(\"%s\") statement", - /* MR23 */ t,p->akaString), - /* MR23 */ FileStr[save_file],save_line); - /* MR23 */ }; - /* MR23 */ } else { - /* MR23 */ p->akaString=akaString; - /* MR23 */ }; - /* MR23 */ }; - /* MR23 */ - zzmatch(102); zzCONSUME; - { - zzBLOCK(zztasp2); - int zzcnt=1; - zzMake0; - { - do { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - if ( go ) { - term = (TermEntry *) hash_get(Tname, LATEXT(1)); - if ( term==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - go = 0; - } - else {t=mystrdup(LATEXT(1)); tok=addTname(LATEXT(1));} - } - zzCONSUME; - - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==119) ) { - zzmatch(119); zzCONSUME; - zzmatch(TokenTerm); - if ( go ) { - toterm = (TermEntry *) hash_get(Tname, LATEXT(1)); - if ( toterm==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - go = 0; - } else { - totext=mystrdup(LATEXT(1)); totok=addTname(LATEXT(1)); - } - } - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr18,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - if ( go ) { - term = (TermEntry *) hash_get(Texpr, LATEXT(1)); - if ( term==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - go = 0; - } - else {t=mystrdup(LATEXT(1)); tok=addTexpr(LATEXT(1));} - } - zzCONSUME; - - } - else {zzFAIL(1,zzerr19,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - if ( go ) { - if (totext == NULL) { - list_add(&(e->tlist), t); - } else { - list_add(&(e->tlist),".."); - list_add(&(e->tlist),t); - list_add(&(e->tlist),totext); - } - totext=NULL; - } - zzLOOP(zztasp2); - } while ( (setwd4[LA(1)]&0x10) ); - zzEXIT(zztasp2); - } - } - zzmatch(98); zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd4, 0x20); - } -} - -void -#ifdef __USE_PROTOS -token(void) -#else -token() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - char *t=NULL, *e=NULL, *a=NULL; int tnum=0; - char *akaString=NULL; TermEntry *te;int save_file=0,save_line=0; - zzmatch(120); - tokenActionActive=1; - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - t=mystrdup(LATEXT(1)); - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==114) ) { - zzmatch(114); zzCONSUME; - zzmatch(QuotedTerm); - akaString=mystrdup(StripQuotes(LATEXT(1))); - /* MR11 */ save_file=CurFile;save_line=zzline; - /* MR11 */ - zzCONSUME; - - zzmatch(115); zzCONSUME; - } - else { - if ( (setwd4[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr20,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==121) ) { - zzmatch(121); zzCONSUME; - zzmatch(122); - tnum = atoi(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x80) ) { - } - else {zzFAIL(1,zzerr21,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - } - else { - if ( (setwd5[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr22,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - e=mystrdup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x2) ) { - } - else {zzFAIL(1,zzerr23,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==Action) ) { - zzmatch(Action); - - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule token: cannot allocate action"); - strcpy(a, LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr24,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==107) ) { - zzmatch(107); zzCONSUME; - } - else { - if ( (setwd5[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr25,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - chkToken(t, e, a, tnum); - if (t != NULL) { - te=(TermEntry *)hash_get(Tname,t); - if (te != NULL && akaString != NULL) { - if (te->akaString != NULL) { - if (strcmp(te->akaString,akaString) != 0) { - warnFL(eMsg2("this #token statment conflicts with a previous #token %s(\"%s\") statement", - t,te->akaString), - FileStr[save_file],save_line); - }; - } else { - te->akaString=akaString; - }; - }; - }; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd5, 0x10); - } -} - -void -#ifdef __USE_PROTOS -block(set * toksrefd,set * rulesrefd) -#else -block(toksrefd,rulesrefd) - set *toksrefd; -set *rulesrefd ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - - Graph g, b; - set saveblah; - int saveinalt = inAlt; - ExceptionGroup *eg; - * toksrefd = empty; - * rulesrefd = empty; - set_clr(AST_nodes_refd_in_actions); - CurBlockID++; - /* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID; - CurAltNum = 1; - /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - saveblah = attribsRefdFromAction; - attribsRefdFromAction = empty; - alt( toksrefd,rulesrefd ); - b = g = zzaArg(zztasp1,1); - - if ( ((Junction *)g.left)->p1->ntype == nAction ) - { - ActionNode *actionNode=(ActionNode *) - ( ( (Junction *)g.left) ->p1); - if (!actionNode->is_predicate ) - { - actionNode->init_action = TRUE; - /* MR12c */ if (actionNode->noHoist) { - /* MR12c */ errFL("<> appears as init-action - use <<>> <>", - /* MR12c */ FileStr[actionNode->file],actionNode->line); - /* MR12c */ }; - } - } - ((Junction *)g.left)->blockid = CurBlockID; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==133) ) { - eg = exception_group(); - - - if ( eg!=NULL ) { - /* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/ - /* MR7 ***** CurAltStart->exception_label = eg->altID; *****/ - list_add(&CurExGroups, (void *)eg); - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - CurAltNum++; - /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==123) ) { - zzmatch(123); - inAlt=1; - zzCONSUME; - - alt( toksrefd,rulesrefd ); - g = Or(g, zzaArg(zztasp2,2)); - - ((Junction *)g.left)->blockid = CurBlockID; - { - zzBLOCK(zztasp3); - zzMake0; - { - while ( (LA(1)==133) ) { - eg = exception_group(); - - - if ( eg!=NULL ) { - /* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/ - /* MR7 ***** CurAltStart->exception_label = eg->altID; *****/ - list_add(&CurExGroups, (void *)eg); - } - zzLOOP(zztasp3); - } - zzEXIT(zztasp3); - } - } - CurAltNum++; - /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzaArg(zztasp1,0) = b; - attribsRefdFromAction = saveblah; inAlt = saveinalt; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd5, 0x20); - } -} - -void -#ifdef __USE_PROTOS -alt(set * toksrefd,set * rulesrefd) -#else -alt(toksrefd,rulesrefd) - set *toksrefd; -set *rulesrefd ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int n=0; Graph g; int e_num=0, old_not=0; Node *node; set elems, dif; - int first_on_line = 1, use_def_MT_handler = 0; - g.left=NULL; g.right=NULL; - - CurAltStart = NULL; - elems = empty; - inAlt = 1; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==88) ) { - zzmatch(88); - use_def_MT_handler = 1; - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr26,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - ; - while ( (setwd5[LA(1)]&0x80) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - old_not=0; - if ( (LA(1)==124) ) { - zzmatch(124); - old_not=1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr27,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - node = element( old_not, first_on_line, use_def_MT_handler ); - - if ( node!=NULL && node->ntype!=nAction ) first_on_line = 0; - - if ( zzaArg(zztasp2,2 ).left!=NULL ) { - g = Cat(g, zzaArg(zztasp2,2)); - n++; - if ( node!=NULL ) { - if ( node->ntype!=nAction ) e_num++; - /* record record number of all rule and token refs */ - if ( node->ntype==nToken ) { - TokNode *tk = (TokNode *)((Junction *)zzaArg(zztasp2,2 ).left)->p1; - tk->elnum = e_num; - set_orel(e_num, &elems); - } - else if ( node->ntype==nRuleRef ) { - RuleRefNode *rn = (RuleRefNode *)((Junction *)zzaArg(zztasp2,2 ).left)->p1; - rn->elnum = e_num; - set_orel(e_num, rulesrefd); - } - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - if ( n == 0 ) g = emptyAlt(); - zzaArg(zztasp1,0) = g; - /* We want to reduce number of LT(i) calls and the number of - * local attribute variables in C++ mode (for moment, later we'll - * do for C also). However, if trees are being built, they - * require most of the attrib variables to create the tree nodes - * with; therefore, we gen a token ptr for each token ref in C++ - */ - if ( GenCC && !GenAST ) - { - /* This now free's the temp set -ATG 5/6/95 */ - set temp; - temp = set_and(elems, attribsRefdFromAction); - set_orin( toksrefd, temp); - set_free(temp); -} -else set_orin( toksrefd, elems); -if ( GenCC ) { - dif = set_dif(attribsRefdFromAction, elems); - if ( set_deg(dif)>0 ) - err("one or more $i in action(s) refer to non-token elements"); - set_free(dif); -} -set_free(elems); -set_free(attribsRefdFromAction); -inAlt = 0; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd6, 0x2); - } -} - -LabelEntry * -#ifdef __USE_PROTOS -element_label(void) -#else -element_label() -#endif -{ - LabelEntry * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(LabelEntry * )) - zzMake0; - { - TermEntry *t=NULL; LabelEntry *l=NULL; RuleEntry *r=NULL; char *lab; - zzmatch(LABEL); - lab = mystrdup(LATEXT(1)); - zzCONSUME; - - - UsedNewStyleLabel = 1; - if ( UsedOldStyleAttrib ) err("cannot mix with new-style labels with old-style $i"); - t = (TermEntry *) hash_get(Tname, lab); - if ( t==NULL ) t = (TermEntry *) hash_get(Texpr, lab); - if ( t==NULL ) r = (RuleEntry *) hash_get(Rname, lab); - if ( t!=NULL ) { - err(eMsg1("label definition clashes with token/tokclass definition: '%s'", lab)); - _retv = NULL; - } - else if ( r!=NULL ) { - err(eMsg1("label definition clashes with rule definition: '%s'", lab)); - _retv = NULL; - } - else { - /* we don't clash with anybody else */ - l = (LabelEntry *) hash_get(Elabel, lab); - if ( l==NULL ) { /* ok to add new element label */ - l = (LabelEntry *)hash_add(Elabel, - lab, - (Entry *)newLabelEntry(lab)); - /* add to list of element labels for this rule */ - list_add(&CurElementLabels, (void *)lab); - /* MR7 */ leAdd(l); /* list of labels waiting for exception group definitions */ - _retv = l; - } - else { - err(eMsg1("label definitions must be unique per rule: '%s'", lab)); - _retv = NULL; -} -} - zzmatch(106); zzCONSUME; - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd6, 0x4); - return _retv; - } -} - -Node * -#ifdef __USE_PROTOS -element(int old_not,int first_on_line,int use_def_MT_handler) -#else -element(old_not,first_on_line,use_def_MT_handler) - int old_not; -int first_on_line; -int use_def_MT_handler ; -#endif -{ - Node * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(Node * )) - zzMake0; - { - - Attrib blk; - Predicate *pred = NULL; - int local_use_def_MT_handler=0; - ActionNode *act; - RuleRefNode *rr; - set toksrefd, rulesrefd; - TermEntry *term; - TokNode *p=NULL; RuleRefNode *q; int approx=0; - LabelEntry *label=NULL; - int predMsgDone=0; - int semDepth=0; - int ampersandStyle; - int height; /* MR11 */ - int equal_height; /* MR11 */ - - char* pFirstSetSymbol = NULL; /* MR21 */ - - _retv = NULL; - if ( (setwd6[LA(1)]&0x8) ) { - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==LABEL) ) { - label = element_label(); - - } - else { - if ( (setwd6[LA(1)]&0x10) ) { - } - else {zzFAIL(1,zzerr28,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - - term = (TermEntry *) hash_get(Tname, LATEXT(1)); - if ( term==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - zzaRet.left = zzaRet.right = NULL; - } - else { - zzaRet = buildToken(LATEXT(1)); - p=((TokNode *)((Junction *)zzaRet.left)->p1); - term = (TermEntry *) hash_get(Tname, LATEXT(1)); - require( term!= NULL, "hash table mechanism is broken"); - p->tclass = term->tclass; - p->complement = old_not; - if ( label!=NULL ) { - p->el_label = label->str; - label->elem = (Node *)p; - } - } - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==119) ) { - zzmatch(119); zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - if ( p!=NULL ) setUpperRange(p, LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - if ( p!=NULL ) setUpperRange(p, LATEXT(1)); - zzCONSUME; - - } - else {zzFAIL(1,zzerr29,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (setwd6[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr30,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - - if ( p!=NULL && (p->upper_range!=0 || p->tclass || old_not) ) - list_add(&MetaTokenNodes, (void *)p); - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==125) ) { - zzmatch(125); - if ( p!=NULL ) p->astnode=ASTroot; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x40) ) { - if ( p!=NULL ) p->astnode=ASTchild; - } - else { - if ( (LA(1)==103) ) { - zzmatch(103); - if ( p!=NULL ) p->astnode=ASTexclude; - zzCONSUME; - - } - else {zzFAIL(1,zzerr31,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==88) ) { - zzmatch(88); - local_use_def_MT_handler = 1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x80) ) { - } - else {zzFAIL(1,zzerr32,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - - if ( p!=NULL && first_on_line ) { - CurAltStart = (Junction *)zzaRet.left; - altAdd(CurAltStart); /* MR7 */ - p->altstart = CurAltStart; - } - if ( p!=NULL ) - p->use_def_MT_handler = use_def_MT_handler || local_use_def_MT_handler; - _retv = (Node *)p; - } - else { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - - term = (TermEntry *) hash_get(Texpr, LATEXT(1)); - if ( term==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - zzaRet.left = zzaRet.right = NULL; - } - else { - zzaRet = buildToken(LATEXT(1)); p=((TokNode *)((Junction *)zzaRet.left)->p1); - p->complement = old_not; - if ( label!=NULL ) { - p->el_label = label->str; - label->elem = (Node *)p; - } - } - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==119) ) { - zzmatch(119); zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==QuotedTerm) ) { - zzmatch(QuotedTerm); - if ( p!=NULL ) setUpperRange(p, LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - if ( p!=NULL ) setUpperRange(p, LATEXT(1)); - zzCONSUME; - - } - else {zzFAIL(1,zzerr33,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (setwd7[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr34,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==125) ) { - zzmatch(125); - if ( p!=NULL ) p->astnode=ASTroot; - zzCONSUME; - - } - else { - if ( (setwd7[LA(1)]&0x2) ) { - if ( p!=NULL ) p->astnode=ASTchild; - } - else { - if ( (LA(1)==103) ) { - zzmatch(103); - if ( p!=NULL ) p->astnode=ASTexclude; - zzCONSUME; - - } - else {zzFAIL(1,zzerr35,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==88) ) { - zzmatch(88); - local_use_def_MT_handler = 1; - zzCONSUME; - - } - else { - if ( (setwd7[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr36,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - - if ( p!=NULL && (p->upper_range!=0 || p->tclass || old_not) ) - list_add(&MetaTokenNodes, (void *)p); - - if ( first_on_line ) { - CurAltStart = (Junction *)zzaRet.left; - altAdd(CurAltStart); /* MR7 */ - p->altstart = CurAltStart; - } - if ( p!=NULL ) - p->use_def_MT_handler = use_def_MT_handler || local_use_def_MT_handler; - _retv = (Node *)p; - } - else { - if ( (LA(1)==WildCard) ) { - if ( old_not ) warn("~ WILDCARD is an undefined operation (implies 'nothing')"); - zzmatch(WildCard); - zzaRet = buildWildCard(LATEXT(1)); p=((TokNode *)((Junction *)zzaRet.left)->p1); - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==125) ) { - zzmatch(125); - p->astnode=ASTroot; - zzCONSUME; - - } - else { - if ( (setwd7[LA(1)]&0x8) ) { - p->astnode=ASTchild; - } - else { - if ( (LA(1)==103) ) { - zzmatch(103); - p->astnode=ASTexclude; - zzCONSUME; - - } - else {zzFAIL(1,zzerr37,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - list_add(&MetaTokenNodes, (void *)p); - - if ( first_on_line ) { - CurAltStart = (Junction *)zzaRet.left; - altAdd(CurAltStart); /* MR7 */ - p->altstart = CurAltStart; - if ( label!=NULL ) { - p->el_label = label->str; - label->elem = (Node *)p; - } - } - _retv = (Node *)p; - } - else { - if ( (LA(1)==NonTerminal) ) { - if ( old_not ) warn("~ NONTERMINAL is an undefined operation"); - zzmatch(NonTerminal); - zzaRet = buildRuleRef(LATEXT(1)); - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==103) ) { - zzmatch(103); - q = (RuleRefNode *) ((Junction *)zzaRet.left)->p1; - q->astnode=ASTexclude; - zzCONSUME; - - } - else { - if ( (setwd7[LA(1)]&0x10) ) { - } - else {zzFAIL(1,zzerr38,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (setwd7[LA(1)]&0x20) ) { - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==104) ) { - zzmatch(104); zzCONSUME; - } - else { - if ( (LA(1)==PassAction) ) { - } - else {zzFAIL(1,zzerr39,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - zzmatch(PassAction); - addParm(((Junction *)zzaRet.left)->p1, LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd7[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr40,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - rr=(RuleRefNode *) ((Junction *)zzaRet.left)->p1; - { - zzBLOCK(zztasp3); - zzMake0; - { - char *a; - if ( (LA(1)==105) ) { - zzmatch(105); zzCONSUME; - zzmatch(PassAction); - - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule element: cannot allocate assignment"); - strcpy(a, LATEXT(1)); - rr->assign = a; - zzCONSUME; - - } - else { - if ( (setwd7[LA(1)]&0x80) ) { - } - else {zzFAIL(1,zzerr41,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - - if ( label!=NULL ) { - rr->el_label = label->str; - label->elem = (Node *)rr; - } - if ( first_on_line ) { - CurAltStart = (Junction *)zzaRet.left; - altAdd(CurAltStart); /* MR7 */ - ((RuleRefNode *)((Junction *)zzaRet.left)->p1)->altstart = CurAltStart; - } - _retv = (Node *)rr; - } - else {zzFAIL(1,zzerr42,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - zzEXIT(zztasp2); - } - } - } - else { - if ( (LA(1)==Action) ) { - if ( old_not ) warn("~ ACTION is an undefined operation"); - zzmatch(Action); - zzaArg(zztasp1,0) = buildAction(LATEXT(1),action_file,action_line, 0); - zzCONSUME; - - if ( first_on_line ) { /* MR7 */ - CurAltStart = (Junction *)zzaArg(zztasp1,0 ).left; /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; - _retv = (Node *) ((Junction *)zzaArg(zztasp1,0 ).left)->p1; - } - else { - if ( (LA(1)==Pred) ) { - if ( old_not ) warn("~ SEMANTIC-PREDICATE is an undefined operation"); - zzmatch(Pred); - zzaArg(zztasp1,0) = buildAction(LATEXT(1),action_file,action_line, 1); - zzCONSUME; - - act = (ActionNode *) ((Junction *)zzaArg(zztasp1,0 ).left)->p1; - if (numericActionLabel) { /* MR10 */ - list_add(&NumericPredLabels,act); /* MR10 */ - numericActionLabel=0; /* MR10 */ - }; /* MR10 */ - { - zzBLOCK(zztasp2); - zzMake0; - { - char *a; - if ( (LA(1)==PassAction) ) { - zzmatch(PassAction); - - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule element: cannot allocate predicate fail action"); - strcpy(a, LATEXT(1)); - act->pred_fail = a; - zzCONSUME; - - } - else { - if ( (setwd8[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr43,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - if ( first_on_line ) { /* MR7 */ - CurAltStart = (Junction *)zzaArg(zztasp1,0 ).left; /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; - _retv = (Node *)act; - } - else { - if ( (setwd8[LA(1)]&0x2) ) { - if ( old_not ) warn("~ BLOCK is an undefined operation"); - BlkLevel++; - if (BlkLevel >= MAX_BLK_LEVEL) fatal("Blocks nested too deeply"); - /* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID; - /* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==Pragma) ) { - zzmatch(Pragma); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==126) ) { - zzmatch(126); - approx=LL_k; - zzCONSUME; - - } - else { - if ( (LA(1)==127) ) { - zzmatch(127); - approx = 1; - zzCONSUME; - - } - else { - if ( (LA(1)==128) ) { - zzmatch(128); - approx = 2; - zzCONSUME; - - } - else {zzFAIL(1,zzerr44,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - } - else { - if ( (setwd8[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr45,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==FirstSetSymbol) ) { - zzmatch(FirstSetSymbol); zzCONSUME; - zzmatch(114); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==NonTerminal) ) { - zzmatch(NonTerminal); - - /* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1, - /* MR21 */ sizeof(char)); - /* MR21 */ require(pFirstSetSymbol!=NULL, - /* MR21 */ "cannot allocate first set name"); - /* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1)); - /* MR21 */ - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - - /* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1, - /* MR21 */ sizeof(char)); - /* MR21 */ require(pFirstSetSymbol!=NULL, - /* MR21 */ "cannot allocate first set name"); - /* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1)); - /* MR21 */ - zzCONSUME; - - } - else {zzFAIL(1,zzerr46,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - zzmatch(115); zzCONSUME; - } - else { - if ( (setwd8[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr47,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==114) ) { - zzmatch(114); zzCONSUME; - block( &toksrefd,&rulesrefd ); - zzmatch(115); - blk = zzaRet = zzaArg(zztasp2,2); - /* MR23 */ CurBlockID_array[BlkLevel] = (-1); - /* MR23 */ CurAltNum_array[BlkLevel] = (-1); - --BlkLevel; - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==129) ) { - zzmatch(129); - zzaRet = makeLoop(zzaRet,approx,pFirstSetSymbol); - zzCONSUME; - - } - else { - if ( (LA(1)==130) ) { - zzmatch(130); - zzaRet = makePlus(zzaRet,approx,pFirstSetSymbol); - zzCONSUME; - - } - else { - if ( (LA(1)==131) ) { - zzmatch(131); zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (setwd8[LA(1)]&0x10) ) { - { - zzBLOCK(zztasp5); - zzMake0; - { - if ( (LA(1)==132) ) { - zzmatch(132); - ampersandStyle=0; - zzCONSUME; - - } - else { - if ( (LA(1)==113) ) { - zzmatch(113); - ampersandStyle=1; - zzCONSUME; - - } - else {zzFAIL(1,zzerr48,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp5); - } - } - zzmatch(Pred); - zzaRet = buildAction(LATEXT(1),action_file,action_line,1); - zzCONSUME; - - act = (ActionNode *) ((Junction *)zzaRet.left)->p1; - semDepth=predicateLookaheadDepth(act); - if (numericActionLabel) { /* MR10 */ - list_add(&NumericPredLabels,act); /* MR10 */ - numericActionLabel=0; /* MR10 */ - }; /* MR10 */ - { - zzBLOCK(zztasp5); - zzMake0; - { - char *a; - if ( (LA(1)==PassAction) ) { - zzmatch(PassAction); - - a = (char *)calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule element: cannot allocate predicate fail action"); - strcpy(a, LATEXT(1)); - act->pred_fail = a; - zzCONSUME; - - } - else { - if ( (setwd8[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr49,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp5); - } - } - if ( first_on_line) { /* MR7 */ - CurAltStart=(Junction *)zzaRet.left; /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; - _retv = (Node *)act; - - pred = computePredFromContextGuard(blk,&predMsgDone); /* MR10 */ - if ( pred==NULL) { /* MR10 */ - if ( !predMsgDone) err("invalid or missing context guard"); /* MR10 */ - predMsgDone=1; /* MR10 */ - } else { /* MR10 */ - act->guardNodes=(Junction *)blk.left; /* MR11 */ - pred->expr = act->action; - pred->source = act; - /* MR10 */ pred->ampersandStyle = ampersandStyle; /* 0 means (g)? => ... 1 means (g)? && ... */ - /* MR13 */ if (pred->tcontext != NULL) { - /* MR13 */ height=MR_max_height_of_tree(pred->tcontext); - /* MR13 */ equal_height=MR_all_leaves_same_height(pred->tcontext,height); - /* MR13 */ if (! equal_height) { - /* MR13 */ errFL("in guarded predicates all tokens in the guard must be at the same height", - /* MR13 */ FileStr[act->file],act->line); - /* MR13 */ }; - /* MR13 */ } - /* MR10 */ if (ampersandStyle) { - /* MR10 */ act->ampersandPred = pred; - /* MR11 */ if (! HoistPredicateContext) { - /* MR11 */ errFL("without \"-prc on\" (guard)? && <>? ... doesn't make sense", - /* MR11 */ FileStr[act->file],act->line); - /* MR11 */ }; - /* MR10 */ } else { - /* MR10 */ act->guardpred = pred; - /* MR10 */ }; - /* MR10 */ if (pred->k != semDepth) { - /* MR10 */ warn(eMsgd2("length of guard (%d) does not match the length of semantic predicate (%d)", - /* MR10 */ pred->k,semDepth)); - /* MR10 */ }; - } - } - else { - if ( (setwd8[LA(1)]&0x40) ) { - zzaRet = makeBlk(zzaRet,approx,pFirstSetSymbol); - FoundGuessBlk = 1; - ((Junction *) ((Junction *)zzaRet.left)->p1)->guess=1; - if ( ! first_on_line ) { - err("(...)? predicate must be first element of production"); - } - } - else {zzFAIL(1,zzerr50,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (setwd8[LA(1)]&0x80) ) { - zzaRet = makeBlk(zzaRet,approx,pFirstSetSymbol); - } - else {zzFAIL(1,zzerr51,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - zzEXIT(zztasp3); - } - } - - if ( pred==NULL && !predMsgDone) { /* MR10 */ - ((Junction *)((Junction *)zzaRet.left)->p1)->blockid = CurBlockID; - ((Junction *)((Junction *)zzaRet.left)->p1)->tokrefs = toksrefd; - ((Junction *)((Junction *)zzaRet.left)->p1)->rulerefs = rulesrefd; - if ( first_on_line ) { /* MR7 */ - CurAltStart = (Junction *)((Junction *)((Junction *)zzaRet.left)->p1); /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; /* MR7 */ - _retv = (Node *) ((Junction *)zzaRet.left)->p1; - } - } - else { - if ( (LA(1)==102) ) { - zzmatch(102); zzCONSUME; - block( &toksrefd,&rulesrefd ); - zzaRet = makeOpt(zzaArg(zztasp2,2),approx,pFirstSetSymbol); - /* MR23 */ CurBlockID_array[BlkLevel] = (-1); - /* MR23 */ CurAltNum_array[BlkLevel] = (-1); - --BlkLevel; - zzmatch(98); - - ((Junction *)((Junction *)zzaRet.left)->p1)->blockid = CurBlockID; - ((Junction *)((Junction *)zzaRet.left)->p1)->tokrefs = toksrefd; - ((Junction *)((Junction *)zzaRet.left)->p1)->rulerefs = rulesrefd; - zzCONSUME; - - if ( first_on_line ) { /* MR7 */ - CurAltStart = (Junction *) ((Junction *)((Junction *)zzaRet.left)->p1); /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; - _retv = (Node *) ((Junction *)zzaRet.left)->p1; - } - else {zzFAIL(1,zzerr52,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - } - else { - if ( (LA(1)==129) ) { - zzmatch(129); - warn("don't you want a ')' with that '*'?"); CannotContinue=TRUE; - zzCONSUME; - - } - else { - if ( (LA(1)==130) ) { - zzmatch(130); - warn("don't you want a ')' with that '+'?"); CannotContinue=TRUE; - zzCONSUME; - - } - else { - if ( (LA(1)==105) ) { - zzmatch(105); - warn("'>' can only appear after a nonterminal"); CannotContinue=TRUE; - zzCONSUME; - - } - else { - if ( (LA(1)==PassAction) ) { - zzmatch(PassAction); - warn("[...] out of context 'rule > [...]'"); - CannotContinue=TRUE; - zzCONSUME; - - } - else {zzFAIL(1,zzerr53,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - } - } - } - } - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd9, 0x1); - return _retv; - } -} - -void -#ifdef __USE_PROTOS -default_exception_handler(void) -#else -default_exception_handler() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - DefaultExGroup = exception_group(); - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd9, 0x2); - } -} - -ExceptionGroup * -#ifdef __USE_PROTOS -exception_group(void) -#else -exception_group() -#endif -{ - ExceptionGroup * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(ExceptionGroup * )) - zzMake0; - { - ExceptionHandler *h; LabelEntry *label=NULL; /* MR6 */ - FoundException = 1; FoundExceptionGroup = 1; - zzmatch(133); - _retv = (ExceptionGroup *)calloc(1, sizeof(ExceptionGroup)); - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - char *p; - if ( (LA(1)==PassAction) ) { - zzmatch(PassAction); - - p = LATEXT(1)+1; - p[strlen(p)-1] = '\0'; /* kill trailing space */ - label = (LabelEntry *) hash_get(Elabel, LATEXT(1)+1); - if ( label==NULL ) - { - err(eMsg1("unknown label in exception handler: '%s'", LATEXT(1)+1)); - } - zzCONSUME; - - } - else { - if ( (setwd9[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr54,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==135) ) { - h = exception_handler(); - - list_add(&(_retv->handlers), (void *)h); - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==134) ) { - zzmatch(134); zzCONSUME; - zzmatch(106); zzCONSUME; - zzmatch(Action); - { - ExceptionHandler *eh = (ExceptionHandler *) - calloc(1, sizeof(ExceptionHandler)); - char *a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(eh!=NULL, "exception: cannot allocate handler"); - require(a!=NULL, "exception: cannot allocate action"); - strcpy(a, LATEXT(1)); - eh->action = a; - eh->signalname = (char *) calloc(strlen("default")+1, sizeof(char)); - require(eh->signalname!=NULL, "exception: cannot allocate sig name"); - strcpy(eh->signalname, "default"); - list_add(&(_retv->handlers), (void *)eh); - } - zzCONSUME; - - } - else { - if ( (setwd9[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr55,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - if ( label!=NULL ) { - /* Record ex group in sym tab for this label */ - if ( label->ex_group!=NULL ) { - err(eMsg1("duplicate exception handler for label '%s'",label->str)); - } else { - label->ex_group = _retv; - /* Label the exception group itself */ - _retv->label = label->str; - /* Make the labelled element pt to the exception also */ - /* MR6 */ if (label->elem == NULL) { - /* MR6 */ err(eMsg1("reference in exception handler to undefined label '%s'",label->str)); - /* MR6 */ } else { - switch ( label->elem->ntype ) { - case nRuleRef : - { - RuleRefNode *r = (RuleRefNode *)label->elem; - r->ex_group = _retv; - break; - } - case nToken : - { - TokNode *t = (TokNode *)label->elem; - t->ex_group = _retv; - break; - } - } /* end switch */ - /* MR6 */ }; /* end test on label->elem */ - } /* end test on label->ex_group */ - - } /* end test on exception label */ - -/* MR7 */ - /* MR7 */ if (BlkLevel == 1 && label == NULL) { - /* MR7 */ _retv->forRule=1; - /* MR7 */ } else if (label == NULL) { - /* MR7 */ _retv->altID = makeAltID(CurBlockID_array[BlkLevel], CurAltNum_array[BlkLevel]); - /* MR7 */ egAdd(_retv); - /* MR7 */ } else { - /* MR7 */ _retv->labelEntry=label; - /* MR7 */ }; - /* MR7 */ - /* MR7 */ /* You may want to remove this exc from the rule list */ - /* MR7 */ /* and handle at the labeled element site. */ - /* MR7 */ - /* MR7 */ if (label != NULL) { - /* MR7 */ _retv = NULL; - /* MR7 */ }; - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd9, 0x10); - return _retv; - } -} - -ExceptionHandler * -#ifdef __USE_PROTOS -exception_handler(void) -#else -exception_handler() -#endif -{ - ExceptionHandler * _retv; - zzRULE; - zzBLOCK(zztasp1); - PCCTS_PURIFY(_retv,sizeof(ExceptionHandler * )) - zzMake0; - { - ; - zzmatch(135); - - _retv = (ExceptionHandler *)calloc(1, sizeof(ExceptionHandler)); - require(_retv!=NULL, "exception: cannot allocate handler"); - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==NonTerminal) ) { - zzmatch(NonTerminal); - - _retv->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(_retv->signalname!=NULL, "exception: cannot allocate sig name"); - strcpy(_retv->signalname, LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==TokenTerm) ) { - zzmatch(TokenTerm); - - _retv->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(_retv->signalname!=NULL, "exception: cannot allocate sig name"); - strcpy(_retv->signalname, LATEXT(1)); - zzCONSUME; - - } - else {zzFAIL(1,zzerr56,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzmatch(106); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - _retv->action = NULL; - if ( (LA(1)==Action) ) { - zzmatch(Action); - - _retv->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(_retv->action!=NULL, "exception: cannot allocate action"); - strcpy(_retv->action, LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd9[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr57,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return _retv; -fail: - zzEXIT(zztasp1); - CannotContinue=TRUE; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd9, 0x40); - return _retv; - } -} - -void -#ifdef __USE_PROTOS -enum_file(char * fname) -#else -enum_file(fname) - char *fname ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - if ( (setwd9[LA(1)]&0x80) ) { - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==143) ) { - zzmatch(143); zzCONSUME; - zzmatch(ID); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==149) ) { - zzmatch(149); zzCONSUME; - zzmatch(ID); zzCONSUME; - } - else { - if ( (setwd10[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr58,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - } - else { - if ( (setwd10[LA(1)]&0x2) ) { - } - else {zzFAIL(1,zzerr59,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==151) ) { - { - zzBLOCK(zztasp3); - int zzcnt=1; - zzMake0; - { - do { - enum_def( fname ); - zzLOOP(zztasp3); - } while ( (LA(1)==151) ); - zzEXIT(zztasp3); - } - } - } - else { - if ( (LA(1)==149) ) { - defines( fname ); - } - else {zzFAIL(1,zzerr60,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - } - else { - if ( (LA(1)==Eof) ) { - } - else {zzFAIL(1,zzerr61,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd10, 0x4); - } -} - -void -#ifdef __USE_PROTOS -defines(char * fname) -#else -defines(fname) - char *fname ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int v; int maxt=(-1); char *t; - { - zzBLOCK(zztasp2); - int zzcnt=1; - zzMake0; - { - do { - zzmatch(149); zzCONSUME; - zzmatch(ID); - t = mystrdup(LATEXT(1)); - zzCONSUME; - - zzmatch(INT); - - v = atoi(LATEXT(1)); - /* fprintf(stderr, "#token %s=%d\n", t, v);*/ - - /* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */ - /* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */ - /* MR2 Don't let #tokdefs be confused by */ - /* MR2 DLGminToken and DLGmaxToken */ - - if ( ! isDLGmaxToken(t)) { /* MR2 */ - TokenNum = v; - if ( v>maxt ) maxt=v; - if ( Tnum( t ) == 0 ) { - addForcedTname( t, v ); - } else { - warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline); - }; -}; - zzCONSUME; - - zzLOOP(zztasp2); - } while ( (LA(1)==149) ); - zzEXIT(zztasp2); - } - } - TokenNum = maxt + 1; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd10, 0x8); - } -} - -void -#ifdef __USE_PROTOS -enum_def(char * fname) -#else -enum_def(fname) - char *fname ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int v= 0; int maxt=(-1); char *t; - zzmatch(151); zzCONSUME; - zzmatch(ID); zzCONSUME; - zzmatch(152); zzCONSUME; - zzmatch(ID); - t = mystrdup(LATEXT(1)); - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==153) ) { - zzmatch(153); zzCONSUME; - zzmatch(INT); - v=atoi(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd10[LA(1)]&0x10) ) { - v++; - } - else {zzFAIL(1,zzerr62,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - /* fprintf(stderr, "#token %s=%d\n", t, v);*/ - TokenNum = v; - if ( v>maxt ) maxt=v; /* MR3 */ - if ( Tnum( t ) == 0 ) addForcedTname( t, v ); - else { - warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline); - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==154) ) { - zzmatch(154); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==ID)&&(isDLGmaxToken(LATEXT(1))) ) { - if (!(isDLGmaxToken(LATEXT(1))) ) {zzfailed_pred(" isDLGmaxToken(LATEXT(1))",0 /* report */, { 0; /* no user action */ } );} - zzmatch(ID); zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==153) ) { - zzmatch(153); zzCONSUME; - zzmatch(INT); zzCONSUME; - } - else { - if ( (setwd10[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr63,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (LA(1)==ID) ) { - zzmatch(ID); - t = mystrdup(LATEXT(1)); - zzCONSUME; - - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==153) ) { - zzmatch(153); zzCONSUME; - zzmatch(INT); - v=atoi(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd10[LA(1)]&0x40) ) { - v++; - } - else {zzFAIL(1,zzerr64,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - - /* fprintf(stderr, "#token %s=%d\n", t, v);*/ - TokenNum = v; - if ( v>maxt ) maxt=v; /* MR3 */ - if ( Tnum( t ) == 0 ) addForcedTname( t, v ); - else { - warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline); - } - } - else { - if ( (setwd10[LA(1)]&0x80) ) { - } - else {zzFAIL(1,zzerr65,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(155); zzCONSUME; - zzmatch(156); - TokenNum = maxt + 1; - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd11, 0x1); - } -} - - -/* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */ -/* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */ -/* MR2 Don't let #tokdefs be confused by */ -/* MR2 DLGminToken and DLGmaxToken */ - -/* semantic check on DLGminToken and DLGmaxmaxToken in #tokdefs */ - -#ifdef __USE_PROTOS -static int isDLGmaxToken(char *Token) -#else -static int isDLGmaxToken(Token) -char * Token; -#endif -{ -static char checkStr1[] = "DLGmaxToken"; -static char checkStr2[] = "DLGminToken"; - - if (strcmp(Token, checkStr1) == 0) -return 1; -else if (strcmp(Token, checkStr2) == 0) -return 1; -else -return 0; -} - -/* semantics of #token */ -static void -#ifdef __USE_PROTOS -chkToken(char *t, char *e, char *a, int tnum) -#else -chkToken(t,e,a,tnum) -char *t, *e, *a; -int tnum; -#endif -{ -TermEntry *p; - - /* check to see that they don't try to redefine a token as a token class */ -if ( t!=NULL ) { -p = (TermEntry *) hash_get(Tname, t); -if ( p!=NULL && p->classname ) { - err(eMsg1("redefinition of #tokclass '%s' to #token not allowed; ignored",t)); - if ( a!=NULL ) free((char *)a); - return; -} -} - - if ( t==NULL && e==NULL ) { /* none found */ -err("#token requires at least token name or rexpr"); -} -else if ( t!=NULL && e!=NULL ) { /* both found */ -if ( UserDefdTokens ) { /* if #tokdefs, must not define new */ - p = (TermEntry *) hash_get(Tname, t); - if ( p == NULL) { - err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t)); - return; - }; -} -Tklink(t, e); -if ( a!=NULL ) { - if ( hasAction(e) ) { - err(eMsg1("redefinition of action for %s; ignored",e)); - } - else setHasAction(e, a); -} -} -else if ( t!=NULL ) { /* only one found */ -if ( UserDefdTokens ) { - p = (TermEntry *) hash_get(Tname, t); - if (p == NULL) { - err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t)); - }; - return; -} -if ( Tnum( t ) == 0 ) addTname( t ); -else { - err(eMsg1("redefinition of token %s; ignored",t)); -} -if ( a!=NULL ) { - err(eMsg1("action cannot be attached to a token name (%s); ignored",t)); - free((char *)a); -} -} -else if ( e!=NULL ) { -if ( Tnum( e ) == 0 ) addTexpr( e ); -else { - if ( hasAction(e) ) { - err(eMsg1("redefinition of action for expr %s; ignored",e)); - } - else if ( a==NULL ) { - err(eMsg1("redefinition of expr %s; ignored",e)); - } -} -if ( a!=NULL ) setHasAction(e, a); -} - - /* if a token type number was specified, then add the token ID and 'tnum' -* pair to the ForcedTokens list. (only applies if an id was given) -*/ -if ( t!=NULL && tnum>0 ) -{ -if ( set_el(tnum, reserved_positions) ) -{ - err(eMsgd("a token has already been forced to token number %d; ignored", tnum)); -} -else -{ - list_add(&ForcedTokens, newForcedToken(t,tnum)); - set_orel(tnum, &reserved_positions); -} -} -} - -static int -#ifdef __USE_PROTOS -match_token(char *s, char **nxt) -#else -match_token(s,nxt) -char *s; -char **nxt; -#endif -{ - if ( !(*s>='A' && *s<='Z') ) return 0; - s++; - while ( (*s>='a' && *s<='z') || - (*s>='A' && *s<='Z') || - (*s>='0' && *s<='9') || - *s=='_' ) - { - s++; - } - if ( *s!=' ' && *s!='}' ) return 0; - *nxt = s; - return 1; -} - -static int -#ifdef __USE_PROTOS -match_rexpr(char *s, char **nxt) -#else -match_rexpr(s,nxt) -char *s; -char **nxt; -#endif -{ - if ( *s!='"' ) return 0; - s++; - while ( *s!='"' ) - { - if ( *s=='\n' || *s=='\r' ) /* MR13 */ - warn("eoln found in regular expression"); - if ( *s=='\\' ) s++; - s++; - } - *nxt = s+1; - return 1; -} - -/* -* Walk a string "{ A .. Z }" where A..Z is a space separated list -* of token references (either labels or reg exprs). Return a -* string "inlineX_set" for some unique integer X. Basically, -* we pretend as if we had seen "#tokclass inlineX { A .. Z }" -* on the input stream outside of an action. -*/ -char * -#ifdef __USE_PROTOS -inline_set(char *s) -#else -inline_set(s) -char *s; -#endif -{ - char *nxt; - fprintf(stderr, "found consumeUntil( {...} )\n"); - while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} - if ( *s!='{' ) - { - err("malformed consumeUntil( {...} ); missing '{'"); - return "bad_set"; - } - s++; - while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} - while ( *s!='}' ) - { - if ( match_token(s,&nxt) ) fprintf(stderr, "found token %s\n", s); - else if ( match_rexpr(s,&nxt) ) fprintf(stderr, "found rexpr %s\n", s); - else { - err("invalid element in consumeUntil( {...} )"); - return "bad_set"; - } - s = nxt; - while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} - } - return "inlineX_set"; -} - -/* ANTLR-specific syntax error message generator -* (define USER_ZZSYN when compiling so don't get 2 definitions) -*/ -void -#ifdef __USE_PROTOS -zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, -int k, char *bad_text) -#else -zzsyn(text, tok, egroup, eset, etok, k, bad_text) -char *text, *egroup, *bad_text; -int tok; -int etok; -int k; -SetWordType *eset; -#endif -{ -fprintf(stderr, ErrHdr, FileStr[CurFile]!=NULL?FileStr[CurFile]:"stdin", zzline); -fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text); -if ( !etok && !eset ) {fprintf(stderr, "\n"); return;} -if ( k==1 ) fprintf(stderr, " missing"); -else -{ -fprintf(stderr, "; \"%s\" not", bad_text); -if ( zzset_deg(eset)>1 ) fprintf(stderr, " in"); -} -if ( zzset_deg(eset)>0 ) zzedecode(eset); -else fprintf(stderr, " %s", zztokens[etok]); -if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup); -fprintf(stderr, "\n"); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.g b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.g deleted file mode 100644 index d7e6a62e1..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.g +++ /dev/null @@ -1,2586 +0,0 @@ -/* - * antlr.g -- PCCTS Version 1.xx ANTLR - * - * Parse an antlr input grammar and build a syntax-diagram. - * - * Written in itself (needs at least 1.06 to work) - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-1995 - */ - -/* MR1 */ -/* MR1 10-Apr-97 MR1 Replace #if logic with #include "pcctscfg.h" */ -/* MR1 */ - -#header << - #include "pcctscfg.h" - #include "set.h" - #include - #include "syn.h" - #include "hash.h" - #include "generic.h" - #define zzcr_attr(attr,tok,t) - >> - -<< - -/* MR20 G. Hobbelt For Borland C++ 4.x & 5.x compiling with ALL warnings enabled */ -#if defined(__TURBOC__) -#pragma warn -aus /* unused assignment of 'xxx' */ -#endif - - -#ifdef __USE_PROTOS -static void chkToken(char *, char *, char *, int); -#else -static void chkToken(); -#endif - -#ifdef __USE_PROTOS -static int isDLGmaxToken(char *Token); /* MR3 */ -#else -static int isDLGmaxToken(); /* MR3 */ -#endif - -static int class_nest_level = 0; - -/* MR20 G. Hobbelt extern definitions moved to antlr.h */ - ->> - -#lexaction << -/* maintained, but not used for now */ -set AST_nodes_refd_in_actions = set_init; -int inAlt = 0; -set attribsRefdFromAction = set_init; /* MR20 */ -int UsedOldStyleAttrib = 0; -int UsedNewStyleLabel = 0; -#ifdef __USE_PROTOS -char *inline_set(char *); -#else -char *inline_set(); -#endif - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ -/* MR1 in DLG action */ - -int tokenActionActive=0; /* MR1 */ - ->> - -#lexclass STRINGS -#token QuotedTerm "\"" << zzmode(START); >> -#token "\n|\r|\r\n" << - zzline++; - warn("eoln found in string"); - zzskip(); - >> -#token "\\(\n|\r|\r\n)" << zzline++; zzmore(); >> -#token "\\~[]" << zzmore(); >> -#token "~[\n\r\"\\]+" << zzmore(); >> - -#lexclass ACTION_STRINGS -#token "\"" << zzmode(ACTIONS); zzmore(); >> -#token "\n|\r|\r\n" << - zzline++; - warn("eoln found in string (in user action)"); - zzskip(); - >> -#token "\\(\n|\r|\r\n)" << zzline++; zzmore(); >> -#token "\\~[]" << zzmore(); >> -#token "~[\n\r\"\\]+" << zzmore(); >> - -#lexclass ACTION_CHARS -#token "'" << zzmode(ACTIONS); zzmore(); >> -#token "\n|\r|\r\n" << - zzline++; - warn("eoln found in char literal (in user action)"); - zzskip(); - >> -#token "\\~[]" << zzmore(); >> -#token "~[\n\r'\\]+" << zzmore(); >> - -#lexclass ACTION_COMMENTS -#token "\*/" << zzmode(ACTIONS); zzmore(); >> -#token "\*" << zzmore(); >> -#token "\n|\r|\r\n" << zzline++; zzmore(); DAWDLE; >> -#token "~[\n\r\*]+" << zzmore(); >> - -#lexclass TOK_DEF_COMMENTS -#token "\*/" << zzmode(PARSE_ENUM_FILE); - zzmore(); >> -#token "\*" << zzmore(); >> -#token "\n|\r|\r\n" << zzline++; zzmore(); DAWDLE; >> -#token "~[\n\r\*]+" << zzmore(); >> - -#lexclass TOK_DEF_CPP_COMMENTS -#token "\n|\r|\r\n" << zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE; >> -#token "~[\n\r]+" << zzskip(); >> - -#lexclass ACTION_CPP_COMMENTS -#token "\n|\r|\r\n" << zzline++; zzmode(ACTIONS); zzmore(); DAWDLE; >> -#token "~[\n\r]+" << zzmore(); >> - -#lexclass CPP_COMMENTS -#token "\n|\r|\r\n" << zzline++; zzmode(START); zzskip(); DAWDLE; >> -#token "~[\n\r]+" << zzskip(); >> - -#lexclass COMMENTS -#token "\*/" << zzmode(START); zzskip(); >> -#token "\*" << zzskip(); >> -#token "\n|\r|\r\n" << zzline++; zzskip(); DAWDLE; >> -#token "~[\n\r\*]+" << zzskip(); >> - -/* - * This lexical class accepts actions of type [..] and <<..>> - * - * It translates the following special items for C: - * - * $j --> "zzaArg(current zztasp, j)" - * $i.j --> "zzaArg(zztaspi, j)" - * $i.nondigit> "zzaArg(current zztasp, i).nondigit" - * $$ --> "zzaRet" - * $alnum --> "alnum" (used to ref parameters) - * $rule --> "zzaRet" - * $retval --> "_retv.retval" if > 1 return values else "_retv" - * $[token, text] --> "zzconstr_attr(token, text)" - * $[] --> "zzempty_attr()" - * - * It translates the following special items for C++: - * (attributes are now stored with 'Token' and $i's are only - * pointers to the Tokens. Rules don't have attributes now.) - * - * $j --> "_tbj" where b is the block level - * $i.j --> "_tij" - * $j->nondigit> "_tbj->nondigit" - * $$ --> "$$" - * $alnum --> "alnum" (used to ref parameters) - * $rule --> "$rule" - * $retval --> "_retv.retval" if > 1 return values else "_retv" - * $[token, text] --> invalid - * $[] --> invalid - * - * And, for trees: - * - * #0 --> "(*_root)" - * #i --> "zzastArg(i)" - * #[args] --> "zzmk_ast(zzastnew(), args)" - * #[] --> "zzastnew()" - * #( root, child1, ..., childn ) - * --> "zztmake(root, child1, ...., childn, NULL)" - * #() --> "NULL" - * - * For C++, ... - * - * #0 --> "(*_root)" - * #i --> "_astbi" where b is the block level - * #alnum --> "alnum_ast" (used to ref #label) - * #[args] --> "new AST(args)" - * #[] --> "new AST" - * #( root, child1, ..., childn ) - * --> "AST::tmake(root, child1, ...., childn, NULL)" - * #() --> "NULL" - * - * To escape, - * - * \] --> ] - * \) --> ) - * \$ --> $ - * \# --> # - * - * A stack is used to nest action terminators because they can be nested - * like crazy: << #[$[..],..] >> - */ -#lexclass ACTIONS -#token Action "\>\>" << /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = ' '; - zzbegexpr[1] = ' '; - if ( zzbufovf ) { - err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); - } - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ -/* MR1 in DLG action */ -/* MR1 Doesn't matter what kind of action it is - reset*/ - - tokenActionActive=0; /* MR1 */ - >> -#token Pred "\>\>?" << /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = '\0'; - if ( zzbufovf ) { - err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE)); - }; -#ifdef __cplusplus__ -/* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -#ifdef __STDC__ -/* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -#ifdef __USE_PROTOS -/* MRxx */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -/* MR10 */ list_apply(CurActionLabels,mark_label_used_in_sem_pred); -#endif -#endif -#endif - >> -#token PassAction "\]" << if ( topint() == ']' ) { - popint(); - if ( istackempty() ) /* terminate action */ - { - zzmode(START); - NLATEXT[0] = ' '; - zzbegexpr[0] = ' '; - if ( zzbufovf ) { - err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - else { - /* terminate $[..] and #[..] */ - if ( GenCC ) zzreplstr("))"); - else zzreplstr(")"); - zzmore(); - } - } - else if ( topint() == '|' ) { /* end of simple [...] */ - popint(); - zzmore(); - } - else zzmore(); - >> -#token "consumeUntil\( [\ \t]* \{~[\}]+\} [\ \t]* \)" - << - zzmore(); - zzreplstr(inline_set(zzbegexpr+ - strlen("consumeUntil("))); - >> -#token "consumeUntil\( ~[\)]+ \)" - << zzmore(); >> -#token "\n|\r|\r\n" << zzline++; zzmore(); DAWDLE; >> -#token "\>" << zzmore(); >> -#token "$" << zzmore(); >> -#token "$$" << if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();} - else err("$$ use invalid in C++ mode"); >> - -#token "$\[\]" << if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();} - else err("$[] use invalid in C++ mode"); >> -#token "$\[" << - pushint(']'); - if ( !GenCC ) zzreplstr("zzconstr_attr("); - else err("$[..] use invalid in C++ mode"); - zzmore(); - >> -#token "$[0-9]+" <<{ - static char buf[100]; - numericActionLabel=1; /* MR10 */ - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("$i attrib ref too big"); - set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)", - BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s", - BlkLevel-1,zzbegexpr+1); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - >> -#token "$[0-9]+." <<{ - static char buf[100]; - numericActionLabel=1; /* MR10 */ - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("$i.field attrib ref too big"); - zzbegexpr[strlen(zzbegexpr)-1] = ' '; - set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).", - BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s.", - BlkLevel-1,zzbegexpr+1); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - >> -#token "$[0-9]+.[0-9]+" <<{ - static char buf[100]; - static char i[20], j[20]; - char *p,*q; - numericActionLabel=1; /* MR10 */ - if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big"); - for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) { - if ( q == &i[20] ) - fatalFL("i of $i.j attrib ref too big", - FileStr[CurFile], zzline ); - *q++ = *p; - } - *q = '\0'; - for (p++, q= &j[0]; *p!='\0'; p++) { - if ( q == &j[20] ) - fatalFL("j of $i.j attrib ref too big", - FileStr[CurFile], zzline ); - *q++ = *p; - } - *q = '\0'; - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j); - else sprintf(buf,"_t%s%s",i,j); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - >> -#token "$[_a-zA-Z][_a-zA-Z0-9]*" - <<{ static char buf[300]; LabelEntry *el; - zzbegexpr[0] = ' '; - if ( CurRule != NULL && - strcmp(CurRule, &zzbegexpr[1])==0 ) { - if ( !GenCC ) zzreplstr("zzaRet"); - } - else if ( CurRetDef != NULL && - strmember(CurRetDef, &zzbegexpr[1])) { - if ( hasMultipleOperands( CurRetDef ) ) { - require (strlen(zzbegexpr)<=(size_t)285, - "$retval attrib ref too big"); - sprintf(buf,"_retv.%s",&zzbegexpr[1]); - zzreplstr(buf); - } - else zzreplstr("_retv"); - } - else if ( CurParmDef != NULL && - strmember(CurParmDef, &zzbegexpr[1])) { - ; - } - else if ( Elabel==NULL ) { - { err("$-variables in actions outside of rules are not allowed"); } - } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) { -/* MR10 */ -/* MR10 */ /* element labels might exist without an elem when */ -/* MR10 */ /* it is a forward reference (to a rule) */ -/* MR10 */ -/* MR10 */ if ( GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) ) -/* MR10 */ { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); } -/* MR10 */ -/* MR10 */ if ( !GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) && GenAST) { -/* MR10 */ err("You can no longer use attributes returned by rules when also using ASTs"); -/* MR10 */ err(" Use upward inheritance (\"rule >[Attrib a] : ... <<$a=...\>\>\")"); -/* MR10 */ }; -/* MR10 */ -/* MR10 */ /* keep track of <<... $label ...>> for semantic predicates in guess mode */ -/* MR10 */ /* element labels contain pointer to the owners node */ -/* MR10 */ -/* MR10 */ if (el->elem != NULL && el->elem->ntype == nToken) { -/* MR10 */ list_add(&CurActionLabels,el); -/* MR10 */ }; - } - else - warn(eMsg1("$%s not parameter, return value, (defined) element label",&zzbegexpr[1])); - } - zzmore(); - >> -#token "#0" << zzreplstr("(*_root)"); zzmore(); chkGTFlag(); >> -#token "#\[\]" << if ( GenCC ) { - if (NewAST) zzreplstr("(newAST)"); - else zzreplstr("(new AST)");} - else {zzreplstr("zzastnew()");} zzmore(); - chkGTFlag(); - >> -#token "#\(\)" << zzreplstr("NULL"); zzmore(); chkGTFlag(); >> -#token "#[0-9]+" <<{ - static char buf[100]; - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("#i AST ref too big"); - if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"zzastArg(%s)",zzbegexpr+1); - zzreplstr(buf); - zzmore(); - set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions); - chkGTFlag(); - } - >> - -/* MR14 Arpad Beszedes 26-May-98 - Add support for #line directives when antlr source is pre-processed - #lexclass ACTIONS -*/ - -#token "#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n)" - << - zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore(); - getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr); - >> - -#token "#line ~[\n\r]* (\n|\r|\r\n)" - << - zzline++; zzmore(); - >> - -/* MR14 end of a block to support #line in antlr source code */ - -#token "#[_a-zA-Z][_a-zA-Z0-9]*" - << - if ( !(strcmp(zzbegexpr, "#ifdef")==0 || - strcmp(zzbegexpr, "#if")==0 || - strcmp(zzbegexpr, "#else")==0 || - strcmp(zzbegexpr, "#endif")==0 || - strcmp(zzbegexpr, "#ifndef")==0 || - strcmp(zzbegexpr, "#define")==0 || - strcmp(zzbegexpr, "#pragma")==0 || - strcmp(zzbegexpr, "#undef")==0 || - strcmp(zzbegexpr, "#import")==0 || - strcmp(zzbegexpr, "#line")==0 || - strcmp(zzbegexpr, "#include")==0 || - strcmp(zzbegexpr, "#error")==0) ) - { - static char buf[100]; - sprintf(buf, "%s_ast", zzbegexpr+1); -/* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1)); - zzreplstr(buf); - chkGTFlag(); - } - zzmore(); - >> -#token "#\[" << - pushint(']'); - if ( GenCC ) { - if (NewAST) zzreplstr("(newAST("); - else zzreplstr("(new AST("); } - else zzreplstr("zzmk_ast(zzastnew(),"); - zzmore(); - chkGTFlag(); - >> -#token "#\(" << - pushint('}'); - if ( GenCC ) { - if (tmakeInParser) { - zzreplstr("tmake("); - } - else { - zzreplstr("ASTBase::tmake("); - } - } - else { - zzreplstr("zztmake("); - } - zzmore(); - chkGTFlag(); - >> -#token "#" << zzmore(); >> -#token "\)" << - if ( istackempty() ) - zzmore(); - else if ( topint()==')' ) { - popint(); - } - else if ( topint()=='}' ) { - popint(); - /* terminate #(..) */ - zzreplstr(", NULL)"); - } - zzmore(); - >> -#token "\[" << - pushint('|'); /* look for '|' to terminate simple [...] */ - zzmore(); - >> -#token "\(" << - pushint(')'); - zzmore(); - >> - -#token "\\\]" << zzreplstr("]"); zzmore(); >> -#token "\\\)" << zzreplstr(")"); zzmore(); >> - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ -/* MR1 in DLG action */ - -#token "\\>" << if (! tokenActionActive) zzreplstr(">"); /* MR1 */ - zzmore(); /* MR1 */ - >> /* MR1 */ - - -#token "'" << zzmode(ACTION_CHARS); zzmore();>> -#token "\"" << zzmode(ACTION_STRINGS); zzmore();>> -#token "\\$" << zzreplstr("$"); zzmore(); >> -#token "\\#" << zzreplstr("#"); zzmore(); >> -#token "\\(\n|\r|\r\n)" << zzline++; zzmore(); >> -#token "\\~[\]\)>$#]" << zzmore(); >> /* escaped char, always ignore */ -#token "/" << zzmore(); >> -#token "/\*" << zzmode(ACTION_COMMENTS); zzmore(); >> -#token "\*/" << warn("Missing /*; found dangling */ in action"); zzmore(); >> -#token "//" << zzmode(ACTION_CPP_COMMENTS); zzmore(); >> -#token "~[\n\r\)\(\\$#\>\]\[\"'/]+" << zzmore(); >> - -#lexclass START -#token "[\t\ ]+" << zzskip(); >> /* Ignore White */ -#token "\n|\r|\r\n" << zzline++; zzskip(); >> /* Track Line # */ -#token "\[" << zzmode(ACTIONS); zzmore(); - istackreset(); - pushint(']'); >> -#token "\<\<" << action_file=CurFile; action_line=zzline; - zzmode(ACTIONS); zzmore(); - list_free(&CurActionLabels,0); /* MR10 */ - numericActionLabel=0; /* MR10 */ - istackreset(); - pushint('>'); >> -#token "\"" << zzmode(STRINGS); zzmore(); >> -#token "/\*" << zzmode(COMMENTS); zzskip(); >> -#token "\*/" << warn("Missing /*; found dangling */"); zzskip(); >> -#token "//" << zzmode(CPP_COMMENTS); zzskip(); >> - -/* MR14 Arpad Beszedes 26-May-98 - Add support for #line directives when antlr source is pre-processed - #lexclass START -*/ - -#token "#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n)" - << - zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore(); - getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr); - >> - -#token "#line ~[\n\r]* (\n|\r|\r\n)" - << - zzline++; zzmore(); - >> - -/* MR14 end of a block to support #line in antlr source code */ - -/* */ -/* 8-Apr-97 Regularize escape sequence for ">>" */ -/* appearing in string literals */ -/* */ - -#token "\>\>" << warn("Missing <<; found dangling \>\>"); zzskip(); >> /* MR1 */ -#token WildCard "." -#token "\@" <> /* MR6 */ -#token Eof "@" - << /* L o o k F o r A n o t h e r F i l e */ - { - FILE *new_input; - new_input = NextFile(); - if ( new_input == NULL ) { NLA=Eof; return; } - fclose( input ); - input = new_input; - zzrdstream( input ); - zzskip(); /* Skip the Eof (@) char i.e continue */ - } - >> - -#token LABEL - -#errclass "grammar-element" { element } -#errclass "meta-symbol" { "\}" "!" ";" "\|" "\~" "^" "\)" } - -#token Pragma "{\\}#pragma" /* MR21 */ -#token FirstSetSymbol "{\\}#FirstSetSymbol" /* MR21 */ -/* - * Get a grammar -- Build a list of rules like: - * - * o-->Rule1--o - * | - * o-->Rule2--o - * | - * ... - * | - * o-->RuleN--o - */ - -/* rule grammar */ - -grammar : <> - ( "{\\}#header" Action /* MR13 */ - << - if ( HdrAction==NULL ) { - HdrAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(HdrAction!=NULL, "rule grammar: cannot allocate header action"); - strcpy(HdrAction, LATEXT(1)); - } - else warn("additional #header statement ignored"); - >> - | "{\\}#first" Action - << - if ( FirstAction==NULL ) { - FirstAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(FirstAction!=NULL, "rule grammar: cannot allocate #first action"); - strcpy(FirstAction, LATEXT(1)); - } else { - warn("additional #first statement ignored"); - }; - >> - - | "{\\}#parser" QuotedTerm - << - if ( GenCC ) { - warn("#parser meta-op incompatible with -CC; ignored"); - } - else { - if ( strcmp(ParserName,"zzparser")==0 ) { - ParserName=StripQuotes(mystrdup(LATEXT(1))); - if ( RulePrefix[0]!='\0' ) - { - warn("#parser meta-op incompatible with '-gp prefix'; '-gp' ignored"); - RulePrefix[0]='\0'; - } - } - else warn("additional #parser statement ignored"); - } - >> - | "{\\}#tokdefs" QuotedTerm - <<{ - char *fname; - zzantlr_state st; FILE *f; struct zzdlg_state dst; - UserTokenDefsFile = mystrdup(LATEXT(1)); - zzsave_antlr_state(&st); - zzsave_dlg_state(&dst); - fname = mystrdup(LATEXT(1)); - f = fopen(StripQuotes(fname), "r"); - if ( f==NULL ) {warn(eMsg1("cannot open token defs file '%s'", fname+1));} - else { - ANTLRm(enum_file(fname+1), f, PARSE_ENUM_FILE); - UserDefdTokens = 1; - } - zzrestore_antlr_state(&st); - zzrestore_dlg_state(&dst); - }>> - )* - ( Action - <<{ - UserAction *ua = newUserAction(LATEXT(1)); - ua->file = action_file; ua->line = action_line; - if ( class_nest_level>0 ) list_add(&class_before_actions, ua); - else list_add(&BeforeActions, ua); - }>> - | laction - | lmember /* MR1 */ - | lprefix /* MR1 */ - | aLexclass - | token - | error - | tclass - | aPred /* MR11 */ - | default_exception_handler - | class_def - | "\}" - << - if ( class_nest_level==0 ) - warn("missing class definition for trailing '}'"); - class_nest_level--; - >> - )* - - rule <> - ( rule - - <> - - | aLexclass - | token - | error - | tclass - | aPred /* MR11 */ - | class_def - | "\}" - << - if ( class_nest_level==0 ) - warn("missing class definition for trailing '}'"); - class_nest_level--; - >> - )* - ( Action - <<{ - UserAction *ua = newUserAction(LATEXT(1)); - ua->file = action_file; ua->line = action_line; - if ( class_nest_level>0 ) list_add(&class_after_actions, ua); - else list_add(&AfterActions, ua); - }>> - | laction - | lmember /* MR1 */ - | lprefix /* MR1 */ - | error - | tclass - | class_def - | aPred /* MR11 */ - | "\}" - << - if ( class_nest_level==0 ) - warn("missing class definition for trailing '}'"); - class_nest_level--; - >> - )* - Eof - ; - <> - -/* rule class_def */ - -class_def - : <> - "class" - ( NonTerminal <> - | TokenTerm <> - ) - << - if ( CurrentClassName[0]!='\0' && strcmp(CurrentClassName,name)!=0 - && GenCC ) { - err("only one grammar class allowed in this release"); - go = 0; - } - else strcpy(CurrentClassName, name); - >> - <> - -/* MR10 */ (~ "\{" -/* MR10 */ <> -/* MR10 */ )* - - "\{" - << - no_classes_found = 0; - if ( class_nest_level>=1 ) {warn("cannot have nested classes");} - else class_nest_level++; - >> - ; - <> - -/* - * Build -o-->o-R-o-->o- where -o-R-o- is the block from rule 'block'. - * Construct the RuleBlk front and EndRule node on the end of the - * block. This is used to add FOLLOW pointers to the rule end. Add the - * new rule name to the Rname hash table and sets its rulenum. - * Store the parameter definitions if any are found. - * - * Note that locks are required on the RuleBlk and EndRule nodes to thwart - * infinite recursion. - * - * Return the left graph pointer == NULL to indicate error/dupl rule def. - */ - -/* rule rule */ - -rule : << - - ExceptionGroup *eg; - RuleEntry *q; Junction *p; Graph r; int f, l; ECnode *e; - set toksrefd, rulesrefd; - char *pdecl=NULL, *ret=NULL, *a; CurRetDef = CurParmDef = NULL; - CurExGroups = NULL; - CurElementLabels = NULL; - CurAstLabelsInActions = NULL; /* MR27 */ - /* We want a new element label hash table for each rule */ - if ( Elabel!=NULL ) killHashTable(Elabel); - Elabel = newHashTable(); - attribsRefdFromAction = empty; - >> - NonTerminal - <str; - } - CurRuleNode = q; - f = CurFile; l = zzline; - NumRules++; - >> - { "!" <noAST = TRUE;>> } - { <<;>> - {"\<"} - PassAction - << pdecl = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(pdecl!=NULL, "rule rule: cannot allocate param decl"); - strcpy(pdecl, LATEXT(1)); - CurParmDef = pdecl; - >> - } - { "\>" - PassAction - << ret = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(ret!=NULL, "rule rule: cannot allocate ret type"); - strcpy(ret, LATEXT(1)); - CurRetDef = ret; - >> - } - { QuotedTerm <egroup=mystrdup(LATEXT(1));>> } - << - if ( GenEClasseForRules && q!=NULL ) { - e = newECnode; - require(e!=NULL, "cannot allocate error class node"); - if ( q->egroup == NULL ) {a = q->str; a[0] = (char)toupper(a[0]);} - else a = q->egroup; - if ( Tnum( a ) == 0 ) - { - e->tok = addTname( a ); - list_add(&eclasses, (char *)e); - if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]); - /* refers to itself */ - list_add(&(e->elist), mystrdup(q->str)); - } - else { - warn(eMsg1("default errclass for '%s' would conflict with token/errclass/tokclass",a)); - if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]); - free((char *)e); - } - } - >> - <= MAX_BLK_LEVEL) fatal("Blocks nested too deeply"); -/* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID; -/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - >> - - ":" <> - block[&toksrefd, &rulesrefd] - <blockid = CurBlockID; - CurRuleBlk->jtype = RuleBlk; - if ( q!=NULL ) CurRuleBlk->rname = q->str; - CurRuleBlk->file = f; - CurRuleBlk->line = l; - CurRuleBlk->pdecl = pdecl; - CurRuleBlk->ret = ret; - CurRuleBlk->lock = makelocks(); - CurRuleBlk->pred_lock = makelocks(); - CurRuleBlk->tokrefs = toksrefd; - CurRuleBlk->rulerefs = rulesrefd; - p = newJunction(); /* add EndRule Node */ - ((Junction *)r.right)->p1 = (Node *)p; - r.right = (Node *) p; - p->jtype = EndRule; - p->lock = makelocks(); - p->pred_lock = makelocks(); - CurRuleBlk->end = p; - if ( q!=NULL ) q->rulenum = NumRules; - $7 = r; - >> - << - /* MR23 */ CurBlockID_array[BlkLevel] = (-1); - /* MR23 */ CurAltNum_array[BlkLevel] = (-1); - --BlkLevel; - >> - <> /* MR7 */ - ";" <> - { Action - << a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule rule: cannot allocate error action"); - strcpy(a, LATEXT(1)); - CurRuleBlk->erraction = a; - >> - } - ( exception_group > [eg] - <label == NULL || *eg->label=='\0' ) q->has_rule_exception = 1; - } - >> - )* - <> - <exceptions = CurExGroups;>> - <el_labels = CurElementLabels;>> - <ast_labels_in_actions = CurAstLabelsInActions;>> /* MR27 */ - <> /* MR27 Moved */ - ; - <> - -/* - * pragma : "{\\}#pragma" "dup\-labeled\-tokens" - * <> - * ; - */ - -/* rule laction */ - -laction : <> - - "{\\}#lexaction" - Action - << - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule laction: cannot allocate action"); - strcpy(a, LATEXT(1)); - list_add(&LexActions, a); - >> - ; - <> - -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via #lexmember <<....>> & #lexprefix <<...>> */ -/* MR1 */ - -/* rule lmember */ - -lmember: <> /* MR1 */ - -/* MR1 */ "{\\}#lexmember" -/* MR1 */ Action -/* MR1 */ << -/* MR1 */ if (! GenCC) { -/* MR1 */ err("Use #lexmember only in C++ mode (to insert code in DLG class header"); -/* MR1 */ } else { -/* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); -/* MR1 */ require(a!=NULL, "rule lmember: cannot allocate action"); -/* MR1 */ strcpy(a, LATEXT(1)); -/* MR1 */ list_add(&LexMemberActions, a); -/* MR1 */ }; -/* MR1 */ >> -/* MR1 */ ; -/* MR1 */ <> - -/* rule lprefix */ - -lprefix: <> /* MR1 */ - -/* MR1 */ "{\\}#lexprefix" -/* MR1 */ Action -/* MR1 */ << -/* MR1 */ if (! GenCC) { -/* MR1 */ err("Use #lexprefix only in C++ mode (to insert code in DLG class header"); -/* MR1 */ } else { -/* MR1 */ a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); -/* MR1 */ require(a!=NULL, "rule lprefix: cannot allocate action"); -/* MR1 */ strcpy(a, LATEXT(1)); -/* MR1 */ list_add(&LexPrefixActions, a); -/* MR1 */ }; -/* MR1 */ >> -/* MR1 */ ; -/* MR1 */ <> - -/* - * #pred upper <>? predicate literal - * #pred lower <>? predicate literal - * #pred up_or_low upper || lower predicate expression - * concealed interdependence - * #pred up_or_low_2 <>? A || B predicate literal equals predicate expr - * analyze using lower||upper - * generate using isLetter() - */ - -/* rule aPref */ - -aPred: <> - - "{\\}#pred" - - << - MR_usingPredNames=1; /* will need to use -mrhoist version of genPredTree */ - >> - - /* used to allow NonTerminal but it caused problems - when a rule name immediately followed a #pred statement */ - - TokenTerm <> - - << - /* don't free - referenced in predicates */ - - CurPredName=(char *)calloc(1,strlen(name) + 10); - strcat(CurPredName,"#pred "); - strcat(CurPredName,name); - - predEntry=(PredEntry *) hash_get(Pname,name); - if (predEntry != NULL) { - warnFL(eMsg1("#pred %s previously defined - ignored",name), - FileStr[action_file],action_line); - name=NULL; - }; - >> - - ( - - Pred <> - - { - predOrExpr>[predExpr] <> - } - - <file=save_file; - predEntry->line=save_line; - predExpr=MR_predFlatten(predExpr); - predEntry->predLiteral=predLiteral; - if (! predExprPresent || predExpr == NULL) { - predExpr=new_pred(); - predExpr->expr=predLiteral; - predExpr->source=newActionNode(); - predExpr->source->action=predExpr->expr; - predExpr->source->rname=CurPredName; - predExpr->source->line=action_line; - predExpr->source->file=action_file; - predExpr->source->is_predicate=1; - predExpr->k=predicateLookaheadDepth(predExpr->source); - }; - predEntry->pred=predExpr; - hash_add(Pname,name,(Entry *)predEntry); - predExpr=NULL; - }; - predicate_free(predExpr); - >> - - | - <> - - predOrExpr>[predExpr] - - <file=CurFile; - predEntry->line=zzline; - predExpr=MR_predFlatten(predExpr); - predEntry->pred=predExpr; - hash_add(Pname,name,(Entry *)predEntry); - predExpr=NULL; - }; - predicate_free(predExpr); - >> - ) - {";"} -; - -/* fail */ - -<> - -/* rule predOrExpr */ - -predOrExpr>[Predicate *result] : - <> - predAndExpr>[predExpr] - << - ORnode=new_pred(); - ORnode->expr=PRED_OR_LIST; - if (predExpr != NULL) { - ORnode->down=predExpr; - tail=&predExpr->right; - }; - >> - ( "\|\|" predAndExpr>[predExpr] - << - if (predExpr != NULL) { - *tail=predExpr; - tail=&predExpr->right; - }; - >> - )* - << - $result=ORnode; - ORnode=NULL; - >> -; - -/* fail */ - -<> - -/* rule predAndExpr */ - -predAndExpr>[Predicate *result] : - <> - predPrimary>[predExpr] - << - ANDnode=new_pred(); - ANDnode->expr=PRED_AND_LIST; - if (predExpr != NULL) { - ANDnode->down=predExpr; - tail=&predExpr->right; - }; - >> - ( "&&" predPrimary>[predExpr] - << - if (predExpr != NULL) { - *tail=predExpr; - tail=&predExpr->right; - }; - >> - )* - << - $result=ANDnode; - ANDnode=NULL; - >> -; - -/* fail */ - -<> - - -/* rule predPrimary */ - -predPrimary>[Predicate *result] : - << - char *name=NULL; - PredEntry *predEntry=NULL; - Predicate *predExpr=NULL; - >> - - TokenTerm <> - - << - predEntry=(PredEntry *) hash_get(Pname,name); - if (predEntry == NULL) { - warnFL(eMsg1("no previously defined #pred with name \"%s\"",name), - FileStr[CurFile],zzline); - name=NULL; - $result=NULL; - } else { - predExpr=predicate_dup(predEntry->pred); - predExpr->predEntry=predEntry; - $result=predExpr; - }; - >> - - | "\(" predOrExpr>[predExpr] "\)" - << - $result=predExpr; - >> - - | "!" predPrimary>[predExpr] - << - predExpr->inverted=!predExpr->inverted; - $result=predExpr; - >> -; - -/* fail */ << - predicate_free(predExpr); - >> - -/* rule aLexclass */ - -aLexclass: "{\\}#lexclass" TokenTerm <> - ; - <> - -/* rule error */ - -error : <> - "{\\}#errclass" - (<<;>> TokenTerm <> - | QuotedTerm <> - ) - <lexclass = CurrentLexClass; - if ( Tnum( (t=StripQuotes(t)) ) == 0 ) - { - if ( hash_get(Texpr, t) != NULL ) - warn(eMsg1("errclass name conflicts with regular expression '%s'",t)); - e->tok = addTname( t ); - set_orel(e->tok, &imag_tokens); - require((p=(TermEntry *)hash_get(Tname, t)) != NULL, - "hash table mechanism is broken"); - p->classname = 1; /* entry is errclass name, not token */ - list_add(&eclasses, (char *)e); - } - else - { - warn(eMsg1("redefinition of errclass or conflict w/token or tokclass '%s'; ignored",t)); - free( (char *)e ); - go=0; - } - >> - "\{" - ( NonTerminal <> - | TokenTerm <> - | QuotedTerm <> - ) - <elist), t);>> - ( - ( NonTerminal <> - | TokenTerm <> - | QuotedTerm <> - ) - <elist), t);>> - )* - "\}" - ; - <> - -/* rule tclass */ - -tclass : <> - <> - <> - "{\\}#tokclass" TokenTerm <> - <lexclass = CurrentLexClass; - if ( Tnum( t ) == 0 ) - { - e->tok = addTname( t ); - set_orel(e->tok, &imag_tokens); - set_orel(e->tok, &tokclasses); - require((p=(TermEntry *)hash_get(Tname, t)) != NULL, - "hash table mechanism is broken"); - p->classname = 1; /* entry is class name, not token */ - p->tclass = e; /* save ptr to this tclass def */ - list_add(&tclasses, (char *)e); - } - else - { - warn(eMsg1("redefinition of tokclass or conflict w/token '%s'; ignored",t)); - free( (char *)e ); - go=0; - } - >> -/* MR23 */ { -/* MR23 */ "\(" -/* MR23 */ QuotedTerm -/* MR23 */ <> -/* MR23 */ "\)" -/* MR23 */ } -/* MR23 */ -/* MR23 */ -/* MR23 */ << -/* MR23 */ if (p!= NULL && akaString != NULL) { -/* MR23 */ if (p->akaString != NULL) { -/* MR23 */ if (strcmp(p->akaString,akaString) != 0) { -/* MR23 */ warnFL(eMsg2("this #tokclass statment conflicts with a previous #tokclass %s(\"%s\") statement", -/* MR23 */ t,p->akaString), -/* MR23 */ FileStr[save_file],save_line); -/* MR23 */ }; -/* MR23 */ } else { -/* MR23 */ p->akaString=akaString; -/* MR23 */ }; -/* MR23 */ }; -/* MR23 */ >> - - "\{" - ( - ( TokenTerm - <> - - { - ".." - TokenTerm - - <> - } - - | QuotedTerm - <> - ) - <tlist), t); - } else { - list_add(&(e->tlist),".."); - list_add(&(e->tlist),t); - list_add(&(e->tlist),totext); - } - totext=NULL; - } - >> - )+ // MR15 Manfred Kogler - forbid empty #tokclass sets (was "+") - "\}" - ; - <> - -/* rule token */ - -token : <> - <> /* MR11 */ - "{\\}#token" - -/* MR1 10-Apr-97 MR1 Allow shift right operator in DLG actions */ -/* MR1 Danger when parser feedback to lexer */ -/* MR1 */ - - <> /* MR1 */ - { TokenTerm <> - -/* MR11 */ { -/* MR11 */ "\(" -/* MR11 */ QuotedTerm -/* MR11 */ <> -/* MR11 */ "\)" -/* MR11 */ } - - { "=" "[0-9]+" /* define the token type number */ - <> - } - } - { QuotedTerm <> } - { Action - << - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule token: cannot allocate action"); - strcpy(a, LATEXT(1)); - >> - } - - { ";" } /* MR11 */ - - <> - - <akaString != NULL) { - if (strcmp(te->akaString,akaString) != 0) { - warnFL(eMsg2("this #token statment conflicts with a previous #token %s(\"%s\") statement", - t,te->akaString), - FileStr[save_file],save_line); - }; - } else { - te->akaString=akaString; - }; - }; - }; - >> - ; - <> - -/* rule block */ - -block[set *toksrefd, set *rulesrefd] - : << - Graph g, b; - set saveblah; - int saveinalt = inAlt; - ExceptionGroup *eg; - *$toksrefd = empty; - *$rulesrefd = empty; - set_clr(AST_nodes_refd_in_actions); - CurBlockID++; -/* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID; - CurAltNum = 1; -/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - saveblah = attribsRefdFromAction; - attribsRefdFromAction = empty; - >> - - alt[toksrefd,rulesrefd] <> - - << - if ( ((Junction *)g.left)->p1->ntype == nAction ) - { - ActionNode *actionNode=(ActionNode *) - ( ( (Junction *)g.left) ->p1); - if (!actionNode->is_predicate ) - { - actionNode->init_action = TRUE; -/* MR12c */ if (actionNode->noHoist) { -/* MR12c */ errFL("<> appears as init-action - use <<>> <>", -/* MR12c */ FileStr[actionNode->file],actionNode->line); -/* MR12c */ }; - } - } - ((Junction *)g.left)->blockid = CurBlockID; - >> - - ( exception_group > [eg] - << - if ( eg!=NULL ) { -/* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/ -/* MR7 ***** CurAltStart->exception_label = eg->altID; *****/ - list_add(&CurExGroups, (void *)eg); - } - >> - )* - <> - - ( "\|" <> - alt[toksrefd,rulesrefd] <> - << - ((Junction *)g.left)->blockid = CurBlockID; - >> - - ( exception_group > [eg] - << - if ( eg!=NULL ) { -/* MR7 ***** eg->altID = makeAltID(CurBlockID,CurAltNum); *****/ -/* MR7 ***** CurAltStart->exception_label = eg->altID; *****/ - list_add(&CurExGroups, (void *)eg); - } - >> - )* - - <> - - )* - <<$0 = b;>> - <> - ; - <> - -/* rule alt */ - -alt[set *toksrefd, set *rulesrefd] - : <> - { "\@" /* handle MismatchedToken signals with default handler */ - <> - } - - ( <<;>> /* MR9 Removed unreferenced variable "tok" */ - { <> "\~" <> } - element[old_not, first_on_line, use_def_MT_handler] > [node] - <ntype!=nAction ) first_on_line = 0;>> - << - if ( $2.left!=NULL ) { - g = Cat(g, $2); - n++; - if ( node!=NULL ) { - if ( node->ntype!=nAction ) e_num++; - /* record record number of all rule and token refs */ - if ( node->ntype==nToken ) { - TokNode *tk = (TokNode *)((Junction *)$2.left)->p1; - tk->elnum = e_num; - set_orel(e_num, &elems); - } - else if ( node->ntype==nRuleRef ) { - RuleRefNode *rn = (RuleRefNode *)((Junction *)$2.left)->p1; - rn->elnum = e_num; - set_orel(e_num, $rulesrefd); - } - } - } - >> - )* - <0 ) - err("one or more $i in action(s) refer to non-token elements"); - set_free(dif); - } - set_free(elems); - set_free(attribsRefdFromAction); - inAlt = 0; - >> - ; - <> - -/* rule element_label */ - -element_label > [LabelEntry *label] - : <> - LABEL <> - << - UsedNewStyleLabel = 1; - if ( UsedOldStyleAttrib ) err("cannot mix with new-style labels with old-style $i"); - t = (TermEntry *) hash_get(Tname, lab); - if ( t==NULL ) t = (TermEntry *) hash_get(Texpr, lab); - if ( t==NULL ) r = (RuleEntry *) hash_get(Rname, lab); - if ( t!=NULL ) { - err(eMsg1("label definition clashes with token/tokclass definition: '%s'", lab)); - $label = NULL; - } - else if ( r!=NULL ) { - err(eMsg1("label definition clashes with rule definition: '%s'", lab)); - $label = NULL; - } - else { - /* we don't clash with anybody else */ - l = (LabelEntry *) hash_get(Elabel, lab); - if ( l==NULL ) { /* ok to add new element label */ - l = (LabelEntry *)hash_add(Elabel, - lab, - (Entry *)newLabelEntry(lab)); - /* add to list of element labels for this rule */ - list_add(&CurElementLabels, (void *)lab); -/* MR7 */ leAdd(l); /* list of labels waiting for exception group definitions */ - $label = l; - } - else { - err(eMsg1("label definitions must be unique per rule: '%s'", lab)); - $label = NULL; - } - } - >> - ":" - ; - -/* rule element */ - -element[int old_not, int first_on_line, int use_def_MT_handler] > [Node *node] - : << - Attrib blk; - Predicate *pred = NULL; - int local_use_def_MT_handler=0; - ActionNode *act; - RuleRefNode *rr; - set toksrefd, rulesrefd; - TermEntry *term; - TokNode *p=NULL; RuleRefNode *q; int approx=0; - LabelEntry *label=NULL; - int predMsgDone=0; - int semDepth=0; - int ampersandStyle; - int height; /* MR11 */ - int equal_height; /* MR11 */ - - char* pFirstSetSymbol = NULL; /* MR21 */ - - $node = NULL; - >> - {element_label>[label]} - ( TokenTerm - << - term = (TermEntry *) hash_get(Tname, LATEXT(1)); - if ( term==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - $$.left = $$.right = NULL; - } - else { - $$ = buildToken(LATEXT(1)); - p=((TokNode *)((Junction *)$$.left)->p1); - term = (TermEntry *) hash_get(Tname, LATEXT(1)); - require( term!= NULL, "hash table mechanism is broken"); - p->tclass = term->tclass; - p->complement = $old_not; - if ( label!=NULL ) { - p->el_label = label->str; - label->elem = (Node *)p; - } - } - >> - { ".." - ( QuotedTerm - <> - | TokenTerm - <> - ) - } - << - if ( p!=NULL && (p->upper_range!=0 || p->tclass || $old_not) ) - list_add(&MetaTokenNodes, (void *)p); - >> - ( "^" <astnode=ASTroot;>> - | <astnode=ASTchild;>> - | "!" <astnode=ASTexclude;>> - ) - { "\@" <> } - << - if ( p!=NULL && $first_on_line ) { - CurAltStart = (Junction *)$$.left; - altAdd(CurAltStart); /* MR7 */ - p->altstart = CurAltStart; - } - if ( p!=NULL ) - p->use_def_MT_handler = $use_def_MT_handler || local_use_def_MT_handler; - $node = (Node *)p; - >> - | QuotedTerm - << - term = (TermEntry *) hash_get(Texpr, LATEXT(1)); - if ( term==NULL && UserDefdTokens ) { - err("implicit token definition not allowed with #tokdefs"); - $$.left = $$.right = NULL; - } - else { - $$ = buildToken(LATEXT(1)); p=((TokNode *)((Junction *)$$.left)->p1); - p->complement = $old_not; - if ( label!=NULL ) { - p->el_label = label->str; - label->elem = (Node *)p; - } - } - >> - { ".." - ( QuotedTerm - <> - | TokenTerm - <> - ) - } - ( "^" <astnode=ASTroot;>> - | <astnode=ASTchild;>> - | "!" <astnode=ASTexclude;>> - ) - { "\@" <> } - << - if ( p!=NULL && (p->upper_range!=0 || p->tclass || $old_not) ) - list_add(&MetaTokenNodes, (void *)p); - >> - << - if ( $first_on_line ) { - CurAltStart = (Junction *)$$.left; - altAdd(CurAltStart); /* MR7 */ - p->altstart = CurAltStart; - } - if ( p!=NULL ) - p->use_def_MT_handler = $use_def_MT_handler || local_use_def_MT_handler; - $node = (Node *)p; - >> - - | <> - "." - <<$$ = buildWildCard(LATEXT(1)); p=((TokNode *)((Junction *)$$.left)->p1);>> - ( "^" <astnode=ASTroot;>> - | <astnode=ASTchild;>> - | "!" <astnode=ASTexclude;>> - ) - <> - << - if ( $first_on_line ) { - CurAltStart = (Junction *)$$.left; - altAdd(CurAltStart); /* MR7 */ - p->altstart = CurAltStart; - if ( label!=NULL ) { - p->el_label = label->str; - label->elem = (Node *)p; - } - } - $node = (Node *)p; - >> - - | <> - NonTerminal - <<$$ = buildRuleRef(LATEXT(1));>> - { "!" <p1; - q->astnode=ASTexclude;>> - } - { {"\<"} - PassAction <p1, LATEXT(1));>> - } - <p1;>> - { <> - "\>" - PassAction - << - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule element: cannot allocate assignment"); - strcpy(a, LATEXT(1)); - rr->assign = a; - >> - } - << - if ( label!=NULL ) { - rr->el_label = label->str; - label->elem = (Node *)rr; - } - if ( $first_on_line ) { - CurAltStart = (Junction *)$$.left; - altAdd(CurAltStart); /* MR7 */ - ((RuleRefNode *)((Junction *)$$.left)->p1)->altstart = CurAltStart; - } - $node = (Node *)rr; - >> - ) - - | <> - Action <<$0 = buildAction(LATEXT(1),action_file,action_line, 0);>> - <> /* MR7 */ - <<$node = (Node *) ((Junction *)$0.left)->p1;>> - - | <> - Pred <<$0 = buildAction(LATEXT(1),action_file,action_line, 1);>> - <p1;>> - <> - { <> - PassAction - << - a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule element: cannot allocate predicate fail action"); - strcpy(a, LATEXT(1)); - act->pred_fail = a; - >> - } - <> /* MR7 */ - <<$node = (Node *)act;>> - - | <> - <= MAX_BLK_LEVEL) fatal("Blocks nested too deeply"); -/* MR23 */ CurBlockID_array[BlkLevel] = CurBlockID; -/* MR23 */ CurAltNum_array[BlkLevel] = CurAltNum; - >> - { Pragma - ( "approx" <> - | "LL\(1\)" <> /* MR20 */ - | "LL\(2\)" <> /* MR20 */ - ) - } - -/* MR21 */ { FirstSetSymbol -/* MR21 */ "\(" -/* MR21 */ ( NonTerminal -/* MR21 */ << -/* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1, -/* MR21 */ sizeof(char)); -/* MR21 */ require(pFirstSetSymbol!=NULL, -/* MR21 */ "cannot allocate first set name"); -/* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1)); -/* MR21 */ >> -/* MR21 */ | TokenTerm -/* MR21 */ << -/* MR21 */ pFirstSetSymbol = (char *) calloc(strlen(LATEXT(1))+1, -/* MR21 */ sizeof(char)); -/* MR21 */ require(pFirstSetSymbol!=NULL, -/* MR21 */ "cannot allocate first set name"); -/* MR21 */ strcpy(pFirstSetSymbol, LATEXT(1)); -/* MR21 */ >> -/* MR21 */ ) -/* MR21 */ "\)" -/* MR21 */ } - - ( - - "\(" block[&toksrefd,&rulesrefd] "\)" - <> - - ( "\*" <<$$ = makeLoop($$,approx,pFirstSetSymbol);>> - | "\+" <<$$ = makePlus($$,approx,pFirstSetSymbol);>> - | "?" - ( - ( "=>" <> - | "&&" <> /* MR10 (g)? && <

>? */ - ) - Pred /* generalized predicate */ - /* first make into a predicate */ - <<$$ = buildAction(LATEXT(1),action_file,action_line,1);>> - <p1;>> - <> /* MR10 */ - <> - { <> - PassAction - << - a = (char *)calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(a!=NULL, "rule element: cannot allocate predicate fail action"); - strcpy(a, LATEXT(1)); - act->pred_fail = a; - >> - } - <> - <<$node = (Node *)act;>> - - /* for now, just snag context */ - << - pred = computePredFromContextGuard(blk,&predMsgDone); /* MR10 */ - if ( pred==NULL) { /* MR10 */ - if ( !predMsgDone) err("invalid or missing context guard"); /* MR10 */ - predMsgDone=1; /* MR10 */ - } else { /* MR10 */ - act->guardNodes=(Junction *)blk.left; /* MR11 */ - pred->expr = act->action; - pred->source = act; -/* MR10 */ pred->ampersandStyle = ampersandStyle; /* 0 means (g)? => ... 1 means (g)? && ... */ -/* MR13 */ if (pred->tcontext != NULL) { -/* MR13 */ height=MR_max_height_of_tree(pred->tcontext); -/* MR13 */ equal_height=MR_all_leaves_same_height(pred->tcontext,height); -/* MR13 */ if (! equal_height) { -/* MR13 */ errFL("in guarded predicates all tokens in the guard must be at the same height", -/* MR13 */ FileStr[act->file],act->line); -/* MR13 */ }; -/* MR13 */ } -/* MR10 */ if (ampersandStyle) { -/* MR10 */ act->ampersandPred = pred; -/* MR11 */ if (! HoistPredicateContext) { -/* MR11 */ errFL("without \"-prc on\" (guard)? && <>? ... doesn't make sense", -/* MR11 */ FileStr[act->file],act->line); -/* MR11 */ }; -/* MR10 */ } else { -/* MR10 */ act->guardpred = pred; -/* MR10 */ }; -/* MR10 */ if (pred->k != semDepth) { -/* MR10 */ warn(eMsgd2("length of guard (%d) does not match the length of semantic predicate (%d)", -/* MR10 */ pred->k,semDepth)); -/* MR10 */ }; - } - >> - | <<$$ = makeBlk($$,approx,pFirstSetSymbol); - FoundGuessBlk = 1; - ((Junction *) ((Junction *)$$.left)->p1)->guess=1; - if ( !$first_on_line ) { - err("(...)? predicate must be first element of production"); - } - >> - ) - | <<$$ = makeBlk($$,approx,pFirstSetSymbol);>> - ) - << - if ( pred==NULL && !predMsgDone) { /* MR10 */ - ((Junction *)((Junction *)$$.left)->p1)->blockid = CurBlockID; - ((Junction *)((Junction *)$$.left)->p1)->tokrefs = toksrefd; - ((Junction *)((Junction *)$$.left)->p1)->rulerefs = rulesrefd; - if ( $first_on_line ) { /* MR7 */ - CurAltStart = (Junction *)((Junction *)((Junction *)$$.left)->p1); /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; /* MR7 */ - $node = (Node *) ((Junction *)$$.left)->p1; - } - >> - - | "\{" block[&toksrefd,&rulesrefd] - <<$$ = makeOpt($2,approx,pFirstSetSymbol); - /* MR23 */ CurBlockID_array[BlkLevel] = (-1); - /* MR23 */ CurAltNum_array[BlkLevel] = (-1); - --BlkLevel; - >> - "\}" - << - ((Junction *)((Junction *)$$.left)->p1)->blockid = CurBlockID; - ((Junction *)((Junction *)$$.left)->p1)->tokrefs = toksrefd; - ((Junction *)((Junction *)$$.left)->p1)->rulerefs = rulesrefd; - >> - <p1); /* MR7 */ - altAdd(CurAltStart); /* MR7 */ - }; - >> - <<$node = (Node *) ((Junction *)$$.left)->p1;>> - - ) - -/* Error catching alternatives */ - | "\*" <> - | "\+" <> - | "\>" <' can only appear after a nonterminal"); CannotContinue=TRUE;>> - | PassAction < [...]'"); - CannotContinue=TRUE;>> - ; - <> - -/* rule default_exception_handler */ - -default_exception_handler - : exception_group > [DefaultExGroup] - ; - -/* rule exception_group */ - -exception_group > [ExceptionGroup *eg] - : <> /* MR6 */ - - "exception" <<$eg = (ExceptionGroup *)calloc(1, sizeof(ExceptionGroup));>> - { <> - PassAction /* did they attach a label? */ - << - p = LATEXT(1)+1; - p[strlen(p)-1] = '\0'; /* kill trailing space */ - label = (LabelEntry *) hash_get(Elabel, LATEXT(1)+1); - if ( label==NULL ) - { - err(eMsg1("unknown label in exception handler: '%s'", LATEXT(1)+1)); - } - >> - } - ( exception_handler > [h] - <handlers), (void *)h);>> - )* - { "default" ":" Action - <<{ - ExceptionHandler *eh = (ExceptionHandler *) - calloc(1, sizeof(ExceptionHandler)); - char *a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require(eh!=NULL, "exception: cannot allocate handler"); - require(a!=NULL, "exception: cannot allocate action"); - strcpy(a, LATEXT(1)); - eh->action = a; - eh->signalname = (char *) calloc(strlen("default")+1, sizeof(char)); - require(eh->signalname!=NULL, "exception: cannot allocate sig name"); - strcpy(eh->signalname, "default"); - list_add(&($eg->handlers), (void *)eh); - }>> - } - - << - if ( label!=NULL ) { - /* Record ex group in sym tab for this label */ - if ( label->ex_group!=NULL ) { - err(eMsg1("duplicate exception handler for label '%s'",label->str)); - } else { - label->ex_group = $eg; - /* Label the exception group itself */ - $eg->label = label->str; - /* Make the labelled element pt to the exception also */ -/* MR6 */ if (label->elem == NULL) { -/* MR6 */ err(eMsg1("reference in exception handler to undefined label '%s'",label->str)); -/* MR6 */ } else { - switch ( label->elem->ntype ) { - case nRuleRef : - { - RuleRefNode *r = (RuleRefNode *)label->elem; - r->ex_group = $eg; - break; - } - case nToken : - { - TokNode *t = (TokNode *)label->elem; - t->ex_group = $eg; - break; - } - } /* end switch */ -/* MR6 */ }; /* end test on label->elem */ - } /* end test on label->ex_group */ - - } /* end test on exception label */ - -/* MR7 */ -/* MR7 */ if (BlkLevel == 1 && label == NULL) { -/* MR7 */ $eg->forRule=1; -/* MR7 */ } else if (label == NULL) { -/* MR7 */ $eg->altID = makeAltID(CurBlockID_array[BlkLevel], CurAltNum_array[BlkLevel]); -/* MR7 */ egAdd($eg); -/* MR7 */ } else { -/* MR7 */ $eg->labelEntry=label; -/* MR7 */ }; -/* MR7 */ -/* MR7 */ /* You may want to remove this exc from the rule list */ -/* MR7 */ /* and handle at the labeled element site. */ -/* MR7 */ -/* MR7 */ if (label != NULL) { -/* MR7 */ $eg = NULL; -/* MR7 */ }; - - >> - ; - <> - -/* rule exception_handler */ - -exception_handler > [ExceptionHandler *eh] - : <<;>> /* MR9 Removed unreferenced variable "a" */ - "catch" - << - $eh = (ExceptionHandler *)calloc(1, sizeof(ExceptionHandler)); - require($eh!=NULL, "exception: cannot allocate handler"); - >> - ( NonTerminal - << - $eh->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require($eh->signalname!=NULL, "exception: cannot allocate sig name"); - strcpy($eh->signalname, LATEXT(1)); - >> - | TokenTerm - << - $eh->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require($eh->signalname!=NULL, "exception: cannot allocate sig name"); - strcpy($eh->signalname, LATEXT(1)); - >> - ) - ":" - { <<$eh->action = NULL;>> - Action - << - $eh->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - require($eh->action!=NULL, "exception: cannot allocate action"); - strcpy($eh->action, LATEXT(1)); - >> - } - ; - <> - -#token NonTerminal "[a-z] [A-Za-z0-9_]*" - << - while ( zzchar==' ' || zzchar=='\t' ) { - zzadvance(); - } - if ( zzchar == ':' && inAlt ) NLA = LABEL; - >> -#token TokenTerm "[A-Z] [A-Za-z0-9_]*" - << - while ( zzchar==' ' || zzchar=='\t' ) { - zzadvance(); - } - if ( zzchar == ':' && inAlt ) NLA = LABEL; - >> -#token "{\\}#[A-Za-z0-9_]*" <> - -#lexclass PARSE_ENUM_FILE - -#token "[\t\ ]+" << zzskip(); >> /* Ignore White */ -#token "\n|\r|\r\n" << zzline++; zzskip(); >> /* Track Line # */ -#token "//" << zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); >> -#token "/\*" << zzmode(TOK_DEF_COMMENTS); zzskip(); >> -#token "#ifdef" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >> -#token "#if" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >> -#token "#ifndef" << ; >> -#token "#else" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >> -#token "#endif" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >> -#token "#undef" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >> -#token "#import" << zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); >> -#token "@" << ; >> - -/* rule enum_file */ - -enum_file[char *fname] - : { "#ifndef" ID - { "#define" ID /* ignore if it smells like a gate */ - /* First #define after the first #ifndef (if any) is ignored */ - } - } - ( ( enum_def[$fname] )+ - | defines[$fname] - ) - | - ; - -/* rule defines */ - -defines[char *fname] - : <> /* MR3 */ - ( - "#define" ID - <> - INT - << - v = atoi(LATEXT(1)); -/* fprintf(stderr, "#token %s=%d\n", t, v);*/ - - /* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */ - /* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */ - /* MR2 Don't let #tokdefs be confused by */ - /* MR2 DLGminToken and DLGmaxToken */ - - if ( ! isDLGmaxToken(t)) { /* MR2 */ - TokenNum = v; - if ( v>maxt ) maxt=v; - if ( Tnum( t ) == 0 ) { - addForcedTname( t, v ); - } else { - warnFL(eMsg1("redefinition of token %s; ignored",t),$fname,zzline); - }; - }; - >> - )+ - <> - ; - -/* rule enum_def */ - -enum_def[char *fname] - : <> /* MR3 */ - "enum" ID - "\{" - ID - <> - ( "=" INT <> - | <> - ) - << -/* fprintf(stderr, "#token %s=%d\n", t, v);*/ - TokenNum = v; - if ( v>maxt ) maxt=v; /* MR3 */ - if ( Tnum( t ) == 0 ) addForcedTname( t, v ); - else { - warnFL(eMsg1("redefinition of token %s; ignored",t),$fname,zzline); - } - >> - ( "," - - /* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */ - /* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */ - /* MR2 Don't let #tokdefs be confused by */ - /* MR2 DLGminToken and DLGmaxToken */ - - { - <>? ID { "=" INT } /* MR2 */ - | ID /* MR2 */ - <> - ( "=" INT <> - | <> - ) - << -/* fprintf(stderr, "#token %s=%d\n", t, v);*/ - TokenNum = v; - if ( v>maxt ) maxt=v; /* MR3 */ - if ( Tnum( t ) == 0 ) addForcedTname( t, v ); - else { - warnFL(eMsg1("redefinition of token %s; ignored",t),$fname,zzline); - } - >> - } - )* - "\}" - ";" - <> /* MR3 */ - ; - -#token INT "[0-9]+" -#token ID "[a-zA-Z_][_a-zA-Z0-9]*" - -#lexclass START - -/* MR14 Arpad Beszedes 26-May-98 - Add support for #line directives when antlr source is pre-processed -*/ - -#lexaction -<< - -static char * -#ifdef __USE_PROTOS -getFileNameFromTheLineInfo(char *toStr, char *fromStr) -#else -getFileNameFromTheLineInfo(toStr, fromStr) -char *toStr, *fromStr; -#endif -{ - int i, j, k; - - if (!fromStr || !toStr) return toStr; - - /* find the first " */ - - for (i=0; - (i> - -<< - -/* MR2 Andreas Magnusson (Andreas.Magnusson@mailbox.swipnet.se) */ -/* MR2 Fix to bug introduced by 1.33MR1 for #tokdefs */ -/* MR2 Don't let #tokdefs be confused by */ -/* MR2 DLGminToken and DLGmaxToken */ - -/* semantic check on DLGminToken and DLGmaxmaxToken in #tokdefs */ - -#ifdef __USE_PROTOS -static int isDLGmaxToken(char *Token) -#else -static int isDLGmaxToken(Token) - char * Token; -#endif -{ - static char checkStr1[] = "DLGmaxToken"; - static char checkStr2[] = "DLGminToken"; - - if (strcmp(Token, checkStr1) == 0) - return 1; - else if (strcmp(Token, checkStr2) == 0) - return 1; - else - return 0; -} - -/* semantics of #token */ -static void -#ifdef __USE_PROTOS -chkToken(char *t, char *e, char *a, int tnum) -#else -chkToken(t,e,a,tnum) -char *t, *e, *a; -int tnum; -#endif -{ - TermEntry *p; - - /* check to see that they don't try to redefine a token as a token class */ - if ( t!=NULL ) { - p = (TermEntry *) hash_get(Tname, t); - if ( p!=NULL && p->classname ) { - err(eMsg1("redefinition of #tokclass '%s' to #token not allowed; ignored",t)); - if ( a!=NULL ) free((char *)a); - return; - } - } - - if ( t==NULL && e==NULL ) { /* none found */ - err("#token requires at least token name or rexpr"); - } - else if ( t!=NULL && e!=NULL ) { /* both found */ - if ( UserDefdTokens ) { /* if #tokdefs, must not define new */ - p = (TermEntry *) hash_get(Tname, t); - if ( p == NULL) { -err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t)); - return; - }; - } - Tklink(t, e); - if ( a!=NULL ) { - if ( hasAction(e) ) { - err(eMsg1("redefinition of action for %s; ignored",e)); - } - else setHasAction(e, a); - } - } - else if ( t!=NULL ) { /* only one found */ - if ( UserDefdTokens ) { - p = (TermEntry *) hash_get(Tname, t); - if (p == NULL) { -err(eMsg1("new token definition '%s' not allowed - only #token with name already defined by #tokdefs file allowed",t)); - }; - return; - } - if ( Tnum( t ) == 0 ) addTname( t ); - else { - err(eMsg1("redefinition of token %s; ignored",t)); - } - if ( a!=NULL ) { - err(eMsg1("action cannot be attached to a token name (%s); ignored",t)); - free((char *)a); - } - } - else if ( e!=NULL ) { - if ( Tnum( e ) == 0 ) addTexpr( e ); - else { - if ( hasAction(e) ) { - err(eMsg1("redefinition of action for expr %s; ignored",e)); - } - else if ( a==NULL ) { - err(eMsg1("redefinition of expr %s; ignored",e)); - } - } - if ( a!=NULL ) setHasAction(e, a); - } - - /* if a token type number was specified, then add the token ID and 'tnum' - * pair to the ForcedTokens list. (only applies if an id was given) - */ - if ( t!=NULL && tnum>0 ) - { - if ( set_el(tnum, reserved_positions) ) - { - err(eMsgd("a token has already been forced to token number %d; ignored", tnum)); - } - else - { - list_add(&ForcedTokens, newForcedToken(t,tnum)); - set_orel(tnum, &reserved_positions); - } - } -} ->> - -<< -static int -#ifdef __USE_PROTOS -match_token(char *s, char **nxt) -#else -match_token(s,nxt) -char *s; -char **nxt; -#endif -{ - if ( !(*s>='A' && *s<='Z') ) return 0; - s++; - while ( (*s>='a' && *s<='z') || - (*s>='A' && *s<='Z') || - (*s>='0' && *s<='9') || - *s=='_' ) - { - s++; - } - if ( *s!=' ' && *s!='}' ) return 0; - *nxt = s; - return 1; -} - -static int -#ifdef __USE_PROTOS -match_rexpr(char *s, char **nxt) -#else -match_rexpr(s,nxt) -char *s; -char **nxt; -#endif -{ - if ( *s!='"' ) return 0; - s++; - while ( *s!='"' ) - { - if ( *s=='\n' || *s=='\r' ) /* MR13 */ - warn("eoln found in regular expression"); - if ( *s=='\\' ) s++; - s++; - } - *nxt = s+1; - return 1; -} - -/* - * Walk a string "{ A .. Z }" where A..Z is a space separated list - * of token references (either labels or reg exprs). Return a - * string "inlineX_set" for some unique integer X. Basically, - * we pretend as if we had seen "#tokclass inlineX { A .. Z }" - * on the input stream outside of an action. - */ -char * -#ifdef __USE_PROTOS -inline_set(char *s) -#else -inline_set(s) -char *s; -#endif -{ - char *nxt; - fprintf(stderr, "found consumeUntil( {...} )\n"); - while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} - if ( *s!='{' ) - { - err("malformed consumeUntil( {...} ); missing '{'"); - return "bad_set"; - } - s++; - while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} - while ( *s!='}' ) - { - if ( match_token(s,&nxt) ) fprintf(stderr, "found token %s\n", s); - else if ( match_rexpr(s,&nxt) ) fprintf(stderr, "found rexpr %s\n", s); - else { - err("invalid element in consumeUntil( {...} )"); - return "bad_set"; - } - s = nxt; - while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} - } - return "inlineX_set"; -} ->> - -<< -/* ANTLR-specific syntax error message generator - * (define USER_ZZSYN when compiling so don't get 2 definitions) - */ -void -#ifdef __USE_PROTOS -zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, -int k, char *bad_text) -#else -zzsyn(text, tok, egroup, eset, etok, k, bad_text) -char *text, *egroup, *bad_text; -int tok; -int etok; -int k; -SetWordType *eset; -#endif -{ - fprintf(stderr, ErrHdr, FileStr[CurFile]!=NULL?FileStr[CurFile]:"stdin", zzline); - fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text); - if ( !etok && !eset ) {fprintf(stderr, "\n"); return;} - if ( k==1 ) fprintf(stderr, " missing"); - else - { - fprintf(stderr, "; \"%s\" not", bad_text); - if ( zzset_deg(eset)>1 ) fprintf(stderr, " in"); - } - if ( zzset_deg(eset)>0 ) zzedecode(eset); - else fprintf(stderr, " %s", zztokens[etok]); - if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup); - fprintf(stderr, "\n"); -} ->> - -#lexaction << -#ifdef __USE_PROTOS -void mark_label_used_in_sem_pred(LabelEntry *le) /* MR10 */ -#else -void mark_label_used_in_sem_pred(le) /* MR10 */ - LabelEntry *le; -#endif -{ - TokNode *tn; - require (le->elem->ntype == nToken,"mark_label_used... ntype != nToken"); - tn=(TokNode *)le->elem; - require (tn->label != 0,"mark_label_used... TokNode has no label"); - tn->label_used_in_semantic_pred=1; -} ->> diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.r b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.r deleted file mode 100644 index 5741ec4be..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr.r +++ /dev/null @@ -1,787 +0,0 @@ -/* - File: antlrMPW.r - Target: antlr 133MR - Created: Monday, June 15, 1998 4:41:11 AM - Author: Kenji Tanaka (kentar@osa.att.ne.jp) -*/ - -#include "cmdo.r" - -resource 'cmdo' (128, "Antlr") { - { /* array dialogs: 5 elements */ - /* [1] */ - 295, - "ANTLR -- Purdue Compiler Construction To" - "ol Set (PCCTS) LL(k) parser generator.", - { /* array itemArray: 12 elements */ - /* [1] */ - NotDependent { - - }, - CheckOption { - NotSet, - {18, 23, 33, 223}, - "Read grammar from stdin", - "-", - "Read grammar from stdin." - }, - /* [2] */ - NotDependent { - - }, - CheckOption { - NotSet, - {38, 23, 53, 310}, - "Send grammar.c/grammar.cpp to stdout", - "-stdout", - "Send grammar.c/grammar.cpp to stdout." - }, - /* [3] */ - NotDependent { - - }, - MultiFiles { - "Grammar File(s)É", - "Choose the grammar specification files y" - "ou wish to have ANTLR process.", - {79, 22, 98, 152}, - "Grammar specification:", - "", - MultiInputFiles { - { /* array MultiTypesArray: 1 elements */ - /* [1] */ - text - }, - ".g", - "Files ending in .g", - "All text files" - } - }, - /* [4] */ - NotDependent { - - }, - Files { - DirOnly, - OptionalFile { - {58, 168, 74, 298}, - {79, 169, 98, 299}, - "Output Directory", - ":", - "-o", - "", - "Choose the directory where ANTLR will pu" - "t its output.", - dim, - "Output DirectoryÉ", - "", - "" - }, - NoMore { - - } - }, - /* [5] */ - NotDependent { - - }, - Redirection { - StandardOutput, - {126, 27} - }, - /* [6] */ - NotDependent { - - }, - Redirection { - DiagnosticOutput, - {126, 178} - }, - /* [7] */ - NotDependent { - - }, - TextBox { - gray, - {117, 20, 167, 300}, - "Redirection" - }, - /* [8] */ - NotDependent { - - }, - NestedDialog { - 5, - {20, 324, 40, 460}, - "Parse OptionsÉ", - "Parse control options may be set with th" - "is button." - }, - /* [9] */ - NotDependent { - - }, - NestedDialog { - 2, - {50, 324, 70, 460}, - "Generate OptionsÉ", - "Various command line options may be set " - "with this button." - }, - /* [10] */ - NotDependent { - - }, - NestedDialog { - 3, - {78, 324, 98, 460}, - "More OptionsÉ", - "Antlr has ALOT of options. There are eve" - "n more to be found with this button." - }, - /* [11] */ - NotDependent { - - }, - NestedDialog { - 4, - {106, 324, 126, 460}, - "Rename OptionsÉ", - "Options for renaming output files may be" - " set with this button." - }, - /* [12] */ - NotDependent { - - }, - VersionDialog { - VersionString { - "1.33MR" - }, - "PCCTS was written by Terence Parr, Russe" - "ll Quong, Will Cohen, and Hank Dietz: 19" - "89-1998. MPW port by Scott Haney.", - noDialog - } - }, - /* [2] */ - 295, - "Use this dialog to specify command line " - "Generate Options.", - { /* array itemArray: 15 elements */ - /* [1] */ - NotDependent { - - }, - CheckOption { - NotSet, - {18, 25, 33, 225}, - "Generate C++ code", - "-CC", - "Generate C++ output from both ANTLR and " - "DLG." - }, - /* [2] */ - NotDependent { - - }, - CheckOption { - NotSet, - {38, 25, 53, 225}, - "Generate ASTs", - "-gt", - "Generate code for Abstract-Syntax-Trees " - "(ASTs)." - }, - /* [3] */ - NotDependent { - - }, - CheckOption { - NotSet, - {58, 25, 73, 225}, - "Generate line info", - "-gl", - "If this option is checked, ANTLR will ge" - "nerate line info about grammaractions, t" - "hereby making debugging easier since com" - "pile errors will point to the grammar fi" - "le." - }, - /* [4] */ - NotDependent { - - }, - CheckOption { - NotSet, - {78, 25, 93, 225}, - "Generate error classes", - "-ge", - "If this option is checked, ANTLR will ge" - "nerate an error class foreach non-termin" - "al." - }, - /* [5] */ - NotDependent { - - }, - CheckOption { - NotSet, - {98, 25, 113, 225}, - "Don't generate Code", - "-gc", - "If this option is checked, ANTLR will ge" - "nerate no code, i.e. it will only perfor" - "m analysis on the grammar." - }, - /* [6] */ - NotDependent { - - }, - CheckOption { - NotSet, - {118, 25, 133, 225}, - "Delay lookahead fetches", - "-gk", - "If this option is checked, ANTLR will ge" - "nerate a parser that delays lookahead fe" - "tches until needed." - }, - /* [7] */ - NotDependent { - - }, - CheckOption { - NotSet, - {138, 25, 153, 225}, - "Use newAST(...)", - "-newAST", - "In C++ mode use \"newAST(...)\" rather tha" - "n \"new AST(...)\"" - }, - /* [8] */ - NotDependent { - - }, - CheckOption { - NotSet, - {18, 235, 33, 435}, - "Support parse traces", - "-gd", - "If this option is checked, ANTLR inserts" - " code in each parsing function to provid" - "e for user-defined handling of a detaile" - "d parse trace. The code consists of call" - "s to zzTRACEIN and zzTRACEOUT." - }, - /* [9] */ - NotDependent { - - }, - CheckOption { - NotSet, - {38, 235, 53, 435}, - "Generate cross-references", - "-cr", - "If this option is checked, ANTLR will ge" - "nerate a cross reference for all rules. " - "For each rule it will print a list of al" - "l other rules that refrence it." - }, - /* [10] */ - NotDependent { - - }, - CheckOption { - NotSet, - {58, 235, 73, 435}, - "Don't create Lexer files", - "-gx", - "If this option is checked, ANTLR will no" - "t generate DLG-related output files. Thi" - "s option should be used if one wants a c" - "ustom lexical analyzer or if one has mad" - "e changes to the grammar not affecting t" - "he lexical structure." - }, - /* [11] */ - NotDependent { - - }, - CheckOption { - NotSet, - {78, 235, 93, 460}, - "Don't generate token expr sets", - "-gs", - "If this option is checked, ANTLR will no" - "t generate sets for token expression set" - "s; instead, it will generate a || separa" - "ted sequence of LA(1)==token #. " - }, - /* [12] */ - NotDependent { - - }, - CheckOption { - NotSet, - {98, 235, 113, 460}, - "Generate ANSI-compatible", - "-ga", - "Generate ANSI-compatible code (default=F" - "ALSE)" - }, - /* [13] */ - NotDependent { - - }, - CheckOption { - NotSet, - {118, 235, 133, 460}, - "Don't generate tokens.h", - "-gxt", - "Do not generate tokens.h (default=FALSE)" - }, - /* [13] */ - NotDependent { - - }, - CheckOption { - NotSet, - {138, 235, 153, 460}, - "Provide \"(alpha)? beta\" info", - "-alpha", - "Provide additional information for \"(alpha)? beta\" error messages" - }, - /* [14] */ - NotDependent { - - }, - RegularEntry { - "Tabs(1 to 8):", - {162, 23, 177, 117}, - {163, 125, 179, 196}, - "", - keepCase, - "-tab", - "Width of tabs (1 to 8) for grammar.c/gra" - "mmar.cpp files." - }, - /* [15] */ - NotDependent { - - }, - RegularEntry { - "Function Prefix:", - {161, 236, 177, 342}, - {162, 345, 177, 454}, - "", - keepCase, - "-gp", - "Prefix all generated rule functions with" - " a string." - } - }, - /* [3] */ - 295, - "Use this dialog to specify still more co" - "mmand line options.", - { /* array itemArray: 12 elements */ - /* [1] */ - NotDependent { - - }, - RadioButtons { - { /* array radioArray: 3 elements */ - /* [1] */ - {38, 25, 53, 85}, "None", "", Set, "When this option is selected, ANTLR will" - " not print the grammar to stdout.", - /* [2] */ - {38, 100, 53, 160}, "Yes", "-p", NotSet, "When this option is selected, ANTLR will" - " print the grammar, stripped of all acti" - "ons and comments, to stdout.", - /* [3] */ - {38, 175, 53, 235}, "More", "-pa", NotSet, "When this option is selected, ANTLR will" - " print the grammar, stripped of all acti" - "ons and comments, to stdout. It will als" - "o annotate the output with the first set" - "s determined from grammar analysis." - } - }, - /* [2] */ - NotDependent { - - }, - TextBox { - gray, - {28, 15, 60, 250}, - "Grammar Printing" - }, - /* [3] */ - NotDependent { - - }, - RadioButtons { - { /* array radioArray: 3 elements */ - /* [1] */ - {88, 25, 103, 85}, "Low", "", Set, "When this option is selected, ANTLR will" - " show ambiguities/errors in low detail.", - /* [2] */ - {88, 100, 103, 160}, "Medium", "-e2", NotSet, "When this option is selected, ANTLR will" - " show ambiguities/errors in more detail.", - /* [3] */ - {88, 175, 103, 235}, "High", "-e3", NotSet, "When this option is selected, ANTLR will" - " show ambiguities/errors in excruciating" - " detail." - } - }, - /* [4] */ - NotDependent { - - }, - TextBox { - gray, - {78, 15, 110, 250}, - "Error reporting" - }, - /* [5] */ - NotDependent { - - }, - CheckOption { - NotSet, - {130, 22, 145, 222}, - "More warnings", - "-w2", - "If this option is checked, ANTLR will wa" - "rn if semantic predicates and/or (É)? bl" - "ocks are assumed to cover ambiguous alte" - "rnatives." - }, - /* [6] */ - NotDependent { - - }, - RegularEntry { - "Report when tnode usage exceeds:", - {162, 23, 180, 253}, - {162, 255, 178, 326}, - "", - keepCase, - "-treport", - "Report when tnode usage exceeds value du" - "ring ambiguity resolution." - }, - /* [7] */ - NotDependent { - - }, - CheckOption { - NotSet, - {40, 292, 55, 431}, - "Predicate", - "-info p", - "With the antlr \"-info p\" switch the user" - " will receive information about the pred" - "icate suppression in the generated file." - }, - /* [8] */ - NotDependent { - - }, - CheckOption { - NotSet, - {60, 292, 75, 430}, - "Tree Nodes", - "-info t", - "Using \"-info t\" gives information about " - "the total number of tnodes created and t" - "he peak number of tnodes." - }, - /* [9] */ - NotDependent { - - }, - CheckOption { - NotSet, - {80, 292, 95, 425}, - "First/follow", - "-info f", - "first/follow set information." - }, - /* [10] */ - NotDependent { - - }, - CheckOption { - NotSet, - {100, 292, 115, 425}, - "Monitor progress", - "-info m", - "prints name of each rule as it is starte" - "d and flushes output at start of each rule." - }, - /* [11] */ - NotDependent { - - }, - CheckOption { - NotSet, - {120, 292, 135, 416}, - "Orphan rules", - "-info o", - "If there is more than one rule which is " - "not referenced by any other rule then al" - "l such rules are listed." - }, - /* [12] */ - NotDependent { - - }, - TextBox { - gray, - {28, 279, 147, 451}, - "Extra info" - } - }, - /* [4] */ - 295, - "Use this dialog to specify command line " - "options relating to renaming output file" - "s.", - { /* array itemArray: 7 elements */ - /* [1] */ - NotDependent { - - }, - RegularEntry { - "Errors file name:", - {35, 25, 50, 205}, - {35, 205, 51, 300}, - "err.c", - keepCase, - "-fe", - "This entry specifies the name ANTLR uses" - " for the errors file." - }, - /* [2] */ - NotDependent { - - }, - RegularEntry { - "Lexical output name:", - {60, 25, 75, 205}, - {60, 205, 76, 300}, - "parser.dlg", - keepCase, - "-fl", - "This entry specifies the name ANTLR uses" - " for the lexical output file." - }, - /* [3] */ - NotDependent { - - }, - RegularEntry { - "Lexical modes name:", - {85, 25, 100, 205}, - {85, 205, 101, 300}, - "mode.h", - keepCase, - "-fm", - "This entry specifies the name ANTLR uses" - " for the lexical mode definitions file." - }, - /* [4] */ - NotDependent { - - }, - RegularEntry { - "Remap file name:", - {110, 25, 125, 205}, - {110, 205, 126, 300}, - "remap.h", - keepCase, - "-fr", - "This entry specifies the name ANTLR uses" - " for the file that remaps globally visib" - "le symbols." - }, - /* [5] */ - NotDependent { - - }, - RegularEntry { - "Tokens file name:", - {135, 25, 150, 205}, - {135, 205, 151, 300}, - "tokens.h", - keepCase, - "-ft", - "This entry specifies the name ANTLR uses" - " for the tokens file." - }, - /* [6] */ - NotDependent { - - }, - CheckOption { - NotSet, - {160, 25, 175, 175}, - "Create std header", - "-gh", - "If this option is checked, ANTLR will cr" - "eate a standard header file named, by de" - "fault 'stdpccts.h'. This name can be alt" - "ered using the entry right next door." - }, - /* [7] */ - Or { - { /* array OrArray: 1 elements */ - /* [1] */ - 6 - } - }, - RegularEntry { - "Std header file name:", - {160, 175, 175, 355}, - {160, 355, 176, 450}, - "stdpccts.h", - keepCase, - "-fh", - "This entry specifies the name ANTLR uses" - " for the standard header file." - } - }, - /* [5] */ - 295, - "Use this dialog to specify parse options" - ".", - { /* array itemArray: 9 elements */ - /* [1] */ - NotDependent { - - }, - RegularEntry { - "Lookahead:", - {23, 27, 38, 152}, - {46, 29, 62, 154}, - "1", - keepCase, - "-k", - "This entry specifies the number of token" - "s of lookahead." - }, - /* [2] */ - NotDependent { - - }, - RegularEntry { - "Compr lookahead:", - {22, 167, 37, 292}, - {46, 172, 62, 297}, - "", - keepCase, - "-ck", - "This entry specifies the number of token" - "s of lookahead when using compressed (li" - "near approximation) lookahead. In genera" - "l, the compressed lookahead is much deep" - "er than the full lookahead." - }, - /* [3] */ - NotDependent { - - }, - RegularEntry { - "Max tree nodes:", - {22, 312, 37, 437}, - {46, 315, 62, 445}, - "", - keepCase, - "-rl", - "This entry specifies the maximum number " - "of tokens of tree nodes used by the gram" - "mar analysis." - }, - /* [4] */ - NotDependent { - - }, - CheckOption { - NotSet, - {76, 25, 91, 350}, - "Maintenance Release style hoisting", - "-mrhoist", - "Turn on/off k=1 Maintenance Release styl" - "e hoisting." - }, - /* [5] */ - NotDependent { - - }, - CheckOption { - NotSet, - {96, 25, 111, 431}, - "EXPERIMENTAL Maintenance Release style h" - "oisting", - "-mrhoistk", - "Turn on/off k>1 EXPERIMENTAL Maintenance" - " Release style hoisting." - }, - /* [6] */ - NotDependent { - - }, - CheckOption { - NotSet, - {116, 25, 131, 363}, - "Compute context for hoisted predicates", - "-prc on", - "Turn on/off computation of context for h" - "oisted predicates." - }, - /* [7] */ - NotDependent { - - }, - RegularEntry { - "Ambiguity aid:", - {140, 27, 155, 125}, - {141, 135, 155, 209}, - "", - keepCase, - "-aa", - "Ambiguity aid for a rule (rule name or l" - "ine number)." - }, - /* [8] */ - NotDependent { - - }, - RegularEntry { - "Limits exp growth:", - {140, 236, 155, 361}, - {139, 372, 155, 452}, - "", - keepCase, - "-aad", - "Limits exp growth of -aa listing - defau" - "lt=1 (max=ck value)." - }, - /* [9] */ - NotDependent { - - }, - CheckOption { - NotSet, - {164, 26, 179, 366}, - "Lookahead token may appear multiple time" - "s", - "-aam", - "Lookahead token may appear multiple time" - "s in -aa listing." - } - } - } -}; - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr1.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr1.txt deleted file mode 100644 index 4545275e4..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr1.txt +++ /dev/null @@ -1,264 +0,0 @@ - - - -ANTLR(1) PCCTS Manual Pages ANTLR(1) - - - -NAME - antlr - ANother Tool for Language Recognition - -SYNTAX - antlr [_o_p_t_i_o_n_s] _g_r_a_m_m_a_r__f_i_l_e_s - -DESCRIPTION - _A_n_t_l_r converts an extended form of context-free grammar into - a set of C functions which directly implement an efficient - form of deterministic recursive-descent LL(k) parser. - Context-free grammars may be augmented with predicates to - allow semantics to influence parsing; this allows a form of - context-sensitive parsing. Selective backtracking is also - available to handle non-LL(k) and even non-LALR(k) con- - structs. _A_n_t_l_r also produces a definition of a lexer which - can be automatically converted into C code for a DFA-based - lexer by _d_l_g. Hence, _a_n_t_l_r serves a function much like that - of _y_a_c_c, however, it is notably more flexible and is more - integrated with a lexer generator (_a_n_t_l_r directly generates - _d_l_g code, whereas _y_a_c_c and _l_e_x are given independent - descriptions). Unlike _y_a_c_c which accepts LALR(1) grammars, - _a_n_t_l_r accepts LL(k) grammars in an extended BNF notation - - which eliminates the need for precedence rules. - - Like _y_a_c_c grammars, _a_n_t_l_r grammars can use automatically- - maintained symbol attribute values referenced as dollar - variables. Further, because _a_n_t_l_r generates top-down - parsers, arbitrary values may be inherited from parent rules - (passed like function parameters). _A_n_t_l_r also has a mechan- - ism for creating and manipulating abstract-syntax-trees. - - There are various other niceties in _a_n_t_l_r, including the - ability to spread one grammar over multiple files or even - multiple grammars in a single file, the ability to generate - a version of the grammar with actions stripped out (for - documentation purposes), and lots more. - -OPTIONS - -ck _n - Use up to _n symbols of lookahead when using compressed - (linear approximation) lookahead. This type of looka- - head is very cheap to compute and is attempted before - full LL(k) lookahead, which is of exponential complex- - ity in the worst case. In general, the compressed loo- - kahead can be much deeper (e.g, -ck 10) _t_h_a_n _t_h_e _f_u_l_l - _l_o_o_k_a_h_e_a_d (_w_h_i_c_h _u_s_u_a_l_l_y _m_u_s_t _b_e _l_e_s_s _t_h_a_n _4). - - -CC Generate C++ output from both ANTLR and DLG. - - -cr Generate a cross-reference for all rules. For each - rule, print a list of all other rules that reference - it. - - -e1 Ambiguities/errors shown in low detail (default). - - -e2 Ambiguities/errors shown in more detail. - - -e3 Ambiguities/errors shown in excruciating detail. - - -fe file - Rename err.c to file. - - -fh file - Rename stdpccts.h header (turns on -gh) to file. - - -fl file - Rename lexical output, parser.dlg, to file. - - -fm file - Rename file with lexical mode definitions, mode.h, to - file. - - -fr file - Rename file which remaps globally visible symbols, - remap.h, to file. - - -ft file - Rename tokens.h to file. - - -ga Generate ANSI-compatible code (default case). This has - not been rigorously tested to be ANSI XJ11 C compliant, - but it is close. The normal output of _a_n_t_l_r is - currently compilable under both K&R, ANSI C, and C++- - this option does nothing because _a_n_t_l_r generates a - bunch of #ifdef's to do the right thing depending on - the language. - - -gc Indicates that _a_n_t_l_r should generate no C code, i.e., - only perform analysis on the grammar. - - -gd C code is inserted in each of the _a_n_t_l_r generated pars- - ing functions to provide for user-defined handling of a - detailed parse trace. The inserted code consists of - calls to the user-supplied macros or functions called - zzTRACEIN and zzTRACEOUT. The only argument is a _c_h_a_r - * pointing to a C-style string which is the grammar - rule recognized by the current parsing function. If no - definition is given for the trace functions, upon rule - entry and exit, a message will be printed indicating - that a particular rule as been entered or exited. - - -ge Generate an error class for each non-terminal. - - -gh Generate stdpccts.h for non-ANTLR-generated files to - include. This file contains all defines needed to - describe the type of parser generated by _a_n_t_l_r (e.g. - how much lookahead is used and whether or not trees are - constructed) and contains the header action specified - by the user. - - -gk Generate parsers that delay lookahead fetches until - needed. Without this option, _a_n_t_l_r generates parsers - which always have _k tokens of lookahead available. - - -gl Generate line info about grammar actions in C parser of - the form # _l_i_n_e "_f_i_l_e" which makes error messages from - the C/C++ compiler make more sense as they will point - into the grammar file not the resulting C file. - Debugging is easier as well, because you will step - through the grammar not C file. - - -gs Do not generate sets for token expression lists; - instead generate a ||-separated sequence of - LA(1)==_t_o_k_e_n__n_u_m_b_e_r. The default is to generate sets. - - -gt Generate code for Abstract-Syntax Trees. - - -gx Do not create the lexical analyzer files (dlg-related). - This option should be given when the user wishes to - provide a customized lexical analyzer. It may also be - used in _m_a_k_e scripts to cause only the parser to be - rebuilt when a change not affecting the lexical struc- - ture is made to the input grammars. - - -k _n Set k of LL(k) to _n; i.e. set tokens of look-ahead - (default==1). - - -o dir - Directory where output files should go (default="."). - This is very nice for keeping the source directory - clear of ANTLR and DLG spawn. - - -p The complete grammar, collected from all input grammar - files and stripped of all comments and embedded - actions, is listed to stdout. This is intended to aid - in viewing the entire grammar as a whole and to elim- - inate the need to keep actions concisely stated so that - the grammar is easier to read. Hence, it is preferable - to embed even complex actions directly in the grammar, - rather than to call them as subroutines, since the sub- - routine call overhead will be saved. - - -pa This option is the same as -p except that the output is - annotated with the first sets determined from grammar - analysis. - - -prc on - Turn on the computation and hoisting of predicate con- - text. - - -prc off - Turn off the computation and hoisting of predicate con- - text. This option makes 1.10 behave like the 1.06 - release with option -pr on. Context computation is off - by default. - - -rl _n - Limit the maximum number of tree nodes used by grammar - analysis to _n. Occasionally, _a_n_t_l_r is unable to - analyze a grammar submitted by the user. This rare - situation can only occur when the grammar is large and - the amount of lookahead is greater than one. A non- - linear analysis algorithm is used by PCCTS to handle - the general case of LL(k) parsing. The average com- - plexity of analysis, however, is near linear due to - some fancy footwork in the implementation which reduces - the number of calls to the full LL(k) algorithm. An - error message will be displayed, if this limit is - reached, which indicates the grammar construct being - analyzed when _a_n_t_l_r hit a non-linearity. Use this - option if _a_n_t_l_r seems to go out to lunch and your disk - start thrashing; try _n=10000 to start. Once the - offending construct has been identified, try to remove - the ambiguity that _a_n_t_l_r was trying to overcome with - large lookahead analysis. The introduction of (...)? - backtracking blocks eliminates some of these problems - - _a_n_t_l_r does not analyze alternatives that begin with - (...)? (it simply backtracks, if necessary, at run - time). - - -w1 Set low warning level. Do not warn if semantic - predicates and/or (...)? blocks are assumed to cover - ambiguous alternatives. - - -w2 Ambiguous parsing decisions yield warnings even if - semantic predicates or (...)? blocks are used. Warn if - predicate context computed and semantic predicates - incompletely disambiguate alternative productions. - - - Read grammar from standard input and generate stdin.c - as the parser file. - -SPECIAL CONSIDERATIONS - _A_n_t_l_r works... we think. There is no implicit guarantee of - anything. We reserve no legal rights to the software known - as the Purdue Compiler Construction Tool Set (PCCTS) - PCCTS - is in the public domain. An individual or company may do - whatever they wish with source code distributed with PCCTS - or the code generated by PCCTS, including the incorporation - of PCCTS, or its output, into commercial software. We - encourage users to develop software with PCCTS. However, we - do ask that credit is given to us for developing PCCTS. By - "credit", we mean that if you incorporate our source code - into one of your programs (commercial product, research pro- - ject, or otherwise) that you acknowledge this fact somewhere - in the documentation, research report, etc... If you like - PCCTS and have developed a nice tool with the output, please - mention that you developed it using PCCTS. As long as these - guidelines are followed, we expect to continue enhancing - this system and expect to make other tools available as they - are completed. - -FILES - *.c output C parser. - - *.cpp - output C++ parser when C++ mode is used. - - parser.dlg - output _d_l_g lexical analyzer. - - err.c - token string array, error sets and error support rou- - tines. Not used in C++ mode. - - remap.h - file that redefines all globally visible parser sym- - bols. The use of the #parser directive creates this - file. Not used in C++ mode. - - stdpccts.h - list of definitions needed by C files, not generated by - PCCTS, that reference PCCTS objects. This is not gen- - erated by default. Not used in C++ mode. - - tokens.h - output #_d_e_f_i_n_e_s for tokens used and function prototypes - for functions generated for rules. - - -SEE ALSO - dlg(1), pccts(1) - - - - - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr68K.make b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr68K.make deleted file mode 100644 index 37c6c9b3d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlr68K.make +++ /dev/null @@ -1,135 +0,0 @@ -# File: antlr68K.make -# Target: antlr68K -# Sources: ::support:set:set.c -# antlr.c -# bits.c -# build.c -# egman.c -# err.c -# fcache.c -# fset2.c -# fset.c -# gen.c -# globals.c -# hash.c -# lex.c -# main.c -# misc.c -# mrhoist.c -# pred.c -# scan.c -# Created: Sunday, May 17, 1998 10:12:02 PM -# Author: Kenji Tanaka - - -MAKEFILE = antlr68K.make -¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified -Includes = ¶ - -i "::h:" ¶ - -i "::support:set:" -Sym¥68K = -ObjDir¥68K = :Obj: - -COptions = {Includes} {Sym¥68K} -model far -w off -d MPW -d __STDC__=1 -d USER_ZZSYN - -Objects¥68K = ¶ - "{ObjDir¥68K}set.c.o" ¶ - "{ObjDir¥68K}antlr.c.o" ¶ - "{ObjDir¥68K}bits.c.o" ¶ - "{ObjDir¥68K}build.c.o" ¶ - "{ObjDir¥68K}egman.c.o" ¶ - "{ObjDir¥68K}err.c.o" ¶ - "{ObjDir¥68K}fcache.c.o" ¶ - "{ObjDir¥68K}fset2.c.o" ¶ - "{ObjDir¥68K}fset.c.o" ¶ - "{ObjDir¥68K}gen.c.o" ¶ - "{ObjDir¥68K}globals.c.o" ¶ - "{ObjDir¥68K}hash.c.o" ¶ - "{ObjDir¥68K}lex.c.o" ¶ - "{ObjDir¥68K}main.c.o" ¶ - "{ObjDir¥68K}misc.c.o" ¶ - "{ObjDir¥68K}mrhoist.c.o" ¶ - "{ObjDir¥68K}pred.c.o" ¶ - "{ObjDir¥68K}scan.c.o" - - -antlr68K ÄÄ {¥MondoBuild¥} {Objects¥68K} - Link ¶ - -o {Targ} -d {Sym¥68K} ¶ - {Objects¥68K} ¶ - -t 'MPST' ¶ - -c 'MPS ' ¶ - -mf ¶ - -model far ¶ - -br ON ¶ - -srtsg ALL ¶ - "{Libraries}Stubs.o" ¶ - #"{Libraries}MathLib.o" ¶ - #"{CLibraries}Complex.o" ¶ - "{CLibraries}StdCLib.o" ¶ - "{Libraries}MacRuntime.o" ¶ - "{Libraries}IntEnv.o" ¶ - "{Libraries}ToolLibs.o" ¶ - "{Libraries}Interface.o" - - -"{ObjDir¥68K}set.c.o" Ä {¥MondoBuild¥} "::support:set:set.c" - {C} "::support:set:set.c" -o {Targ} {COptions} - -"{ObjDir¥68K}antlr.c.o" Ä {¥MondoBuild¥} antlr.c - {C} antlr.c -o {Targ} {COptions} - -"{ObjDir¥68K}bits.c.o" Ä {¥MondoBuild¥} bits.c - {C} bits.c -o {Targ} {COptions} - -"{ObjDir¥68K}build.c.o" Ä {¥MondoBuild¥} build.c - {C} build.c -o {Targ} {COptions} - -"{ObjDir¥68K}egman.c.o" Ä {¥MondoBuild¥} egman.c - {C} egman.c -o {Targ} {COptions} - -"{ObjDir¥68K}err.c.o" Ä {¥MondoBuild¥} err.c - {C} err.c -o {Targ} {COptions} - -"{ObjDir¥68K}fcache.c.o" Ä {¥MondoBuild¥} fcache.c - {C} fcache.c -o {Targ} {COptions} - -"{ObjDir¥68K}fset2.c.o" Ä {¥MondoBuild¥} fset2.c - {C} fset2.c -o {Targ} {COptions} - -"{ObjDir¥68K}fset.c.o" Ä {¥MondoBuild¥} fset.c - {C} fset.c -o {Targ} {COptions} - -"{ObjDir¥68K}gen.c.o" Ä {¥MondoBuild¥} gen.c - {C} gen.c -o {Targ} {COptions} - -"{ObjDir¥68K}globals.c.o" Ä {¥MondoBuild¥} globals.c - {C} globals.c -o {Targ} {COptions} - -"{ObjDir¥68K}hash.c.o" Ä {¥MondoBuild¥} hash.c - {C} hash.c -o {Targ} {COptions} - -"{ObjDir¥68K}lex.c.o" Ä {¥MondoBuild¥} lex.c - {C} lex.c -o {Targ} {COptions} - -"{ObjDir¥68K}main.c.o" Ä {¥MondoBuild¥} main.c - {C} main.c -o {Targ} {COptions} - -"{ObjDir¥68K}misc.c.o" Ä {¥MondoBuild¥} misc.c - {C} misc.c -o {Targ} {COptions} - -"{ObjDir¥68K}mrhoist.c.o" Ä {¥MondoBuild¥} mrhoist.c - {C} mrhoist.c -o {Targ} {COptions} - -"{ObjDir¥68K}pred.c.o" Ä {¥MondoBuild¥} pred.c - {C} pred.c -o {Targ} {COptions} - -"{ObjDir¥68K}scan.c.o" Ä {¥MondoBuild¥} scan.c - {C} scan.c -o {Targ} {COptions} - - -antlr68K ÄÄ antlr.r - Rez antlr.r -o antlr68K -a - -Install Ä antlr68K - Duplicate -y antlr68K "{MPW}"Tools:antlr diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlrPPC.make b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlrPPC.make deleted file mode 100644 index 9ff303835..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/antlrPPC.make +++ /dev/null @@ -1,101 +0,0 @@ -# Target: antlrPPC -# Sources: ::support:set:set.c -# antlr.c -# bits.c -# build.c -# egman.c -# err.c -# fcache.c -# fset2.c -# fset.c -# gen.c -# globals.c -# hash.c -# lex.c -# main.c -# misc.c -# mrhoist.c -# pred.c -# scan.c -# Created: Sunday, May 17, 1998 10:24:53 PM -# Author: Kenji Tanaka -MAKEFILE = antlrPPC.make -¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified -Includes = ¶ - -i "::h:" ¶ - -i "::support:set:" -Sym¥PPC = -ObjDir¥PPC = :Obj: -PPCCOptions = {Includes} {Sym¥PPC} -w off -d MPW -d __STDC__=1 -d USER_ZZSYN -Objects¥PPC = ¶ - "{ObjDir¥PPC}set.c.x" ¶ - "{ObjDir¥PPC}antlr.c.x" ¶ - "{ObjDir¥PPC}bits.c.x" ¶ - "{ObjDir¥PPC}build.c.x" ¶ - "{ObjDir¥PPC}egman.c.x" ¶ - "{ObjDir¥PPC}err.c.x" ¶ - "{ObjDir¥PPC}fcache.c.x" ¶ - "{ObjDir¥PPC}fset2.c.x" ¶ - "{ObjDir¥PPC}fset.c.x" ¶ - "{ObjDir¥PPC}gen.c.x" ¶ - "{ObjDir¥PPC}globals.c.x" ¶ - "{ObjDir¥PPC}hash.c.x" ¶ - "{ObjDir¥PPC}lex.c.x" ¶ - "{ObjDir¥PPC}main.c.x" ¶ - "{ObjDir¥PPC}misc.c.x" ¶ - "{ObjDir¥PPC}mrhoist.c.x" ¶ - "{ObjDir¥PPC}pred.c.x" ¶ - "{ObjDir¥PPC}scan.c.x" -antlrPPC ÄÄ {¥MondoBuild¥} {Objects¥PPC} - PPCLink ¶ - -o {Targ} {Sym¥PPC} ¶ - {Objects¥PPC} ¶ - -t 'MPST' ¶ - -c 'MPS ' ¶ - "{SharedLibraries}InterfaceLib" ¶ - "{SharedLibraries}StdCLib" ¶ - #"{SharedLibraries}MathLib" ¶ - "{PPCLibraries}StdCRuntime.o" ¶ - "{PPCLibraries}PPCCRuntime.o" ¶ - "{PPCLibraries}PPCToolLibs.o" -"{ObjDir¥PPC}set.c.x" Ä {¥MondoBuild¥} "::support:set:set.c" - {PPCC} "::support:set:set.c" -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}antlr.c.x" Ä {¥MondoBuild¥} antlr.c - {PPCC} antlr.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}bits.c.x" Ä {¥MondoBuild¥} bits.c - {PPCC} bits.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}build.c.x" Ä {¥MondoBuild¥} build.c - {PPCC} build.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}egman.c.x" Ä {¥MondoBuild¥} egman.c - {PPCC} egman.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}err.c.x" Ä {¥MondoBuild¥} err.c - {PPCC} err.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}fcache.c.x" Ä {¥MondoBuild¥} fcache.c - {PPCC} fcache.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}fset2.c.x" Ä {¥MondoBuild¥} fset2.c - {PPCC} fset2.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}fset.c.x" Ä {¥MondoBuild¥} fset.c - {PPCC} fset.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}gen.c.x" Ä {¥MondoBuild¥} gen.c - {PPCC} gen.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}globals.c.x" Ä {¥MondoBuild¥} globals.c - {PPCC} globals.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}hash.c.x" Ä {¥MondoBuild¥} hash.c - {PPCC} hash.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}lex.c.x" Ä {¥MondoBuild¥} lex.c - {PPCC} lex.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}main.c.x" Ä {¥MondoBuild¥} main.c - {PPCC} main.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}misc.c.x" Ä {¥MondoBuild¥} misc.c - {PPCC} misc.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}mrhoist.c.x" Ä {¥MondoBuild¥} mrhoist.c - {PPCC} mrhoist.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}pred.c.x" Ä {¥MondoBuild¥} pred.c - {PPCC} pred.c -o {Targ} {PPCCOptions} -"{ObjDir¥PPC}scan.c.x" Ä {¥MondoBuild¥} scan.c - {PPCC} scan.c -o {Targ} {PPCCOptions} - -antlrPPC ÄÄ antlr.r - Rez antlr.r -o antlrPPC -a -Install Ä antlrPPC - Duplicate -y antlrPPC "{MPW}"Tools:antlr diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/bits.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/bits.c deleted file mode 100644 index dcbdc9413..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/bits.c +++ /dev/null @@ -1,1025 +0,0 @@ -/* bits.c -- manage creation and output of bit sets used by the parser. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include -#include -#include -#include "pcctscfg.h" -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" - -/* char is only thing that is pretty much always known == 8 bits - * This allows output of antlr (set stuff, anyway) to be androgynous (portable) - */ -typedef unsigned char SetWordType; -#define BitsPerByte 8 -#define BitsPerWord BitsPerByte*sizeof(SetWordType) - -static SetWordType *setwd = NULL; -int setnum = -1; -int wordnum = 0; - -int esetnum = 0; - -/* Used to convert native wordsize, which ANTLR uses (via set.c) to manipulate sets, - to bytes that are most portable size-wise. - */ -void -#ifdef __USE_PROTOS -DumpIntAsChars( FILE *f, char *format, unsigned wd ) -#else -DumpIntAsChars( f, format, wd ) -FILE *f; -char *format; -unsigned wd; -#endif -{ - int i; - /* uses max of 32 bit unsigned integer for the moment */ - static unsigned long byte_mask[sizeof(unsigned long)] = - { 0xFF, 0xFF00UL, 0xFF0000UL, 0xFF000000UL }; /* MR20 G. Hobbelt */ -/* 0xFF00000000, 0xFF0000000000, 0xFF000000000000, 0xFF00000000000000 };*/ - - /* for each byte in the word */ - assert(sizeof(unsigned) <= 4); /* M20 G. Hobbelt Sanity check */ - for (i=0; i>(i*BitsPerByte)); - if ( itok))); - return empty; - } - r = RulePtr[q->rulenum]; - r->end->halt = TRUE; /* don't let reach fall off end of rule here */ - rk = empty; - REACH(r, 1, &rk, a); - r->end->halt = FALSE; - return a; -} - -/* - * scan the list of tokens/eclasses/nonterminals filling the new eclass - * with the set described by the list. Note that an eclass can be - * quoted to allow spaces etc... However, an eclass must not conflict - * with a reg expr found elsewhere. The reg expr will be taken over - * the eclass name. - */ -static void -#ifdef __USE_PROTOS -doEclass( char *eclass ) -#else -doEclass( eclass ) -char *eclass; -#endif -{ - TermEntry *q; - ECnode *p; - TCnode *tcnode; - ListNode *e; - unsigned int t; - unsigned deg=0; - set a; - require(eclass!=NULL, "doEclass: NULL eset"); - - p = (ECnode *) eclass; - lexmode(p->lexclass); /* switch to lexclass where errclass is defined */ - p->eset = empty; - for (e = (p->elist)->next; e!=NULL; e=e->next) - { - q = NULL; /* MR23 */ - - if ( islower( *((char *)e->elem) ) ) /* is it a rule ref? (alias FIRST request) */ - { - a = Efirst((char *)e->elem, p); - set_orin(&p->eset, a); - deg += set_deg(a); - set_free( a ); - continue; - } - else if ( *((char *)e->elem)=='"' ) - { - t = 0; - q = (TermEntry *) hash_get(Texpr, (char *) e->elem); - if ( q == NULL ) - { - /* if quoted and not an expr look for eclass name */ - q = (TermEntry *) hash_get(Tname, *((char **)&(e->elem))=StripQuotes((char *)e->elem)); - if ( q != NULL ) t = q->token; - } - else t = q->token; - } - else /* labelled token/eclass/tokclass */ - { - q = (TermEntry *) hash_get(Tname, (char *)e->elem); - if ( q != NULL ) - { - if ( strcmp((char *)e->elem, TokenString(p->tok))==0 ) - { - warnNoFL(eMsg1("self-referential error class '%s'; ignored", - (char *)e->elem)); - continue; - } - else - t = q->token; - } - else t=0; - } - if ( t!=0 ) - { - if (isTermEntryTokClass(q)) { /* MR23 */ - tcnode = q->tclass; /* MR23 */ - set_orin(&p->eset, tcnode->tset); /* MR23 */ - deg = set_deg(p->eset); /* MR23 */ - } /* MR23 */ - else { - set_orel(t, &p->eset); - deg++; - } - } - else warnNoFL(eMsg2("undefined token '%s' referenced in errclass '%s'; ignored", - (char *)e->elem, TokenString(p->tok))); - } - p->setdeg = deg; -} - -void -#ifdef __USE_PROTOS -ComputeErrorSets( void ) -#else -ComputeErrorSets( ) -#endif -{ -#ifdef __cplusplus - list_apply(eclasses, (void (*)(void *)) doEclass); -#else -#ifdef __USE_PROTOS - list_apply(eclasses, (void (*)(void *)) doEclass); -#else - list_apply(eclasses, doEclass); -#endif -#endif -} - -void -#ifdef __USE_PROTOS -ComputeTokSets( void ) -#else -ComputeTokSets( ) -#endif -{ - ListNode *t, *e = NULL, *e1, *e2; - int something_changed; - int i; - TCnode *p; - TermEntry *q, *q1, *q2; - - if ( tclasses == NULL ) return; - - /* turn lists of token/tokclass references into sets */ - for (t = tclasses->next; t!=NULL; t=t->next) - { - p = (TCnode *) t->elem; - - /* if wild card, then won't have entries in tclass, assume all_tokens */ - if ( p->tok == WildCardToken ) - { - p->tset = set_dup(all_tokens); - continue; - } - - lexmode(p->lexclass); /* switch to lexclass where tokclass is defined */ - p->tset = empty; - - /* instantiate all tokens/token_classes into the tset */ - for (e = (p->tlist)->next; e!=NULL; e=e->next) - { - char *tokstr; - tokstr = (char *)e->elem; - if ( *tokstr == '"' ) { - q = (TermEntry *) hash_get(Texpr, tokstr); - require(q!=NULL, "ComputeTokSets: no token def"); - set_orel(q->token, &p->tset); - } else if (tokstr[0] == '.') { - e1=e->next; - e2=e1->next; - e=e2; - q1= (TermEntry *) hash_get(Tname, (char *)e1->elem); - require(q1!=NULL, "ComputeTokSets: no token def"); - q2= (TermEntry *) hash_get(Tname, (char *)e2->elem); - require(q2!=NULL, "ComputeTokSets: no token def"); - - if (set_el(q1->token,imag_tokens)) { -errNoFL(eMsg2("can't define #tokclass %s using #tokclass or #errclass %s", - TokenString(p->tok),(char *)e1->elem) ); - } - if (set_el(q2->token,imag_tokens)) { -errNoFL(eMsg2("can't define #tokclass %s using #tokclass or #errclass %s", - TokenString(p->tok),(char *)e2->elem) ); - } - if (q1->token > q2->token) { -errNoFL(eMsg3("for #tokclass %s %s..%s - first token number > second token number", - TokenString(p->tok),(char *)e1->elem,(char *)e2->elem) ); - for (i=q2->token; i<=q1->token; i++) { set_orel(i, &p->tset); } - } else { - for (i=q1->token; i<=q2->token; i++) { set_orel(i, &p->tset); } - } - } else { - q = (TermEntry *) hash_get(Tname, tokstr); - require(q!=NULL, "ComputeTokSets: no token def"); - set_orel(q->token, &p->tset); - } - } - } - - /* Go thru list of tokclasses again looking for tokclasses in sets */ -again: - something_changed = 0; - for (t = tclasses->next; t!=NULL; t=t->next) - { - set tcl; - p = (TCnode *) t->elem; - tcl = set_and(p->tset, tokclasses); - if ( !set_nil(tcl) ) - { - int tk; - /* replace refs to tokclasses with the associated set of tokens */ - something_changed = 1; - while ( !set_nil(tcl) ) - { - tk = set_int(tcl); /* grab one of the tok class refs */ - set_rm(tk, tcl); - if ( p->tok != tk ) /* tokclass ref to yourself? */ - { - q = (TermEntry *) hash_get(Tname, TokenString(tk)); - require(q!=NULL, "#tokclass not in hash table"); - set_orin(&p->tset, q->tclass->tset); - } - set_rm(tk, p->tset); /* remove ref that we replaced */ - } - } - set_free(tcl); - } - if ( something_changed ) goto again; -} - -void -#ifdef __USE_PROTOS -DumpRemainingTokSets(void) -#else -DumpRemainingTokSets() -#endif -{ - TCnode *p; - ListNode *t; - - /* Go thru tclasses (for the last time) and dump the sets not dumped - * during code gen; yes, this is a bogus way to do this, but ComputeTokSets() - * can't dump the defs as the error file and tok file has not been created - * yet etc... - */ - if ( tclasses==NULL ) return; - for (t = tclasses->next; t!=NULL; t=t->next) - { - unsigned e; - p = (TCnode *) t->elem; - if ( p->dumped ) continue; - e = DefErrSet(&(p->tset), 0, TokenString(p->tok)); - p->dumped = 1; - p->setnum = e; - } -} - - -/* replace a subset of an error set with an error class name if a subset is found - * repeat process until no replacements made - */ -void -#ifdef __USE_PROTOS -SubstErrorClass( set *f ) -#else -SubstErrorClass( f ) -set *f; -#endif -{ - int max, done = 0; - ListNode *p; - ECnode *ec, *maxclass = NULL; - set a; - require(f!=NULL, "SubstErrorClass: NULL eset"); - - if ( eclasses == NULL ) return; - while ( !done ) - { - max = 0; - maxclass = NULL; - for (p=eclasses->next; p!=NULL; p=p->next) /* chk all error classes */ - { - ec = (ECnode *) p->elem; - if ( ec->setdeg > max ) - { - if ( set_sub(ec->eset, *f) || set_equ(ec->eset, *f) ) - {maxclass = ec; max=ec->setdeg;} - } - } - if ( maxclass != NULL ) /* if subset found, replace with token */ - { - a = set_dif(*f, maxclass->eset); - set_orel((unsigned)maxclass->tok, &a); - set_free(*f); - *f = a; - } - else done = 1; - } -} - -int -#ifdef __USE_PROTOS -DefErrSet1(int nilOK, set *f, int subst, char *name ) -#else -DefErrSet1(nilOK, f, subst, name ) -int nilOK; -set *f; -int subst; /* should be substitute error classes? */ -char *name; -#endif -{ - if ( GenCC ) return DefErrSetForCC1(nilOK, f, subst, name, "_set"); - else return DefErrSetForC1(nilOK, f, subst, name, "_set"); -} - -int -#ifdef __USE_PROTOS -DefErrSet( set *f, int subst, char *name ) -#else -DefErrSet( f, subst, name ) -set *f; -int subst; /* should be substitute error classes? */ -char *name; -#endif -{ - return DefErrSet1(0,f,subst,name); -} - -int -#ifdef __USE_PROTOS -DefErrSetWithSuffix(int nilOK, set *f, int subst, char *name, const char* suffix) -#else -DefErrSetWithSuffix(nilOK, f, subst, name, suffix ) -int nilOK; -set *f; -int subst; /* should be substitute error classes? */ -char *name; -char *suffix; -#endif -{ - if ( GenCC ) return DefErrSetForCC1(nilOK, f, subst, name, suffix ); - else return DefErrSetForC1(nilOK, f, subst, name, suffix); -} - -/* Define a new error set. WARNING...set-implementation dependent. - */ -int -#ifdef __USE_PROTOS -DefErrSetForC1(int nilOK, set *f, int subst, char * name, const char * suffix) -#else -DefErrSetForC1(nilOK, f, subst, name, suffix) -int nilOK; /* MR13 */ -set *f; -int subst; /* should be substitute error classes? */ -char *name; -const char *suffix; -#endif -{ - unsigned *p, *endp; - int e=1; - - if (!nilOK) require(!set_nil(*f), "DefErrSetForC1: nil set to dump?"); - - if ( subst ) SubstErrorClass(f); - p = f->setword; - endp = &(f->setword[f->n]); - esetnum++; - if ( name!=NULL ) - fprintf(DefFile, "extern SetWordType %s%s[];\n", name, suffix); - else - fprintf(DefFile, "extern SetWordType zzerr%d[];\n", esetnum); - if ( name!=NULL ) { - fprintf(ErrFile, "SetWordType %s%s[%d] = {", - name, - suffix, - NumWords(TokenNum-1)*sizeof(unsigned)); - } - else { - fprintf(ErrFile, "SetWordType zzerr%d[%d] = {", - esetnum, - NumWords(TokenNum-1)*sizeof(unsigned)); - } - while ( p < endp ) - { - if ( e > 1 ) fprintf(ErrFile, ", "); - DumpIntAsChars(ErrFile, "0x%x", *p++); - if ( e == 3 ) - { - DAWDLE; - if ( p < endp ) fprintf(ErrFile, ","); - fprintf(ErrFile, "\n\t"); - e=1; - } - else e++; - } - fprintf(ErrFile, "};\n"); - - return esetnum; -} - -int -#ifdef __USE_PROTOS -DefErrSetForC( set *f, int subst, char *name ) -#else -DefErrSetForC( f, subst, name ) -set *f; -int subst; /* should be substitute error classes? */ -char *name; -#endif -{ - return DefErrSetForC1(0,f,subst,name, "_set"); -} - -/* Define a new error set. WARNING...set-implementation dependent; - * Only used when -CC on. - */ - -int -#ifdef __USE_PROTOS -DefErrSetForCC1(int nilOK, set *f, int subst, char *name, const char *suffix ) -#else -DefErrSetForCC1(nilOK, f, subst, name, suffix ) -int nilOK; /* MR13 */ -set *f; -int subst; /* should be substitute error classes? */ -char *name; -const char *suffix; -#endif -{ - unsigned *p, *endp; - int e=1; - - if (!nilOK) require(!set_nil(*f), "DefErrSetForCC1: nil set to dump?"); - - if ( subst ) SubstErrorClass(f); - p = f->setword; - endp = &(f->setword[f->n]); - esetnum++; - - if ( name!=NULL ) { - fprintf(Parser_h, "\tstatic SetWordType %s%s[%d];\n", name, suffix, - NumWords(TokenNum-1)*sizeof(unsigned)); - fprintf(Parser_c, "SetWordType %s::%s%s[%d] = {", - CurrentClassName, - name, - suffix, - NumWords(TokenNum-1)*sizeof(unsigned)); - } - else { - fprintf(Parser_c, "SetWordType %s::err%d[%d] = {", - CurrentClassName, - esetnum, - NumWords(TokenNum-1)*sizeof(unsigned)); - fprintf(Parser_h, "\tstatic SetWordType err%d[%d];\n", esetnum, - NumWords(TokenNum-1)*sizeof(unsigned)); - } - - while ( p < endp ) - { - if ( e > 1 ) fprintf(Parser_c, ", "); - DumpIntAsChars(Parser_c, "0x%x", *p++); - if ( e == 3 ) - { - if ( p < endp ) fprintf(Parser_c, ","); - fprintf(Parser_c, "\n\t"); - e=1; - } - else e++; - } - fprintf(Parser_c, "};\n"); - - return esetnum; -} - -int -#ifdef __USE_PROTOS -DefErrSetForCC( set *f, int subst, char *name ) -#else -DefErrSetForCC( f, subst, name ) -set *f; -int subst; /* should be substitute error classes? */ -char *name; -#endif -{ - return DefErrSetForCC1(0,f,subst,name, "_set"); -} - -void -#ifdef __USE_PROTOS -GenParser_c_Hdr(void) -#else -GenParser_c_Hdr() -#endif -{ - int i,j; - TermEntry *te; - char * hasAkaName = NULL; /* MR23 */ - - hasAkaName = (char *) malloc(TokenNum+1); /* MR23 */ - require(hasAkaName!=NULL, "Cannot alloc hasAkaName\n"); /* MR23 */ - for (i = 0; i < TokenNum; i++) hasAkaName[i]='0'; /* MR23 */ - hasAkaName[TokenNum] = 0; /* MR23 */ - - fprintf(Parser_c, "/*\n"); - fprintf(Parser_c, " * %s: P a r s e r S u p p o r t\n", CurrentClassName); - fprintf(Parser_c, " *\n"); - fprintf(Parser_c, " * Generated from:"); - for (i=0; i=LastTokenCounted ) - { - fprintf(Parser_c, ",\n\t/* %02d */\t\"invalid\"", i); - continue; - } - if ( TokenString(i) != NULL ) { - te=(TermEntry *) hash_get(Tname,TokenString(i)); /* MR11 */ - if (te == NULL || te->akaString == NULL) { /* MR11 */ - fprintf(Parser_c, ",\n\t/* %02d */\t\"%s\"", i, TokenString(i)); - } else { - hasAkaName[i] = '1'; /* MR23 */ - fprintf(Parser_c, ",\n\t/* %02d */\t\"%s\"", i, te->akaString); /* MR11 */ - } - } - else - { - /* look in all lexclasses for the reg expr */ - for (j=0; j=NumLexClasses ) - { - if ( UserDefdTokens ) - { - fprintf(Parser_c, ",\n\t/* %02d */\t\"\"", i); - } - else - fatal_internal(eMsgd("No label or expr for token %d",i)); - } - } - } - fprintf(Parser_c, "\n};\n"); - - /* Build constructors */ - fprintf(Parser_c, "\n%s::", CurrentClassName); - fprintf(Parser_c, "%s(ANTLRTokenBuffer *input) : %s(input,%d,%d,%d,%d)\n", - CurrentClassName, - (BaseClassName == NULL ? "ANTLRParser" : BaseClassName), - OutputLL_k, - FoundGuessBlk, - DemandLookahead, - NumWords(TokenNum-1)*sizeof(unsigned)); - fprintf(Parser_c, "{\n"); - fprintf(Parser_c, "\ttoken_tbl = _token_tbl;\n"); - if (TraceGen) { - fprintf(Parser_c, "\ttraceOptionValueDefault=1;\t\t// MR10 turn trace ON\n"); - } else { - fprintf(Parser_c, "\ttraceOptionValueDefault=0;\t\t// MR10 turn trace OFF\n"); - }; - fprintf(Parser_c, "}\n\n"); - free ( (void *) hasAkaName); -} - -void -#ifdef __USE_PROTOS -GenParser_h_Hdr(void) -#else -GenParser_h_Hdr() -#endif -{ - int i; - - fprintf(Parser_h, "/*\n"); - fprintf(Parser_h, " * %s: P a r s e r H e a d e r \n", CurrentClassName); - fprintf(Parser_h, " *\n"); - fprintf(Parser_h, " * Generated from:"); - for (i=0; i 1 ) fprintf(ErrFile, "#define LL_K %d\n", OutputLL_k); -#ifdef DUM - if ( LexGen ) fprintf(ErrFile, "#define zzEOF_TOKEN %d\n", (TokenInd!=NULL?TokenInd[EofToken]:EofToken)); -#endif - fprintf(ErrFile, "#define zzSET_SIZE %d\n", NumWords(TokenNum-1)*sizeof(unsigned)); - if ( DemandLookahead ) fprintf(ErrFile, "#define DEMAND_LOOK\n"); - fprintf(ErrFile, "#include \"antlr.h\"\n"); - if ( GenAST ) fprintf(ErrFile, "#include \"ast.h\"\n"); - - if ( UserDefdTokens ) fprintf(ErrFile, "#include %s\n", UserTokenDefsFile); - /* still need this one as it has the func prototypes */ - fprintf(ErrFile, "#include \"%s\"\n", DefFileName); - fprintf(ErrFile, "#include \"dlgdef.h\"\n"); - fprintf(ErrFile, "#include \"err.h\"\n\n"); - - /* Dump a zztokens for each automaton */ - if ( strcmp(ParserName, DefaultParserName)!=0 ) - { - fprintf(ErrFile, "ANTLRChar *%s_zztokens[%d]={\n", ParserName, TokenNum-1); - } - else - { - fprintf(ErrFile, "ANTLRChar *zztokens[%d]={\n", TokenNum-1); - } - fprintf(ErrFile, "\t/* 00 */\t\"Invalid\""); - for (i=1; i=LastTokenCounted ) - { - fprintf(ErrFile, ",\n\t/* %02d */\t\"invalid\"", i); - continue; - } - if ( TokenString(i) != NULL ) { - te=(TermEntry *) hash_get(Tname,TokenString(i)); /* MR11 */ - if (te == NULL || te->akaString == NULL) { /* MR11 */ - fprintf(ErrFile, ",\n\t/* %02d */\t\"%s\"", i, TokenString(i)); - } else { - fprintf(ErrFile, ",\n\t/* %02d */\t\"%s\"", i, te->akaString); /* MR11 */ - } - } - else - { - /* look in all lexclasses for the reg expr */ - for (j=0; j=NumLexClasses ) - { - if ( UserDefdTokens ) - { - fprintf(ErrFile, ",\n\t/* %02d */\t\"\"", i); - } - else - fatal_internal(eMsgd("No label or expr for token %d",i)); - } - } - } - fprintf(ErrFile, "\n};\n"); -} - -void -#ifdef __USE_PROTOS -dumpExpr( FILE *f, char *e ) -#else -dumpExpr( f, e ) -FILE *f; -char *e; -#endif -{ - while ( *e!='\0' ) - { - if ( *e=='\\' && *(e+1)=='\\' ) - {putc('\\', f); putc('\\', f); e+=2;} - else if ( *e=='\\' && *(e+1)=='"' ) - {putc('\\', f); putc('"', f); e+=2;} - else if ( *e=='\\' ) {putc('\\', f); putc('\\', f); e++;} - else {putc(*e, f); e++;} - } -} - -int -#ifdef __USE_PROTOS -isTermEntryTokClass(TermEntry *te) -#else -isTermEntryTokClass(te) -TermEntry *te; -#endif -{ - ListNode *t; - TCnode *p; - TermEntry *q; - char *tokstr; - - if (tclasses == NULL) return 0; - - for (t = tclasses->next; t!=NULL; t=t->next) - { - p = (TCnode *) t->elem; - tokstr = TokenString(p->tok); - lexmode(p->lexclass); /* switch to lexclass where tokclass is defined */ - q = (TermEntry *) hash_get(Tname, tokstr); - if (q == te) return 1; - } - return 0; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/build.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/build.c deleted file mode 100644 index 8b198c955..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/build.c +++ /dev/null @@ -1,813 +0,0 @@ -/* - * build.c -- functions associated with building syntax diagrams. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include -#include -#include "pcctscfg.h" -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" - -#define SetBlk(g, t, approx, first_set_symbol) { \ - ((Junction *)g.left)->jtype = t; \ - ((Junction *)g.left)->approx = approx; \ - ((Junction *)g.left)->pFirstSetSymbol = first_set_symbol; \ - ((Junction *)g.left)->end = (Junction *) g.right; \ - ((Junction *)g.right)->jtype = EndBlk;} - -/* Add the parameter string 'parm' to the parms field of a block-type junction - * g.left points to the sentinel node on a block. i.e. g.left->p1 points to - * the actual junction with its jtype == some block-type. - */ -void -#ifdef __USE_PROTOS -addParm( Node *p, char *parm ) -#else -addParm( p, parm ) -Node *p; -char *parm; -#endif -{ - char *q = (char *) malloc( strlen(parm) + 1 ); - require(p!=NULL, "addParm: NULL object\n"); - require(q!=NULL, "addParm: unable to alloc parameter\n"); - - strcpy(q, parm); - if ( p->ntype == nRuleRef ) - { - ((RuleRefNode *)p)->parms = q; - } - else if ( p->ntype == nJunction ) - { - ((Junction *)p)->parm = q; /* only one parameter allowed on subrules */ - } - else fatal_internal("addParm: invalid node for adding parm"); -} - -/* - * Build an action node for the syntax diagram - * - * buildAction(ACTION) ::= --o-->ACTION-->o-- - * - * Where o is a junction node. - */ -Graph -#ifdef __USE_PROTOS -buildAction( char *action, int file, int line, int is_predicate ) -#else -buildAction( action, file, line, is_predicate ) -char *action; -int file; -int line; -int is_predicate; -#endif -{ - Junction *j1, *j2; - Graph g; - ActionNode *a; - require(action!=NULL, "buildAction: invalid action"); - - j1 = newJunction(); - j2 = newJunction(); - a = newActionNode(); - a->action = (char *) malloc( strlen(action)+1 ); - require(a->action!=NULL, "buildAction: cannot alloc space for action\n"); - strcpy(a->action, action); - j1->p1 = (Node *) a; - a->next = (Node *) j2; - a->is_predicate = is_predicate; - - if (is_predicate) { - PredEntry *predEntry; - char *t; - char *key; - char *u; - int inverted=0; - - t=key=(char *)calloc(1,strlen(a->action)+1); - - for (u=a->action; *u != '\0' ; u++) { - if (*u != ' ') { - if (t==key && *u=='!') { - inverted=!inverted; - } else { - *t++=*u; - }; - }; - }; - - *t='\0'; - - - predEntry=(PredEntry *)hash_get(Pname,key); - a->predEntry=predEntry; - if (predEntry != NULL) a->inverted=inverted; - } else { -/* MR12c */ char *strStart=a->action; -/* MR12c */ char *strEnd; -/* MR12c */ strEnd=strStart+strlen(strStart)-1; -/* MR12c */ for ( ; strEnd >= strStart && isspace(*strEnd); strEnd--) *strEnd=0; -/* MR12c */ while (*strStart != '\0' && isspace(*strStart)) strStart++; -/* MR12c */ if (ci_strequ(strStart,"nohoist")) { -/* MR12c */ a->noHoist=1; -/* MR12c */ } - } - - g.left = (Node *) j1; g.right = (Node *) j2; - a->file = file; - a->line = line; - a->rname = CurRule; /* MR10 */ - return g; -} - -/* - * Build a token node for the syntax diagram - * - * buildToken(TOKEN) ::= --o-->TOKEN-->o-- - * - * Where o is a junction node. - */ -Graph -#ifdef __USE_PROTOS -buildToken( char *text ) -#else -buildToken( text ) -char *text; -#endif -{ - Junction *j1, *j2; - Graph g; - TokNode *t; - require(text!=NULL, "buildToken: invalid token name"); - - j1 = newJunction(); - j2 = newJunction(); - t = newTokNode(); - t->altstart = CurAltStart; - if ( *text == '"' ) {t->label=FALSE; t->token = addTexpr( text );} - else {t->label=TRUE; t->token = addTname( text );} - j1->p1 = (Node *) t; - t->next = (Node *) j2; - g.left = (Node *) j1; g.right = (Node *) j2; - return g; -} - -/* - * Build a wild-card node for the syntax diagram - * - * buildToken(TOKEN) ::= --o-->'.'-->o-- - * - * Where o is a junction node. - */ -Graph -#ifdef __USE_PROTOS -buildWildCard( char *text ) -#else -buildWildCard( text ) -char *text; -#endif -{ - Junction *j1, *j2; - Graph g; - TokNode *t; - TCnode *w; - TermEntry *p; - require(text!=NULL, "buildWildCard: invalid token name"); - - j1 = newJunction(); - j2 = newJunction(); - t = newTokNode(); - - /* If the ref a wild card, make a token class for it */ - if ( Tnum(WildCardString) == 0 ) - { - w = newTCnode; - w->tok = addTname( WildCardString ); - set_orel(w->tok, &imag_tokens); - set_orel(w->tok, &tokclasses); - WildCardToken = w->tok; - require((p=(TermEntry *)hash_get(Tname, WildCardString)) != NULL, - "hash table mechanism is broken"); - p->classname = 1; /* entry is class name, not token */ - p->tclass = w; /* save ptr to this tclass def */ - list_add(&tclasses, (char *)w); - } - else { - p=(TermEntry *)hash_get(Tname, WildCardString); - require( p!= NULL, "hash table mechanism is broken"); - w = p->tclass; - } - - t->token = w->tok; - t->wild_card = 1; - t->tclass = w; - - t->altstart = CurAltStart; - j1->p1 = (Node *) t; - t->next = (Node *) j2; - g.left = (Node *) j1; g.right = (Node *) j2; - return g; -} - -void -#ifdef __USE_PROTOS -setUpperRange(TokNode *t, char *text) -#else -setUpperRange(t, text) -TokNode *t; -char *text; -#endif -{ - require(t!=NULL, "setUpperRange: NULL token node"); - require(text!=NULL, "setUpperRange: NULL token string"); - - if ( *text == '"' ) {t->upper_range = addTexpr( text );} - else {t->upper_range = addTname( text );} -} - -/* - * Build a rule reference node of the syntax diagram - * - * buildRuleRef(RULE) ::= --o-->RULE-->o-- - * - * Where o is a junction node. - * - * If rule 'text' has been defined already, don't alloc new space to store string. - * Set r->text to point to old copy in string table. - */ -Graph -#ifdef __USE_PROTOS -buildRuleRef( char *text ) -#else -buildRuleRef( text ) -char *text; -#endif -{ - Junction *j1, *j2; - Graph g; - RuleRefNode *r; - RuleEntry *p; - require(text!=NULL, "buildRuleRef: invalid rule name"); - - j1 = newJunction(); - j2 = newJunction(); - r = newRNode(); - r->altstart = CurAltStart; - r->assign = NULL; - if ( (p=(RuleEntry *)hash_get(Rname, text)) != NULL ) r->text = p->str; - else r->text = mystrdup( text ); - j1->p1 = (Node *) r; - r->next = (Node *) j2; - g.left = (Node *) j1; g.right = (Node *) j2; - return g; -} - -/* - * Or two subgraphs into one graph via: - * - * Or(G1, G2) ::= --o-G1-o-- - * | ^ - * v | - * o-G2-o - * - * Set the altnum of junction starting G2 to 1 + altnum of junction starting G1. - * If, however, the G1 altnum is 0, make it 1 and then - * make G2 altnum = G1 altnum + 1. - */ -Graph -#ifdef __USE_PROTOS -Or( Graph g1, Graph g2 ) -#else -Or( g1, g2 ) -Graph g1; -Graph g2; -#endif -{ - Graph g; - require(g1.left != NULL, "Or: invalid graph"); - require(g2.left != NULL && g2.right != NULL, "Or: invalid graph"); - - ((Junction *)g1.left)->p2 = g2.left; - ((Junction *)g2.right)->p1 = g1.right; - /* set altnums */ - if ( ((Junction *)g1.left)->altnum == 0 ) ((Junction *)g1.left)->altnum = 1; - ((Junction *)g2.left)->altnum = ((Junction *)g1.left)->altnum + 1; - g.left = g2.left; - g.right = g1.right; - return g; -} - -/* - * Catenate two subgraphs - * - * Cat(G1, G2) ::= --o-G1-o-->o-G2-o-- - * Cat(NULL,G2)::= --o-G2-o-- - * Cat(G1,NULL)::= --o-G1-o-- - */ -Graph -#ifdef __USE_PROTOS -Cat( Graph g1, Graph g2 ) -#else -Cat( g1, g2 ) -Graph g1; -Graph g2; -#endif -{ - Graph g; - - if ( g1.left == NULL && g1.right == NULL ) return g2; - if ( g2.left == NULL && g2.right == NULL ) return g1; - ((Junction *)g1.right)->p1 = g2.left; - g.left = g1.left; - g.right = g2.right; - return g; -} - -/* - * Make a subgraph an optional block - * - * makeOpt(G) ::= --o-->o-G-o-->o-- - * | ^ - * v | - * o-------o - * - * Note that this constructs {A|B|...|Z} as if (A|B|...|Z|) was found. - * - * The node on the far right is added so that every block owns its own - * EndBlk node. - */ -Graph -#ifdef __USE_PROTOS -makeOpt( Graph g1, int approx, char * pFirstSetSymbol ) -#else -makeOpt( g1, approx, pFirstSetSymbol ) -Graph g1; -int approx; -char * pFirstSetSymbol; -#endif -{ - Junction *j1,*j2,*p; - Graph g; - require(g1.left != NULL && g1.right != NULL, "makeOpt: invalid graph"); - - j1 = newJunction(); - j2 = newJunction(); - ((Junction *)g1.right)->p1 = (Node *) j2; /* add node to G at end */ - - /* MR21 - * - * There is code in genBlk which recognizes the node created - * by emptyAlt() as a special case and bypasses it. We don't - * want this to happen for the optBlk. - */ - - g = emptyAlt3(); /* MR21 */ - if ( ((Junction *)g1.left)->altnum == 0 ) ((Junction *)g1.left)->altnum = 1; - ((Junction *)g.left)->altnum = ((Junction *)g1.left)->altnum + 1; - for(p=(Junction *)g1.left; p->p2!=NULL; p=(Junction *)p->p2) - {;} /* find last alt */ - p->p2 = g.left; /* add optional alternative */ - ((Junction *)g.right)->p1 = (Node *)j2; /* opt alt points to EndBlk */ - g1.right = (Node *)j2; - SetBlk(g1, aOptBlk, approx, pFirstSetSymbol); - j1->p1 = g1.left; /* add generic node in front */ - g.left = (Node *) j1; - g.right = g1.right; - return g; -} - -/* - * Make a graph into subblock - * - * makeBlk(G) ::= --o-->o-G-o-->o-- - * - * The node on the far right is added so that every block owns its own - * EndBlk node. - */ -Graph -#ifdef __USE_PROTOS -makeBlk( Graph g1, int approx, char * pFirstSetSymbol ) -#else -makeBlk( g1, approx, pFirstSetSymbol ) -Graph g1; -int approx; -char * pFirstSetSymbol; -#endif -{ - Junction *j,*j2; - Graph g; - require(g1.left != NULL && g1.right != NULL, "makeBlk: invalid graph"); - - j = newJunction(); - j2 = newJunction(); - ((Junction *)g1.right)->p1 = (Node *) j2; /* add node to G at end */ - g1.right = (Node *)j2; - SetBlk(g1, aSubBlk, approx, pFirstSetSymbol); - j->p1 = g1.left; /* add node in front */ - g.left = (Node *) j; - g.right = g1.right; - - return g; -} - -/* - * Make a subgraph into a loop (closure) block -- (...)* - * - * makeLoop(G) ::= |---| - * v | - * --o-->o-->o-G-o-->o-- - * | ^ - * v | - * o-----------o - * - * After making loop, always place generic node out front. It becomes - * the start of enclosing block. The aLoopBlk is the target of the loop. - * - * Loop blks have TWO EndBlk nodes--the far right and the node that loops back - * to the aLoopBlk node. Node with which we can branch past loop == aLoopBegin and - * one which is loop target == aLoopBlk. - * The branch-past (initial) aLoopBegin node has end - * pointing to the last EndBlk node. The loop-target node has end==NULL. - * - * Loop blocks have a set of locks (from 1..CLL_k) on the aLoopBlk node. - */ -Graph -#ifdef __USE_PROTOS -makeLoop( Graph g1, int approx, char * pFirstSetSymbol ) -#else -makeLoop( g1, approx, pFirstSetSymbol) -Graph g1; -int approx; -char * pFirstSetSymbol; -#endif -{ - Junction *back, *front, *begin; - Graph g; - require(g1.left != NULL && g1.right != NULL, "makeLoop: invalid graph"); - - back = newJunction(); - front = newJunction(); - begin = newJunction(); - g = emptyAlt3(); - ((Junction *)g1.right)->p2 = g1.left; /* add loop branch to G */ - ((Junction *)g1.right)->p1 = (Node *) back; /* add node to G at end */ - ((Junction *)g1.right)->jtype = EndBlk; /* mark 1st EndBlk node */ - ((Junction *)g1.left)->jtype = aLoopBlk; /* mark 2nd aLoopBlk node */ - ((Junction *)g1.left)->end = (Junction *) g1.right; - ((Junction *)g1.left)->lock = makelocks(); - ((Junction *)g1.left)->pred_lock = makelocks(); - g1.right = (Node *) back; - begin->p1 = (Node *) g1.left; - g1.left = (Node *) begin; - begin->p2 = (Node *) g.left; /* make bypass arc */ - ((Junction *)g.right)->p1 = (Node *) back; - SetBlk(g1, aLoopBegin, approx, pFirstSetSymbol); - front->p1 = g1.left; /* add node to front */ - g1.left = (Node *) front; - - return g1; -} - -/* - * Make a subgraph into a plus block -- (...)+ -- 1 or more times - * - * makePlus(G) ::= |---| - * v | - * --o-->o-G-o-->o-- - * - * After making loop, always place generic node out front. It becomes - * the start of enclosing block. The aPlusBlk is the target of the loop. - * - * Plus blks have TWO EndBlk nodes--the far right and the node that loops back - * to the aPlusBlk node. - * - * Plus blocks have a set of locks (from 1..CLL_k) on the aPlusBlk node. - */ -Graph -#ifdef __USE_PROTOS -makePlus( Graph g1, int approx, char * pFirstSetSymbol) -#else -makePlus( g1, approx, pFirstSetSymbol) -Graph g1; -int approx; -char * pFirstSetSymbol; -#endif -{ - int has_empty_alt_already = 0; - Graph g; - Junction *j2, *j3, *first_alt; - Junction *last_alt=NULL, *p; - require(g1.left != NULL && g1.right != NULL, "makePlus: invalid graph"); - - first_alt = (Junction *)g1.left; - j2 = newJunction(); - j3 = newJunction(); - if ( ((Junction *)g1.left)->altnum == 0 ) ((Junction *)g1.left)->altnum = 1; - ((Junction *)g1.right)->p2 = g1.left; /* add loop branch to G */ - ((Junction *)g1.right)->p1 = (Node *) j2; /* add node to G at end */ - ((Junction *)g1.right)->jtype = EndBlk; /* mark 1st EndBlk node */ - g1.right = (Node *) j2; - SetBlk(g1, aPlusBlk, approx, pFirstSetSymbol); - ((Junction *)g1.left)->lock = makelocks(); - ((Junction *)g1.left)->pred_lock = makelocks(); - j3->p1 = g1.left; /* add node to front */ - g1.left = (Node *) j3; - - /* add an optional branch which is the "exit" branch of loop */ - /* FIRST, check to ensure that there does not already exist - * an optional path. - */ - /* find last alt */ - for(p=first_alt; p!=NULL; p=(Junction *)p->p2) - { - if ( p->p1->ntype == nJunction && - p->p1!=NULL && - ((Junction *)p->p1)->jtype==Generic && - ((Junction *)p->p1)->p1!=NULL && - ((Junction *)((Junction *)p->p1)->p1)->jtype==EndBlk ) - { - has_empty_alt_already = 1; - } - last_alt = p; - } - if ( !has_empty_alt_already ) - { - require(last_alt!=NULL, "last_alt==NULL; bad (..)+"); - g = emptyAlt(); - last_alt->p2 = g.left; - ((Junction *)g.right)->p1 = (Node *) j2; - - /* make sure lookahead computation ignores this alt for - * FIRST("(..)+"); but it's still used for computing the FIRST - * of each alternative. - */ - ((Junction *)g.left)->ignore = 1; - } - - return g1; -} - -/* - * Return an optional path: --o-->o-- - */ - -Graph -#ifdef __USE_PROTOS -emptyAlt( void ) -#else -emptyAlt( ) -#endif -{ - Junction *j1, *j2; - Graph g; - - j1 = newJunction(); - j2 = newJunction(); - j1->p1 = (Node *) j2; - g.left = (Node *) j1; - g.right = (Node *) j2; - - return g; -} - -/* MR21 - * - * There is code in genBlk which recognizes the node created - * by emptyAlt() as a special case and bypasses it. We don't - * want this to happen for the optBlk. - */ - -Graph -#ifdef __USE_PROTOS -emptyAlt3( void ) -#else -emptyAlt3( ) -#endif -{ - Junction *j1, *j2, *j3; - Graph g; - - j1 = newJunction(); - j2 = newJunction(); - j3 = newJunction(); - j1->p1 = (Node *) j2; - j2->p1 = (Node *) j3; - g.left = (Node *) j1; - g.right = (Node *) j3; - - return g; -} - -/* N o d e A l l o c a t i o n */ - -TokNode * -#ifdef __USE_PROTOS -newTokNode( void ) -#else -newTokNode( ) -#endif -{ - static TokNode *FreeList = NULL; - TokNode *p, *newblk; - - if ( FreeList == NULL ) - { - newblk = (TokNode *)calloc(TokenBlockAllocSize, sizeof(TokNode)); - if ( newblk == NULL ) - fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule)); - for (p=newblk; p<&(newblk[TokenBlockAllocSize]); p++) - { - p->next = (Node *)FreeList; /* add all new token nodes to FreeList */ - FreeList = p; - } - } - p = FreeList; - FreeList = (TokNode *)FreeList->next;/* remove a TokNode node */ - p->next = NULL; /* NULL the ptr we used */ - memset( (char *) p, 0, sizeof(TokNode)); /* MR10 */ - p->ntype = nToken; - p->rname = CurRule; - p->file = CurFile; - p->line = zzline; - p->altstart = NULL; - - return p; -} - -RuleRefNode * -#ifdef __USE_PROTOS -newRNode( void ) -#else -newRNode( ) -#endif -{ - static RuleRefNode *FreeList = NULL; - RuleRefNode *p, *newblk; - - if ( FreeList == NULL ) - { - newblk = (RuleRefNode *)calloc(RRefBlockAllocSize, sizeof(RuleRefNode)); - if ( newblk == NULL ) - fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule)); - for (p=newblk; p<&(newblk[RRefBlockAllocSize]); p++) - { - p->next = (Node *)FreeList; /* add all new rref nodes to FreeList */ - FreeList = p; - } - } - p = FreeList; - FreeList = (RuleRefNode *)FreeList->next;/* remove a Junction node */ - p->next = NULL; /* NULL the ptr we used */ - memset( (char *) p, 0, sizeof(RuleRefNode)); /* MR10 */ - p->ntype = nRuleRef; - p->rname = CurRule; - p->file = CurFile; - p->line = zzline; - p->astnode = ASTinclude; - p->altstart = NULL; - - return p; -} - -static int junctionSeqNumber=0; /* MR10 */ - -Junction * -#ifdef __USE_PROTOS -newJunction( void ) -#else -newJunction( ) -#endif -{ - static Junction *FreeList = NULL; - Junction *p, *newblk; - - if ( FreeList == NULL ) - { - newblk = (Junction *)calloc(JunctionBlockAllocSize, sizeof(Junction)); - if ( newblk == NULL ) - fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule)); - for (p=newblk; p<&(newblk[JunctionBlockAllocSize]); p++) - { - p->p1 = (Node *)FreeList; /* add all new Junction nodes to FreeList */ - FreeList = p; - } - } - p = FreeList; - FreeList = (Junction *)FreeList->p1;/* remove a Junction node */ - p->p1 = NULL; /* NULL the ptr we used */ - memset( (char *) p, 0, sizeof(Junction)); /* MR10 */ - p->ntype = nJunction; - p->visited = 0; - p->jtype = Generic; - p->rname = CurRule; - p->file = CurFile; - p->line = zzline; - p->exception_label = NULL; - p->fset = (set *) calloc(CLL_k+1, sizeof(set)); - require(p->fset!=NULL, "cannot allocate fset in newJunction"); - p->seq=++junctionSeqNumber; /* MR10 */ - - return p; -} - -ActionNode * -#ifdef __USE_PROTOS -newActionNode( void ) -#else -newActionNode( ) -#endif -{ - static ActionNode *FreeList = NULL; - ActionNode *p, *newblk; - - if ( FreeList == NULL ) - { - newblk = (ActionNode *)calloc(ActionBlockAllocSize, sizeof(ActionNode)); - if ( newblk == NULL ) - fatal_internal(eMsg1("out of memory while building rule '%s'",CurRule)); - for (p=newblk; p<&(newblk[ActionBlockAllocSize]); p++) - { - p->next = (Node *)FreeList; /* add all new Action nodes to FreeList */ - FreeList = p; - } - } - p = FreeList; - FreeList = (ActionNode *)FreeList->next;/* remove an Action node */ - memset( (char *) p, 0, sizeof(ActionNode)); /* MR10 */ - p->ntype = nAction; - p->next = NULL; /* NULL the ptr we used */ - p->done = 0; - p->pred_fail = NULL; - p->guardpred = NULL; - p->ampersandPred = NULL; - return p; -} - -/* - * allocate the array of locks (1..CLL_k) used to inhibit infinite recursion. - * Infinite recursion can occur in (..)* blocks, FIRST calcs and FOLLOW calcs. - * Therefore, we need locks on aLoopBlk, RuleBlk, EndRule nodes. - * - * if ( lock[k]==TRUE ) then we have been here before looking for k tokens - * of lookahead. - */ -char * -#ifdef __USE_PROTOS -makelocks( void ) -#else -makelocks( ) -#endif -{ - char *p = (char *) calloc(CLL_k+1, sizeof(char)); - require(p!=NULL, "cannot allocate lock array"); - - return p; -} - -#if 0 -** #ifdef __USE_PROTOS -** void my_memset(char *p,char value,int count) -** #else -** void my_memset(p,value,count) -** char *p; -** char value; -** int count; -** #endif -** { -** int i; -** -** for (i=0; i -#include - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" - -void -#ifdef __USE_PROTOS -dumpcycles(void) -#else -dumpcycles() -#endif -{ - Cycle *c; - CacheEntry *f; - ListNode *p; - int i=0; - int k; - int degree; - - for (k=1; k <= CLL_k; k++) { - if (Cycles[k] == NULL) continue; - - for (p = Cycles[k]->next; p!=NULL; p=p->next) { - c = (Cycle *) p->elem; - degree=set_deg(c->cyclicDep); - fprintf(stderr,"Cycle %d: (degree %d) %s -->\n", i++, degree, RulePtr[c->croot]->rname); - fprintf(stderr," *self*\n"); - MR_dumpRuleSet(c->cyclicDep); - fprintf(stderr,"\n"); - f = (CacheEntry *) - hash_get(Fcache,Fkey(RulePtr[c->croot]->rname,'o',k)); - if (f == NULL) { - fprintf(stderr," *** FOLLOW(%s) must be in cache but isn't ***\n", - RulePtr[c->croot]->rname); - }; - }; - }; -} - -void -#ifdef __USE_PROTOS -dumpfostack(int k) -#else -dumpfostack(k) -int k; -#endif -{ - int i=0; - int *pi; - - fprintf(stderr,"\n"); - if (FoStack[k] == NULL) { - fprintf(stderr,"FoStack[%d] is null\n",k); - }; - if (FoTOS[k] == NULL) { - fprintf(stderr,"FoTOS[%d] is null\n",k); - } - if (FoTOS[k] != NULL && FoStack[k] != NULL) { - for (pi=FoStack[k]; pi <= FoTOS[k]; pi++) { - i++; - fprintf(stderr,"#%d rule %d %s\n",i,*pi,RulePtr[*pi]->rname); - } - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/dumpnode.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/dumpnode.c deleted file mode 100644 index 7a9c6a7d0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/dumpnode.c +++ /dev/null @@ -1,423 +0,0 @@ -#include -#include - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" - -#ifdef __USE_PROTOS -void dumpset1(set s) -#else -void dumpset1(s) - set s; -#endif -{ - if (set_nil(s)) { - fprintf(stderr,"{}"); - } else { - s_fprT(stderr,s); - }; -} - -#ifdef __USE_PROTOS -void dumpset(set s) -#else -void dumpset(s) - set s; -#endif -{ - dumpset1(s); - fprintf(stderr,"\n"); -} - -#ifdef __USE_PROTOS -int isEndRule(Node * p) -#else -int isEndRule(p) - Node * p; -#endif -{ - int result=0; - if ( p->ntype == nJunction && - ( (Junction *) p)->jtype == EndRule) { - result=1; - }; - return result; -} - -#ifdef __USE_PROTOS -void dumppred1(int depth,Predicate *p) -#else -void dumppred1(depth,p) - int depth; - Predicate *p; -#endif -{ - int i; - int k; - - for (i=0; iexpr == PRED_AND_LIST || - p->expr == PRED_OR_LIST) { - fprintf(stderr," %s", (p->expr == NULL ? "null expr" : p->expr)); - if (p->inverted) fprintf(stderr," predicate inverted !"); - if (p->redundant) { - fprintf(stderr," Redundant!"); - }; - if (p->isConst) fprintf(stderr," const %d !",p->constValue); - fprintf(stderr,"\n"); - } else { - fprintf(stderr,"predicate k=%d",p->k); - k=set_int(p->completionSet); - if (k >= 0) { - fprintf(stderr," Incomplete Set=%d !",k); - }; - k=set_int(p->completionTree); - if (k >= 0) { - fprintf(stderr," Incomplete Tree=%d !",k); - }; - if (p->redundant) { - fprintf(stderr," Redundant!"); - }; - fprintf(stderr," \"%s\" (%x)", (p->expr == NULL ? "null expr" : p->expr) ,p); - if (p->source != NULL) { - fprintf(stderr,"line %d",p->source->line); - }; - if (p->inverted) fprintf(stderr," predicate inverted !"); - fprintf(stderr,"\n"); - for (i=0; iscontext[1]); - for (i=0; itcontext); - fprintf(stderr,"\n"); - }; - fprintf(stderr,"\n"); - if (p->down != NULL) { - dumppred1(depth+1,p->down); - }; - if (p->right != NULL) { - dumppred1(depth,p->right); - }; -} - -#ifdef __USE_PROTOS -void dumppred(Predicate *p) -#else -void dumppred(p) - Predicate *p; -#endif -{ - fprintf(stderr,"---------------------------------\n"); - dumppred1(0,p); - fprintf(stderr,"\n"); -} - -#ifdef __USE_PROTOS -void dumppredtree(Predicate *p) -#else -void dumppredtree(p) - Predicate *p; -#endif -{ - fprintf(stderr,"predicate k=%d \"%s\" line %d\n",p->k,p->expr,p->source->line); - dumpset(p->scontext[1]); -} - -#ifdef __USE_PROTOS -void dumppredexpr(Predicate *p) -#else -void dumppredexpr(p) - Predicate *p; -#endif -{ - fprintf(stderr," pred expr \"%s\"\n",p->expr); -} - -#ifdef __USE_PROTOS -void dt(Tree *t) -#else -void dt(t) - Tree *t; -#endif -{ - MR_dumpTreeF(stderr,0,t,5); -} - -#ifdef __USE_PROTOS -void d(Node * p) -#else -void d(p) - Node * p; -#endif -{ - - Junction *j; - RuleRefNode *r; - TokNode *t; - ActionNode *a; - - if (p==NULL) { - fprintf(stderr,"dumpNode: Node is NULL"); - return; - }; - - switch (p->ntype) { - case nJunction : - j = (Junction *) p; - fprintf(stderr, "Junction (#%d in rule %s line %d) ",j->seq,j->rname,j->line); - if (j->guess) fprintf(stderr,"guess block "); - switch (j->jtype ) { - case aSubBlk : - fprintf(stderr,"aSubBlk"); - break; - case aOptBlk : - fprintf(stderr,"aOptBlk"); - break; - case aLoopBegin : - fprintf(stderr,"aLoopBeginBlk"); - break; - case aLoopBlk : - fprintf(stderr,"aLoopBlk"); - break; - case aPlusBlk : - fprintf(stderr,"aPlusBlk"); - break; - case EndBlk : - fprintf(stderr,"EndBlk"); - break; - case RuleBlk : - fprintf(stderr,"RuleBlk"); - break; - case Generic : - fprintf(stderr,"Generic"); - break; - case EndRule : - fprintf(stderr,"EndRule"); - break; - }; - if (j->halt) fprintf(stderr," halt!"); - if (j->p1) fprintf(stderr," p1 valid"); - if (j->p2) { - if (j->p2->ntype == nJunction) { - fprintf(stderr," (p2=#%d)",( (Junction *) j->p2)->seq); - } else { - fprintf(stderr," (p2 valid)"); - }; - }; - if (j->ignore) fprintf(stderr, " ignore/plus-block-bypass"); - if (j->fset != NULL && set_deg(*j->fset) != 0) { - fprintf(stderr,"\nfset:\n"); - dumpset(*j->fset); - }; - if (j->ftree != NULL) { - fprintf(stderr,"\nftree:\n"); - preorder(j->ftree); - }; - fprintf(stderr,"\n"); - break; - case nRuleRef : - r = (RuleRefNode *) p; - fprintf(stderr, "RuleRefNode (in rule %s line %d) to rule %s\n", r->rname,r->line,r->text); - break; - case nToken : - t = (TokNode *) p; - fprintf(stderr, "TokNode (in rule %s line %d) token %s\n",t->rname,t->line,TerminalString(t->token)); - break; - case nAction : - a =(ActionNode *) p; - if (a->is_predicate) { - fprintf(stderr, "Predicate (in rule %s line %d) %s",a->rname,a->line,a->action); - if (a->inverted) fprintf(stderr," action inverted !"); - if (a->guardpred != NULL) { - fprintf(stderr," guarded"); - dumppredexpr(a->guardpred); - if (a->ampersandPred) { - fprintf(stderr," \"&&\" style"); - } else { - fprintf(stderr," \"=>\" style"); - }; - }; - if (a->predEntry != NULL) fprintf(stderr," predEntry \"%s\" ",a->predEntry->str); - fprintf(stderr,"\n"); - } else if (a->init_action) { - fprintf(stderr, "Init-Action (in rule %s line %d) %s\n",a->rname,a->line,a->action); - } else { - fprintf(stderr, "Action (in rule %s line %d) %s\n",a->rname,a->line,a->action); - }; - break; - }; -} - -#ifdef __USE_PROTOS -Node * dp1(Node * p) -#else -Node * dp1(p) - Node * p; -#endif -{ - Node *result=NULL; - - if (p->ntype == nJunction) { - result=( (Junction *) p )->p1; - d(result); - } else { - fprintf(stderr,"dp1: Not a Junction node"); - }; - return result; -} - -#ifdef __USE_PROTOS -Node * dp2(Node * p) -#else -Node * dp2(p) - Node * p; -#endif -{ - Node *result=NULL; - - if (p->ntype == nJunction) { - result=( (Junction *) p )->p2; - d(result); - } else { - fprintf(stderr,"dp2: Not a Junction node"); - }; - return result; -} - -#ifdef __USE_PROTOS -Node * dn(Node * p) -#else -Node * dn(p) - Node * p; -#endif - -{ - Node *result=NULL; - - if (p->ntype == nRuleRef) { - result=( (RuleRefNode *)p )->next; - } else if (p->ntype == nAction) { - result=( (ActionNode *)p )->next; - } else if (p->ntype == nToken) { - result=( (TokNode *)p )->next; - } else { - fprintf(stderr,"No next field: Neither a RuleRefNode, ActionNode, nor TokNode"); - }; - if (result != NULL) d(result); - return result; -} - -#ifdef __USE_PROTOS -void df(Node * p) -#else -void df(p) - Node * p; -#endif -{ - int count=0; - Node *next; - - fprintf(stderr,"\n#%d ",++count); - d(p); - - for (next=p; next != NULL && !isEndRule(next) ; ) { - fprintf(stderr,"#%d ",++count); - if (next->ntype == nJunction) { - next=dp1(next); - } else { - next=dn(next); - }; - }; -} - -#ifdef __USE_PROTOS -Node * dfn(Node * p,int target) -#else -Node * dfn(p,target) - Node * p; - int target; -#endif -{ - Node *result=NULL; - int count=0; - Node *next; - - fprintf(stderr,"#%d ",++count); - d(p); - - for (next=p; next != NULL && !isEndRule(next) ; ) { - fprintf(stderr,"#%d ",++count); - if (next->ntype == nJunction) { - next=dp1(next); - } else { - next=dn(next); - }; - if (count == target) { - result=next; - break; - }; - }; - return result; -} - - -static int findnodeMatch; - -#ifdef __USE_PROTOS -Junction *findnode1(Node *n) -#else -Junction *findnode1(n) - Node *n; -#endif -{ - Node *next; - Junction *j; - Junction *match; - - if (n == NULL) return NULL; - if (n->ntype == nJunction) { - j=(Junction *) n; - if (j->seq == findnodeMatch) return j; - if (j->jtype == EndRule) return NULL; - if (j->jtype != RuleBlk && j->jtype != EndBlk) { - if (j->p2 != NULL && !j->ignore) { - match=findnode1(j->p2); - if (match != NULL) return match; - }; - }; - }; - next=MR_advance(n); - return findnode1(next); -} - -#ifdef __USE_PROTOS -Junction *findnode(int match) -#else -Junction *findnode(match) - int match; -#endif -{ - Junction *j; - Junction *result=NULL; - - findnodeMatch=match; - - for (j=SynDiag; j != NULL; j=(Junction *)j->p2) { - require (j->ntype == nJunction && j->jtype == RuleBlk,"Not a rule block"); - result=findnode1( (Node *) j); - if (result != NULL) break; - }; - if (result != NULL) { - d( (Node *) result); - }; - return result; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/egman.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/egman.c deleted file mode 100644 index ba26b3257..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/egman.c +++ /dev/null @@ -1,328 +0,0 @@ -/* - * egman.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33MR10 - * 2001 - * - */ - -#include -#include - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "proto.h" - -static ExceptionGroup **egArray=NULL; /* ExceptionGroup by BlkLevel */ -static LabelEntry **leArray=NULL; /* LabelEntry by BlkLevel */ -static Junction **altArray=NULL; /* start of alternates */ -static int arraySize=0; -static int highWater=0; -static ExceptionGroup *lastEG=NULL; /* used in altFixup() */ -static int lastBlkLevel=0; /* used in altFixup() */ - -#ifdef __USE_PROTOS -static void arrayCheck(void); -#else -static void arrayCheck(); -#endif - -/* Called to add an exception group for an alternative EG */ - -#ifdef __USE_PROTOS -void egAdd(ExceptionGroup * eg) -#else -void egAdd(eg) -ExceptionGroup *eg; -#endif -{ - int i; - - ExceptionGroup *nextEG; - ExceptionGroup *innerEG; - - LabelEntry *nextLE; - LabelEntry *innerLE; - - Junction *nextAlt; - Junction *innerAlt; - - lastEG=eg; - lastBlkLevel=BlkLevel; - - arrayCheck(); - eg->pendingLink=egArray[BlkLevel]; - egArray[BlkLevel]=eg; - - /* EG for alternates already have their altID filled in */ - - for (i=BlkLevel+1; i<=highWater ; i++) { - for (innerEG=egArray[i]; innerEG != NULL ; innerEG=nextEG) { - nextEG=innerEG->pendingLink; - innerEG->pendingLink=NULL; - innerEG->outerEG=eg; - }; - egArray[i]=NULL; - }; - - /* - * for patching up the LabelEntry you might use an EG for the - * current alternative - unlike patching up an alternative EG - * i.e. start the loop at BlkLevel rather than (BlkLevel+1) - * fill it in only if the EG and the LE are for the very - * same alternative if they're at the same BlkLevel - * it's easier to leave the LE on this list (filled in) rather than - * trying to selectively remove it. It will eventually be - * removed anyway when the BlkLevel gets small enough. - */ - - for (i=BlkLevel; i<=highWater ; i++) { - for (innerLE=leArray[i]; innerLE != NULL ; innerLE=nextLE) { - nextLE=innerLE->pendingLink; - if (BlkLevel != i || - innerLE->curAltNum == CurAltNum_array[BlkLevel]) { - if (innerLE->outerEG == NULL) { - innerLE->outerEG=eg; - }; - }; - }; - if (BlkLevel != i) leArray[i]=NULL; - }; - -/* - * For the start of alternatives it is necessary to make a - * distinction between the exception group for the current - * alternative and the "fallback" EG for the block which - * contains the alternative - * - * The fallback outerEG is used to handle the case where - * no alternative of a block matches. In that case the - * signal is "NoViableAlt" (or "NoSemViableAlt" and the - * generator needs the EG of the block CONTAINING the - * current one. - * - * rule: ( ( ( a - * | b - * ) - * | c - * ) - * | d - * ); - */ - - for (i=BlkLevel; i <= highWater ; i++) { - for (innerAlt=altArray[i]; innerAlt != NULL ; innerAlt=nextAlt) { - nextAlt=innerAlt->pendingLink; - - /* first fill in the EG for the current alternative */ - /* but leave it on the list in order to get the fallback EG */ - /* if the EG is at the same LEVEL as the alternative then */ - /* fill it in only if in the very same alternative */ - /* */ - /* rule: ( a */ - /* | b */ - /* | c exception ... */ - /* ) */ - /* */ - /* if the EG is outside the alternative (e.g. BlkLevel < i) */ - /* then it doesn't matter about the alternative */ - /* */ - /* rule: ( a */ - /* | b */ - /* | c */ - /* ) exception ... */ - /* */ - -#if 0 - printf("BlkLevel=%d i=%d altnum=%d CurAltNum=%d altID=%s\n", - BlkLevel,i,innerAlt->curAltNum,CurAltNum_array[BlkLevel],eg->altID); -#endif - if (BlkLevel != i || - innerAlt->curAltNum == CurAltNum_array[BlkLevel]) { - if (innerAlt->exception_label == NULL) { - innerAlt->exception_label=eg->altID; - }; - }; - - /* ocurs at a later pass then for the exception_label */ - /* if an outerEG has been found then fill in the outer EG */ - /* remove if from the list when the BlkLevel gets smaller */ - - if (BlkLevel != i) { - if (innerAlt->outerEG == NULL) { - innerAlt->outerEG=eg; - }; - }; - }; - if (BlkLevel != i) altArray[i]=NULL; - }; -} - -#ifdef __USE_PROTOS -void leAdd(LabelEntry * le) -#else -void leAdd(le) -LabelEntry *le; -#endif - -{ - arrayCheck(); - le->pendingLink=leArray[BlkLevel]; - le->curAltNum=CurAltNum_array[BlkLevel]; - leArray[BlkLevel]=le; -} - -#ifdef __USE_PROTOS -void altAdd(Junction *alt) -#else -void altAdd(alt) -Junction *alt; -#endif - -{ - arrayCheck(); -#if 0 - printf("BlkLevel=%d CurAltNum=%d\n", - BlkLevel,CurAltNum_array[BlkLevel]); -#endif - alt->curAltNum=CurAltNum_array[BlkLevel]; - alt->pendingLink=altArray[BlkLevel]; - altArray[BlkLevel]=alt; -} - -static void -#ifdef __USE_PROTOS -arrayCheck(void) -#else -arrayCheck() -#endif -{ - ExceptionGroup **egArrayNew; - LabelEntry **leArrayNew; - Junction **altArrayNew; - int arraySizeNew; - int i; - - if (BlkLevel > highWater) highWater=BlkLevel; - - if (BlkLevel >= arraySize) { - arraySizeNew=BlkLevel+5; /* MR20 */ - egArrayNew=(ExceptionGroup **) - calloc(arraySizeNew,sizeof(ExceptionGroup *)); - leArrayNew=(LabelEntry **) - calloc(arraySizeNew,sizeof(LabelEntry *)); - altArrayNew=(Junction **) - calloc(arraySizeNew,sizeof(Junction *)); - for (i=0; ipendingLink; - innerEG->pendingLink=NULL; - }; - egArray[i]=NULL; - }; - lastEG=NULL; - lastBlkLevel=0; -} - -/* always call leFixup() BEFORE egFixup() */ - -#ifdef __USE_PROTOS -void leFixup(void) -#else -void leFixup() -#endif -{ - - int i; - LabelEntry *nextLE; - LabelEntry *innerLE; - - for (i=BlkLevel; i<=highWater ; i++) { - for (innerLE=leArray[i]; innerLE != NULL ; innerLE=nextLE) { - nextLE=innerLE->pendingLink; - innerLE->pendingLink=NULL; - }; - leArray[i]=NULL; - }; -} - -/* always call altFixup() BEFORE egFixup() */ - -#ifdef __USE_PROTOS -void altFixup(void) -#else -void altFixup() -#endif -{ - - int i; - Junction *nextAlt; - Junction *innerAlt; - - for (i=BlkLevel; i<=highWater ; i++) { - for (innerAlt=altArray[i]; innerAlt != NULL ; innerAlt=nextAlt) { - - /* if an outerEG has been found then fill in the outer EG */ - - if (lastBlkLevel <= i) { - if (innerAlt->outerEG == NULL) { - innerAlt->outerEG=lastEG; - }; - }; - nextAlt=innerAlt->pendingLink; - innerAlt->pendingLink=NULL; - }; - altArray[i]=NULL; - }; -} - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/err.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/err.c deleted file mode 100644 index 4d4d87164..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/err.c +++ /dev/null @@ -1,538 +0,0 @@ -/* - * A n t l r S e t s / E r r o r F i l e H e a d e r - * - * Generated from: antlr.g - * - * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001 - * Parr Research Corporation - * with Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include "pcctscfg.h" -#include "set.h" -#include -#include "syn.h" -#include "hash.h" -#include "generic.h" -#define zzcr_attr(attr,tok,t) -#define zzSET_SIZE 20 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "err.h" - -ANTLRChar *zztokens[157]={ - /* 00 */ "Invalid", - /* 01 */ "Eof", - /* 02 */ "QuotedTerm", - /* 03 */ "\\n|\\r|\\r\\n", - /* 04 */ "\\(\\n|\\r|\\r\\n)", - /* 05 */ "\\~[]", - /* 06 */ "~[\\n\\r\"\\]+", - /* 07 */ "\"", - /* 08 */ "\\n|\\r|\\r\\n", - /* 09 */ "\\(\\n|\\r|\\r\\n)", - /* 10 */ "\\~[]", - /* 11 */ "~[\\n\\r\"\\]+", - /* 12 */ "'", - /* 13 */ "\\n|\\r|\\r\\n", - /* 14 */ "\\~[]", - /* 15 */ "~[\\n\\r'\\]+", - /* 16 */ "\\*/", - /* 17 */ "\\*", - /* 18 */ "\\n|\\r|\\r\\n", - /* 19 */ "~[\\n\\r\\*]+", - /* 20 */ "\\*/", - /* 21 */ "\\*", - /* 22 */ "\\n|\\r|\\r\\n", - /* 23 */ "~[\\n\\r\\*]+", - /* 24 */ "\\n|\\r|\\r\\n", - /* 25 */ "~[\\n\\r]+", - /* 26 */ "\\n|\\r|\\r\\n", - /* 27 */ "~[\\n\\r]+", - /* 28 */ "\\n|\\r|\\r\\n", - /* 29 */ "~[\\n\\r]+", - /* 30 */ "\\*/", - /* 31 */ "\\*", - /* 32 */ "\\n|\\r|\\r\\n", - /* 33 */ "~[\\n\\r\\*]+", - /* 34 */ "Action", - /* 35 */ "Pred", - /* 36 */ "PassAction", - /* 37 */ "consumeUntil\\( [\\ \\t]* \\{~[\\}]+\\} [\\ \\t]* \\)", - /* 38 */ "consumeUntil\\( ~[\\)]+ \\)", - /* 39 */ "\\n|\\r|\\r\\n", - /* 40 */ "\\>", - /* 41 */ "$", - /* 42 */ "$$", - /* 43 */ "$\\[\\]", - /* 44 */ "$\\[", - /* 45 */ "$[0-9]+", - /* 46 */ "$[0-9]+.", - /* 47 */ "$[0-9]+.[0-9]+", - /* 48 */ "$[_a-zA-Z][_a-zA-Z0-9]*", - /* 49 */ "#0", - /* 50 */ "#\\[\\]", - /* 51 */ "#\\(\\)", - /* 52 */ "#[0-9]+", - /* 53 */ "#line[\\ \\t]* [0-9]+ {[\\ \\t]* \"~[\"]+\" ([\\ \\t]* [0-9]*)* } (\\n|\\r|\\r\\n)", - /* 54 */ "#line ~[\\n\\r]* (\\n|\\r|\\r\\n)", - /* 55 */ "#[_a-zA-Z][_a-zA-Z0-9]*", - /* 56 */ "#\\[", - /* 57 */ "#\\(", - /* 58 */ "#", - /* 59 */ "\\)", - /* 60 */ "\\[", - /* 61 */ "\\(", - /* 62 */ "\\\\]", - /* 63 */ "\\\\)", - /* 64 */ "\\>", - /* 65 */ "'", - /* 66 */ "\"", - /* 67 */ "\\$", - /* 68 */ "\\#", - /* 69 */ "\\(\\n|\\r|\\r\\n)", - /* 70 */ "\\~[\\]\\)>$#]", - /* 71 */ "/", - /* 72 */ "/\\*", - /* 73 */ "\\*/", - /* 74 */ "//", - /* 75 */ "~[\\n\\r\\)\\(\\$#\\>\\]\\[\"'/]+", - /* 76 */ "[\\t\\ ]+", - /* 77 */ "\\n|\\r|\\r\\n", - /* 78 */ "\\[", - /* 79 */ "\\<\\<", - /* 80 */ "\"", - /* 81 */ "/\\*", - /* 82 */ "\\*/", - /* 83 */ "//", - /* 84 */ "#line[\\ \\t]* [0-9]+ {[\\ \\t]* \"~[\"]+\" ([\\ \\t]* [0-9]*)* } (\\n|\\r|\\r\\n)", - /* 85 */ "#line ~[\\n\\r]* (\\n|\\r|\\r\\n)", - /* 86 */ "\\>\\>", - /* 87 */ "WildCard", - /* 88 */ "\\@", - /* 89 */ "LABEL", - /* 90 */ "grammar-element", - /* 91 */ "meta-symbol", - /* 92 */ "Pragma", - /* 93 */ "FirstSetSymbol", - /* 94 */ "{\\}#header", - /* 95 */ "{\\}#first", - /* 96 */ "{\\}#parser", - /* 97 */ "{\\}#tokdefs", - /* 98 */ "\\}", - /* 99 */ "class", - /* 100 */ "NonTerminal", - /* 101 */ "TokenTerm", - /* 102 */ "\\{", - /* 103 */ "!", - /* 104 */ "\\<", - /* 105 */ "\\>", - /* 106 */ ":", - /* 107 */ ";", - /* 108 */ "{\\}#lexaction", - /* 109 */ "{\\}#lexmember", - /* 110 */ "{\\}#lexprefix", - /* 111 */ "{\\}#pred", - /* 112 */ "\\|\\|", - /* 113 */ "&&", - /* 114 */ "\\(", - /* 115 */ "\\)", - /* 116 */ "{\\}#lexclass", - /* 117 */ "{\\}#errclass", - /* 118 */ "{\\}#tokclass", - /* 119 */ "..", - /* 120 */ "{\\}#token", - /* 121 */ "=", - /* 122 */ "[0-9]+", - /* 123 */ "\\|", - /* 124 */ "\\~", - /* 125 */ "^", - /* 126 */ "approx", - /* 127 */ "LL\\(1\\)", - /* 128 */ "LL\\(2\\)", - /* 129 */ "\\*", - /* 130 */ "\\+", - /* 131 */ "?", - /* 132 */ "=>", - /* 133 */ "exception", - /* 134 */ "default", - /* 135 */ "catch", - /* 136 */ "{\\}#[A-Za-z0-9_]*", - /* 137 */ "[\\t\\ ]+", - /* 138 */ "\\n|\\r|\\r\\n", - /* 139 */ "//", - /* 140 */ "/\\*", - /* 141 */ "#ifdef", - /* 142 */ "#if", - /* 143 */ "#ifndef", - /* 144 */ "#else", - /* 145 */ "#endif", - /* 146 */ "#undef", - /* 147 */ "#import", - /* 148 */ "ID", - /* 149 */ "#define", - /* 150 */ "INT", - /* 151 */ "enum", - /* 152 */ "\\{", - /* 153 */ "=", - /* 154 */ ",", - /* 155 */ "\\}", - /* 156 */ ";" -}; -SetWordType zzerr1[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr2[20] = {0xfc,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xf3, - 0xbf,0xff,0xff,0xff, 0xff,0xff,0xff,0x1f}; -SetWordType zzerr3[20] = {0xfc,0xff,0xff,0xff, 0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xfb, - 0x3b,0xf7,0xf7,0xc7, 0xff,0xff,0xff,0x1f}; -SetWordType zzerr4[20] = {0x4,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x80,0x7,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType setwd1[157] = {0x0,0x50,0xa0,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6a,0x20,0xa0,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x0,0x0,0x20,0x20,0x21, - 0x21,0x21,0x21,0x6e,0x6e,0x64,0x20,0x0, - 0x20,0xa0,0xa0,0xa0,0x20,0x6a,0x6a,0x6a, - 0x6e,0x20,0x20,0x20,0x20,0x66,0x6e,0x6e, - 0x20,0x66,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20}; -SetWordType zzerr5[20] = {0x0,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x1,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr6[20] = {0x4,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x7,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr7[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x6,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr8[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x4,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr9[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf0,0x70,0x1, 0x20,0x0,0x0,0x0}; -SetWordType setwd2[157] = {0x0,0xf8,0x6,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xf8,0x0,0x1,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xf8,0xf8,0xf8,0x0,0x0, - 0x0,0x1,0x2,0x6,0x0,0xf8,0xf8,0xf8, - 0xf8,0x0,0x0,0x0,0x0,0xf8,0xf8,0xf8, - 0x0,0xf8,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0xe8,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr10[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0xbc,0xf8,0x74,0x1, 0x20,0x0,0x0,0x0}; -SetWordType zzerr11[20] = {0x0,0x0,0x0,0x0, 0x8,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0xa0,0x0,0x4,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr12[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0}; -SetWordType zzerr13[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0xa0,0x0,0x4,0x0, 0x0,0x0,0x0,0x0}; -SetWordType setwd3[157] = {0x0,0xfa,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xfa,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xfa,0xfa,0xfa,0x5,0x0, - 0x5,0x0,0x0,0x0,0xe2,0xfa,0xfa,0xfa, - 0xfa,0xc0,0x80,0x5,0xe0,0xfa,0xfa,0xfa, - 0x0,0xfa,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0xfa,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr14[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr15[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr16[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr17[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr18[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x24,0x0,0x80,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr19[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr20[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x74,0x3, 0x20,0x0,0x0,0x0}; -SetWordType zzerr21[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x70,0x3, 0x20,0x0,0x0,0x0}; -SetWordType setwd4[157] = {0x0,0xe5,0xda,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xe5,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xed,0xe5,0xe7,0x1a,0x0, - 0x0,0x0,0x0,0x0,0xc0,0xe5,0xe5,0xe5, - 0xe5,0x0,0x0,0x0,0x0,0xe5,0xe5,0xe5, - 0x0,0xe5,0x40,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0xe5,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr22[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x3c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0}; -SetWordType zzerr23[20] = {0x6,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0}; -SetWordType zzerr24[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0}; -SetWordType zzerr25[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x70,0x1, 0x20,0x0,0x0,0x0}; -SetWordType zzerr26[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x5, - 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType setwd5[157] = {0x0,0x1f,0xc1,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xdf,0xc0,0xc0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xc0,0x0,0xc0,0x0,0x0,0xc0,0xc0,0x0, - 0x0,0x0,0x0,0x7f,0x1f,0xdf,0xc0,0xc0, - 0x0,0x0,0xc0,0x0,0x67,0x1f,0x1f,0x1f, - 0x1f,0x0,0x0,0xc0,0x60,0x1f,0x1f,0x1f, - 0x0,0x1f,0x0,0x0,0x40,0xc0,0x0,0x0, - 0x0,0x0,0xc0,0xc0,0x0,0x0,0x5f,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr27[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x0,0x0,0x0,0x10, 0x0,0x0,0x0,0x0}; -SetWordType zzerr28[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x80,0x2, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr29[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr30[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd, - 0x0,0x0,0x80,0x0, 0x20,0x0,0x0,0x0}; -SetWordType zzerr31[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd, - 0x0,0x0,0x0,0x0, 0x20,0x0,0x0,0x0}; -SetWordType zzerr32[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x5, - 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr33[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x20,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType setwd6[157] = {0x0,0x0,0xfd,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xe1,0xe1,0xe1,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xfd,0x60,0xe9,0x0,0x0,0xe1,0xe1,0x0, - 0x0,0x0,0x0,0xe2,0x0,0xfd,0xfd,0xe1, - 0x20,0x0,0xe1,0x0,0xe2,0x0,0x0,0x0, - 0x0,0x0,0x0,0xe1,0xe2,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xe2,0xe0,0x20,0x0, - 0x0,0x0,0xe1,0xe1,0x0,0x0,0xe2,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr34[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd, - 0x0,0x0,0x80,0x0, 0x20,0x0,0x0,0x0}; -SetWordType zzerr35[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xd, - 0x0,0x0,0x0,0x0, 0x20,0x0,0x0,0x0}; -SetWordType zzerr36[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x5, - 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr37[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xc, - 0x0,0x0,0x0,0x0, 0x20,0x0,0x0,0x0}; -SetWordType zzerr38[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x84,0x9,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr39[20] = {0x0,0x0,0x0,0x0, 0x10,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x1,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr40[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x4,0x9,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr41[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr42[20] = {0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x80,0x0, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType setwd7[157] = {0x0,0x0,0xdf,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xdf,0xdf,0xff,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xdf,0x3,0xdf,0x0,0x0,0xdf,0xdf,0x0, - 0x0,0x0,0x0,0xdf,0x0,0xdf,0xdf,0xdf, - 0x1,0x30,0xdf,0x0,0xdf,0x0,0x0,0x0, - 0x0,0x0,0x0,0xdf,0xdf,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xdf,0xdf,0x1,0x0, - 0x0,0x0,0xdf,0xdf,0x0,0x0,0xdf,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr43[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr44[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xc0, 0x1,0x0,0x0,0x0}; -SetWordType zzerr45[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x30, - 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr46[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr47[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x20, - 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr48[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x2,0x0, 0x10,0x0,0x0,0x0}; -SetWordType zzerr49[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x4,0x8,0x8,0x18, 0x20,0x0,0x0,0x0}; -SetWordType zzerr50[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x4,0x8,0xa,0x18, 0x30,0x0,0x0,0x0}; -SetWordType zzerr51[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x4,0x8,0x8,0x18, 0x28,0x0,0x0,0x0}; -SetWordType zzerr52[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x40,0x0,0x4,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr53[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x4, - 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType setwd8[157] = {0x0,0x0,0xe1,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0xe1,0xe1,0xe1,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xe1,0x0,0xe1,0x0,0x0,0xe3,0xe7,0x0, - 0x0,0x0,0x0,0xe1,0x0,0xe1,0xe1,0xef, - 0x0,0x0,0xe1,0x0,0xe1,0x0,0x0,0x0, - 0x0,0x0,0x10,0xef,0xe1,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xe1,0xe1,0x0,0x0, - 0x0,0x0,0xe1,0xe1,0x0,0x10,0xe1,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr54[20] = {0x2,0x0,0x0,0x0, 0x14,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x78,0x9, 0xe0,0x0,0x0,0x0}; -SetWordType zzerr55[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x78,0x9, 0x60,0x0,0x0,0x0}; -SetWordType zzerr56[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x30,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr57[20] = {0x2,0x0,0x0,0x0, 0x4,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x1c,0xf8,0x78,0x9, 0xe0,0x0,0x0,0x0}; -SetWordType setwd9[157] = {0x0,0x7c,0x1,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x7f,0x1,0x1,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x1,0x0,0x1,0x0,0x0,0x1,0x1,0x0, - 0x0,0x0,0x0,0x7f,0x7e,0x7f,0x1,0x1, - 0x0,0x0,0x1,0x0,0x7d,0x7e,0x7e,0x7e, - 0x7e,0x0,0x0,0x1,0x7d,0x7e,0x7e,0x7e, - 0x0,0x7e,0x0,0x0,0x7d,0x1,0x0,0x0, - 0x0,0x0,0x1,0x1,0x0,0x0,0x7f,0x64, - 0x64,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x80,0x0,0x0,0x0,0x0,0x0,0x80,0x0, - 0x80,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr58[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x0,0xa0,0x0}; -SetWordType zzerr59[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x80,0xa0,0x0}; -SetWordType zzerr60[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x0,0xa0,0x0}; -SetWordType zzerr61[20] = {0x2,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x80,0xa0,0x0}; -SetWordType zzerr62[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xe}; -SetWordType zzerr63[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xe}; -SetWordType zzerr64[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0xe}; -SetWordType zzerr65[20] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0, 0x0,0x0,0x10,0xc}; -SetWordType setwd10[157] = {0x0,0xc,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0, - 0x3,0x0,0x0,0xf0,0xf0,0x0}; -SetWordType setwd11[157] = {0x0,0x1,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x1,0x0,0x0,0x0,0x0,0x0}; diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fcache.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fcache.c deleted file mode 100644 index 566d81751..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fcache.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * fcache.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33MR10 - * - */ - -#include -#include - -#include "pcctscfg.h" - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" - -#ifdef __USE_PROTOS -CacheEntry *dumpFcache1(char *prev) -#else -CacheEntry *dumpFcache1(prev) - char *prev; -#endif -{ - Entry **table=Fcache; - - int low=0; - int hi=0; - - CacheEntry *least=NULL; - - Entry **p; - - for (p=table; p<&(table[HashTableSize]); p++) { - - CacheEntry *q =(CacheEntry *) *p; - - if ( q != NULL && low==0 ) low = p-table; - while ( q != NULL ) { - if (strcmp(q->str,prev) > 0) { - if (least == NULL) { - least=q; - } else { - if (strcmp(q->str,least->str) < 0) { - least=q; - }; - }; - }; - q = q->next; - }; - - if ( *p != NULL ) hi = p-table; - } - return least; -} - -#ifdef __USE_PROTOS -void reportFcache(CacheEntry *q) -#else -void reportFcache(q) - CacheEntry *q; -#endif -{ - char *qstr; - - fprintf(stdout,"\nrule "); - for (qstr=q->str; *qstr != '*' ; qstr++) { - fprintf(stdout,"%c",*qstr); - }; - - qstr++; - if (*qstr == 'i') fprintf(stdout," First["); - if (*qstr == 'o') fprintf(stdout," Follow["); - qstr++; - fprintf(stdout,"%s]",qstr); - if (q->incomplete) fprintf(stdout," *** incomplete ***"); - fprintf(stdout,"\n"); - MR_dumpTokenSet(stdout,1,q->fset); -} - -void -#ifdef __USE_PROTOS -DumpFcache(void) -#else -DumpFcache() -#endif -{ - - char *prev=""; - int n=0; - CacheEntry *next; - - fprintf(stdout,"\n\nDump of First/Follow Cache\n"); - - for(;;) { - next=dumpFcache1(prev); - if (next == NULL) break; - reportFcache(next); - ++n; - prev=next->str; - }; - fprintf(stdout,"\nEnd dump of First/Follow Cache\n"); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset.c deleted file mode 100644 index 17e1899c3..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset.c +++ /dev/null @@ -1,1555 +0,0 @@ -/* - * fset.c - * - * Compute FIRST and FOLLOW sets. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include - -#include "pcctscfg.h" - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" -#include "limits.h" - -#ifdef __USE_PROTOS -static void ensure_predicates_cover_ambiguous_lookahead_sequences - (Junction *, Junction *, char *, Tree *); -#else -static void ensure_predicates_cover_ambiguous_lookahead_sequences(); -#endif - -/* - * What tokens are k tokens away from junction q? - * - * Follow both p1 and p2 paths (unless RuleBlk) to collect the tokens k away from this - * node. - * We lock the junction according to k--the lookahead. If we have been at this - * junction before looking for the same, k, number of lookahead tokens, we will - * do it again and again...until we blow up the stack. Locks are only used on aLoopBlk, - * RuleBlk, aPlusBlk and EndRule junctions to remove/detect infinite recursion from - * FIRST and FOLLOW calcs. - * - * If p->jtype == EndRule we are going to attempt a FOLLOW. (FOLLOWs are really defined - * in terms of FIRST's, however). To proceed with the FOLLOW, p->halt cannot be - * set. p->halt is set to indicate that a reference to the current rule is in progress - * and the FOLLOW is not desirable. - * - * If we attempt a FOLLOW and find that there is no FOLLOW or REACHing beyond the EndRule - * junction yields an empty set, replace the empty set with EOF. No FOLLOW means that - * only EOF can follow the current rule. This normally occurs only on the start symbol - * since all other rules are referenced by another rule somewhere. - * - * Normally, both p1 and p2 are followed. However, checking p2 on a RuleBlk node is - * the same as checking the next rule which is clearly incorrect. - * - * Cycles in the FOLLOW sense are possible. e.g. Fo(c) requires Fo(b) which requires - * Fo(c). Both Fo(b) and Fo(c) are defined to be Fo(b) union Fo(c). Let's say - * Fo(c) is attempted first. It finds all of the FOLLOW symbols and then attempts - * to do Fo(b) which finds of its FOLLOW symbols. So, we have: - * - * Fo(c) - * / \ - * a set Fo(b) - * / \ - * a set Fo(c) .....Hmmmm..... Infinite recursion! - * - * The 2nd Fo(c) is not attempted and Fo(b) is left deficient, but Fo(c) is now - * correctly Fo(c) union Fo(b). We wish to pick up where we left off, so the fact - * that Fo(b) terminated early means that we lack Fo(c) in the Fo(b) set already - * laying around. SOOOOoooo, we track FOLLOW cycles. All FOLLOW computations are - * cached in a hash table. After the sequence of FOLLOWs finish, we reconcile all - * cycles --> correct all Fo(rule) sets in the cache. - * - * Confused? Good! Read my MS thesis [Purdue Technical Report TR90-30]. - * TJP 8/93 -- can now read PhD thesis from Purdue. - * - * Also, FIRST sets are cached in the hash table. Keys are (rulename,Fi/Fo,k). - * Only FIRST sets, for which the FOLLOW is not included, are stored. - * - * SPECIAL CASE of (...)+ blocks: - * I added an optional alt so that the alts could see what - * was behind the (...)+ block--thus using enough lookahead - * to branch out rather than just enough to distinguish - * between alts in the (...)+. However, when the FIRST("(...)+") is - * is needed, must not use this last "optional" alt. This routine - * turns off this path by setting a new 'ignore' flag for - * the alt and then resetting it afterwards. - */ - -set -#ifdef __USE_PROTOS -rJunc( Junction *p, int k, set *rk ) -#else -rJunc( p, k, rk ) -Junction *p; -int k; -set *rk; -#endif -{ - set a, b; - - require(p!=NULL, "rJunc: NULL node"); - require(p->ntype==nJunction, "rJunc: not junction"); - -#ifdef DBG_LL1 - if ( p->jtype == RuleBlk ) fprintf(stderr, "FIRST(%s,%d) \n",((Junction *)p)->rname,k); - else fprintf(stderr, "rJunc: %s in rule %s\n", - decodeJType[p->jtype], ((Junction *)p)->rname); -#endif - /* if this is one of the added optional alts for (...)+ then return */ - - /* no need to pop backtrace - hasn't been pushed */ - - if ( p->ignore ) return empty; - - if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p); - -/* MR14 */ if (AlphaBetaTrace && p->alpha_beta_guess_end) { -/* MR14 */ warnFL( -/* MR14 */ "not possible to compute follow set for alpha in an \"(alpha)? beta\" block. ", -/* MR14 */ FileStr[p->file],p->line); -/* MR14 */ MR_alphaBetaTraceReport(); -/* MR14 */ }; - -/* MR14 */ if (p->alpha_beta_guess_end) { -/* MR14 */ if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); -/* MR14 */ return empty; -/* MR14 */ } - - /* locks are valid for aLoopBlk,aPlusBlk,RuleBlk,EndRule junctions only */ - if ( p->jtype==aLoopBlk || p->jtype==RuleBlk || - p->jtype==aPlusBlk || p->jtype==EndRule ) - { - require(p->lock!=NULL, "rJunc: lock array is NULL"); - if ( p->lock[k] ) - { - if ( p->jtype == EndRule ) /* FOLLOW cycle? */ - { -#ifdef DBG_LL1 - fprintf(stderr, "FOLLOW cycle to %s: panic!\n", p->rname); -#endif - if (! MR_AmbSourceSearch) RegisterCycle(p->rname, k); - } - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return empty; - } - if ( p->jtype == RuleBlk && - p->end->halt && - ! MR_AmbSourceSearch) /* check for FIRST cache */ - { - CacheEntry *q = (CacheEntry *) hash_get(Fcache, Fkey(p->rname,'i',k)); - if ( q != NULL ) - { - set_orin(rk, q->rk); - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return set_dup( q->fset ); - } - } - if ( p->jtype == EndRule && - !p->halt && /* MR11 was using cache even when halt set */ - ! MR_AmbSourceSearch) /* FOLLOW set cached already? */ - { - CacheEntry *q = (CacheEntry *) hash_get(Fcache, Fkey(p->rname,'o',k)); - if ( q != NULL ) - { -#ifdef DBG_LL1 - fprintf(stderr, "cache for FOLLOW(%s,%d):", p->rname,k); - s_fprT(stderr, q->fset); - if ( q->incomplete ) fprintf(stderr, " (incomplete)"); - fprintf(stderr, "\n"); -#endif - if ( !q->incomplete ) - { - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return set_dup( q->fset ); - } - } - } - p->lock[k] = TRUE; /* This rule is busy */ - } - - a = b = empty; - - if ( p->jtype == EndRule ) - { - if (p->halt ) /* don't want FOLLOW here? */ /* unless MR10 hoisting */ - { - p->lock[k] = FALSE; - set_orel(k, rk); /* indicate this k value needed */ - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return empty; - } - if (! MR_AmbSourceSearch) FoPush(p->rname, k); /* Attempting FOLLOW */ - if ( p->p1 == NULL ) set_orel((TokenInd!=NULL?TokenInd[EofToken]:EofToken), &a);/* if no FOLLOW assume EOF */ -#ifdef DBG_LL1 - fprintf(stderr, "-->FOLLOW(%s,%d)\n", p->rname,k); -#endif - } - - if ( p->p1 != NULL ) { -/* MR14 */ if (p->guess) { -/* MR14 */ if (p->guess_analysis_point == NULL) { -/* MR14 */ Node * guess_point; -/* MR14 */ guess_point=(Node *)analysis_point(p); -/* MR14 */ if (guess_point == (Node *)p) { -/* MR14 */ guess_point=p->p1; -/* MR14 */ } -/* MR14 */ p->guess_analysis_point=guess_point; -/* MR14 */ } -/* MR14 */ REACH(p->guess_analysis_point, k, rk, a); - } else { - REACH(p->p1, k, rk, a); - } - } - - /* C a c h e R e s u l t s */ - - if ( p->jtype == RuleBlk && p->end->halt && ! MR_AmbSourceSearch) /* can save FIRST set? */ - { - CacheEntry *q = newCacheEntry( Fkey(p->rname,'i',k) ); - /*fprintf(stderr, "Caching %s FIRST %d\n", p->rname, k);*/ - hash_add(Fcache, Fkey(p->rname,'i',k), (Entry *)q); - q->fset = set_dup( a ); - q->rk = set_dup( *rk ); - } - - if ( p->jtype == EndRule && - !p->halt && /* MR11 was using cache even with halt set */ - ! MR_AmbSourceSearch) /* just completed FOLLOW? */ - { - /* Cache Follow set */ - CacheEntry *q = (CacheEntry *) hash_get(Fcache, Fkey(p->rname,'o',k)); - if ( q==NULL ) - { - q = newCacheEntry( Fkey(p->rname,'o',k) ); - hash_add(Fcache, Fkey(p->rname,'o',k), (Entry *)q); - } - /*fprintf(stderr, "Caching %s FOLLOW %d\n", p->rname, k);*/ - if ( set_nil(a) && !q->incomplete ) - { - /* Don't ever save a nil set as complete. - * Turn it into an eof set. - */ - set_orel(EofToken, &a); - } - set_orin(&(q->fset), a); - FoPop( k ); - if ( FoTOS[k] == NULL && Cycles[k] != NULL ) ResolveFoCycles(k); -#ifdef DBG_LL1 - fprintf(stderr, "saving FOLLOW(%s,%d):", p->rname, k); - s_fprT(stderr, q->fset); - if ( q->incomplete ) fprintf(stderr, " (incomplete)"); - fprintf(stderr, "\n"); -#endif - } - - if (p->jtype != RuleBlk && p->p2 != NULL && /* MR14 */ ! p->guess) { - REACH(p->p2, k, rk, b); - } - - if ( p->jtype==aLoopBlk || p->jtype==RuleBlk || - p->jtype==aPlusBlk || p->jtype==EndRule ) - p->lock[k] = FALSE; /* unlock node */ - - set_orin(&a, b); - set_free(b); - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return a; -} - -set -#ifdef __USE_PROTOS -rRuleRef( RuleRefNode *p, int k, set *rk_out ) -#else -rRuleRef( p, k, rk_out ) -RuleRefNode *p; -int k; -set *rk_out; -#endif -{ - set rk; - Junction *r; - int k2; - set a, rk2, b; - int save_halt; - RuleEntry *q = (RuleEntry *) hash_get(Rname, p->text); - require(p!=NULL, "rRuleRef: NULL node"); - require(p->ntype==nRuleRef, "rRuleRef: not rule ref"); - -#ifdef DBG_LL1 - fprintf(stderr, "rRuleRef: %s\n", p->text); -#endif - - if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p); - - if ( q == NULL ) - { - warnFL( eMsg1("rule %s not defined",p->text), FileStr[p->file], p->line ); - REACH(p->next, k, rk_out, a); - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return a; - } - rk2 = empty; - -/* MR9 Problems with rule references in guarded predicates */ -/* MR9 Perhaps can use hash table to find rule ? */ - -/* MR9 */ if (RulePtr == NULL) { -/* MR9 */ fatalFL(eMsg2("Rule %s uses rule %s via RulePtr before it has been initialized", -/* MR9 */ p->rname,q->str),FileStr[p->file],p->line); -/* MR9 */ }; - - r = RulePtr[q->rulenum]; - if ( r->lock[k] ) - { - errNoFL( eMsg2("infinite left-recursion to rule %s from rule %s", - r->rname, p->rname) ); - - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - - return empty; - } - - save_halt = r->end->halt; - r->end->halt = TRUE; /* don't let reach fall off end of rule here */ - rk = empty; - REACH(r, k, &rk, a); - r->end->halt = save_halt; - while ( !set_nil(rk) ) { - k2 = set_int(rk); /* MR11 this messes up the ambiguity search routine */ - set_rm(k2, rk); - REACH(p->next, k2, &rk2, b); /* MR11 by changing the value of k */ - set_orin(&a, b); - set_free(b); - } - set_free(rk); /* this has no members, but free it's memory */ - set_orin(rk_out, rk2); /* remember what we couldn't do */ - set_free(rk2); - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return a; -} - -/* - * Return FIRST sub k ( token_node ) - * - * TJP 10/11/93 modified this so that token nodes that are actually - * ranges (T1..T2) work. - */ -set -#ifdef __USE_PROTOS -rToken( TokNode *p, int k, set *rk ) -#else -rToken( p, k, rk ) -TokNode *p; -int k; -set *rk; -#endif -{ - set a; - - require(p!=NULL, "rToken: NULL node"); - require(p->ntype==nToken, "rToken: not token node"); - -#ifdef DBG_LL1 - fprintf(stderr, "rToken: %s\n", (TokenString(p->token)!=NULL)?TokenString(p->token): - ExprString(p->token)); -#endif - - - if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p); - - if (MR_AmbSourceSearch && (k-1) == 0) { - - set localConstrain; - set intersection; - - localConstrain=fset[maxk-k+1]; - - if (! set_nil(p->tset)) { - intersection=set_and(localConstrain,p->tset); - if (! set_nil(intersection)) { - MR_backTraceReport(); - }; - set_free(intersection); - } else { - if (set_el( (unsigned) p->token,localConstrain)) { - MR_backTraceReport(); - } - }; - }; - - if ( k-1 == 0 ) { - - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - - if ( !set_nil(p->tset) ) { - return set_dup(p->tset); - } else { - return set_of(p->token); - }; - } - - REACH(p->next, k-1, rk, a); - - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - - return a; -} - -set -#ifdef __USE_PROTOS -rAction( ActionNode *p, int k, set *rk ) -#else -rAction( p, k, rk ) -ActionNode *p; -int k; -set *rk; -#endif -{ - set a; - - require(p!=NULL, "rJunc: NULL node"); - require(p->ntype==nAction, "rJunc: not action"); - -/* MR11 */ if (p->is_predicate && p->ampersandPred != NULL) { -/* MR11 */ Predicate *pred=p->ampersandPred; -/* MR11 */ if (k <= pred->k) { -/* MR11 */ REACH(p->guardNodes,k,rk,a); -/* MR11 */ return a; -/* MR11 */ }; -/* MR11 */ }; - - /* it might be a good idea when doing an MR_AmbSourceSearch - to *not* look behind predicates under some circumstances - we'll look into that later - */ - - REACH(p->next, k, rk, a); /* ignore actions */ - return a; -} - - /* A m b i g u i t y R e s o l u t i o n */ - - -void -#ifdef __USE_PROTOS -dumpAmbigMsg( set *fset, FILE *f, int want_nls ) -#else -dumpAmbigMsg( fset, f, want_nls ) -set *fset; -FILE *f; -int want_nls; -#endif -{ - int i; - - set copy; /* MR11 */ - - if ( want_nls ) fprintf(f, "\n\t"); - else fprintf(f, " "); - - for (i=1; i<=CLL_k; i++) - { - copy=set_dup(fset[i]); /* MR11 */ - - if ( i>1 ) - { - if ( !want_nls ) fprintf(f, ", "); - } - if ( set_deg(copy) > 3 && elevel == 1 ) - { - int e,m; - fprintf(f, "{"); - for (m=1; m<=3; m++) - { - e=set_int(copy); - fprintf(f, " %s", TerminalString(e)); - set_rm(e, copy); - } - fprintf(f, " ... }"); - } - else s_fprT(f, copy); - if ( want_nls ) fprintf(f, "\n\t"); - set_free(copy); - } - fprintf(f, "\n"); - -} - -static void -#ifdef __USE_PROTOS -verify_context(Predicate *predicate) -#else -verify_context(predicate) -Predicate *predicate; -#endif -{ - if ( predicate == NULL ) return; - - if ( predicate->expr == PRED_OR_LIST || - predicate->expr == PRED_AND_LIST ) - { - verify_context(predicate->down); - verify_context(predicate->right); /* MR10 */ - return; - } - - if ( !predicate->source->ctxwarned && predicate->source->guardpred==NULL && - ((predicate->k > 1 && - !is_single_tuple(predicate->tcontext)) || - ( predicate->k == 1 && - set_deg(predicate->scontext[1])>1 )) ) - { - -/* MR9 Suppress annoying messages caused by our own clever(?) fix */ - - fprintf(stderr, ErrHdr, FileStr[predicate->source->file], - predicate->source->line); - fprintf(stderr, " warning: predicate applied for >1 lookahead %d-sequences\n", predicate->k); - fprintf(stderr, ErrHdr, FileStr[predicate->source->file], - predicate->source->line); - fprintf(stderr, " predicate text: \"%s\"\n", - (predicate->expr == NULL ? "(null)" : predicate->expr) ); - fprintf(stderr, ErrHdr, FileStr[predicate->source->file], - predicate->source->line); - fprintf(stderr, " You may only want one lookahead %d-sequence to apply\n", predicate->k); - fprintf(stderr, ErrHdr, FileStr[predicate->source->file], - predicate->source->line); - fprintf(stderr, " Try using a context guard '(...)? =>'\n"); - predicate->source->ctxwarned = 1; - } - verify_context(predicate->right); /* MR10 */ -} - -/* - * If delta is the set of ambiguous lookahead sequences, then make sure that - * the predicate(s) for productions alt1,alt2 cover the sequences in delta. - * - * For example, - * a : <>? (A B|A C) - * | b - * ; - * b : <>? A B - * | A C - * ; - * - * This should give a warning that (A C) predicts both productions and alt2 - * does not have a predicate in the production that generates (A C). - * - * The warning detection is simple. Let delta = LOOK(alt1) intersection LOOK(alt2). - * Now, if ( delta set-difference context(predicates-for-alt1) != empty then - * alt1 does not "cover" all ambiguous sequences. - * - * If ambig is nonempty, then ambig in LL(k) sense -> use tree info; else use fset - * info. Actually, sets are used only if k=1 for this grammar. - */ -static void -#ifdef __USE_PROTOS -ensure_predicates_cover_ambiguous_lookahead_sequences - ( Junction *alt1, Junction *alt2, char *sub, Tree *ambig ) -#else -ensure_predicates_cover_ambiguous_lookahead_sequences( alt1, alt2, sub, ambig ) -Junction *alt1; -Junction *alt2; -char *sub; -Tree *ambig; -#endif -{ - if ( !ParseWithPredicates ) return; - - if ( ambig!=NULL ) - { - Tree *non_covered = NULL; - if ( alt1->predicate!=NULL ) - non_covered = tdif(ambig, alt1->predicate, alt1->fset, alt2->fset); - if ( (non_covered!=NULL || alt1->predicate==NULL) && WarningLevel>1 ) - { - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity", - alt1->altnum, sub); - if ( alt1->predicate!=NULL && non_covered!=NULL ) - { - fprintf(stderr, " upon"); - preorder(non_covered); - } - else if ( alt1->predicate==NULL ) - { - fprintf(stderr, " upon"); - preorder(ambig->down); - } - fprintf(stderr, "\n"); - } - Tfree(non_covered); - non_covered = NULL; - if ( alt2->predicate!=NULL ) - non_covered = tdif(ambig, alt2->predicate, alt1->fset, alt2->fset); - if ( (non_covered!=NULL || alt2->predicate==NULL) && WarningLevel>1 ) - { - fprintf(stderr, ErrHdr, FileStr[alt2->file], alt2->line); - fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity", - alt2->altnum, sub); - if ( alt2->predicate!=NULL && non_covered!=NULL ) - { - fprintf(stderr, " upon"); - preorder(non_covered); - } - else if ( alt2->predicate==NULL ) - { - fprintf(stderr, " upon"); - preorder(ambig->down); - } - fprintf(stderr, "\n"); - } - Tfree(non_covered); - } - else if ( !set_nil(alt1->fset[1]) ) - { - set delta, non_covered; - delta = set_and(alt1->fset[1], alt2->fset[1]); - non_covered = set_dif(delta, covered_set(alt1->predicate)); - if ( set_deg(non_covered)>0 && WarningLevel>1 ) - { - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity", - alt1->altnum, sub); - if ( alt1->predicate!=NULL ) - { - fprintf(stderr, " upon "); - s_fprT(stderr, non_covered); - } - fprintf(stderr, "\n"); - } - set_free( non_covered ); - non_covered = set_dif(delta, covered_set(alt2->predicate)); - if ( set_deg(non_covered)>0 && WarningLevel>1 ) - { - fprintf(stderr, ErrHdr, FileStr[alt2->file], alt2->line); - fprintf(stderr, " warning: alt %d %shas no predicate to resolve ambiguity", - alt2->altnum, sub); - if ( alt2->predicate!=NULL ) - { - fprintf(stderr, " upon "); - s_fprT(stderr, non_covered); - } - fprintf(stderr, "\n"); - } - set_free( non_covered ); - set_free( delta ); - } - else fatal_internal("productions have no lookahead in predicate checking routine"); -} - -#ifdef __USE_PROTOS -void MR_doPredicatesHelp(int inGuessBlock,Junction *alt1,Junction *alt2,int jtype,char *sub) -#else -void MR_doPredicatesHelp(inGuessBlock,alt1,alt2,jtype,sub) - int inGuessBlock; - Junction *alt1; - Junction *alt2; - int jtype; - char *sub; -#endif -{ - Predicate *p1; - Predicate *p2; - - Junction *parentRule=MR_nameToRuleBlk(alt1->rname); - - if (inGuessBlock && WarningLevel <= 1) return; - - /* let antlr give the usual error message */ - - if (alt1->predicate == NULL && alt2->predicate == NULL) return; - - if ( (jtype == RuleBlk || jtype == aSubBlk) - && (alt1->predicate == NULL && alt2->predicate != NULL)) { - fprintf(stderr, ErrHdr, FileStr[parentRule->file],parentRule->line); - fprintf(stderr," warning: alt %d line %d and alt %d line %d of %s\n%s%s%s", - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - sub, - " These alts have ambig lookahead sequences resolved by a predicate for\n", - " the second choice. The second choice may not be reachable.\n", - " You may want to use a complementary predicate or rearrange the alts\n" - ); - return; - }; - - /* first do the easy comparison. then do the hard one */ - - if (MR_comparePredicates(alt1->predicate,alt2->predicate)) { - - if (jtype == aLoopBegin || jtype == aPlusBlk ) { - - /* I'm not sure this code is reachable. - Predicates following a (...)+ or (...)* block are probably - considered validation predicates and therefore not - participate in the predication expression - */ - - fprintf(stderr, ErrHdr,FileStr[parentRule->file],parentRule->line); - fprintf(stderr," warning: %s of %s in rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s", - "the predicates used to disambiguate optional/exit paths of ", - sub, - CurRule, - FileStr[alt1->file], - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - " are identical and have no resolving power\n"); - } else { - fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line); - fprintf(stderr," warning: %s rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s", - "the predicates used to disambiguate", - CurRule, - FileStr[alt1->file], - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - " are identical and have no resolving power\n"); - }; - } else { - p1=predicate_dup_without_context(alt1->predicate); - p1=MR_unfold(p1); - MR_clearPredEntry(p1); - MR_simplifyInverted(p1,0); - p1=MR_predSimplifyALL(p1); - p2=predicate_dup_without_context(alt2->predicate); - p2=MR_unfold(p2); - MR_clearPredEntry(p2); - MR_simplifyInverted(p2,0); - p2=MR_predSimplifyALL(p2); - if (MR_comparePredicates(p1,p2)) { - if (jtype == aLoopBegin || jtype == aPlusBlk ) { - fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line); - fprintf(stderr," warning: %s of %s in rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s", - "the predicates used to disambiguate optional/exit paths of ", - sub, - CurRule, - FileStr[alt1->file], - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - " are identical when compared without context and may have no\n", - " resolving power for some lookahead sequences.\n"); - } else { - fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line); - fprintf(stderr," warning: %s rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s", - "the predicates used to disambiguate", - CurRule, - FileStr[alt1->file], - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - " are identical when compared without context and may have no\n", - " resolving power for some lookahead sequences.\n"); - }; - if (InfoP) { - fprintf(output,"\n#if 0\n\n"); - fprintf(output,"The following predicates are identical when compared without\n"); - fprintf(output," lookahead context information. For some ambiguous lookahead\n"); - fprintf(output," sequences they may not have any power to resolve the ambiguity.\n"); - fprintf(output,"\n"); - - fprintf(output,"Choice 1: %s alt %d line %d file %s\n\n", - MR_ruleNamePlusOffset( (Node *) alt1), - alt1->altnum, - alt1->line, - FileStr[alt1->file]); - fprintf(output," The original predicate for choice 1 with available context information:\n\n"); - MR_dumpPred1(2,alt1->predicate,1); - fprintf(output," The predicate for choice 1 after expansion (but without context information):\n\n"); - MR_dumpPred1(2,p1,0); - if (p1 == NULL) { - Predicate *phelp; - fprintf(output," The predicate for choice 1 after expansion (but before simplification)\n\n"); - phelp=predicate_dup_without_context(alt1->predicate); - phelp=MR_unfold(phelp); - MR_clearPredEntry(phelp); - MR_simplifyInverted(phelp,0); - phelp=MR_predSimplifyALLX(phelp,1); - MR_dumpPred1(2,phelp,0); - predicate_free(phelp); - }; - fprintf(output,"\n"); - - fprintf(output,"Choice 2: %s alt %d line %d file %s\n\n", - MR_ruleNamePlusOffset( (Node *) alt2), - alt2->altnum, - alt2->line, - FileStr[alt2->file]); - fprintf(output," The original predicate for choice 2 with available context information:\n\n"); - MR_dumpPred1(1,alt2->predicate,1); - fprintf(output," The predicate for choice 2 after expansion (but without context information):\n\n"); - MR_dumpPred1(1,p2,0); - if (p2 == NULL) { - Predicate *phelp; - fprintf(output," The predicate for choice 2 after expansion (but before simplification)\n\n"); - phelp=predicate_dup_without_context(alt2->predicate); - phelp=MR_unfold(phelp); - MR_clearPredEntry(phelp); - MR_simplifyInverted(phelp,0); - phelp=MR_predSimplifyALLX(phelp,1); - MR_dumpPred1(2,phelp,0); - predicate_free(phelp); - }; - fprintf(output,"\n#endif\n"); - }; - } else if (MR_secondPredicateUnreachable(p1,p2)) { - if (jtype == aLoopBegin || jtype == aPlusBlk ) { - fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line); - fprintf(stderr," warning: %s of %s in rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s", - "the predicate used to disambiguate the first choice of the optional/exit paths of ", - sub, - CurRule, - FileStr[alt1->file], - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - " appears to \"cover\" the second predicate when compared without context.\n", - " The second predicate may have no resolving power for some lookahead sequences.\n"); - } else { - fprintf(stderr, ErrHdr, FileStr[parentRule->file], parentRule->line); - fprintf(stderr," warning: %s rule %s\n (file %s alt %d line %d and alt %d line %d)\n%s%s", - "the predicate used to disambiguate the first choice of", - CurRule, - FileStr[alt1->file], - alt1->altnum, - alt1->line, - alt2->altnum, - alt2->line, - " appears to \"cover\" the second predicate when compared without context.\n", - " The second predicate may have no resolving power for some lookahead sequences.\n"); - }; - if (InfoP) { - fprintf(output,"\n#if 0\n\n"); - fprintf(output,"The first predicate appears to \"cover\" the second predicate when they\n"); - fprintf(output," are compared without lookahead context information. For some ambiguous\n"); - fprintf(output," lookahead sequences the second predicate may not have any power to\n"); - fprintf(output," resolve the ambiguity.\n"); - fprintf(output,"\n"); - fprintf(output,"Choice 1: %s alt %d line %d file %s\n\n", - MR_ruleNamePlusOffset( (Node *) alt1), - alt1->altnum, - alt1->line, - FileStr[alt1->file]); - fprintf(output," The original predicate for choice 1 with available context information:\n\n"); - MR_dumpPred1(2,alt1->predicate,1); - fprintf(output," The predicate for choice 1 after expansion (but without context information):\n\n"); - MR_dumpPred1(2,p1,0); - if (p1 == NULL) { - Predicate *phelp; - fprintf(output," The predicate for choice 1 after expansion (but before simplification)\n\n"); - phelp=predicate_dup_without_context(alt1->predicate); - phelp=MR_unfold(phelp); - MR_clearPredEntry(phelp); - MR_simplifyInverted(phelp,0); - phelp=MR_predSimplifyALLX(phelp,1); - MR_dumpPred1(2,phelp,0); - predicate_free(phelp); - }; - fprintf(output,"\n"); - - fprintf(output,"Choice 2: %s alt %d line %d file %s\n\n", - MR_ruleNamePlusOffset( (Node *) alt2), - alt2->altnum, - alt2->line, - FileStr[alt2->file]); - fprintf(output," The original predicate for choice 2 with available context information:\n\n"); - MR_dumpPred1(1,alt2->predicate,1); - fprintf(output," The predicate for choice 2 after expansion (but without context information):\n\n"); - MR_dumpPred1(1,p2,0); - if (p2 == NULL) { - Predicate *phelp; - fprintf(output," The predicate for choice 2 after expansion (but before simplification)\n\n"); - phelp=predicate_dup_without_context(alt2->predicate); - phelp=MR_unfold(phelp); - MR_clearPredEntry(phelp); - MR_simplifyInverted(phelp,0); - phelp=MR_predSimplifyALLX(phelp,1); - MR_dumpPred1(2,phelp,0); - predicate_free(phelp); - }; - fprintf(output,"\n#endif\n"); - }; - }; - predicate_free(p1); - predicate_free(p2); - }; -} - -static int totalOverflow=0; /* MR9 */ - -void -#ifdef __USE_PROTOS -HandleAmbiguity( Junction *block, Junction *alt1, Junction *alt2, int jtype ) -#else -HandleAmbiguity( block, alt1, alt2, jtype ) -Junction *block; -Junction *alt1; -Junction *alt2; -int jtype; -#endif -{ - unsigned **ftbl; - set *fset, b; - int i, numAmbig,n2; - Tree *ambig=NULL, *t, *u; - char *sub = ""; - long n; - int thisOverflow=0; /* MR9 */ - long set_deg_value; /* MR10 */ - long threshhold; /* MR10 */ - - require(block!=NULL, "NULL block"); - require(block->ntype==nJunction, "invalid block"); - - /* These sets are used to constrain LL_k set, but are made CLL_k long anyway */ - fset = (set *) calloc(CLL_k+1, sizeof(set)); - require(fset!=NULL, "cannot allocate fset"); - ftbl = (unsigned **) calloc(CLL_k+1, sizeof(unsigned *)); - require(ftbl!=NULL, "cannot allocate ftbl"); - - /* create constraint table and count number of possible ambiguities (use<=LL_k) */ - for (n=1,i=1; i<=CLL_k; i++) - { - b = set_and(alt1->fset[i], alt2->fset[i]); -/* MR9 */ set_deg_value = set_deg(b); -/* MR10 */ if (n > 0) { -/* MR10 */ threshhold = LONG_MAX / n; -/* MR10 */ if (set_deg_value <= threshhold) { -/* MR10 */ n *= set_deg_value; -/* MR10 */ } else { -/* MR10 */ n=LONG_MAX; -/* MR9 */ if (totalOverflow == 0) { -#if 0 - /* MR10 comment this out because it just makes users worry */ - -/* MR9 */ warnNoFL("Overflow in computing number of possible ambiguities in HandleAmbiguity\n"); -#endif -/* MR9 */ }; -/* MR9 */ thisOverflow++; -/* MR9 */ totalOverflow++; -/* MR9 */ }; -/* MR10 */ } else { -/* MR10 */ n *= set_deg_value; -/* MR9 */ }; - fset[i] = set_dup(b); - ftbl[i] = set_pdq(b); - set_free(b); - } - - switch ( jtype ) - { - case aSubBlk: sub = "of (..) "; break; - case aOptBlk: sub = "of {..} "; break; - case aLoopBegin: sub = "of (..)* "; break; - case aLoopBlk: sub = "of (..)* "; break; - case aPlusBlk: sub = "of (..)+ "; break; - case RuleBlk: sub = "of the rule itself "; break; - default : sub = ""; break; - } - - /* If the block is marked as a compressed lookahead only block, then - * simply return; ambiguity warning is given only at warning level 2. - */ - if ( block->approx>0 ) - { - if ( ParseWithPredicates ) - { - if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */ - if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */ - - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed"); - alt1->predicate=MR_predSimplifyALL(alt1->predicate); - - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed"); - alt2->predicate=MR_predSimplifyALL(alt2->predicate); - - MR_doPredicatesHelp(0,alt1,alt2,jtype,sub); - - if ( HoistPredicateContext - && (alt1->predicate!=NULL||alt2->predicate!=NULL) ) - { - verify_context(alt1->predicate); - verify_context(alt2->predicate); - } - - if ( HoistPredicateContext - && (alt1->predicate!=NULL||alt2->predicate!=NULL) - && WarningLevel>1 ) - ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig); - } - - if ( WarningLevel>1 ) - { - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - if ( jtype == aLoopBegin || jtype == aPlusBlk ) - fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub); - else - fprintf(stderr, " warning(approx): alts %d and %d %sambiguous upon", - alt1->altnum, alt2->altnum, sub); - dumpAmbigMsg(fset, stderr, 0); - MR_traceAmbSource(fset,alt1,alt2); - } - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - return; - } - - /* if all sets have degree 1 for k=1 permutation; - * don't bother doing full LL(k) analysis. - * (This "if" block handles the LL(1) case) - */ - - n2 = 0; - for (i=1; ifset[i])+set_deg(alt2->fset[i]); - - /* here STARTS the special case in which the lookahead sets for alt1 and alt2 - all have degree 1 for kp1)!=NULL ) - { - if ( WarningLevel==1 ) - { - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - return; - } - - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - if ( jtype == aLoopBegin || jtype == aPlusBlk ) - fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub); - else - fprintf(stderr, " warning: alts %d and %d %sambiguous upon", - alt1->altnum, alt2->altnum, sub); - dumpAmbigMsg(fset, stderr, 0); - MR_traceAmbSource(fset,alt1,alt2); - } - - ambig = NULL; - if ( LL_k>1 ) ambig = make_tree_from_sets(alt1->fset, alt2->fset); - if ( ParseWithPredicates ) - { - if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */ - if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */ - - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed"); - alt1->predicate=MR_predSimplifyALL(alt1->predicate); - - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed"); - alt2->predicate=MR_predSimplifyALL(alt2->predicate); - - MR_doPredicatesHelp(0,alt1,alt2,jtype,sub); - - if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) ) - { - verify_context(alt1->predicate); - verify_context(alt2->predicate); - } - if (HoistPredicateContext&&(alt1->predicate!=NULL||alt2->predicate!=NULL) && WarningLevel>1) - ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig); - if ( WarningLevel == 1 && - (alt1->predicate!=NULL||alt2->predicate!=NULL)) - { - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - Tfree(ambig); - return; - } - } -/* end TJP (10/24/93) */ - - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - if ( jtype == aLoopBegin || jtype == aPlusBlk ) - fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub); - else - fprintf(stderr, " warning: alts %d and %d %sambiguous upon", - alt1->altnum, alt2->altnum, sub); - if ( elevel == 3 && LL_k>1 ) - { - preorder(ambig); - fprintf(stderr, "\n"); - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - Tfree(ambig); - return; - }; - - Tfree(ambig); - dumpAmbigMsg(fset, stderr, 0); - - /* because this is a special case in which both alt1 and alt2 have - lookahead sets of degree 1 for kaltnum; - CurAmbigAlt2 = alt2->altnum; - CurAmbigbtype = sub; - CurAmbigfile = alt1->file; - CurAmbigline = alt1->line; - - /* Don't do full LL(n) analysis if (...)? block because the block, - by definition, defies LL(n) analysis. - If guess (...)? block and ambiguous then don't remove anything from - 2nd alt to resolve ambig. - Want to predict with LL sup 1 ( n ) decision not LL(n) if guess block - since it is much cheaper than LL(n). LL sup 1 ( n ) "covers" the LL(n) - lookahead information. - - Note: LL(n) context cannot be computed for semantic predicates when - followed by (..)?. - - If (..)? then we scream "AAAHHHH! No LL(n) analysis will help" - - Is 'ambig' always defined if we enter this if? I hope so - because the 'ensure...()' func references it. TJP Nov 1993. - */ - - /* THM MR30: Instead of using first_item_is_guss_block we use - first_item_is_guess_block_extra which will look inside a - loop block for a guess block. In other words ( (...)? )*. - It there is an ambiguity in this circumstance then we suppress - the normal methods of resolving ambiguities. - */ - - if ( first_item_is_guess_block_extra((Junction *)alt1->p1)!=NULL ) - { - if ( ParseWithPredicates ) - { - if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */ - if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */ - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed"); - alt1->predicate=MR_predSimplifyALL(alt1->predicate); - - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed"); - alt2->predicate=MR_predSimplifyALL(alt2->predicate); - - MR_doPredicatesHelp(1,alt1,alt2,jtype,sub); - - if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) ) - { - verify_context(alt1->predicate); - verify_context(alt2->predicate); - } - if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) && WarningLevel>1 ) - ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig); - if ( WarningLevel==1 && - (alt1->predicate!=NULL||alt2->predicate!=NULL)) - { - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - return; - } - } - - if ( WarningLevel>1 ) - { - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - if ( jtype == aLoopBegin || jtype == aPlusBlk ) - fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub); - else - fprintf(stderr, " warning: alts %d and %d %sambiguous upon", - alt1->altnum, alt2->altnum, sub); - dumpAmbigMsg(fset, stderr, 0); - MR_traceAmbSource(fset,alt1,alt2); - } - - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - return; - } - - /* Not resolved with (..)? block. Do full LL(n) analysis */ - - /* ambig is the set of k-tuples truly in common between alt 1 and alt 2 */ - /* MR11 VerifyAmbig once used fset destructively */ - - ambig = VerifyAmbig(alt1, alt2, ftbl, fset, &t, &u, &numAmbig); - - /* are all things in intersection really ambigs? */ - - if (thisOverflow || numAmbig < n ) /* MR9 */ - { - Tree *v; - - /* remove ambig permutation from 2nd alternative to resolve ambig; - * We want to compute the set of artificial tuples, arising from - * LL sup 1 (n) compression, that collide with real tuples from the - * 2nd alternative. This is the set of "special case" tuples that - * the LL sup 1 (n) decision template maps incorrectly. - */ - - /* when generating code in genExpr() it does - * - * if ( genExprSets(j->fset) && !genExprTree(j->ftree)) {... - * - * Sooooo the j->ftree is the tree of alt2 - * after removal of conflicts, not alt1 ! - */ - - if ( ambig!=NULL ) - { - /* at the top of ambig is an ALT node */ - - for (v=ambig->down; v!=NULL; v=v->right) - { - u = trm_perm(u, v); /* remove v FROM u */ - } -/* fprintf(stderr, "after rm alt2:"); preorder(u); fprintf(stderr, "\n");*/ - } - Tfree( t ); - alt1->ftree = tappend(alt1->ftree, u); - alt1->ftree = tleft_factor(alt1->ftree); - } - - if ( ambig==NULL ) - { - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - return; - } - - ambig = tleft_factor(ambig); - -/* TJP: - * At this point, we surely have an LL(k) ambiguity. Check for predicates - */ - if ( ParseWithPredicates ) - { - if (alt1->predicate != NULL) predicate_free(alt1->predicate); /* MR12 */ - if (alt2->predicate != NULL) predicate_free(alt2->predicate); /* MR12 */ - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt1->predicate = MR_find_predicates_and_supp((Node *)alt1->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt1->predicate),"predicate alt 1 not completed"); - alt1->predicate=MR_predSimplifyALL(alt1->predicate); - - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - alt2->predicate = MR_find_predicates_and_supp((Node *)alt2->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - require (MR_predicate_context_completed(alt2->predicate),"predicate alt 2 not completed"); - alt2->predicate=MR_predSimplifyALL(alt2->predicate); - - MR_doPredicatesHelp(0,alt1,alt2,jtype,sub); - - if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) ) - { - verify_context(alt1->predicate); - verify_context(alt2->predicate); - } - if ( HoistPredicateContext && (alt1->predicate!=NULL||alt2->predicate!=NULL) && WarningLevel>1 ) - ensure_predicates_cover_ambiguous_lookahead_sequences(alt1, alt2, sub, ambig); - if ( WarningLevel==1 && - (alt1->predicate!=NULL||alt2->predicate!=NULL)) - { - - /* We found at least one pred for at least one of the alts; - * If warnings are low, just return. - */ - - Tfree(ambig); - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); - return; - } - /* else we're gonna give a warning */ - } -/* end TJP addition */ - - fprintf(stderr, ErrHdr, FileStr[alt1->file], alt1->line); - if ( jtype == aLoopBegin || jtype == aPlusBlk ) - fprintf(stderr, " warning: optional/exit path and alt(s) %sambiguous upon", sub); - else - fprintf(stderr, " warning: alts %d and %d %sambiguous upon", - alt1->altnum, alt2->altnum, sub); - if ( elevel == 3 ) - { - preorder(ambig->down); /* <===== k>1 ambiguity message data */ - fprintf(stderr, "\n"); - } else { - MR_skipped_e3_report=1; - dumpAmbigMsg(fset, stderr, 0); - }; - - MR_traceAmbSourceK(ambig,alt1,alt2); /* <====== k>1 ambiguity aid */ - - Tfree(ambig); - - for (i=1; i<=CLL_k; i++) set_free( fset[i] ); - free((char *)fset); - for (i=1; i<=CLL_k; i++) free( (char *)ftbl[i] ); - free((char *)ftbl); -} - -/* Don't analyze alpha block of (alpha)?beta; if (alpha)? then analyze - * Return the 1st node of the beta block if present else return j. - */ -Junction * -#ifdef __USE_PROTOS -analysis_point( Junction *j ) -#else -analysis_point( j ) -Junction *j; -#endif -{ - Junction *gblock; - - /* MR13b When there was an action/predicate preceding a guess block - the guess block became invisible at the analysis_point. - - first_item_is_guess_block accepts any kind of node, - despite the fact that the formal is a junction. But - I don't want to have to change it all over the place - until I know it works. - */ - - if ( j->ntype != nJunction && j->ntype != nAction) return j; - - gblock = first_item_is_guess_block((Junction *)j); - - if ( gblock!=NULL ) - { - Junction *past = gblock->end; - Junction *p; - require(past!=NULL, "analysis_point: no end block on (...)? block"); - - for (p=(Junction *)past->p1; p!=NULL; ) - { - if ( p->ntype==nAction ) - { - p=(Junction *)((ActionNode *)p)->next; - continue; - } - if ( p->ntype!=nJunction ) - { - past->alpha_beta_guess_end=1; /* MR14 */ - return (Junction *)past->p1; - } - if ( p->jtype==EndBlk || p->jtype==EndRule ) - { - return j; - } -/* MR6 */ -/* MR6 A guess block is of the form "(alpha)? beta" or "(alpha)?". */ -/* MR6 When beta is omitted (second form) this means "(alpha)? alpha". */ -/* MR6 The program does not store another copy of alpha in this case. */ -/* MR6 During analysis when the program needs to know what follows the */ -/* MR6 guess clause. It calls this routine. */ -/* MR6 */ -/* MR6 If it is of the form "(alpha)? beta" it returns a pointer to beta.*/ -/* MR6 */ -/* MR6 If it is of the form "(alpha)?" it returns a pointer to the guess */ -/* MR6 block itself thereby reusing the junction tree. */ -/* MR6 */ -/* MR6 It works by searching the "next in sequence" chain (skipping actions) */ -/* MR6 searching for a RuleRef or Token node. (Those are the only 4 kinds */ -/* MR6 of nodes: Junctions, RuleRef, Token, and Action.) */ -/* MR6 */ -/* MR6 This won't work for the special case "(alpha)? ()" because it has no */ -/* MR6 rule references or token nodes. It eventually encounters a */ -/* MR6 junction of type EndBlk or EndRule and says to its caller: nothing */ -/* MR6 more here to analyze - must be of the form "(alpha)?". */ -/* MR6 */ -/* MR6 In the case of "(alpha)? ()" it should return a pointer to "()" */ -/* MR6 */ -/* MR6 I think. */ -/* MR6 */ - if ( p->jtype!=Generic) { /* MR6 */ - past->alpha_beta_guess_end=1; /* MR14 */ - return (Junction *)past->p1; /* MR6 */ - }; /* MR6 */ - p=(Junction *)p->p1; - } - } - return j; -} - -set -#ifdef __USE_PROTOS -First( Junction *j, int k, int jtype, int *max_k ) -#else -First( j, k, jtype, max_k ) -Junction *j; -int k; -int jtype; -int *max_k; -#endif -{ - Junction *alt1, *alt2; - set a, rk, fCurBlk; - int savek; - int p1, p2; - - int save_maintainBackTrace; - - require(j->ntype==nJunction, "First: non junction passed"); - - /* C o m p u t e F I R S T s e t w i t h k l o o k a h e a d */ - fCurBlk = rk = empty; - for (alt1=j; alt1!=NULL; alt1 = (Junction *)alt1->p2 ) - { - Junction * p = NULL; - Junction * p1junction = NULL; - p = analysis_point((Junction *)alt1->p1); - p1junction = (Junction *) (alt1->p1); -#if 0 - if (p != p1junction) { - fprintf(stdout,"Analysis point for #%d is #%d", p1junction->seq, p->seq); /* debug */ - } -#endif - REACH(p, k, &rk, alt1->fset[k]); - require(set_nil(rk), "rk != nil"); - set_free(rk); - set_orin(&fCurBlk, alt1->fset[k]); - } - - /* D e t e c t A m b i g u i t i e s */ - *max_k = 1; - for (p1=1,alt1=j; alt1!=NULL; alt1 = (Junction *)alt1->p2, p1++) - { - for (p2=1,alt2=(Junction *)alt1->p2; alt2!=NULL; alt2 = (Junction *)alt2->p2, p2++) - { - savek = k; - a = set_and(alt1->fset[k], alt2->fset[k]); - while ( !set_nil(a) ) - { - /* if we have hit the max k requested, just give warning */ - if ( j->approx==k ) { - } - - if ( k==CLL_k ) - { -#ifdef NOT_USED -*** int save_LL_k = LL_k; -*** int save_CLL_k = CLL_k; -*** /* Get new LL_k from interactive feature if enabled */ -*** if ( AImode ) -*** AmbiguityDialog(j, jtype, alt1, alt2, &CLL_k, &LL_k); -#endif - *max_k = CLL_k; - save_maintainBackTrace=MR_MaintainBackTrace; - if (AlphaBetaTrace) MR_MaintainBackTrace=0; - HandleAmbiguity(j, alt1, alt2, jtype); - MR_MaintainBackTrace=save_maintainBackTrace; - break; - } - else - { - Junction *p = analysis_point((Junction *)alt1->p1); - Junction *q = analysis_point((Junction *)alt2->p1); - k++; /* attempt ambig alts again with more lookahead */ - - REACH(p, k, &rk, alt1->fset[k]); - require(set_nil(rk), "rk != nil"); - REACH(q, k, &rk, alt2->fset[k]); - require(set_nil(rk), "rk != nil"); - set_free(a); - a = set_and(alt1->fset[k], alt2->fset[k]); - if ( k > *max_k ) *max_k = k; - } - } - set_free(a); - k = savek; - } - } - - return fCurBlk; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset2.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset2.c deleted file mode 100644 index 5393a9e6a..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/fset2.c +++ /dev/null @@ -1,2250 +0,0 @@ -/* - * fset2.c - * - * Compute FIRST sets for full LL(k) - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "pcctscfg.h" -#include - -#ifdef PCCTS_USE_STDARG -#include -#else -#include -#endif - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" - -/* ick! globals. Used by permute() to track which elements of a set have been used */ - -static int *findex; -set *fset; /* MR11 make global */ -static unsigned **ftbl; -static set *constrain; /* pts into fset. constrains tToken() to 'constrain' */ -int ConstrainSearch; -int maxk; /* set to initial k upon tree construction request */ - /* MR11 make global */ -static Tree *FreeList = NULL; - -#ifdef __USE_PROTOS -static int tmember_of_context(Tree *, Predicate *); -#else -static int tmember_of_context(); -#endif - -#if TREE_DEBUG -set set_of_tnodes_in_use; -int stop_on_tnode_seq_number=(-1); /* (-1) to disable */ -#endif - -/* Do root - * Then each sibling - */ - -void -#ifdef __USE_PROTOS -preorder( Tree *tree ) -#else -preorder( tree ) -Tree *tree; -#endif -{ - if ( tree == NULL ) return; - if ( tree->down != NULL ) fprintf(stderr, " ("); - if ( tree->token == ALT ) fprintf(stderr, " ALT"); - else fprintf(stderr, " %s", TerminalString(tree->token)); - if ( tree->token==EpToken ) fprintf(stderr, "(%d)", tree->v.rk); - preorder(tree->down); - if ( tree->down != NULL ) fprintf(stderr, " )"); - preorder(tree->right); -} - -#ifdef __USE_PROTOS -int MR_tree_matches_constraints(int k,set * constrain,Tree *t) -#else -int MR_tree_matches_constraints(k,constrain,t) - int k; - set * constrain; - Tree * t; -#endif -{ - int i; - Tree *u; - - if (k == 0) return 1; - - /* for testing guard predicates: if the guard tree is shorter - than the constraint then it is a match. The reason is that - a guard of (A B) should be equivalent to a guard of (A B . . .) - where "." matches every token. Thus a match which runs out - of tree before constraint is a match. - */ - - if (t == NULL) return 1; - require (set_deg(constrain[0]) == 1, - "MR_tree_matches_constraints: set_deg != 1"); - i=set_int(constrain[0]); - if (t->token != i) return 0; - if (k-1 == 0) return 1; - for (u=t->down; u != NULL; u=u->right) { - if (MR_tree_matches_constraints(k-1,&constrain[1],u)) { - return 1; - }; - }; - return 0; -} - -/* check the depth of each primary sibling to see that it is exactly - * k deep. e.g.; - * - * ALT - * | - * A ------- B - * | | - * C -- D E - * - * Remove all branches <= k deep. - * - * Added by TJP 9-23-92 to make the LL(k) constraint mechanism to work. - */ - -static int pruneCount=0; -static int prunePeak=200; - -Tree * -#ifdef __USE_PROTOS -prune( Tree *t, int k ) -#else -prune( t, k ) -Tree *t; -int k; -#endif -{ - pruneCount++; - if (pruneCount > prunePeak+100) { - prunePeak=pruneCount; -#if 0 -*** fprintf(stderr,"pruneCount=%d\n",pruneCount); -/*** preorder(t); ***/ -*** fprintf(stderr,"\n",pruneCount); -#endif - }; - if ( t == NULL ) { - pruneCount--; - return NULL; - }; - if ( t->token == ALT ) fatal_internal("prune: ALT node in FIRST tree"); - if ( t->right!=NULL ) t->right = prune(t->right, k); - if ( k>1 ) - { - if ( t->down!=NULL ) t->down = prune(t->down, k-1); - if ( t->down == NULL ) - { - Tree *r = t->right; - t->right = NULL; - Tfree(t); - pruneCount--; - return r; - } - } - pruneCount--; - return t; -} - -/* build a tree (root child1 child2 ... NULL) */ -#ifdef PCCTS_USE_STDARG -Tree *tmake(Tree *root, ...) -#else -Tree *tmake(va_alist) -va_dcl -#endif -{ - Tree *w; - va_list ap; - Tree *child, *sibling=NULL, *tail=NULL; -#ifndef PCCTS_USE_STDARG - Tree *root; -#endif - -#ifdef PCCTS_USE_STDARG - va_start(ap, root); -#else - va_start(ap); - root = va_arg(ap, Tree *); -#endif - child = va_arg(ap, Tree *); - while ( child != NULL ) - { -#ifdef DUM - /* added "find end of child" thing TJP March 1994 */ - for (w=child; w->right!=NULL; w=w->right) {;} /* find end of child */ -#else - w = child; -#endif - - if ( sibling == NULL ) {sibling = child; tail = w;} - else {tail->right = child; tail = w;} - child = va_arg(ap, Tree *); - } - - /* was "root->down = sibling;" */ - if ( root==NULL ) root = sibling; - else root->down = sibling; - - va_end(ap); - return root; -} - -Tree * -#ifdef __USE_PROTOS -tnode( int tok ) -#else -tnode( tok ) -int tok; -#endif -{ - Tree *p, *newblk; - static int n=0; - - if ( FreeList == NULL ) - { - /*fprintf(stderr, "tnode: %d more nodes\n", TreeBlockAllocSize);*/ - if ( TreeResourceLimit > 0 ) - { - if ( (n+TreeBlockAllocSize) >= TreeResourceLimit ) - { - fprintf(stderr, ErrHdr, FileStr[CurAmbigfile], CurAmbigline); - fprintf(stderr, " hit analysis resource limit while analyzing alts %d and %d %s\n", - CurAmbigAlt1, - CurAmbigAlt2, - CurAmbigbtype); - exit(PCCTS_EXIT_FAILURE); - } - } - newblk = (Tree *)calloc(TreeBlockAllocSize, sizeof(Tree)); - if ( newblk == NULL ) - { - fprintf(stderr, ErrHdr, FileStr[CurAmbigfile], CurAmbigline); - fprintf(stderr, " out of memory while analyzing alts %d and %d %s\n", - CurAmbigAlt1, - CurAmbigAlt2, - CurAmbigbtype); - exit(PCCTS_EXIT_FAILURE); - } - n += TreeBlockAllocSize; - for (p=newblk; p<&(newblk[TreeBlockAllocSize]); p++) - { - p->right = FreeList; /* add all new Tree nodes to Free List */ - FreeList = p; - } - } - p = FreeList; - FreeList = FreeList->right; /* remove a tree node */ - p->right = NULL; /* zero out ptrs */ - p->down = NULL; - p->token = tok; - - TnodesAllocated++; /* MR10 */ - TnodesInUse++; /* MR10 */ - if (TnodesInUse > TnodesPeak) TnodesPeak=TnodesInUse; /* MR10 */ - -#ifdef TREE_DEBUG - require(!p->in_use, "tnode: node in use!"); - p->in_use = 1; - p->seq=TnodesAllocated; - set_orel( (unsigned) TnodesAllocated,&set_of_tnodes_in_use); - if (stop_on_tnode_seq_number == p->seq) { - fprintf(stderr,"\n*** just allocated tnode #%d ***\n", - stop_on_tnode_seq_number); - }; -#endif - return p; -} - -static Tree * -#ifdef __USE_PROTOS -eofnode( int k ) -#else -eofnode( k ) -int k; -#endif -{ - Tree *t=NULL; - int i; - - for (i=1; i<=k; i++) - { - t = tmake(tnode((TokenInd!=NULL?TokenInd[EofToken]:EofToken)), t, NULL); - } - return t; -} - - - -void -#ifdef __USE_PROTOS -_Tfree( Tree *t ) -#else -_Tfree( t ) -Tree *t; -#endif -{ - if ( t!=NULL ) - { -#ifdef TREE_DEBUG - if (t->seq == stop_on_tnode_seq_number) { - fprintf(stderr,"\n*** just freed tnode #%d ***\n",t->seq); - }; - require(t->in_use, "_Tfree: node not in use!"); - t->in_use = 0; - set_rm( (unsigned) t->seq,set_of_tnodes_in_use); -#endif - t->right = FreeList; - FreeList = t; - TnodesInUse--; /* MR10 */ - } -} - -/* tree duplicate */ -Tree * -#ifdef __USE_PROTOS -tdup( Tree *t ) -#else -tdup( t ) -Tree *t; -#endif -{ - Tree *u; - - if ( t == NULL ) return NULL; - u = tnode(t->token); - u->v.rk = t->v.rk; - u->right = tdup(t->right); - u->down = tdup(t->down); - return u; -} - -/* tree duplicate (assume tree is a chain downwards) */ -Tree * -#ifdef __USE_PROTOS -tdup_chain( Tree *t ) -#else -tdup_chain( t ) -Tree *t; -#endif -{ - Tree *u; - - if ( t == NULL ) return NULL; - u = tnode(t->token); - u->v.rk = t->v.rk; - u->down = tdup(t->down); - return u; -} - -Tree * -#ifdef __USE_PROTOS -tappend( Tree *t, Tree *u ) -#else -tappend( t, u ) -Tree *t; -Tree *u; -#endif -{ - Tree *w; - -/*** fprintf(stderr, "tappend("); - *** preorder(t); fprintf(stderr, ","); - *** preorder(u); fprintf(stderr, " )\n"); -*/ - if ( t == NULL ) return u; - if ( t->token == ALT && t->right == NULL ) return tappend(t->down, u); - for (w=t; w->right!=NULL; w=w->right) {;} - w->right = u; - return t; -} - -/* dealloc all nodes in a tree */ -void -#ifdef __USE_PROTOS -Tfree( Tree *t ) -#else -Tfree( t ) -Tree *t; -#endif -{ - if ( t == NULL ) return; - Tfree( t->down ); - Tfree( t->right ); - _Tfree( t ); -} - -/* find all children (alts) of t that require remaining_k nodes to be LL_k - * tokens long. - * - * t-->o - * | - * a1--a2--...--an <-- LL(1) tokens - * | | | - * b1 b2 ... bn <-- LL(2) tokens - * | | | - * . . . - * . . . - * z1 z2 ... zn <-- LL(LL_k) tokens - * - * We look for all [Ep] needing remaining_k nodes and replace with u. - * u is not destroyed or actually used by the tree (a copy is made). - */ -Tree * -#ifdef __USE_PROTOS -tlink( Tree *t, Tree *u, int remaining_k ) -#else -tlink( t, u, remaining_k ) -Tree *t; -Tree *u; -int remaining_k; -#endif -{ - Tree *p; - require(remaining_k!=0, "tlink: bad tree"); - - if ( t==NULL ) return NULL; - /*fprintf(stderr, "tlink: u is:"); preorder(u); fprintf(stderr, "\n");*/ - if ( t->token == EpToken && t->v.rk == remaining_k ) - { - require(t->down==NULL, "tlink: invalid tree"); - if ( u == NULL ) { -/* MR10 */ Tree *tt=t->right; -/* MR10 */ _Tfree(t); -/* MR10 */ return tt; - }; - p = tdup( u ); - p->right = t->right; - _Tfree( t ); - return p; - } - t->down = tlink(t->down, u, remaining_k); - t->right = tlink(t->right, u, remaining_k); - return t; -} - -/* remove as many ALT nodes as possible while still maintaining semantics */ -Tree * -#ifdef __USE_PROTOS -tshrink( Tree *t ) -#else -tshrink( t ) -Tree *t; -#endif -{ - if ( t == NULL ) return NULL; - t->down = tshrink( t->down ); - t->right = tshrink( t->right ); - if ( t->down == NULL ) - { - if ( t->token == ALT ) - { - Tree *u = t->right; - _Tfree(t); - return u; /* remove useless alts */ - } - return t; - } - - /* (? (ALT (? ...)) s) ==> (? (? ...) s) where s = sibling, ? = match any */ - if ( t->token == ALT && t->down->right == NULL) - { - Tree *u = t->down; - u->right = t->right; - _Tfree( t ); - return u; - } - /* (? (A (ALT t)) s) ==> (? (A t) s) where A is a token; s,t siblings */ - if ( t->token != ALT && t->down->token == ALT && t->down->right == NULL ) - { - Tree *u = t->down->down; - _Tfree( t->down ); - t->down = u; - return t; - } - return t; -} - -Tree * -#ifdef __USE_PROTOS -tflatten( Tree *t ) -#else -tflatten( t ) -Tree *t; -#endif -{ - if ( t == NULL ) return NULL; - t->down = tflatten( t->down ); - t->right = tflatten( t->right ); - if ( t->down == NULL ) return t; - - if ( t->token == ALT ) - { - Tree *u; - /* find tail of children */ - for (u=t->down; u->right!=NULL; u=u->right) {;} - u->right = t->right; - u = t->down; - _Tfree( t ); - return u; - } - return t; -} - -Tree * -#ifdef __USE_PROTOS -tJunc( Junction *p, int k, set *rk ) -#else -tJunc( p, k, rk ) -Junction *p; -int k; -set *rk; -#endif -{ - Tree *t=NULL, *u=NULL; - Junction *alt; - Tree *tail=NULL, *r; - -#ifdef DBG_TRAV - fprintf(stderr, "tJunc(%d): %s in rule %s\n", k, - decodeJType[p->jtype], ((Junction *)p)->rname); -#endif - -/* MR14 */ if (AlphaBetaTrace && p->alpha_beta_guess_end) { -/* MR14 */ warnFL( -/* MR14 */ "not possible to compute follow set for alpha in an \"(alpha)? beta\" block. ", -/* MR14 */ FileStr[p->file],p->line); -/* MR14 */ MR_alphaBetaTraceReport(); -/* MR14 */ }; - -/* MR14 */ if (p->alpha_beta_guess_end) { -/* MR14 */ return NULL; -/* MR14 */ } - - if ( p->jtype==aLoopBlk || p->jtype==RuleBlk || - p->jtype==aPlusBlk || p->jtype==aSubBlk || p->jtype==aOptBlk ) - { - if ( p->jtype!=aSubBlk && p->jtype!=aOptBlk ) { - require(p->lock!=NULL, "rJunc: lock array is NULL"); - if ( p->lock[k] ) return NULL; - p->lock[k] = TRUE; - } - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR10 */ }; - - TRAV(p->p1, k, rk, tail); - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack); -/* MR10 */ }; - - if ( p->jtype==RuleBlk ) {p->lock[k] = FALSE; return tail;} - r = tmake(tnode(ALT), tail, NULL); - for (alt=(Junction *)p->p2; alt!=NULL; alt = (Junction *)alt->p2) - { - /* if this is one of the added optional alts for (...)+ then break */ - if ( alt->ignore ) break; - - if ( tail==NULL ) {TRAV(alt->p1, k, rk, tail); r->down = tail;} - else - { -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR10 */ }; - - TRAV(alt->p1, k, rk, tail->right); - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack); -/* MR10 */ }; - if ( tail->right != NULL ) tail = tail->right; - } - } - if ( p->jtype!=aSubBlk && p->jtype!=aOptBlk ) p->lock[k] = FALSE; -#ifdef DBG_TREES - fprintf(stderr, "blk(%s) returns:",((Junction *)p)->rname); preorder(r); fprintf(stderr, "\n"); -#endif - if ( r->down == NULL ) {_Tfree(r); return NULL;} - return r; - } - - if ( p->jtype==EndRule ) - { - if ( p->halt ) /* don't want FOLLOW here? */ - { -/**** if ( ContextGuardTRAV ) return NULL; ****/ - set_orel( (unsigned) k, rk); /* indicate this k value needed */ /* MR10 cast */ - t = tnode(EpToken); - t->v.rk = k; - return t; - } - require(p->lock!=NULL, "rJunc: lock array is NULL"); - if ( p->lock[k] ) return NULL; - /* if no FOLLOW assume k EOF's */ - if ( p->p1 == NULL ) return eofnode(k); - p->lock[k] = TRUE; - } - -/* MR14 */ if (p->p1 != NULL && p->guess && p->guess_analysis_point == NULL) { -/* MR14 */ Node * guess_point; -/* MR14 */ guess_point=(Node *)analysis_point(p); -/* MR14 */ if (guess_point == (Node *)p) { -/* MR14 */ guess_point=p->p1; -/* MR14 */ } -/* MR14 */ p->guess_analysis_point=guess_point; -/* MR14 */ } - - if ( p->p2 == NULL ) - { - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR10 */ }; - -/* M14 */ if (p->guess_analysis_point != NULL) { -/* M14 */ TRAV(p->guess_analysis_point, k, rk,t); -/* M14 */ } else { - TRAV(p->p1, k, rk,t); -/* M14 */ } - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack); -/* MR10 */ }; - - if ( p->jtype==EndRule ) p->lock[k]=FALSE; - return t; - } - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR10 */ }; - -/* M14 */ if (p->guess_analysis_point != NULL) { -/* M14 */ TRAV(p->guess_analysis_point, k, rk,t); -/* M14 */ } else { - TRAV(p->p1, k, rk,t); -/* M14 */ } - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (p->jtype != Generic) MR_pointerStackPop(&MR_BackTraceStack); -/* MR10 */ }; - - if ( p->jtype!=RuleBlk && /* MR14 */ !p->guess) TRAV(p->p2, k, rk, u); - - if ( p->jtype==EndRule ) p->lock[k] = FALSE;/* unlock node */ - - if ( t==NULL ) return tmake(tnode(ALT), u, NULL); - return tmake(tnode(ALT), t, u, NULL); -} - -Tree * -#ifdef __USE_PROTOS -tRuleRef( RuleRefNode *p, int k, set *rk_out ) -#else -tRuleRef( p, k, rk_out ) -RuleRefNode *p; -int k; -set *rk_out; -#endif -{ - int k2; - Tree *t=NULL, *u=NULL; - Junction *r; - set rk, rk2; - int save_halt; - RuleEntry *q = (RuleEntry *) hash_get(Rname, p->text); - -#ifdef DBG_TRAV - fprintf(stderr, "tRuleRef: %s\n", p->text); -#endif - if ( q == NULL ) - { - TRAV(p->next, k, rk_out, t);/* ignore undefined rules */ - return t; - } - rk = rk2 = empty; - if (RulePtr == NULL) fatal("RulePtr==NULL"); - r = RulePtr[q->rulenum]; - if ( r->lock[k] ) return NULL; - save_halt = r->end->halt; - r->end->halt = TRUE; /* don't let reach fall off end of rule here */ - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR10 */ }; - - TRAV(r, k, &rk, t); - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ MR_pointerStackPop(&MR_BackTraceStack); -/* MR10 */ }; - - r->end->halt = save_halt; -#ifdef DBG_TREES - fprintf(stderr, "after ruleref, t is:"); preorder(t); fprintf(stderr, "\n"); -#endif - t = tshrink( t ); - while ( !set_nil(rk) ) { /* any k left to do? if so, link onto tree */ - k2 = set_int(rk); - set_rm(k2, rk); - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR10 */ }; - - TRAV(p->next, k2, &rk2, u); - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ MR_pointerStackPop(&MR_BackTraceStack); -/* MR10 */ }; - - t = tlink(t, u, k2); /* any alts missing k2 toks, add u onto end */ - Tfree(u); /* MR10 */ - } - set_free(rk); /* rk is empty, but free it's memory */ - set_orin(rk_out, rk2); /* remember what we couldn't do */ - set_free(rk2); - return t; -} - -Tree * -#ifdef __USE_PROTOS -tToken( TokNode *p, int k, set *rk ) -#else -tToken( p, k, rk ) -TokNode *p; -int k; -set *rk; -#endif -{ - Tree *t=NULL, *tset=NULL, *u; - - if (ConstrainSearch) { - if (MR_AmbSourceSearch) { - require(constrain>=fset&&constrain<=&(fset[CLL_k]),"tToken: constrain is not a valid set"); - } else { - require(constrain>=fset&&constrain<=&(fset[LL_k]),"tToken: constrain is not a valid set"); - }; - constrain = &fset[maxk-k+1]; - } - -#ifdef DBG_TRAV - fprintf(stderr, "tToken(%d): %s\n", k, TerminalString(p->token)); - if ( ConstrainSearch ) { - fprintf(stderr, "constrain is:"); s_fprT(stderr, *constrain); fprintf(stderr, "\n"); - } -#endif - - /* is it a meta token (set of tokens)? */ - - if ( !set_nil(p->tset) ) - { - unsigned e=0; - set a; - Tree *n, *tail = NULL; - - if ( ConstrainSearch ) { - a = set_and(p->tset, *constrain); - if (set_nil(a)) { /* MR10 */ - set_free(a); /* MR11 */ - return NULL; /* MR10 */ - }; /* MR10 */ - } else { - a = set_dup(p->tset); - }; - - for (; !set_nil(a); set_rm(e, a)) - { - e = set_int(a); - n = tnode(e); - if ( tset==NULL ) { tset = n; tail = n; } - else { tail->right = n; tail = n; } - } - set_free( a ); - } - else if ( ConstrainSearch && !set_el(p->token, *constrain) ) - { -/* fprintf(stderr, "ignoring token %s(%d)\n", TerminalString(p->token), - k);*/ - return NULL; - } - else { - tset = tnode( p->token ); - }; - -/* MR10 */ if (MR_MaintainBackTrace) { -/* MR10 */ if (k == 1) { -/* MR10 */ MR_pointerStackPush(&MR_BackTraceStack,p); -/* MR13 */ if (MR_SuppressSearch) { -/* MR13 */ MR_suppressSearchReport(); -/* MR13 */ } else { -/* MR10 */ MR_backTraceReport(); -/* MR13 */ }; -/* MR10 */ MR_pointerStackPop(&MR_BackTraceStack); -/* MR11 */ Tfree(tset); -/* MR11 */ return NULL; -/* MR10 */ }; -/* MR10 */ }; - - if ( k == 1 ) return tset; - - if (MR_MaintainBackTrace) { - MR_pointerStackPush(&MR_BackTraceStack,p); - }; - - TRAV(p->next, k-1, rk, t); - - if (MR_MaintainBackTrace) { - Tfree(t); - Tfree(tset); - MR_pointerStackPop(&MR_BackTraceStack); - return NULL; - }; - - /* here, we are positive that, at least, this tree will not contribute - * to the LL(2) tree since it will be too shallow, IF t==NULL. - * If doing a context guard walk, then don't prune. - */ - if ( t == NULL && !ContextGuardTRAV ) /* tree will be too shallow */ - { - if ( tset!=NULL ) Tfree( tset ); - return NULL; - } -#ifdef DBG_TREES - fprintf(stderr, "tToken(%d)->next:",k); preorder(t); fprintf(stderr, "\n"); -#endif - - /* if single token root, then just make new tree and return */ - /* MR10 - set_nil(p->tset) isn't a good test because of ConstraintSearch */ - - if (tset->right == NULL) return tmake(tset, t, NULL); /* MR10 */ - - /* here we must make a copy of t as a child of each element of the tset; - * e.g., "T1..T3 A" would yield ( nil ( T1 A ) ( T2 A ) ( T3 A ) ) - */ - for (u=tset; u!=NULL; u=u->right) - { - /* make a copy of t and hook it onto bottom of u */ - u->down = tdup(t); - } - Tfree( t ); -#ifdef DBG_TREES - fprintf(stderr, "range is:"); preorder(tset); fprintf(stderr, "\n"); -#endif - return tset; -} - -Tree * -#ifdef __USE_PROTOS -tAction( ActionNode *p, int k, set *rk ) -#else -tAction( p, k, rk ) -ActionNode *p; -int k; -set *rk; -#endif -{ - Tree *t=NULL; - set *save_fset=NULL; - int i; - - /* fprintf(stderr, "tAction\n"); */ - -/* An MR_SuppressSearch is looking for things that can be - reached even when the predicate is false. - - There are three kinds of predicates: - plain: r1: <

>? r2 - guarded: r1: (A)? => <

>? r2 - ampersand style: r1: (A)? && <

>? r2 - - Of the three kinds of predicates, only a guard predicate - has things which are reachable even when the predicate - is false. To be reachable the constraint must *not* - match the guard. - -*/ - - if (p->is_predicate && MR_SuppressSearch) { - - Predicate *pred=p->guardpred; - - if (pred == NULL) { - t=NULL; - goto EXIT; - }; - constrain = &fset[maxk-k+1]; - if (pred->k == 1) { - set dif; - dif=set_dif(*constrain,pred->scontext[1]); - if (set_nil(dif)) { - set_free(dif); - t=NULL; - goto EXIT; - }; - set_free(dif); - } else { - if (MR_tree_matches_constraints(k,constrain,pred->tcontext)) { - t=NULL; - goto EXIT; - }; - } - }; - - /* The ampersand predicate differs from the - other predicates because its first set - is a subset of the first set behind the predicate - - r1: (A)? && <

>? r2 ; - r2: A | B; - - In this case first[1] of r1 is A, even - though first[1] of r2 is {A B}. - */ - - if (p->is_predicate && p->ampersandPred != NULL) { - - Predicate *pred=p->ampersandPred; - Tree *tAND; - Tree *tset; - - if (k <= pred->k) { - if (MR_MaintainBackTrace) MR_pointerStackPush(&MR_BackTraceStack,p); - TRAV(p->guardNodes,k,rk,t); - if (MR_MaintainBackTrace) MR_pointerStackPop(&MR_BackTraceStack); - return t; - } else { - require (k>1,"tAction for ampersandpred: k <= 1"); - if (ConstrainSearch) { - if (MR_AmbSourceSearch) { - require(constrain>=fset&&constrain<=&(fset[CLL_k]), - "tToken: constrain is not a valid set"); - } else { - require(constrain>=fset&&constrain<=&(fset[LL_k]), - "tToken: constrain is not a valid set"); - }; - save_fset=(set *) calloc (CLL_k+1,sizeof(set)); - require (save_fset != NULL,"tAction save_fset alloc"); - for (i=1; i <= CLL_k ; i++) { - save_fset[i]=set_dup(fset[i]); - }; - if (pred->k == 1) { - constrain = &fset[maxk-k+1]; - set_andin(constrain,pred->scontext[1]); - if (set_nil(*constrain)) { - t=NULL; - goto EXIT; - }; - } else { - constrain = &fset[maxk-k+1]; - if (! MR_tree_matches_constraints(pred->k,constrain,pred->tcontext)) { - t=NULL; - goto EXIT; - }; /* end loop on i */ - }; /* end loop on pred scontext/tcontext */ - }; /* end if on k > pred->k */ - }; /* end if on constrain search */ - - TRAV(p->next,k,rk,t); - - if (t != NULL) { - t=tshrink(t); - t=tflatten(t); - t=tleft_factor(t); - if (pred->tcontext != NULL) { - tAND=MR_computeTreeAND(t,pred->tcontext); - } else { - tset=MR_make_tree_from_set(pred->scontext[1]); - tAND=MR_computeTreeAND(t,tset); - Tfree(tset); - }; - Tfree(t); - t=tAND; - }; - goto EXIT; - - }; /* end if on ampersand predicate */ - - TRAV(p->next,k,rk,t); - -EXIT: - if (save_fset != NULL) { - for (i=1 ; i <= CLL_k ; i++) { - set_free(fset[i]); - fset[i]=save_fset[i]; - }; - free ( (char *) save_fset); - }; - return t; -} - -/* see if e exists in s as a possible input permutation (e is always a chain) */ - -int -#ifdef __USE_PROTOS -tmember( Tree *e, Tree *s ) -#else -tmember( e, s ) -Tree *e; -Tree *s; -#endif -{ - if ( e==NULL||s==NULL ) return 0; -/** fprintf(stderr, "tmember("); -*** preorder(e); fprintf(stderr, ","); -*** preorder(s); fprintf(stderr, " )\n"); -*/ - if ( s->token == ALT && s->right == NULL ) return tmember(e, s->down); - if ( e->token!=s->token ) - { - if ( s->right==NULL ) return 0; - return tmember(e, s->right); - } - if ( e->down==NULL && s->down == NULL ) return 1; - if ( tmember(e->down, s->down) ) return 1; - if ( s->right==NULL ) return 0; - return tmember(e, s->right); -} - -/* see if e exists in s as a possible input permutation (e is always a chain); - * Only check s to the depth of e. In other words, 'e' can be a shorter - * sequence than s. - */ -int -#ifdef __USE_PROTOS -tmember_constrained( Tree *e, Tree *s) -#else -tmember_constrained( e, s ) -Tree *e; -Tree *s; -#endif -{ - if ( e==NULL||s==NULL ) return 0; -/** fprintf(stderr, "tmember_constrained("); -*** preorder(e); fprintf(stderr, ","); -*** preorder(s); fprintf(stderr, " )\n"); -**/ - if ( s->token == ALT && s->right == NULL ) - return tmember_constrained(e, s->down); - if ( e->token!=s->token ) - { - if ( s->right==NULL ) return 0; - return tmember_constrained(e, s->right); - } - if ( e->down == NULL ) return 1; /* if s is matched to depth of e return */ - if ( tmember_constrained(e->down, s->down) ) return 1; - if ( s->right==NULL ) return 0; - return tmember_constrained(e, s->right); -} - -/* combine (? (A t) ... (A u) ...) into (? (A t u)) */ -Tree * -#ifdef __USE_PROTOS -tleft_factor( Tree *t ) -#else -tleft_factor( t ) -Tree *t; -#endif -{ - Tree *u, *v, *trail, *w; - - /* left-factor what is at this level */ - if ( t == NULL ) return NULL; - for (u=t; u!=NULL; u=u->right) - { - trail = u; - v=u->right; - while ( v!=NULL ) - { - if ( u->token == v->token ) - { - if ( u->down!=NULL ) - { - for (w=u->down; w->right!=NULL; w=w->right) {;} - w->right = v->down; /* link children together */ - } - else u->down = v->down; - trail->right = v->right; /* unlink factored node */ - _Tfree( v ); - v = trail->right; - } - else {trail = v; v=v->right;} - } - } - /* left-factor what is below */ - for (u=t; u!=NULL; u=u->right) u->down = tleft_factor( u->down ); - return t; -} - -/* remove the permutation p from t if present */ -Tree * -#ifdef __USE_PROTOS -trm_perm( Tree *t, Tree *p ) -#else -trm_perm( t, p ) -Tree *t; -Tree *p; -#endif -{ - /* - fprintf(stderr, "trm_perm("); - preorder(t); fprintf(stderr, ","); - preorder(p); fprintf(stderr, " )\n"); - */ - if ( t == NULL || p == NULL ) return NULL; - if ( t->token == ALT ) - { - t->down = trm_perm(t->down, p); - if ( t->down == NULL ) /* nothing left below, rm cur node */ - { - Tree *u = t->right; - _Tfree( t ); - return trm_perm(u, p); - } - t->right = trm_perm(t->right, p); /* look for more instances of p */ - return t; - } - if ( p->token != t->token ) /* not found, try a sibling */ - { - t->right = trm_perm(t->right, p); - return t; - } - t->down = trm_perm(t->down, p->down); - if ( t->down == NULL ) /* nothing left below, rm cur node */ - { - Tree *u = t->right; - _Tfree( t ); - return trm_perm(u, p); - } - t->right = trm_perm(t->right, p); /* look for more instances of p */ - return t; -} - -/* add the permutation 'perm' to the LL_k sets in 'fset' */ -void -#ifdef __USE_PROTOS -tcvt( set *fset, Tree *perm ) -#else -tcvt( fset, perm ) -set *fset; -Tree *perm; -#endif -{ - if ( perm==NULL ) return; - set_orel(perm->token, fset); - tcvt(fset+1, perm->down); -} - -/* for each element of ftbl[k], make it the root of a tree with permute(ftbl[k+1]) - * as a child. - */ -Tree * -#ifdef __USE_PROTOS -permute( int k, int max_k ) -#else -permute( k, max_k ) -int k, max_k; -#endif -{ - Tree *t, *u; - - if ( k>max_k ) return NULL; - if ( ftbl[k][findex[k]] == nil ) return NULL; - t = permute(k+1, max_k); - if ( t==NULL&&k maxk will have to change. - */ -Tree * -#ifdef __USE_PROTOS -VerifyAmbig( Junction *alt1, Junction *alt2, unsigned **ft, set *fs, Tree **t, Tree **u, int *numAmbig ) -#else -VerifyAmbig( alt1, alt2, ft, fs, t, u, numAmbig ) -Junction *alt1; -Junction *alt2; -unsigned **ft; -set *fs; -Tree **t; -Tree **u; -int *numAmbig; -#endif -{ - set rk; - Tree *perm, *ambig=NULL; - Junction *p; - int k; - int tnodes_at_start=TnodesAllocated; - int tnodes_at_end; - int tnodes_used; - set *save_fs; - int j; - - save_fs=(set *) calloc(CLL_k+1,sizeof(set)); - require(save_fs != NULL,"save_fs calloc"); - - for (j=0; j <= CLL_k ; j++) save_fs[j]=set_dup(fs[j]); - - maxk = LL_k; /* NOTE: for now, we look for LL_k */ - ftbl = ft; - fset = fs; - constrain = &(fset[1]); - findex = (int *) calloc(LL_k+1, sizeof(int)); - if ( findex == NULL ) - { - fprintf(stderr, ErrHdr, FileStr[CurAmbigfile], CurAmbigline); - fprintf(stderr, " out of memory while analyzing alts %d and %d of %s\n", - CurAmbigAlt1, - CurAmbigAlt2, - CurAmbigbtype); - exit(PCCTS_EXIT_FAILURE); - } - for (k=1; k<=LL_k; k++) findex[k] = 0; - - rk = empty; - ConstrainSearch = 1; /* consider only tokens in ambig sets */ - - p = analysis_point((Junction *)alt1->p1); - TRAV(p, LL_k, &rk, *t); - *t = tshrink( *t ); - *t = tflatten( *t ); - *t = tleft_factor( *t ); /* MR10 */ - *t = prune(*t, LL_k); - *t = tleft_factor( *t ); - -/*** fprintf(stderr, "after shrink&flatten&prune&left_factor:"); preorder(*t); fprintf(stderr, "\n");*/ - if ( *t == NULL ) - { -/*** fprintf(stderr, "TreeIncomplete --> no LL(%d) ambiguity\n", LL_k);*/ - Tfree( *t ); /* kill if impossible to have ambig */ - *t = NULL; - } - - p = analysis_point((Junction *)alt2->p1); - - TRAV(p, LL_k, &rk, *u); - *u = tshrink( *u ); - *u = tflatten( *u ); - *t = tleft_factor( *t ); /* MR10 */ - *u = prune(*u, LL_k); - *u = tleft_factor( *u ); -/* fprintf(stderr, "after shrink&flatten&prune&lfactor:"); preorder(*u); fprintf(stderr, "\n");*/ - if ( *u == NULL ) - { -/* fprintf(stderr, "TreeIncomplete --> no LL(%d) ambiguity\n", LL_k);*/ - Tfree( *u ); - *u = NULL; - } - - for (k=1; k<=LL_k; k++) set_clr( fs[k] ); - - ambig = tnode(ALT); - k = 0; - if ( *t!=NULL && *u!=NULL ) - { - while ( (perm=permute(1,LL_k))!=NULL ) - { -/* fprintf(stderr, "chk perm:"); preorder(perm); fprintf(stderr, "\n");*/ - if ( tmember(perm, *t) && tmember(perm, *u) ) - { -/* fprintf(stderr, "ambig upon"); preorder(perm); fprintf(stderr, "\n");*/ - - k++; - perm->right = ambig->down; - ambig->down = perm; - tcvt(&(fs[1]), perm); - } - else Tfree( perm ); - } - } - - for (j=0; j <= CLL_k ; j++) fs[j]=save_fs[j]; - free( (char *) save_fs); - - tnodes_at_end=TnodesAllocated; - tnodes_used=tnodes_at_end - tnodes_at_start; - - if (TnodesReportThreshold > 0 && tnodes_used > TnodesReportThreshold) { - fprintf(stdout,"There were %d tuples whose ambiguity could not be resolved by full lookahead\n",k); - fprintf(stdout,"There were %d tnodes created to resolve ambiguity between:\n\n",tnodes_used); - fprintf(stdout," Choice 1: %s line %d file %s\n", - MR_ruleNamePlusOffset( (Node *) alt1),alt1->line,FileStr[alt1->file]); - fprintf(stdout," Choice 2: %s line %d file %s\n", - MR_ruleNamePlusOffset( (Node *) alt2),alt2->line,FileStr[alt2->file]); - for (j=1; j <= CLL_k ; j++) { - fprintf(stdout,"\n Intersection of lookahead[%d] sets:\n",j); - MR_dumpTokenSet(stdout,2,fs[j]); - }; - fprintf(stdout,"\n"); - }; - - *numAmbig = k; - if ( ambig->down == NULL ) {_Tfree(ambig); ambig = NULL;} - free( (char *)findex ); -/* fprintf(stderr, "final ambig:"); preorder(ambig); fprintf(stderr, "\n");*/ - return ambig; -} - -static Tree * -#ifdef __USE_PROTOS -bottom_of_chain( Tree *t ) -#else -bottom_of_chain( t ) -Tree *t; -#endif -{ - if ( t==NULL ) return NULL; - for (; t->down != NULL; t=t->down) {;} - return t; -} - -/* - * Make a tree from k sets where the degree of the first k-1 sets is 1. - */ -Tree * -#ifdef __USE_PROTOS -make_tree_from_sets( set *fset1, set *fset2 ) -#else -make_tree_from_sets( fset1, fset2 ) -set *fset1; -set *fset2; -#endif -{ - set inter; - int i; - Tree *t=NULL, *n, *u; - unsigned *p,*q; - require(LL_k>1, "make_tree_from_sets: LL_k must be > 1"); - - /* do the degree 1 sets first */ - for (i=1; i<=LL_k-1; i++) - { - inter = set_and(fset1[i], fset2[i]); - require(set_deg(inter)==1, "invalid set to tree conversion"); - n = tnode(set_int(inter)); - if (t==NULL) t=n; else tmake(t, n, NULL); - set_free(inter); - } - - /* now add the chain of tokens at depth k */ - u = bottom_of_chain(t); - inter = set_and(fset1[LL_k], fset2[LL_k]); - if ( (q=p=set_pdq(inter)) == NULL ) fatal_internal("Can't alloc space for set_pdq"); - /* first one is linked to bottom, then others are sibling linked */ - n = tnode(*p++); - u->down = n; - u = u->down; - while ( *p != nil ) - { - n = tnode(*p); - u->right = n; - u = u->right; - p++; - } - free((char *)q); - - return t; -} - -/* create and return the tree of lookahead k-sequences that are in t, but not - * in the context of predicates in predicate list p. - */ -Tree * -#ifdef __USE_PROTOS -tdif( Tree *ambig_tuples, Predicate *p, set *fset1, set *fset2 ) -#else -tdif( ambig_tuples, p, fset1, fset2 ) -Tree *ambig_tuples; -Predicate *p; -set *fset1; -set *fset2; -#endif -{ - unsigned **ft; - Tree *dif=NULL; - Tree *perm; - set b; - int i,k; - - if ( p == NULL ) return tdup(ambig_tuples); - - ft = (unsigned **) calloc(CLL_k+1, sizeof(unsigned *)); - require(ft!=NULL, "cannot allocate ft"); - for (i=1; i<=CLL_k; i++) - { - b = set_and(fset1[i], fset2[i]); - ft[i] = set_pdq(b); - set_free(b); - } - findex = (int *) calloc(LL_k+1, sizeof(int)); - if ( findex == NULL ) - { - fatal_internal("out of memory in tdif while checking predicates"); - } - for (k=1; k<=LL_k; k++) findex[k] = 0; - -#ifdef DBG_TRAV - fprintf(stderr, "tdif_%d[", p->k); - preorder(ambig_tuples); - fprintf(stderr, ","); - preorder(p->tcontext); - fprintf(stderr, "] ="); -#endif - - ftbl = ft; - while ( (perm=permute(1,p->k))!=NULL ) - { -#ifdef DBG_TRAV - fprintf(stderr, "test perm:"); preorder(perm); fprintf(stderr, "\n"); -#endif - if ( tmember_constrained(perm, ambig_tuples) && - !tmember_of_context(perm, p) ) - { -#ifdef DBG_TRAV - fprintf(stderr, "satisfied upon"); preorder(perm); fprintf(stderr, "\n"); -#endif - k++; - if ( dif==NULL ) dif = perm; - else - { - perm->right = dif; - dif = perm; - } - } - else Tfree( perm ); - } - -#ifdef DBG_TRAV - preorder(dif); - fprintf(stderr, "\n"); -#endif - - for (i=1; i<=CLL_k; i++) free( (char *)ft[i] ); - free((char *)ft); - free((char *)findex); - - return dif; -} - -/* is lookahead sequence t a member of any context tree for any - * predicate in p? - */ -static int -#ifdef __USE_PROTOS -tmember_of_context( Tree *t, Predicate *p ) -#else -tmember_of_context( t, p ) -Tree *t; -Predicate *p; -#endif -{ - for (; p!=NULL; p=p->right) - { - if ( p->expr==PRED_AND_LIST || p->expr==PRED_OR_LIST ) - return tmember_of_context(t, p->down); - if ( tmember_constrained(t, p->tcontext) ) return 1; - if ( tmember_of_context(t, p->down) ) return 1; - } - return 0; -} - -int -#ifdef __USE_PROTOS -is_single_tuple( Tree *t ) -#else -is_single_tuple( t ) -Tree *t; -#endif -{ - if ( t == NULL ) return 0; - if ( t->right != NULL ) return 0; - if ( t->down == NULL ) return 1; - return is_single_tuple(t->down); -} - - -/* MR10 Check that a context guard contains only allowed things */ -/* MR10 (mainly token references). */ - -#ifdef __USE_PROTOS -int contextGuardOK(Node *p,int h,int *hmax) -#else -int contextGuardOK(p,h,hmax) - Node *p; - int h; - int *hmax; -#endif -{ - Junction *j; - TokNode *tn; - - if (p == NULL) return 1; - if (p->ntype == nToken) { - h++; - if (h > *hmax) *hmax=h; - tn=(TokNode *)p; - if (tn->el_label != NULL) { - warnFL(eMsg1("a label (\"%s\") for a context guard element is meaningless",tn->el_label), - FileStr[p->file],p->line); - }; - return contextGuardOK( ( (TokNode *) p)->next,h,hmax); - } else if (p->ntype == nAction) { - goto Fail; - } else if (p->ntype == nRuleRef) { - goto Fail; - } else { - require (p->ntype == nJunction,"Unexpected ntype"); - j=(Junction *) p; - if (j->jtype != Generic && - j->jtype != aSubBlk && /* pretty sure this one is allowed */ -/**** j->jtype != aOptBlk && ****/ /* pretty sure this one is allowed */ /* MR11 not any more ! */ - j->jtype != EndBlk) { - errFL("A context guard may not contain an option block: {...} or looping block: (...)* or (...)+", - FileStr[p->file],p->line); - contextGuardOK(j->p1,h,hmax); - return 0; - }; - /* do both p1 and p2 so use | rather than || */ - return contextGuardOK(j->p2,h,hmax) | contextGuardOK(j->p1,h,hmax); - }; -Fail: - errFL("A context guard may contain only Token references - guard will be ignored", - FileStr[p->file],p->line); - contextGuardOK( ( (ActionNode *) p)->next,h,hmax); - return 0; -} - -/* - * Look at a (...)? generalized-predicate context-guard and compute - * either a lookahead set (k==1) or a lookahead tree for k>1. The - * k level is determined by the guard itself rather than the LL_k - * variable. For example, ( A B )? is an LL(2) guard and ( ID )? - * is an LL(1) guard. For the moment, you can only have a single - * tuple in the guard. Physically, the block must look like this - * --o-->TOKEN-->o-->o-->TOKEN-->o-- ... -->o-->TOKEN-->o-- - * An error is printed for any other type. - */ -Predicate * -#ifdef __USE_PROTOS -computePredFromContextGuard(Graph blk,int *msgDone) /* MR10 */ -#else -computePredFromContextGuard(blk,msgDone) /* MR10 */ - Graph blk; - int *msgDone; /* MR10 */ -#endif -{ - Junction *junc = (Junction *)blk.left, *p; - Tree *t=NULL; - Predicate *pred = NULL; - set scontext, rk; - int ok; - int hmax=0; - - require(junc!=NULL && junc->ntype == nJunction, "bad context guard"); - -/* MR10 Check for anything other than Tokens and generic junctions */ - - *msgDone=0; /* MR10 */ - ok=contextGuardOK( (Node *)junc,0,&hmax); /* MR10 */ - if (! ok) { /* MR10 */ - *msgDone=1; /* MR10 */ - return NULL; /* MR10 */ - }; /* MR10 */ - if (hmax == 0) { -errFL("guard is 0 tokens long",FileStr[junc->file],junc->line); /* MR11 */ - *msgDone=1; - return NULL; - }; - if (hmax > CLL_k) { /* MR10 */ -errFL(eMsgd2("guard is %d tokens long - lookahead is limited to max(k,ck)==%d", /* MR10 */ - hmax,CLL_k), /* MR10 */ - FileStr[junc->file],junc->line); /* MR10 */ - *msgDone=1; /* MR10 */ - return NULL; /* MR10 */ - }; /* MR10 */ - - rk = empty; - p = junc; - pred = new_pred(); - pred->k = hmax; /* MR10 should be CLL_k, not LLK ? */ - if (hmax > 1 ) /* MR10 was LL_k */ - { - ConstrainSearch = 0; - ContextGuardTRAV = 1; - TRAV(p, hmax, &rk, t); /* MR10 was LL_k */ - ContextGuardTRAV = 0; - set_free(rk); - t = tshrink( t ); - t = tflatten( t ); - t = tleft_factor( t ); -/* - fprintf(stderr, "ctx guard:"); - preorder(t); - fprintf(stderr, "\n"); -*/ - pred->tcontext = t; - } - else - { - REACH(p, 1, &rk, scontext); - require(set_nil(rk), "rk != nil"); - set_free(rk); -/* - fprintf(stderr, "LL(1) ctx guard is:"); - s_fprT(stderr, scontext); - fprintf(stderr, "\n"); -*/ - pred->scontext[1] = scontext; - } - - list_add(&ContextGuardPredicateList,pred); /* MR13 */ - - return pred; -} - -/* MR13 - When the context guard is originally computed the - meta-tokens are not known. -*/ - -#ifdef __USE_PROTOS -void recomputeContextGuard(Predicate *pred) -#else -void recomputeContextGuard(pred) - Predicate *pred; -#endif -{ - Tree * t=NULL; - set scontext; - set rk; - ActionNode * actionNode; - Junction * p; - - actionNode=pred->source; - require (actionNode != NULL,"context predicate's source == NULL"); - - p=actionNode->guardNodes; - require (p != NULL,"context predicate's guardNodes == NULL"); - - rk = empty; - if (pred->k > 1 ) - { - ConstrainSearch = 0; - ContextGuardTRAV = 1; - TRAV(p, pred->k, &rk, t); - ContextGuardTRAV = 0; - set_free(rk); - t = tshrink( t ); - t = tflatten( t ); - t = tleft_factor( t ); - Tfree(pred->tcontext); - pred->tcontext = t; - } - else - { - REACH(p, 1, &rk, scontext); - require(set_nil(rk), "rk != nil"); - set_free(rk); - set_free(pred->scontext[1]); - pred->scontext[1] = scontext; - } -} - -/* MR11 - had enough of flags yet ? */ - -int MR_AmbSourceSearch=0; -int MR_AmbSourceSearchGroup=0; -int MR_AmbSourceSearchChoice=0; -int MR_AmbSourceSearchLimit=0; -int MR_matched_AmbAidRule=0; - -static set *matchSets[2]={NULL,NULL}; -static int *tokensInChain=NULL; -static Junction *MR_AmbSourceSearchJ[2]; - -void MR_traceAmbSourceKclient() -{ - int i; - set *save_fset; - int save_ConstrainSearch; - set incomplete; - Tree *t; - - if (matchSets[0] == NULL) { - matchSets[0]=(set *) calloc (CLL_k+1,sizeof(set)); - require (matchSets[0] != NULL,"matchSets[0] alloc"); - matchSets[1]=(set *) calloc (CLL_k+1,sizeof(set)); - require (matchSets[1] != NULL,"matchSets[1] alloc"); - }; - - for (i=1 ; i <= MR_AmbSourceSearchLimit ; i++) { - set_clr(matchSets[0][i]); - set_orel( (unsigned) tokensInChain[i], - &matchSets[0][i]); - set_clr(matchSets[1][i]); - set_orel( (unsigned) tokensInChain[i], - &matchSets[1][i]); - }; - - save_fset=fset; - save_ConstrainSearch=ConstrainSearch; - - - - for (i=0 ; i < 2 ; i++) { - -#if 0 -** fprintf(stdout," Choice:%d Depth:%d ",i+1,MR_AmbSourceSearchLimit); -** fprintf(stdout,"("); -** for (j=1 ; j <= MR_AmbSourceSearchLimit ; j++) { -** if (j != 1) fprintf(stdout," "); -** fprintf(stdout,"%s",TerminalString(tokensInChain[j])); -** }; -** fprintf(stdout,")\n\n"); -#endif - - fset=matchSets[i]; - - MR_AmbSourceSearch=1; - MR_MaintainBackTrace=1; - MR_AmbSourceSearchChoice=i; - ConstrainSearch=1; - - maxk = MR_AmbSourceSearchLimit; - - incomplete=empty; - t=NULL; - - constrain = &(fset[1]); - MR_pointerStackReset(&MR_BackTraceStack); - - TRAV(MR_AmbSourceSearchJ[i],maxk,&incomplete,t); - - Tfree(t); - - require (set_nil(incomplete),"MR_traceAmbSourceK TRAV incomplete"); - require (MR_BackTraceStack.count == 0,"K: MR_BackTraceStack.count != 0"); - - set_free(incomplete); - }; - - ConstrainSearch=save_ConstrainSearch; - fset=save_fset; - MR_AmbSourceSearch=0; - MR_MaintainBackTrace=0; - MR_AmbSourceSearchChoice=0; -} - -#ifdef __USE_PROTOS -Tree *tTrunc(Tree *t,int depth) -#else -Tree *tTrunc(t,depth) - Tree *t; -#endif -{ - Tree *u; - - require ( ! (t == NULL && depth > 0),"tree too short"); - - if (depth == 0) return NULL; - - if (t->token == ALT) { - u=tTrunc(t->down,depth); - } else { - u=tnode(t->token); - u->down=tTrunc(t->down,depth-1); - }; - if (t->right != NULL) u->right=tTrunc(t->right,depth); - return u; -} - -#ifdef __USE_PROTOS -void MR_iterateOverTree(Tree *t,int chain[]) -#else -void MR_iterateOverTree(t,chain) - Tree *t; - int chain[]; -#endif -{ - if (t == NULL) return; - chain[0]=t->token; - if (t->down != NULL) { - MR_iterateOverTree(t->down,&chain[1]); - } else { - MR_traceAmbSourceKclient(); - }; - MR_iterateOverTree(t->right,&chain[0]); - chain[0]=0; -} - -#ifdef __USE_PROTOS -void MR_traceAmbSourceK(Tree *t,Junction *alt1,Junction *alt2) -#else -void MR_traceAmbSourceK(t,alt1,alt2) - Tree *t; - Junction *alt1; - Junction *alt2; -#endif -{ - int i; - int depth; - int maxDepth; - Tree *truncatedTree; - - if (MR_AmbAidRule == NULL) return; - - if ( ! ( - strcmp(MR_AmbAidRule,alt1->rname) == 0 || - strcmp(MR_AmbAidRule,alt2->rname) == 0 || - MR_AmbAidLine==alt1->line || - MR_AmbAidLine==alt2->line - ) - ) return; - - MR_matched_AmbAidRule++; - - /* there are no token sets in trees, only in TokNodes */ - - MR_AmbSourceSearchJ[0]=analysis_point( (Junction *) alt1->p1); - MR_AmbSourceSearchJ[1]=analysis_point( (Junction *) alt2->p1); - - if (tokensInChain == NULL) { - tokensInChain=(int *) calloc (CLL_k+1,sizeof(int)); - require (tokensInChain != NULL,"tokensInChain alloc"); - }; - - MR_AmbSourceSearchGroup=0; - - fprintf(stdout,"\n"); - fprintf(stdout," Ambiguity Aid "); - fprintf(stdout, - (MR_AmbAidDepth <= LL_k ? - "(-k %d -aa %s %s -aad %d)\n\n" : - "(-k %d -aa %s %s [-k value limits -aad %d])\n\n"), - LL_k, - MR_AmbAidRule, - (MR_AmbAidMultiple ? "-aam" : ""), - MR_AmbAidDepth); - - for (i=0 ; i < 2 ; i++) { - fprintf(stdout," Choice %d: %-25s line %d file %s\n", - (i+1), - MR_ruleNamePlusOffset( (Node *) MR_AmbSourceSearchJ[i]), - MR_AmbSourceSearchJ[i]->line, - FileStr[MR_AmbSourceSearchJ[i]->file]); - }; - - fprintf(stdout,"\n"); - - if (MR_AmbAidDepth < LL_k) { - maxDepth=MR_AmbAidDepth; - } else { - maxDepth=LL_k; - }; - - for (depth=1 ; depth <= maxDepth; depth++) { - MR_AmbSourceSearchLimit=depth; - if (depth < LL_k) { - truncatedTree=tTrunc(t,depth); - truncatedTree=tleft_factor(truncatedTree); - MR_iterateOverTree(truncatedTree,&tokensInChain[1]); /* <===== */ - Tfree(truncatedTree); - } else { - MR_iterateOverTree(t,tokensInChain); /* <===== */ - }; - fflush(stdout); - fflush(stderr); - }; - - fprintf(stdout,"\n"); - MR_AmbSourceSearch=0; - MR_MaintainBackTrace=0; - MR_AmbSourceSearchGroup=0; - MR_AmbSourceSearchChoice=0; - MR_AmbSourceSearchLimit=0; - -} - - -/* this if for k=1 grammars only - - this is approximate only because of the limitations of linear - approximation lookahead. Don't want to do a k=3 search when - the user only specified a ck=3 grammar -*/ - -#ifdef __USE_PROTOS -void MR_traceAmbSource(set *matchSets,Junction *alt1, Junction *alt2) -#else -void MR_traceAmbSource(matchSets,alt1,alt2) - set *matchSets; - Junction *alt1; - Junction *alt2; -#endif -{ - set *save_fset; - Junction *p[2]; - int i; - int j; - set *dup_matchSets; - set intersection; - set incomplete; - set tokensUsed; - int depth; - - if (MR_AmbAidRule == NULL) return; - if ( ! ( - strcmp(MR_AmbAidRule,alt1->rname) == 0 || - strcmp(MR_AmbAidRule,alt2->rname) == 0 || - MR_AmbAidLine==alt1->line || - MR_AmbAidLine==alt2->line - ) - ) return; - - MR_matched_AmbAidRule++; - - save_fset=fset; - - dup_matchSets=(set *) calloc(CLL_k+1,sizeof(set)); - require (dup_matchSets != NULL,"Can't allocate dup_matchSets"); - - p[0]=analysis_point( (Junction *) alt1->p1); - p[1]=analysis_point( (Junction *) alt2->p1); - - fprintf(stdout,"\n"); - - fprintf(stdout," Ambiguity Aid "); - fprintf(stdout, - (MR_AmbAidDepth <= CLL_k ? - "(-ck %d -aa %s %s -aad %d)\n\n" : - "(-ck %d -aa %s %s [-ck value limits -aad %d])\n\n"), - CLL_k, - MR_AmbAidRule, - (MR_AmbAidMultiple ? "-aam" : ""), - MR_AmbAidDepth); - - for (i=0 ; i < 2 ; i++) { - fprintf(stdout," Choice %d: %-25s line %d file %s\n", - (i+1), - MR_ruleNamePlusOffset( (Node *) p[i]), - p[i]->line,FileStr[p[i]->file]); - }; - - for (j=1; j <= CLL_k ; j++) { - fprintf(stdout,"\n Intersection of lookahead[%d] sets:\n",j); - intersection=set_and(alt1->fset[j],alt2->fset[j]); - MR_dumpTokenSet(stdout,2,intersection); - set_free(intersection); - }; - - fprintf(stdout,"\n"); - - require (1 <= MR_AmbAidDepth && MR_AmbAidDepth <= CLL_k, - "illegal MR_AmbAidDepth"); - - MR_AmbSourceSearchGroup=0; - for (depth=1; depth <= MR_AmbAidDepth; depth++) { - MR_AmbSourceSearchLimit=depth; - for (i=0 ; i < 2 ; i++) { - -/*** fprintf(stdout," Choice:%d Depth:%d\n\n",i+1,depth); ***/ - - for (j=0 ; j <= CLL_k ; j++) { dup_matchSets[j]=set_dup(matchSets[j]); }; - fset=dup_matchSets; - - fflush(output); - fflush(stdout); - - MR_AmbSourceSearch=1; - MR_MaintainBackTrace=1; - MR_AmbSourceSearchChoice=i; - - maxk = depth; - tokensUsed=empty; - incomplete=empty; - - constrain = &(fset[1]); - MR_pointerStackReset(&MR_BackTraceStack); - - REACH(p[i],depth,&incomplete,tokensUsed); - - fflush(output); - fflush(stdout); - - require (set_nil(incomplete),"MR_traceAmbSource REACH incomplete"); - require (MR_BackTraceStack.count == 0,"1: MR_BackTraceStack.count != 0"); - - set_free(incomplete); - set_free(tokensUsed); - - for (j=0 ; j <= CLL_k ; j++) { set_free(dup_matchSets[j]); }; - }; - }; - - fprintf(stdout,"\n"); - - MR_AmbSourceSearch=0; - MR_MaintainBackTrace=0; - MR_AmbSourceSearchGroup=0; - MR_AmbSourceSearchChoice=0; - MR_AmbSourceSearchLimit=0; - - fset=save_fset; - free ( (char *) dup_matchSets); -} - -static int itemCount; - -void MR_backTraceDumpItemReset() { - itemCount=0; -} - -#ifdef __USE_PROTOS -void MR_backTraceDumpItem(FILE *f,int skip,Node *n) -#else -void MR_backTraceDumpItem(f,skip,n) - FILE *f; - int skip; - Node *n; -#endif -{ - TokNode *tn; - RuleRefNode *rrn; - Junction *j; - ActionNode *a; - - switch (n->ntype) { - case nToken: - itemCount++; if (skip) goto EXIT; - tn=(TokNode *)n; - if (set_nil(tn->tset)) { - fprintf(f," %2d #token %-23s",itemCount,TerminalString(tn->token)); - } else { - fprintf(f," %2d #tokclass %-20s",itemCount,TerminalString(tn->token)); - }; - break; - case nRuleRef: - itemCount++; if (skip) goto EXIT; - rrn=(RuleRefNode *)n; - fprintf(f," %2d to %-27s",itemCount,rrn->text); - break; - case nAction: - a=(ActionNode *)n; - goto EXIT; - case nJunction: - - j=(Junction *)n; - - switch (j->jtype) { - case aSubBlk: - if (j->guess) { - itemCount++; if (skip) goto EXIT; - fprintf(f," %2d %-30s",itemCount,"in (...)? block at"); - break; - }; -/****** fprintf(f," %2d %-32s",itemCount,"in (...) block at"); *******/ -/****** break; *******/ - goto EXIT; - case aOptBlk: - itemCount++; if (skip) goto EXIT; - fprintf(f," %2d %-30s",itemCount,"in {...} block"); - break; - case aLoopBlk: - itemCount++; if (skip) goto EXIT; - fprintf(f," %2d %-30s",itemCount,"in (...)* block"); - break; - case EndBlk: - if (j->alpha_beta_guess_end) { - itemCount++; if (skip) goto EXIT; - fprintf(f," %2d %-30s",itemCount,"end (...)? block at"); - break; - }; - goto EXIT; -/****** fprintf(f," %2d %-32s",itemCount,"end of a block at"); *****/ -/****** break; *****/ - case RuleBlk: - itemCount++; if (skip) goto EXIT; - fprintf(f," %2d %-30s",itemCount,j->rname); - break; - case Generic: - goto EXIT; - case EndRule: - itemCount++; if (skip) goto EXIT; - fprintf (f," %2d end %-26s",itemCount,j->rname); - break; - case aPlusBlk: - itemCount++; if (skip) goto EXIT; - fprintf(f," %2d %-30s",itemCount,"in (...)+ block"); - break; - case aLoopBegin: - goto EXIT; - }; - break; - }; - fprintf(f," %-23s line %-4d %s\n",MR_ruleNamePlusOffset(n),n->line,FileStr[n->file]); -EXIT: - return; -} - - -static PointerStack previousBackTrace={0,0,NULL}; - -#ifdef __USE_PROTOS -void MR_backTraceReport(void) -#else -void MR_backTraceReport() -#endif -{ - int i; - int match = 0; - int limitMatch; - - Node *p; - TokNode *tn; - set remainder; - int depth; - - /* Even when doing a k=2 search this routine can get - called when there is only 1 token on the stack. - This is because something like rRuleRef can change - the search value of k from 2 to 1 temporarily. - It does this because the it wants to know the k=1 - first set before it does a k=2 search - */ - - depth=0; - for (i=0; i < MR_BackTraceStack.count ; i++) { - p=(Node *) MR_BackTraceStack.data[i]; - if (p->ntype == nToken) depth++; - }; - -/* MR14 */ if (MR_AmbSourceSearch) { -/* MR14 */ require (depth <= MR_AmbSourceSearchLimit,"depth > MR_AmbSourceSearchLimit"); -/* MR14 */ } - - /* MR23 THM - Traceback report was being called at the wrong time for -alpha reports */ - /* Reported by Arpad Beszedes (beszedes@inf.u-szeged.hu) */ - - if (MR_AmbSourceSearchLimit == 0 || depth < MR_AmbSourceSearchLimit) { - return; - }; - - MR_backTraceDumpItemReset(); - - limitMatch=MR_BackTraceStack.count; - if (limitMatch > previousBackTrace.count) { - limitMatch=previousBackTrace.count; - }; - - for (match=0; match < limitMatch; match++) { - if (MR_BackTraceStack.data[match] != - previousBackTrace.data[match]) { - break; - }; - }; - - /* not sure at the moment why there would be duplicates */ - - if (match != MR_BackTraceStack.count) { - - fprintf(stdout," Choice:%d Depth:%d Group:%d", - (MR_AmbSourceSearchChoice+1), - MR_AmbSourceSearchLimit, - ++MR_AmbSourceSearchGroup); - - depth=0; - fprintf(stdout," ("); - for (i=0; i < MR_BackTraceStack.count ; i++) { - p=(Node *) MR_BackTraceStack.data[i]; - if (p->ntype != nToken) continue; - tn=(TokNode *)p; - if (depth != 0) fprintf(stdout," "); - fprintf(stdout,TerminalString(tn->token)); - depth++; - if (! MR_AmbAidMultiple) { - if (set_nil(tn->tset)) { - set_rm( (unsigned) tn->token,fset[depth]); - } else { - remainder=set_dif(fset[depth],tn->tset); - set_free(fset[depth]); - fset[depth]=remainder; - }; - }; - }; - fprintf(stdout,")\n"); - - for (i=0; i < MR_BackTraceStack.count ; i++) { - MR_backTraceDumpItem(stdout, (i -#include -#include -#include "pcctscfg.h" -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" - -#define NumExprPerLine 4 -static int on1line=0; -static set tokensRefdInBlock; - - /* T r a n s l a t i o n T a b l e s */ - -/* C_Trans[node type] == pointer to function that knows how to translate that node. */ -#ifdef __cplusplus -void (*C_Trans[NumNodeTypes+1])(...) = { - NULL, - NULL, /* See next table. -Junctions have many types */ - (void (*)(...)) genRuleRef, - (void (*)(...)) genToken, - (void (*)(...)) genAction - }; -#else -void (*C_Trans[NumNodeTypes+1])() = { - NULL, - NULL, /* See next table. -Junctions have many types */ - genRuleRef, - genToken, - genAction - }; -#endif - -/* C_JTrans[Junction type] == pointer to function that knows how to translate that - * kind of junction node. - */ -#ifdef __cplusplus -void (*C_JTrans[NumJuncTypes+1])(...) = { - NULL, - (void (*)(...)) genSubBlk, - (void (*)(...)) genOptBlk, - (void (*)(...)) genLoopBlk, - (void (*)(...)) genEndBlk, - (void (*)(...)) genRule, - (void (*)(...)) genJunction, - (void (*)(...)) genEndRule, - (void (*)(...)) genPlusBlk, - (void (*)(...)) genLoopBegin - }; -#else -void (*C_JTrans[NumJuncTypes+1])() = { - NULL, - genSubBlk, - genOptBlk, - genLoopBlk, - genEndBlk, - genRule, - genJunction, - genEndRule, - genPlusBlk, - genLoopBegin - }; -#endif - -#define PastWhiteSpace(s) while (*(s) == ' ' || *(s) == '\t') {s++;} - -static int tabs = 0; - -/* MR6 Got tired of text running off page when using standard tab stops */ - -#define TAB { int i; \ - if (TabWidth==0) { \ - for (i=0; irname);} - else gen1("zzTRACEOUT((ANTLRChar *)\"%s\");\n", q->rname); - } -} - -static void -#ifdef __USE_PROTOS -warn_about_using_gk_option(void) -#else -warn_about_using_gk_option() -#endif -{ - static int warned_already=0; - - if ( !DemandLookahead || warned_already ) return; - warned_already = 1; - warnNoFL("-gk option could cause trouble for <<...>>? predicates"); -} - -void -#ifdef __USE_PROTOS -freeBlkFsets( Junction *q ) -#else -freeBlkFsets( q ) -Junction *q; -#endif -{ - int i; - Junction *alt; - require(q!=NULL, "freeBlkFsets: invalid node"); - - for (alt=q; alt != NULL; alt= (Junction *) alt->p2 ) - { - for (i=1; i<=CLL_k; i++) set_free(alt->fset[i]); - } -} - -/* - * Generate a local variable allocation for each token references - * in this block. - */ -static void -#ifdef __USE_PROTOS -genTokenPointers( Junction *q ) -#else -genTokenPointers( q ) -Junction *q; -#endif -{ - /* Rule refs are counted and can be referenced, but their - * value is not set to anything useful ever. - * - * The ptrs are to be named _tij where i is the current level - * and j is the element number within an alternative. - */ - int first=1, t=0; - set a; - tokensRefdInBlock = q->tokrefs; - - if ( set_deg(q->tokrefs) == 0 ) return; - a = set_dup(q->tokrefs); - gen("ANTLRTokenPtr "); - for (; !set_nil(a); set_rm(t, a)) - { - t = set_int(a); - if ( first ) first = 0; - else _gen(","); - if ( !DontCopyTokens ) _gen2("_tv%d%d,", BlkLevel, t); - _gen2("_t%d%d", BlkLevel, t); - if ( !DontCopyTokens ) {_gen2("= &_tv%d%d", BlkLevel, t);} - else _gen("=NULL"); - } - _gen(";\n"); - set_free(a); -} - -static int -#ifdef __USE_PROTOS -hasDefaultException(ExceptionGroup *eg) -#else -hasDefaultException(eg) -ExceptionGroup *eg; -#endif -{ - ListNode *q; - - for (q = eg->handlers->next; q!=NULL; q=q->next) - { - ExceptionHandler *eh = (ExceptionHandler *)q->elem; - if ( strcmp("default", eh->signalname)==0 ) { - return 1; - } - } - return 0; -} -static void -#ifdef __USE_PROTOS -dumpException(ExceptionGroup *eg, int no_default_case) -#else -dumpException(eg, no_default_case) -ExceptionGroup *eg; -int no_default_case; -#endif -{ - char *outerLabel; /* MR7 */ - int altHandler=0; /* MR7 */ - int namedHandler=0; /* MR7 */ - - outerLabel=findOuterHandlerLabel(eg); /* MR7 */ - - if (eg->label != NULL) { /* MR7 */ - namedHandler=1; /* MR7 */ - } else if (eg->forRule) { /* MR7 */ - /* nothing */ /* MR20 */ - } else { /* MR7 */ - altHandler=1; /* MR7 */ - }; /* MR7 */ - -#if 0 -** if (! eg->used) { /* MR7 */ -** warnFL("exception group never used", /* MR7 */ -** FileStr[eg->altstart->file],eg->altstart->line); /* MR7 */ -** }; /* MR7 */ -#endif - - if (namedHandler) { /* MR7 */ - gen1("switch ( _signal ) { /* [%s] */\n",eg->label); /* MR7 */ - } else { /* MR7 */ - gen("switch ( _signal ) {\n"); /* MR7 */ - gen("case NoSignal: break; /* MR7 */\n"); /* MR7 */ - }; /* MR7 */ - { - ListNode *q; - for (q = eg->handlers->next; q!=NULL; q=q->next) - { - ExceptionHandler *eh = (ExceptionHandler *)q->elem; - if ( strcmp("default", eh->signalname)==0 ) { - gen("default :\n"); - tabs++; - dumpAction(eh->action, output, tabs, -1, 1, 1); - gen("_signal=NoSignal; /* MR7 */\n"); /* MR7 */ - gen("break; /* MR7 */\n"); /* MR7 */ - tabs--; - gen("}\n"); - - /* copied from later code in dumpException */ /* MR7 */ - - if (namedHandler) { /* MR7 */ - gen("if (_signal != NoSignal)"); /* MR7 */ - _gen1(" goto %s_handler; /* MR7 */\n",outerLabel);/* MR7 */ - } else if (altHandler) { /* MR7 */ - gen1("goto %s_handler; /* MR7 */\n",outerLabel); /* MR7 */ - }; - return; - } - gen1("case %s :\n", eh->signalname); - tabs++; - if ( eh->action != NULL ) - { - dumpAction(eh->action, output, tabs, -1, 1, 1); - gen("break; /* MR7 */\n"); /* MR7 */ - } - tabs--; - } - } - if ( no_default_case ) return; - - gen("default :\n"); - tabs++; /* MR7 */ - gen("break; /* MR7 */\n"); /* MR7 */ - tabs--; /* MR7 */ - - tabs++; -/***** gen("*_retsignal = _signal;\n"); *****/ - - tabs--; - gen("}\n"); - - if (namedHandler) { /* MR7 */ - gen("if (_signal != NoSignal)"); /* MR7 */ - _gen1(" goto %s_handler; /* MR7 */\n",outerLabel); /* MR7 */ - } else if (altHandler) { /* MR7 */ - gen1("goto %s_handler; /* MR7 */\n",outerLabel); /* MR7 */ - }; - -} - -static void -#ifdef __USE_PROTOS -dumpExceptions(ListNode *list) -#else -dumpExceptions(list) -ListNode *list; -#endif -{ - ListNode *p; - - for (p = list->next; p!=NULL; p=p->next) - { - ExceptionGroup *eg = (ExceptionGroup *) p->elem; - _gen2("%s%s_handler:\n", - eg->label==NULL?"":eg->label, - eg->altID==NULL?"":eg->altID); - if ( eg->altID!=NULL ) dumpException(eg, 0); - else { - /* This must be the rule exception handler */ - dumpException(eg, 1); - if ( !hasDefaultException(eg) ) - { - gen("default :\n"); - tabs++; - gen("zzdflthandlers(_signal,_retsignal);\n"); - tabs--; - gen("}\n"); - } - } - } -} - -/* For each element label that is found in a rule, generate a unique - * Attribute (and AST pointer if GenAST) variable. - */ -void -#ifdef __USE_PROTOS -genElementLabels(ListNode *list) -#else -genElementLabels(list) -ListNode *list; -#endif -{ - int first=1; - ListNode *p; - - if ( GenCC ) {gen("ANTLRTokenPtr");} - else {gen("Attrib");} - for (p = list->next; p!=NULL; p=p->next) - { - char *ep = (char *)p->elem; - if ( first ) first = 0; - else _gen(","); - if ( GenCC ) {_gen1(" %s=NULL",ep);} - else {_gen1(" %s",ep);} - } - _gen(";\n"); - - if ( !GenAST ) return; - - first = 1; - gen("AST"); - for (p = list->next; p!=NULL; p=p->next) - { - char *ep = (char *)p->elem; - if ( first ) first = 0; - else _gen(","); - _gen1(" *%s_ast=NULL",ep); - } - _gen(";\n"); -} - -/* - * Generate a local variable allocation for each token or rule reference - * in this block. - */ -static void -#ifdef __USE_PROTOS -genASTPointers( Junction *q ) -#else -genASTPointers( q ) -Junction *q; -#endif -{ - int first=1, t; - set a; - - a = set_or(q->tokrefs, q->rulerefs); - if ( set_deg(a) > 0 ) - { - gen("AST "); - for (; !set_nil(a); set_rm(t, a)) - { - t = set_int(a); - if ( first ) first = 0; - else _gen(","); - _gen2("*_ast%d%d=NULL", BlkLevel, t); - } - set_free(a); - } - _gen(";\n"); -} - -static void -#ifdef __USE_PROTOS -BLOCK_Head( void ) -#else -BLOCK_Head( ) -#endif -{ - gen("{\n"); - tabs++; - if ( !GenCC ) gen1("zzBLOCK(zztasp%d);\n", BlkLevel); -} - -static void -#ifdef __USE_PROTOS -BLOCK_Tail( void ) -#else -BLOCK_Tail( ) -#endif -{ - if ( !GenCC ) gen1("zzEXIT(zztasp%d);\n", BlkLevel); - if ( !GenCC ) gen("}\n"); - tabs--; - gen("}\n"); -} - -static void -#ifdef __USE_PROTOS -BLOCK_Preamble( Junction *q ) -#else -BLOCK_Preamble( q ) -Junction *q; -#endif -{ - ActionNode *a; - Junction *begin; - - BLOCK_Head(); - if ( GenCC ) genTokenPointers(q); - if ( GenCC&&GenAST ) genASTPointers(q); - if ( q->jtype == aPlusBlk ) gen("int zzcnt=1;\n"); - if ( q->parm != NULL && !q->predparm ) gen1("zzaPush(%s);\n", q->parm) - else if ( !GenCC ) gen("zzMake0;\n"); - if ( !GenCC ) gen("{\n"); - if ( q->jtype == aLoopBegin ) begin = (Junction *) ((Junction *)q->p1); - else begin = q; - if ( has_guess_block_as_first_item(begin) ) - { - gen("zzGUESS_BLOCK\n"); - } - if ( q->jtype == aLoopBegin ) - a = findImmedAction( ((Junction *)q->p1)->p1 ); /* look at aLoopBlk */ - else - a = findImmedAction( q->p1 ); - if ( a!=NULL && !a->is_predicate) { -/* MR21 */ if (!a->noHoist) dumpActionPlus(a, a->action, output, tabs, a->file, a->line, 1); - a->done = 1; /* remove action. We have already handled it */ - } -} - -void -#ifdef __USE_PROTOS -genCombinedPredTreeContextOrig( Predicate *p ) -#else -genCombinedPredTreeContextOrig( p ) -Predicate *p; -#endif -{ - static set *ctx=NULL; /* genExprSets() is destructive, make copy*/ - require(p!=NULL, "can't make context tree for NULL pred tree"); - -#ifdef DBG_PRED - fprintf(stderr, "enter genCombinedPredTreeContextOrig(%s,0x%x) with sets:\n", p->expr, p); - s_fprT(stderr, p->scontext[1]); - fprintf(stderr, "\n"); -#endif - if ( p->down == NULL ) - { -/*** if ( p->k>1 && p->tcontext!=NULL ) ***/ - if ( p->tcontext!=NULL ) - { - _gen("("); - genExprTree(p->tcontext, 1); - _gen(")"); - } -/*** else if ( p->k==1 && set_deg(p->scontext[1])>0 ) ***/ - else if ( set_deg(p->scontext[1])>0 ) - { - if ( ctx==NULL ) ctx = (set *)calloc(CLL_k+1, sizeof(set)); - require(ctx!=NULL, "ctx cannot allocate"); - ctx[0]=empty; - ctx[1]=set_dup(p->scontext[1]); - _gen("("); - genExprSets(&(ctx[0]), p->k); - _gen(")"); - set_free(ctx[1]); - } - else if ( p->expr==PRED_AND_LIST || p->expr==PRED_OR_LIST ) { - fatal_internal("pred tree is orphan OR or AND list"); - } - else { - if (! HoistPredicateContext) { - _gen(" 1 /* no context: prc is off */ "); - } else { - fatal_internal("pred tree context is empty"); - }; - } - return; - } - -/* MR10 - make AND just like OR */ - - if ( p->expr == PRED_AND_LIST ) - { - Predicate *list = p->down; - for (; list!=NULL; list=list->right) - { - genCombinedPredTreeContextOrig(list); - if ( list->right!=NULL ) _gen("|| /* MR10 was wrong */ "); - }; - return; - } - - if ( p->expr == PRED_OR_LIST ) - { - Predicate *list = p->down; - for (; list!=NULL; list=list->right) - { - genCombinedPredTreeContextOrig(list); - if ( list->right!=NULL ) _gen("||"); - }; - return; - }; - - fatal("pred tree is really wacked"); -} - -/* [genCombinedPredTreeContext] */ - -void -#ifdef __USE_PROTOS -genCombinedPredTreeContext( Predicate *p ) -#else -genCombinedPredTreeContext( p ) -Predicate *p; -#endif -{ - Tree *t; - int predDepth=0; - - if (0 && ! MR_usingPredNames && ! MRhoisting) { - genCombinedPredTreeContextOrig(p); - } else { -/* MR13 */ MR_pred_depth(p,&predDepth); -/* MR13 */ if (predDepth == 1) { -/* MR13 */ -/* MR13 */ set scontext[2]; -/* MR13 */ scontext[0]=empty; -/* MR13 */ scontext[1]=MR_compute_pred_set(p); -/* MR13 */ if (set_nil(scontext[1])) { -/* MR13 */ _gen(" 1 /* MR12 no context (-prc off) */ "); -/* MR13 */ } else { -/* MR13 */ _gen("("); -/* MR13 */ genExprSets(&scontext[0], 1); -/* MR13 */ set_free(scontext[1]); -/* MR13 */ _gen(")"); -/* MR13 */ }; - - } else { - t=MR_compute_pred_tree_context(p); - if (t == NULL) { - _gen(" 1 /* MR12 no context (-prc off) */ "); - } else { - _gen("("); - genExprTree(t, 1); - Tfree(t); /* MR10 */ - _gen(")"); - }; - }; - }; -} - -/* [genPredTreeGate] */ - -void -#ifdef __USE_PROTOS -genPredTreeGate( Predicate *p, int in_and_expr ) -#else -genPredTreeGate( p, in_and_expr ) -Predicate *p; -int in_and_expr; -#endif -{ - if ( in_and_expr ) - { - _gen("!("); - genCombinedPredTreeContext(p); - _gen(")||"); - if ( p->down!=NULL ) _gen("\n"); - } - else - { - _gen("("); - genCombinedPredTreeContext(p); - _gen(")&&"); - if ( p->down!=NULL ) _gen("\n"); - } -} - -#ifdef __USE_PROTOS -void genPredEntry(Predicate *p,int outer) -#else -void genPredEntry(p,outer) - Predicate *p; - int outer; -#endif -{ - int inverted=0; - Predicate *q; - int localOuter=outer; - int needRP=0; - - if (p == NULL) return; - - if (p->predEntry != NULL && p->predEntry->predLiteral != NULL) { - if (p->inverted != p->predEntry->pred->inverted) { - _gen("! /* inverted pred */ ("); - needRP=1; - } else { - if (!localOuter) _gen("("); - needRP=1; - }; - dumpAction(p->predEntry->predLiteral,output,0,p->source->file,p->source->line,0); - if (needRP) _gen(")"); - return; - }; - - inverted=p->inverted; - - if (inverted) { - _gen(" ! /* inverted pred */ ("); - localOuter=1; - }; - - if (p->expr == PRED_OR_LIST) { - if (!localOuter) _gen("("); - for (q=p->down; q != NULL ; q=q->right) { - genPredEntry(q,0); - if (q->right != NULL) _gen(" || "); - }; - if (!localOuter) _gen(")"); - } else if (p->expr == PRED_AND_LIST) { - if (!localOuter) _gen("("); - for (q=p->down; q != NULL ; q=q->right) { - genPredEntry(q,0); - if (q->right != NULL) _gen(" && "); - }; - if (!localOuter) _gen(")"); - } else { - if (!localOuter) _gen("("); - require (p->source != NULL,"predEntry->source == NULL"); - require (p->source->inverted == 0,"dumpPredEntry p->source->inverted != 0"); - dumpAction(p->source->action,output,0,p->source->file,p->source->line,0); - if (!localOuter) _gen(")"); - }; - - if (inverted) { - _gen(")"); - } -} - -void -#ifdef __USE_PROTOS -dumpPredAction(ActionNode *anode, - char *s,FILE *output,int tabs,int file,int line,int final_newline) -#else -dumpPredAction(anode, - s,output,tabs,file,line,final_newline) - - ActionNode *anode; - char *s; - FILE *output; - int tabs; - int file; - int line; - int final_newline; -#endif -{ - PredEntry *predEntry=anode->predEntry; - int inverted=anode->inverted; - Predicate *workPred; - - if (predEntry == NULL) { - - /* inline predicate literal */ - - require(inverted == 0,"dumpPredAction action->inverted"); - dumpAction(s,output,tabs,file,line,final_newline); - - } else { - - /* a reference to a predicate - possibly with an inverted source */ - - if (predEntry->predLiteral != NULL) { - if (inverted) _gen("! /* inverted pred */ ("); - dumpAction(predEntry->predLiteral,output,0,anode->file,anode->line,0); - if (inverted) _gen(")"); - } else { - workPred=predicate_dup(predEntry->pred); - if (inverted) workPred->inverted=!workPred->inverted; - genPredEntry(workPred,1); - predicate_free(workPred); - }; - }; -} - -/* [genPred] */ - -void -#ifdef __USE_PROTOS -genPred(Predicate *p, Node *j,int suppress_sva) -#else -genPred(p,j,suppress_sva) - Predicate *p; - Node *j; - int suppress_sva; -#endif -{ - if ( FoundException && !suppress_sva) {_gen("(_sva=(");} /* MR11 suppress_sva */ - else {_gen("(");} - if ( GenLineInfo && j->file != -1 ) _gen("\n"); - if (p->source != NULL && p->source->ampersandPred != NULL) { - if (p->source->ampersandPred->k == 1) { - - set ctx[2]; - - ctx[0]=empty; - ctx[1]=set_dup(p->source->ampersandPred->scontext[1]); - - _gen("("); - genExprSets(&(ctx[0]), p->k); - _gen(") && "); - set_free(ctx[1]); - } else { - _gen("( "); - genExprTree(p->source->ampersandPred->tcontext,1); - _gen(" ) && "); - }; - }; - - dumpPredAction((ActionNode *)p->source, - p->expr, output, 0, -1 /*indicates no line info*/, j->line, 0); - - if ( FoundException && !suppress_sva) /* MR11 suppress_sva */ - {_gen("),_sva)");} /* MR10 - get red of "meant ==" messages */ - else {_gen(")");} -} - -void -#ifdef __USE_PROTOS -MR_distinctORcontextOpt(Predicate *p,Node *j,int in_and_expr) -#else -MR_distinctORcontextOpt(p,j,in_and_expr) - Predicate *p; - Node *j; - int in_and_expr; -#endif -{ - Predicate *q; - - _gen(" /* MR10 Distinct OR context optimization */ \n"); - - if (in_and_expr) { - gen("zzpf=0,\n"); - for (q=p->down; q != NULL; q=q->right) { - gen("( "); - genCombinedPredTreeContext(q); - _gen(" && (zzpf=1, "); - genPred(q,j,0); - _gen(" )) ||\n"); - }; - gen("!zzpf)"); - } else { - require (0, - "MR_distinctORcontextOpt: can't get here when using MR_predSimplify"); -#if 0 -** for (q=p->down; q != NULL; q=q->right) { -** gen("( "); -** genCombinedPredTreeContext(q); -** _gen(" && "); -** genPred(q,j); -** if (q->right != NULL) { -** _gen(" ) ||\n"); -** }; -** }; -** gen(")"); -#endif - }; -} - -void -#ifdef __USE_PROTOS -genPredTreeOrig( Predicate *p, Node *j, int in_and_expr ) -#else -genPredTreeOrig( p, j, in_and_expr ) -Predicate *p; -Node *j; -int in_and_expr; -#endif -{ - -/* MR10 */ int allHaveContext=1; -/* MR10 */ int noneHaveContext=1; - -/* MR10 */ MR_predContextPresent(p,&allHaveContext,&noneHaveContext); - - if ( ! noneHaveContext ) /* MR10 context guards ignored when -prc off */ - { - _gen("("); - genPredTreeGate(p, in_and_expr); - } - - /* if leaf node, just gen predicate */ - - if ( p->down==NULL ) - { - genPred(p,j,0); - if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ - return; - } - - /* if AND list, do both preds (only two possible) */ - if ( p->expr == PRED_AND_LIST ) - { -#if 0 -** _gen("("); -** genPredTreeOrig(p->down, j, 1); -** _gen("&&"); -** genPredTreeOrig(p->down->right, j, 1); -** _gen(")"); -** if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ -** return; -#endif - /* MR11 - make it work with AND with more than two children - like OR */ - - Predicate *list; - _gen("("); - list = p->down; - for (; list!=NULL; list=list->right) - { - genPredTreeOrig(list, j, 1); - if ( list->right!=NULL ) _gen("&&"); - } - _gen(")"); - if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ - return; - }; - - if ( p->expr == PRED_OR_LIST ) - { - Predicate *list; - _gen("("); - list = p->down; - for (; list!=NULL; list=list->right) - { - genPredTreeOrig(list, j, 0); - if ( list->right!=NULL ) _gen("||"); - } - _gen(")"); - if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ - return; - } - - fatal_internal("genPredTreeOrig: predicate tree is wacked"); -} - -#if 0 -** Predicate member dummyPredDepth is no longer used in MR10 -** but we might need it again in the future -** -** if (MRhoisting) { -** if ( !noneHaveContext && -** ! in_and_expr && -** p->source != NULL && -** p->source->dummyPredicateDepth > 0 && -** p->down == NULL) { -** _gen("("); -** genCombinedPredTreeContext(p); -** _gen(" )\n"); -** return; -** }; -** }; -#endif - -/* [genPredTree] */ - -/* in_and_expr - - what to do if the context is wrong - what to do if the context is correct but the predicate is false - - remember: if the context is wrong it's the same as if the - predicate is true as far as enabling an alternative - - Consider (AND p q r) - - if in an ... && ... expression then you don't want - the entire predicate chain to fail just because the - context for one component is wrong: so return true - - Consider (OR p q r) - - if in an ... || ... expression then you don't want - the entire predicate chain to succeed just because - the context for one component is correct when the - corresponding test is false: so return false when - the context is correct but the test is false. -*/ - -void -#ifdef __USE_PROTOS -genPredTree( Predicate *p, Node *j, int in_and_expr, int suppress_sva ) -#else -genPredTree( p, j, in_and_expr, suppress_sva) - Predicate *p; - Node *j; - int in_and_expr; - int suppress_sva; -#endif -{ - - int allHaveContext=1; - int noneHaveContext=1; - Tree *groupTree; - Tree *oneTree; - Predicate *q; - int identicalORcontextOptimization=0; - int identicalANDcontextOptimization=0; - - if (0 && !MR_usingPredNames && !MRhoisting) { - genPredTreeOrig(p,j,in_and_expr); - return; - }; - - MR_predContextPresent(p,&allHaveContext,&noneHaveContext); - - if ( ! noneHaveContext ) { /* MR10 context guards ignored when -prc off */ - - _gen("("); - - /* MR10 optimize OR predicates which are all leaves */ - - if (p->expr == PRED_OR_LIST && MR_allPredLeaves(p->down)) { - groupTree=MR_compute_pred_tree_context(p); - for (q=p->down ; q != NULL ; q=q->right) { - oneTree=MR_compute_pred_tree_context(q); - if (! MR_tree_equ(groupTree,oneTree)) { - Tfree(oneTree); - break; - }; - Tfree(oneTree); - }; - Tfree(groupTree); - if (q == NULL) { - _gen("/* MR10 individual OR gates suppressed when all predicates are leaves"); - _gen(" with identical context */\n"); - genPredTreeGate(p,in_and_expr); /* use the parent's in_and_expr for this gate */ - identicalORcontextOptimization=1; - } else { - MR_distinctORcontextOpt(p,j,in_and_expr); - return; - }; - } else if (p->expr == PRED_AND_LIST && MR_allPredLeaves(p->down)) { - - /* MR12 optimize AND predicates which are all leaves */ - - groupTree=MR_compute_pred_tree_context(p); - for (q=p->down ; q != NULL ; q=q->right) { - oneTree=MR_compute_pred_tree_context(q); - if (! MR_tree_equ(groupTree,oneTree)) { - Tfree(oneTree); - break; - }; - Tfree(oneTree); - }; - Tfree(groupTree); - if (q == NULL) { - _gen("/* MR12 individual AND gates suppressed when all predicates are leaves"); - _gen(" with identical context */\n"); - genPredTreeGate(p,in_and_expr); /* use the parent's in_and_expr for this gate */ - identicalANDcontextOptimization=1; - } else { - genPredTreeGate(p, in_and_expr); - }; - } else { - genPredTreeGate(p, in_and_expr); - }; - } - - /* if leaf node, just gen predicate */ - - if ( p->down==NULL ) - { - genPred(p,j,suppress_sva); - if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ - return; - } - - /* if AND list, do both preds (only two possible) */ - /* MR10 not any more ! */ - - if ( p->expr == PRED_AND_LIST ) - { - Predicate *list; - _gen("("); - list = p->down; - for (; list != NULL; list=list->right) { - if (identicalANDcontextOptimization) { - genPred(list, j,suppress_sva); - } else { - genPredTree(list, j, 1, suppress_sva); /* in and context */ - }; - if ( list->right!=NULL ) _gen("&&"); - }; - _gen(")"); - if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ - return; - } - - if ( p->expr == PRED_OR_LIST ) - { - Predicate *list; - _gen("("); - list = p->down; - for (; list!=NULL; list=list->right) - { - if (identicalORcontextOptimization) { - genPred(list, j,suppress_sva); - } else { - genPredTree(list, j, 0, suppress_sva); - }; - if ( list->right!=NULL ) _gen("||"); - } - _gen(")"); - if ( ! noneHaveContext ) _gen(")"); /* MR10 context guards ignored when -prc off */ - return; - } - - fatal_internal("predicate tree is wacked"); -} - -/* [genPredTreeMainXX] */ - -Predicate * /* MR10 */ -#ifdef __USE_PROTOS -genPredTreeMainXX( Predicate *p, Node *j ,int in_and_expr) -#else -genPredTreeMainXX( p, j ,in_and_expr) - Predicate *p; - Node *j; - int in_and_expr; -#endif -{ - - int allHaveContext=1; - int noneHaveContext=1; - -#if 0 - fprintf(stderr,"Pred before\n"); - dumppred(p); - fprintf(stderr,"\n"); - fprintf(stderr,"Pred after\n"); - dumppred(p); - fprintf(stderr,"\n"); -#endif - - p=MR_predSimplifyALL(p); /* MR10 */ - - require (MR_predicate_context_completed(p),"predicate context is not complete"); - - MR_cleanup_pred_trees(p); /* MR10 */ - - MR_predContextPresent(p,&allHaveContext,&noneHaveContext); - if (!noneHaveContext & !allHaveContext) { - warnFL("predicate contains elements both with and without context", - FileStr[j->file],j->line); - }; - - if (InfoP) { - _gen("\n#if 0\n\n"); - MR_dumpPred(p,1); - _gen("#endif\n"); - }; - genPredTree(p,j,in_and_expr,0); - return p; -} - -Predicate * /* MR10 */ -#ifdef __USE_PROTOS -genPredTreeMain( Predicate *p, Node *j) -#else -genPredTreeMain( p, j) - Predicate *p; - Node *j; -#endif -{ - return genPredTreeMainXX(p,j,1); -} - -static void -#ifdef __USE_PROTOS -genExprTreeOriginal( Tree *t, int k ) -#else -genExprTreeOriginal( t, k ) -Tree *t; -int k; -#endif -{ - require(t!=NULL, "genExprTreeOriginal: NULL tree"); - - if ( t->token == ALT ) - { - _gen("("); genExprTreeOriginal(t->down, k); _gen(")"); - if ( t->right!=NULL ) - { - _gen("||"); - on1line++; - if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); } - _gen("("); genExprTreeOriginal(t->right, k); _gen(")"); - } - return; - } - if ( t->down!=NULL ) _gen("("); - _gen1("LA(%d)==",k); - if ( TokenString(t->token) == NULL ) _gen1("%d", t->token) - else _gen1("%s", TokenString(t->token)); - if ( t->down!=NULL ) - { - _gen("&&"); - on1line++; - if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); } - _gen("("); genExprTreeOriginal(t->down, k+1); _gen(")"); - } - if ( t->down!=NULL ) _gen(")"); - if ( t->right!=NULL ) - { - _gen("||"); - on1line++; - if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); } - _gen("("); genExprTreeOriginal(t->right, k); _gen(")"); - } -} - -#ifdef __USE_PROTOS -static void MR_LAtokenString(int k,int token) -#else -static void MR_LAtokenString(k,token) - int k; - int token; -#endif -{ - char *ts; - - ts=TokenString(token); - if (ts == NULL) { - _gen2(" LA(%d)==%d",k,token); - } else { - _gen2(" LA(%d)==%s",k,ts); - }; -} - - -#ifdef __USE_PROTOS -static int MR_countLeaves(Tree *t) -#else -static int MR_countLeaves(t) - Tree *t; -#endif -{ - if (t == NULL) return 0; - if (t->token == ALT) { - return MR_countLeaves(t->down)+MR_countLeaves(t->right); - } else { - return 1+MR_countLeaves(t->down)+MR_countLeaves(t->right); - }; -} - -#ifdef __USE_PROTOS -static void MR_genOneLine(Tree *tree,int k) -#else -static void MR_genOneLine(tree,k) - Tree *tree; - int k; -#endif -{ - if (tree == NULL) return; - if (tree->token == ALT) { - MR_genOneLine(tree->down,k); - } else { - MR_LAtokenString(k,tree->token); - if (tree->down != NULL && - tree->down->right == NULL) { - _gen(" &&"); - MR_genOneLine(tree->down,k+1); - } else if (tree->down != NULL) { - _gen(" && ("); - MR_genOneLine(tree->down,k+1); - _gen(")"); - }; - }; - if (tree->right != NULL) { - _gen(" ||"); - MR_genOneLine(tree->right,k); - }; -} - -static int across; -static int depth; -static int lastkonline; - -#ifdef __USE_PROTOS -static void MR_genMultiLine(Tree *tree,int k) -#else -static void MR_genMultiLine(tree,k) - Tree *tree; - int k; -#endif -{ - int i; - - if (tree == NULL) return; - if (tree->token == ALT) { - MR_genMultiLine(tree,k); - } else { - MR_LAtokenString(k,tree->token); - lastkonline=k; - across++; - if (tree->down != NULL && tree->down->right == NULL) { - if (across > 3) { - _gen("\n"); - across=0; - lastkonline=0; - for (i=0 ; i < depth+k ; i++) _gen(" "); - _gen("&&"); - } else { - _gen(" &&"); - }; - MR_genMultiLine(tree->down,k+1); - } else if (tree->down != NULL) { - _gen("\n"); - lastkonline=0; - across=0; - for (i=0 ; i < depth+k ; i++) _gen(" "); - _gen("&& ("); - MR_genMultiLine(tree->down,k+1); - _gen(")"); - }; - }; - if (tree->right != NULL) { - if (k < lastkonline) { - _gen("\n"); - across=0; - lastkonline=0; - for (i=0; i < depth+k-1 ; i++) _gen(" "); - _gen("||"); - } else if (across > 3 ) { - _gen("\n"); - across=0; - lastkonline=0; - for (i=0; i < depth+k ; i++) _gen(" "); - _gen("||"); - } else { - _gen(" ||"); - }; - MR_genMultiLine(tree->right,k); - }; -} - -#ifdef __USE_PROTOS -static void genExprTree(Tree *tree,int k) -#else -static void genExprTree(tree,k) - Tree *tree; - int k; -#endif -{ - int count; - -#if 0 - /* MR20 THM This was probably an error. - The routine should probably reference that static - "across" and this declaration hides it. - */ - - int across; -#endif - - require (tree != NULL,"genExprTree: tree is NULL"); - require (k > 0,"genExprTree: k <= 0"); - - if (0 && !MRhoisting) { /* MR11 make new version standard */ - genExprTreeOriginal(tree,k); - } else { - count=MR_countLeaves(tree); - if (count < 5) { - MR_genOneLine(tree,k); - } else { - _gen("\n"); - across=0; - depth=0; - lastkonline=0; - MR_genMultiLine(tree,k); - _gen("\n"); - }; - }; -} - - -/* - * Generate LL(k) type expressions of the form: - * - * (LA(1) == T1 || LA(1) == T2 || ... || LA(1) == Tn) && - * (LA(2) == T1 || LA(2) == T2 || ... || LA(2) == Tn) && - * ..... - * (LA(k) == T1 || LA(k) == T2 || ... || LA(k) == Tn) - * - * If GenExprSetsOpt generate: - * - * (setwdi[LA(1)]&(1<= 1. - * - * This routine is visible only to this file and cannot answer a TRANS message. - * - */ - -/* [genExpr] */ - -static int -#ifdef __USE_PROTOS -genExpr( Junction *j ) -#else -genExpr( j ) -Junction *j; -#endif -{ - int max_k; - - /* if full LL(k) is sufficient, then don't use approximate (-ck) lookahead - * from CLL_k..LL_k - */ - { - int limit; - if ( j->ftree!=NULL ) limit = LL_k; - else limit = CLL_k; - max_k = genExprSets(j->fset, limit); - } - - /* Do tests for real tuples from other productions that conflict with - * artificial tuples generated by compression (using sets of tokens - * rather than k-trees). - */ - if ( j->ftree != NULL ) - { - _gen(" && !("); genExprTree(j->ftree, 1); _gen(")"); - } - - if ( ParseWithPredicates && j->predicate!=NULL ) - { - Predicate *p = j->predicate; - warn_about_using_gk_option(); - _gen("&&"); - j->predicate=genPredTreeMain(p, (Node *)j); /* MR10 */ - } - - return max_k; -} - -static int -#ifdef __USE_PROTOS -genExprSets( set *fset, int limit ) -#else -genExprSets( fset, limit ) -set *fset; -int limit; -#endif -{ - int k = 1; - int max_k = 0; - unsigned *e, *g, firstTime=1; - - if (set_nil(fset[1])) { - _gen(" 0 /* MR13 empty set expression - undefined rule ? infinite left recursion ? */ "); - MR_BadExprSets++; - }; - - if ( GenExprSetsOpt ) - { - while ( k <= limit && !set_nil(fset[k]) ) /* MR11 */ - { - if ( set_deg(fset[k])==1 ) /* too simple for a set? */ - { - int e; - _gen1("(LA(%d)==",k); - e = set_int(fset[k]); - if ( TokenString(e) == NULL ) _gen1("%d)", e) - else _gen1("%s)", TokenString(e)); - } - else - { - NewSet(); - FillSet( fset[k] ); - _gen3("(setwd%d[LA(%d)]&0x%x)", wordnum, k, 1<max_k ) max_k = k; - if ( k == CLL_k ) break; - k++; - if ( k<=limit && !set_nil(fset[k]) ) _gen(" && "); /* MR11 */ - on1line++; - if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); } - } - return max_k; - } - - while ( k<= limit && !set_nil(fset[k]) ) /* MR11 */ - { - if ( (e=g=set_pdq(fset[k])) == NULL ) fatal_internal("genExpr: cannot allocate IF expr pdq set"); - for (; *e!=nil; e++) - { - if ( !firstTime ) _gen(" || ") else { _gen("("); firstTime = 0; } - on1line++; - if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); } - _gen1("LA(%d)==",k); - if ( TokenString(*e) == NULL ) _gen1("%d", *e) - else _gen1("%s", TokenString(*e)); - } - free( (char *)g ); - _gen(")"); - if ( k>max_k ) max_k = k; - if ( k == CLL_k ) break; - k++; - if ( k <= limit && !set_nil(fset[k]) ) { firstTime=1; _gen(" && "); } /* MR11 */ - on1line++; - if ( on1line > NumExprPerLine ) { on1line=0; _gen("\n"); } - } - return max_k; -} - -/* - * Generate code for any type of block. If the last alternative in the block is - * empty (not even an action) don't bother doing it. This permits us to handle - * optional and loop blocks as well. - * - * Only do this block, return after completing the block. - * This routine is visible only to this file and cannot answer a TRANS message. - */ -static set -#ifdef __USE_PROTOS -genBlk( Junction *q, int jtype, int *max_k, int *need_right_curly, int * lastAltEmpty /* MR23 */) -#else -genBlk( q, jtype, max_k, need_right_curly, lastAltEmpty /* MR23 */) -Junction *q; -int jtype; -int *max_k; -int *need_right_curly; -int *lastAltEmpty; /* MR23 */ -#endif -{ - set f; - Junction *alt; - int a_guess_in_block = 0; - require(q!=NULL, "genBlk: invalid node"); - require(q->ntype == nJunction, "genBlk: not junction"); - *need_right_curly=0; - *lastAltEmpty = 0; /* MR23 */ - if ( q->p2 == NULL ) /* only one alternative? Then don't need if */ - { - if (first_item_is_guess_block((Junction *)q->p1)!=NULL ) - { - if (jtype != aLoopBlk && jtype != aOptBlk && jtype != aPlusBlk) { - warnFL("(...)? as only alternative of block is unnecessary", FileStr[q->file], q->line); - }; - gen("zzGUESS\n"); /* guess anyway to make output code consistent */ -/* MR10 disable */ /**** gen("if ( !zzrv )\n"); ****/ -/* MR10 */ gen("if ( !zzrv ) {\n"); tabs++; (*need_right_curly)++; - }; - TRANS(q->p1); - return empty; /* no decision to be made-->no error set */ - } - - f = First(q, 1, jtype, max_k); - for (alt=q; alt != NULL; alt= (Junction *) alt->p2 ) - { - if ( alt->p2 == NULL ) /* chk for empty alt */ - { - Node *p = alt->p1; - if ( p->ntype == nJunction ) - { - /* we have empty alt */ -/* MR23 - There is a conflict between giving good error information for non-exceptions - and making life easy for those using parser exception handling. Consider: - - r: { A } b; - b: B; - - with input "C" - - Before MR21 the error message would be "expecting B - found C". After MR21 - the error message would be "expcect A, B - found C". This was good, but it - caused problems for those using parser exceptions because the reference to - B was generated inside the {...} where B really wasn't part of the block. - - In MR23 this has been changed for the case where exceptions are in use to - not generate the extra check in the tail of the {A} block. -*/ - - -/* MR23 */ if (isEmptyAlt( ((Junction *)p)->p1, (Node *)q->end)) { -/* MR23 */ *lastAltEmpty = 1; -/* MR23 */ if (FoundException) { -/* MR23 */ /* code to restore state if a prev alt didn't follow guess */ -/* MR23 */ if ( a_guess_in_block && jtype != aPlusBlk) { -/* MR23 */ gen("if ( !zzrv ) zzGUESS_DONE; /* MR28 */\n"); -/* MR23 */ } -/* MR23 */ break; -/* MR23 */ }; -/* MR28 */ if (jtype == aPlusBlk) { -/* MR28 */ break; -/* MR28 */ } -/* MR23 */ } - } - } /* end of for loop on alt */ - -/* MR10 */ if (alt->p2 == NULL && -/* MR10 */ ( q->jtype == aSubBlk || q->jtype == RuleBlk) ) { -/* MR10 */ if (first_item_is_guess_block(alt)) { -/* MR10 */ warnFL("(...)? as last alternative of block is unnecessary", -/* MR10 */ FileStr[alt->file],alt->line); -/* MR10 */ }; -/* MR10 */ }; - - if ( alt != q ) gen("else ") - else - { - if ( DemandLookahead ) { - if ( !GenCC ) {gen1("LOOK(%d);\n", *max_k);} - else gen1("look(%d);\n", *max_k); - } - } - - if ( alt!=q ) - { - _gen("{\n"); - tabs++; - (*need_right_curly)++; - /* code to restore state if a prev alt didn't follow guess */ - if ( a_guess_in_block ) - gen("if ( !zzrv ) zzGUESS_DONE;\n"); - } - if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL ) - { - a_guess_in_block = 1; - gen("zzGUESS\n"); - } - gen("if ( "); - if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL ) _gen("!zzrv && "); - genExpr(alt); - _gen(" ) "); - _gen("{\n"); - tabs++; - TRANS(alt->p1); - --tabs; - gen("}\n"); -/* MR10 */ if (alt->p2 == NULL) { -/* MR10 */ if (first_item_is_guess_block(alt)) { -/* MR10 */ gen("/* MR10 */ else {\n"); -/* MR10 */ tabs++; -/* MR10 */ (*need_right_curly)++; -/* MR10 */ /* code to restore state if a prev alt didn't follow guess */ -/* MR10 */ gen("/* MR10 */ if ( !zzrv ) zzGUESS_DONE;\n"); -/* MR10 */ gen("/* MR10 */ if (0) {} /* last alternative of block is guess block */\n"); -/* MR10 */ }; -/* MR10 */ }; - } - return f; -} - -static int -#ifdef __USE_PROTOS -has_guess_block_as_first_item( Junction *q ) -#else -has_guess_block_as_first_item( q ) -Junction *q; -#endif -{ - Junction *alt; - - for (alt=q; alt != NULL; alt= (Junction *) alt->p2 ) - { - if ( first_item_is_guess_block((Junction *)alt->p1)!=NULL ) return 1; - } - return 0; -} - -static int -#ifdef __USE_PROTOS -has_guess_block_as_last_item( Junction *q ) -#else -has_guess_block_as_last_item( q ) -Junction *q; -#endif -{ - Junction *alt; - - if (q == NULL) return 0; - for (alt=q; alt->p2 != NULL && !( (Junction *) alt->p2)->ignore; alt= (Junction *) alt->p2 ) {}; - return first_item_is_guess_block( (Junction *) alt->p1) != NULL; -} - -/* MR30 See description of first_item_is_guess_block for background */ - -Junction * -#ifdef __USE_PROTOS -first_item_is_guess_block_extra(Junction *q ) -#else -first_item_is_guess_block_extra(q) -Junction *q; -#endif -{ - while ( q!=NULL && - ( ( q->ntype==nAction ) || - ( q->ntype==nJunction && - (q->jtype==Generic || q->jtype == aLoopBlk) - ) - ) - ) - { - if ( q->ntype==nJunction ) q = (Junction *)q->p1; - else q = (Junction *) ((ActionNode *)q)->next; - } - - if ( q==NULL ) return NULL; - if ( q->ntype!=nJunction ) return NULL; - if ( q->jtype!=aSubBlk ) return NULL; - if ( !q->guess ) return NULL; - - return q; -} - -/* return NULL if 1st item of alt is NOT (...)? block; else return ptr to aSubBlk node - * of (...)?; This function ignores actions and predicates. - */ - -Junction * -#ifdef __USE_PROTOS -first_item_is_guess_block( Junction *q ) -#else -first_item_is_guess_block( q ) -Junction *q; -#endif -{ - Junction * qOriginal = q; /* DEBUG */ - - /* MR14 Couldn't find aSubBlock which was a guess block when it lay - behind aLoopBlk. The aLoopBlk only appear in conjunction with - aLoopBegin, but the routine didn't know that. I think. - - MR14a Added extra parentheses to clarify precedence - - MR30 This appears to have been a mistake. The First set was then - computed incorrectly for: - - r : ( (A)? B - | C - )* - - The routine analysis_point was seeing the guess block when - it was still analyzing the loopBegin block. As a consequence, - when it looked for the analysis_point it was processing the B, but - skipping over the C alternative altogether because it thought - it was looking at a guess block, not realizing there was a loop - block in front of the loopBegin. - - loopBegin loopBlk subBlk/guess A G EB G B EB EB EB ER - | | | ^ ^ - | | | | - | +-> G C G ----------------------+ | - | | - +--- G G G -------------------------------------+ - - Reported by Arpad Beszedes (beszedes@inf.u-szeged.hu). - - MR30 This is still more complicated. This fix caused ambiguity messages - to be reported for "( (A B)? )* A B" but not for "( (A B)? )+". Why is - there a difference when these are outwardly identical ? It is because the - start of a (...)* block is represented by two nodes: a loopBegin block - followed by a loopBlock whereas the start of a (...)+ block is - represented as a single node: a plusBlock. So if first_item_is_guess_block - is called when the current node is a loopBegin it starts with the - loop block rather than the the sub block which follows the loop block. - However, we can't just skip past the loop block because some routines - depend on the old implementation. So, we provide a new implementation - which does skip the loopBlock. However, which should be called when ? - I'm not sure, but my guess is that first_item_is_guess_block_extra (the - new one) should only be called for the ambiguity routines. - - */ - - while ( q!=NULL && - ( ( q->ntype==nAction ) || - ( q->ntype==nJunction && - (q->jtype==Generic /*** || q->jtype == aLoopBlk ***/ ) /*** MR30 Undo MR14 change ***/ - ) - ) - ) - { - if ( q->ntype==nJunction ) q = (Junction *)q->p1; - else q = (Junction *) ((ActionNode *)q)->next; - } - - if ( q==NULL ) return NULL; - if ( q->ntype!=nJunction ) return NULL; - if ( q->jtype!=aSubBlk ) return NULL; - if ( !q->guess ) return NULL; - - return q; -} - -/* MR1 */ -/* MR1 10-Apr-97 MR1 Routine to stringize failed semantic predicates msgs */ -/* MR1 */ - -#define STRINGIZEBUFSIZE 1024 - -static char stringizeBuf[STRINGIZEBUFSIZE]; -char * -#ifdef __USE_PROTOS -stringize(char * s) -#else -stringize(s) -char *s; -#endif - -{ - char *p; - char *stop; - - p=stringizeBuf; - stop=&stringizeBuf[1015]; - - if (s != 0) { - while (*s != 0) { - if (p >= stop) { - goto stringizeStop; - } else if (*s == '\n') { - *p++='\\'; - *p++='n'; - *p++='\\'; - *p++=*s++; - } else if (*s == '\\') { - *p++=*s; - *p++=*s++; - } else if (*s == '\"') { - *p++='\\'; - *p++=*s++; - while (*s != 0) { - if (p >= stop) { - goto stringizeStop; - } else if (*s == '\n') { - *p++='\\'; - *p++=*s++; - } else if (*s == '\\') { - *p++=*s++; - *p++=*s++; - } else if (*s == '\"') { - *p++='\\'; - *p++=*s++; - break; - } else { - *p++=*s++; - }; - }; - } else if (*s == '\'') { - *p++=*s++; - while (*s != 0) { - if (p >= stop) { - goto stringizeStop; - } else if (*s == '\'') { - *p++=*s++; - break; - } else if (*s == '\\') { - *p++=*s++; - *p++=*s++; - } else if (*s == '\"') { - *p++='\\'; - *p++=*s++; - break; - } else { - *p++=*s++; - }; - }; - } else { - *p++=*s++; - }; - }; - }; - goto stringizeExit; -stringizeStop: - *p++='.'; - *p++='.'; - *p++='.'; -stringizeExit: - *p=0; - return stringizeBuf; -} - -#ifdef __USE_PROTOS -int isNullAction(char *s) -#else -int isNullAction(s) - char *s; -#endif -{ - char *p; - for (p=s; *p != '\0' ; p++) { - if (*p != ';' && *p !=' ') return 0; - }; - return 1; -} -/* MR1 */ -/* MR1 End of Routine to stringize code for failed predicates msgs */ -/* MR1 */ - -/* Generate an action. Don't if action is NULL which means that it was already - * handled as an init action. - */ -void -#ifdef __USE_PROTOS -genAction( ActionNode *p ) -#else -genAction( p ) -ActionNode *p; -#endif -{ - require(p!=NULL, "genAction: invalid node and/or rule"); - require(p->ntype==nAction, "genAction: not action"); - - if ( !p->done ) /* MR10 */ /* MR11 */ - { - if ( p->is_predicate) - { - if ( p->guardpred != NULL ) - { - Predicate *guardDup=predicate_dup(p->guardpred); /* MR10 */ - gen("if (!"); - guardDup=genPredTreeMain(guardDup, (Node *)p); - predicate_free(guardDup); - } -/* MR10 */ else if (p->ampersandPred != NULL) { -/* MR10 */ gen("if (!"); -/* MR10 */ p->ampersandPred=genPredTreeMain(p->ampersandPred, (Node *)p); -/* MR10 */ } - else - { - gen("if (!("); - /* make sure that '#line n' is on front of line */ - if ( GenLineInfo && p->file != -1 ) _gen("\n"); - dumpPredAction(p,p->action, output, 0, p->file, p->line, 0); - _gen(")"); - } - -/* MR23 Change failed predicate macro to have three arguments: - - macro arg 1: The stringized predicate itself - macro arg 2: 0 => no user-defined error action - 1 => user-defined error action - macro arg 3: The user-defined error action - - This gives the user more control of the error action. -*/ - tabs++; - gen3(") {zzfailed_pred(\"%s\",%s, { %s } );}\n", /* MR23 */ - stringize(p->action), /* MR23 */ - (p->pred_fail == NULL ? /* MR23/MR27 */ - "0 /* report */" : "1 /* user action */"), /* MR23/MR27 */ - (p->pred_fail == NULL ? /* MR23 */ - "0; /* no user action */" : p->pred_fail)); /* MR23 */ - tabs--; - } - else /* not a predicate */ - { - if (! isNullAction(p->action) && !p->noHoist) { - if ( FoundGuessBlk ) { - if ( GenCC ) { - gen("if ( !guessing ) {\n"); - } else { - gen("zzNON_GUESS_MODE {\n"); - }; - }; - dumpActionPlus(p, p->action, output, tabs, p->file, p->line, 1); /* MR21 */ - if ( FoundGuessBlk ) gen("}\n"); - }; - } - } - TRANS(p->next) -} - -/* - * if invoking rule has !noAST pass zzSTR to rule ref and zzlink it in - * else pass addr of temp root ptr (&_ast) (don't zzlink it in). - * - * if ! modifies rule-ref, then never link it in and never pass zzSTR. - * Always pass address of temp root ptr. - */ -void -#ifdef __USE_PROTOS -genRuleRef( RuleRefNode *p ) -#else -genRuleRef( p ) -RuleRefNode *p; -#endif -{ - Junction *q; - char *handler_id = ""; - RuleEntry *r, *r2; - char *parm = "", *exsig = ""; - - int genRuleRef_emittedGuessGuard=0; /* MR10 */ - - require(p!=NULL, "genRuleRef: invalid node and/or rule"); - require(p->ntype==nRuleRef, "genRuleRef: not rule reference"); - - if ( p->altstart!=NULL && p->altstart->exception_label!=NULL ) - handler_id = p->altstart->exception_label; - - r = (RuleEntry *) hash_get(Rname, p->text); - if ( r == NULL ) - { - warnFL( eMsg1("rule %s not defined", - p->text), FileStr[p->file], p->line ); - return; - } - -/* MR8 5-Aug-97 Reported by S.Bochnak@microtool.com.pl */ -/* Don't do assign when no return values declared */ -/* Move definition of q up and use it to guard p->assign */ - - q = RulePtr[r->rulenum]; /* find definition of ref'd rule */ /* MR8 */ - - r2 = (RuleEntry *) hash_get(Rname, p->rname); - if ( r2 == NULL ) {warnNoFL("Rule hash table is screwed up beyond belief"); return;} - - OutLineInfo(output,p->line,FileStr[p->file]); - - if ( GenCC && GenAST ) { - gen("_ast = NULL;\n"); - } - - if ( FoundGuessBlk && p->assign!=NULL && q->ret != NULL ) { /* MR8 */ - if ( GenCC ) { - gen("if ( !guessing ) {\n"); - } else { - gen("zzNON_GUESS_MODE {\n"); - }; - tabs++; /* MR11 */ - genRuleRef_emittedGuessGuard=1; /* MR11 */ - }; - - if ( FoundException ) exsig = "&_signal"; - - tab(); - if ( GenAST ) - { - if ( GenCC ) { -/**** if ( r2->noAST || p->astnode==ASTexclude ) -****/ - { -/**** _gen("_ast = NULL;\n"); -****/ - parm = "&_ast"; - } -/*** we always want to set just a pointer now, then set correct -pointer after - - else { - _gen("_astp = -(_tail==NULL)?(&_sibling):(&(_tail->_right));\n"); - parm = "_astp"; - } -****/ - } - else { - if ( r2->noAST || p->astnode==ASTexclude ) - { - _gen("_ast = NULL; "); - parm = "&_ast"; - } - else parm = "zzSTR"; - } - if ( p->assign!=NULL && q->ret!=NULL ) /* MR8 */ - { - if ( !hasMultipleOperands(p->assign) ) {_gen1("%s = ",p->assign);} /* MR23 */ - else _gen1("{ struct _rv%d _trv; _trv = ", r->rulenum); - } - if ( FoundException ) { - _gen5("%s%s(%s,&_signal%s%s); ", - RulePrefix, - p->text, - parm, - (p->parms!=NULL)?",":"", - (p->parms!=NULL)?p->parms:""); - if ( p->ex_group!=NULL ) { - _gen("\n"); - gen("if (_signal) {\n"); - tabs++; - dumpException(p->ex_group, 0); - tabs--; - gen("}"); - } - else { - _gen1("if (_signal) goto %s_handler;", handler_id); - } - } - else { - _gen5("%s%s(%s%s%s);", - RulePrefix, - p->text, - parm, - (p->parms!=NULL)?",":"", - (p->parms!=NULL)?p->parms:""); - } - if ( GenCC && (r2->noAST || p->astnode==ASTexclude) ) - { - /* rule has a ! or element does */ - /* still need to assign to #i so we can play with it */ - _gen("\n"); - gen2("_ast%d%d = (AST *)_ast;", BlkLevel-1, p->elnum); - } - else if ( !r2->noAST && p->astnode == ASTinclude ) - { - /* rule doesn't have a ! and neither does element */ -/* MR10 */ if (FoundGuessBlk && !genRuleRef_emittedGuessGuard) { -/* MR10 */ _gen("\n"); -/* MR10 */ if (GenCC) gen ("if (!guessing) { /* MR10 */") -/* MR10 */ else gen ("if (!zzguessing) { /* MR10 */\n"); -/* MR10 */ tabs++; -/* MR10 */ }; - if ( GenCC ) { - _gen("\n"); - gen("if ( _tail==NULL ) _sibling = _ast; else _tail->setRight(_ast);\n"); - gen2("_ast%d%d = (AST *)_ast;\n", BlkLevel-1, p->elnum); - tab(); - } - else _gen(" "); - if ( GenCC ) { - _gen("ASTBase::"); } - else _gen("zz"); - _gen("link(_root, &_sibling, &_tail);"); - -/* MR10 */ if (FoundGuessBlk && !genRuleRef_emittedGuessGuard) { /* MR10 */ -/* MR10 */ _gen("\n"); -/* MR10 */ tabs--; -/* MR10 */ if (GenCC) gen ("}; /* MR10 */") -/* MR10 */ else gen ("}; /* MR10 */"); -/* MR10 */ }; - } - } - else - { - if ( p->assign!=NULL && q->ret!=NULL ) /* MR8 */ - { - if ( !hasMultipleOperands(p->assign) ) {_gen1("%s = ",p->assign);} /* MR23 */ - else _gen1("{ struct _rv%d _trv; _trv = ", r->rulenum); - } - if ( FoundException ) { - _gen4("%s%s(&_signal%s%s); ", - RulePrefix, - p->text, - (p->parms!=NULL)?",":"", - (p->parms!=NULL)?p->parms:""); - if ( p->ex_group!=NULL ) { - _gen("\n"); - gen("if (_signal) {\n"); - tabs++; - dumpException(p->ex_group, 0); - tabs--; - gen("}"); - } - else { - _gen1("if (_signal) goto %s_handler;", handler_id); - } - } - else { - _gen3("%s%s(%s);", - RulePrefix, - p->text, - (p->parms!=NULL)?p->parms:""); - } - if ( p->assign!=NULL && q->ret!=NULL ) _gen("\n"); /* MR8 */ - } - - if ( p->assign!=NULL && q->ret!=NULL) { /* MR8 */ - if ( hasMultipleOperands(p->assign) ) /* MR23 */ - { - _gen("\n"); - dumpRetValAssign(p->assign, q->ret, p); /* MR30 */ - _gen("}"); - } - } - _gen("\n"); - - /* Handle element labels now */ - if ( p->el_label!=NULL ) - { - if ( GenAST ) - { - if ( GenCC ) { - gen3("%s_ast = _ast%d%d;\n", p->el_label, BlkLevel-1, p->elnum); - } - else {gen1("%s_ast = zzastCur;\n", p->el_label);} - } - else if (!GenCC ) { - gen1("%s = zzaCur;\n", p->el_label); - } - } - - if ( FoundGuessBlk && p->assign!=NULL && q->ret!=NULL ) { /* MR8 */ - /* in guessing mode, don't branch to handler upon error */ - tabs--; /* MR11 */ - gen("} else {\n"); - tabs++; /* MR11 */ - if ( FoundException ) { - gen6("%s%s(%s%s&_signal%s%s);\n", - RulePrefix, - p->text, - parm, - (*parm!='\0')?",":"", - (p->parms!=NULL)?",":"", - (p->parms!=NULL)?p->parms:""); - } - else { - gen5("%s%s(%s%s%s);\n", - RulePrefix, - p->text, - parm, - (p->parms!=NULL && *parm!='\0')?",":"", - (p->parms!=NULL)?p->parms:""); - } - tabs--; /* MR11 */ - gen("}\n"); - } - TRANS(p->next) -} - -/* - * Generate code to match a token. - * - * Getting the next token is tricky. We want to ensure that any action - * following a token is executed before the next GetToken(); - */ -void -#ifdef __USE_PROTOS -genToken( TokNode *p ) -#else -genToken( p ) -TokNode *p; -#endif -{ - RuleEntry *r; - char *handler_id = ""; - ActionNode *a; - char *set_name; - char *set_nameErrSet; - int complement; - int ast_label_in_action = 0; /* MR27 */ - int pushedCmodeAST = 0; /* MR27 */ - - require(p!=NULL, "genToken: invalid node and/or rule"); - require(p->ntype==nToken, "genToken: not token"); - if ( p->altstart!=NULL && p->altstart->exception_label!=NULL ) - handler_id = p->altstart->exception_label; - - r = (RuleEntry *) hash_get(Rname, p->rname); - if ( r == NULL ) {warnNoFL("Rule hash table is screwed up beyond belief"); return;} - -/* - * MR27 Has the element label been referenced as an AST (with the # operator) ? - * If so, then we'll want to build the AST even though the user has used - * the ! operator. - */ -/* MR27 */ if (GenAST && p->el_label != NULL) { -/* MR27 */ ast_label_in_action = list_search_cstring(r->ast_labels_in_actions, -/* MR27 */ p->el_label); -/* MR27 */ } - - OutLineInfo(output,p->line,FileStr[p->file]); - - if ( !set_nil(p->tset) ) /* implies '.', ~Tok, or tokenclass */ - { - unsigned e; - unsigned eErrSet = 0; - set b; - set bErrSet; /* MR23 */ - b = set_dup(p->tset); - bErrSet = set_dup(p->tset); /* MR23 */ - complement = p->complement; /* MR23 */ - if ( p->tclass!=NULL && complement == 0 /* MR23 */) { /* token class not complemented*/ - static char buf[MaxRuleName+20]; /* MR23 */ - static char bufErrSet[MaxRuleName+20]; /* MR23 */ - if ( p->tclass->dumped ) { - e = p->tclass->setnum; - eErrSet = p->tclass->setnumErrSet; - } - else { - e = DefErrSet(&b, 0, TokenString(p->token)); - eErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, TokenString(p->token), "_errset"); - p->tclass->dumped = 1; /* indicate set has been created */ - p->tclass->setnum = e; - p->tclass->setnumErrSet = eErrSet; /* MR23 */ - } - sprintf(buf, "%s_set", TokenString(p->token)); - sprintf(bufErrSet, "%s_errset", TokenString(p->token)); /* MR23 */ - set_name = buf; - set_nameErrSet = bufErrSet; /* MR23 */ - } - - /* MR23 - Forgot about the case of ~TOKCLASS. */ - - else if ( p->tclass!=NULL && complement != 0 /* MR23 */) - { - static char buf[MaxRuleName+20]; /* MR23 */ - static char bufErrSet[MaxRuleName+20]; /* MR23 */ - if ( p->tclass->dumpedComplement ) { - e = p->tclass->setnumComplement; - eErrSet = p->tclass->setnumErrSetComplement; - } - else { - e = DefErrSetWithSuffix(0, &b, 0, TokenString(p->token), "_setbar"); - eErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, TokenString(p->token), "_errsetbar"); - p->tclass->dumpedComplement = 1; /* indicate set has been created */ - p->tclass->setnumComplement = e; - p->tclass->setnumErrSetComplement = eErrSet; /* MR23 */ - } - sprintf(buf, "%s_setbar", TokenString(p->token)); - sprintf(bufErrSet, "%s_errsetbar", TokenString(p->token)); /* MR23 */ - set_name = buf; - set_nameErrSet = bufErrSet; /* MR23 */ - } - else { /* wild card */ - static char buf[sizeof("zzerr")+10]; - static char bufErrSet[sizeof("zzerr")+10]; - int n = DefErrSet( &b, 0, NULL ); - int nErrSet = DefErrSetWithSuffix(0, &bErrSet, 1, NULL, "_set"); - if ( GenCC ) sprintf(buf, "err%d", n); - else sprintf(buf, "zzerr%d", n); - if ( GenCC ) sprintf(bufErrSet, "err%d", nErrSet); - else sprintf(bufErrSet, "zzerr%d", nErrSet); - set_name = buf; - set_nameErrSet = bufErrSet; - } - - if ( !FoundException ) { -/* MR23 */ gen2("zzsetmatch(%s, %s);", set_name, set_nameErrSet); - } - else if ( p->ex_group==NULL ) { - if ( p->use_def_MT_handler ) - gen3("zzsetmatch_wdfltsig(%s,(ANTLRTokenType)%d,%s);", - set_name, - p->token, - tokenFollowSet(p)) - else - gen2("zzsetmatch_wsig(%s, %s_handler);", - set_name, - handler_id); - } - else - { - gen1("if ( !_setmatch_wsig(%s) ) {\n", set_name); - tabs++; -/* MR6 */ if (FoundGuessBlk) { -/* MR6 */ if ( GenCC ) {gen("if ( guessing ) goto fail;\n");} -/* MR6 */ else gen("if ( zzguessing ) goto fail;\n"); -/* MR6 */ }; - gen("_signal=MismatchedToken;\n"); - dumpException(p->ex_group, 0); - tabs--; - gen("}\n"); - } - set_free(b); - set_free(bErrSet); - } - else if ( TokenString(p->token)!=NULL ) - { - if ( FoundException ) { - if ( p->use_def_MT_handler ) - gen2("zzmatch_wdfltsig(%s,%s);",TokenString(p->token),tokenFollowSet(p)) - else if ( p->ex_group==NULL ) - { - gen2("zzmatch_wsig(%s, %s_handler);", - TokenString(p->token), - handler_id); - } - else - { -/* MR6 */ if (GenCC) { -/* MR6 */ gen1("if ( !_match_wsig(%s) ) {\n", TokenString(p->token)); -/* MR6 */ } else { -/* MR6 */ gen1("if ( !_zzmatch_wsig(%s) ) {\n", TokenString(p->token)); -/* MR6 */ }; - tabs++; -/* MR6 */ if (FoundGuessBlk) { -/* MR6 */ if ( GenCC ) {gen("if ( guessing ) goto fail;\n");} -/* MR6 */ else gen("if ( zzguessing ) goto fail;\n"); -/* MR6 */ }; - gen("_signal=MismatchedToken;\n"); - dumpException(p->ex_group, 0); - tabs--; - gen("}\n"); - } - } - else gen1("zzmatch(%s);", TokenString(p->token)); - } - else { - if ( FoundException ) { - if ( p->use_def_MT_handler ) - gen2("zzmatch_wdfltsig((ANTLRTokenType)%d,%s);", - p->token,tokenFollowSet(p)) - else - gen2("zzmatch_wsig(%d,%s_handler);",p->token,handler_id); - } - else {gen1("zzmatch(%d);", p->token);} - } - - a = findImmedAction( p->next ); - /* generate the token labels */ - if ( GenCC && p->elnum>0 ) - { - /* If building trees in C++, always gen the LT() assigns */ - if ( set_el(p->elnum, tokensRefdInBlock) || GenAST ) - { -/* MR10 */ if ( FoundGuessBlk ) { -/* MR10 */ gen("\n"); -/* MR10 */ if (p->label_used_in_semantic_pred) { -/* MR10 */ gen2(" _t%d%d = (ANTLRTokenPtr)LT(1); /* MR10 */\n", BlkLevel-1, p->elnum); -/* MR10 */ } else { -/* MR10 */ gen("if ( !guessing ) {\n"); tab(); -/* MR10 */ _gen2(" _t%d%d = (ANTLRTokenPtr)LT(1);\n", BlkLevel-1, p->elnum); -/* MR10 */ gen("}\n"); -/* MR10 */ }; -/* MR10 */ } else { -/* MR10 */ _gen2(" _t%d%d = (ANTLRTokenPtr)LT(1);", BlkLevel-1, p->elnum); -/* MR10 */ }; -/* MR10 */ - } - -/* - * MR23 labase is never used in the C++ runtime library. - * and this code is generated only in C++ mode - */ - -/*** if ( LL_k>1 ) / * MR23 disabled */ -/*** if ( !DemandLookahead ) _gen(" labase++;"); / * MR23 disabled */ -/*** _gen("\n"); / * MR23 disabled */ -/*** tab(); / * MR23 disabled */ - } - if ( GenAST ) - { - if ( FoundGuessBlk && - (ast_label_in_action || !(p->astnode == ASTexclude || r->noAST)) ) - { - if ( GenCC ) {_gen("if ( !guessing ) {\n"); tab();} - else {_gen("zzNON_GUESS_MODE {\n"); tab();} - } - -/* MR27 addition when labels referenced when operator ! used */ - - pushedCmodeAST = 0; /* MR27 */ - if (ast_label_in_action && (p->astnode == ASTexclude || r->noAST)) { - _gen("\n"); - if (GenCC) { -/* MR13 */ if (NewAST) { -/* MR13 */ gen4("_ast%d%d = newAST(_t%d%d); /* MR27 */\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum); -/* MR13 */ } else { -/* MR13 */ gen4("_ast%d%d = new AST(_t%d%d); /* MR27 */\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum); -/* MR13 */ } - } - else { - pushedCmodeAST = 1; - gen("zzastPush(zzmk_ast(zzastnew(),zzaCur)); /* MR27 */"); - } - } - -/* end MR27 addition for labels referenced when operator ! used */ - - if (!r->noAST ) - { - if (GenCC && !(p->astnode == ASTexclude) ) { - _gen("\n"); -/* MR13 */ if (NewAST) { -/* MR13 */ gen4("_ast%d%d = newAST(_t%d%d);\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum); -/* MR13 */ } else { -/* MR13 */ gen4("_ast%d%d = new AST(_t%d%d);\n", BlkLevel-1, p->elnum, BlkLevel-1, p->elnum); -/* MR13 */ } - tab(); - } - if ( GenCC && !(p->astnode == ASTexclude) ) - {_gen2("_ast%d%d->", BlkLevel-1, p->elnum);} - else _gen(" "); - if ( p->astnode==ASTchild ) { - if ( !GenCC ) _gen("zz"); - _gen("subchild(_root, &_sibling, &_tail);"); - } - else if ( p->astnode==ASTroot ) { - if ( !GenCC ) _gen("zz"); - _gen("subroot(_root, &_sibling, &_tail);"); - } - if ( GenCC && !(p->astnode == ASTexclude) ) { - _gen("\n"); - tab(); - } - } - else if ( !GenCC ) { - if (! pushedCmodeAST) _gen(" zzastDPush;"); - } - if ( FoundGuessBlk && - (ast_label_in_action || !(p->astnode == ASTexclude || r->noAST)) ) - {gen("}\n"); tab();} - } - - /* Handle element labels now */ - if ( p->el_label!=NULL ) - { - int done_NON_GUESSMODE=0; - - _gen("\n"); - -/* MR10 */ /* do Attrib / Token ptr for token label used in semantic pred */ -/* MR10 */ /* for these cases do assign even in guess mode */ -/* MR10 */ -/* MR10 */ if (p->label_used_in_semantic_pred) { -/* MR10 */ if ( GenCC ) { -/* MR10 */ if ( set_el(p->elnum, tokensRefdInBlock) || GenAST ) { -/* MR10 */ gen3("%s = _t%d%d;", p->el_label, BlkLevel-1, p->elnum); -/* MR10 */ } else { -/* MR10 */ gen1("%s = (ANTLRTokenPtr)LT(1);\n", p->el_label); -/* MR10 */ }; -/* MR10 */ } else { -/* MR10 */ gen1("%s = zzaCur;", p->el_label); -/* MR10 */ }; -/* MR10 */ if (FoundGuessBlk) _gen(" /* MR10 */"); -/* MR10 */ _gen("\n"); -/* MR10 */ }; - - /* Do Attrib / Token ptr */ - -/* MR10 */ if (! p->label_used_in_semantic_pred) { -/* MR10 */ -/* MR10 */ if ( FoundGuessBlk ) { -/* MR10 */ if (! done_NON_GUESSMODE) { -/* MR10 */ done_NON_GUESSMODE=1; -/* MR10 */ if ( GenCC ) {gen("if ( !guessing ) {\n"); tab();} -/* MR10 */ else {gen("zzNON_GUESS_MODE {\n"); tab();} -/* MR10 */ }; -/* MR10 */ }; -/* MR10 */ -/* MR10 */ if ( GenCC ) { -/* MR10 */ if ( set_el(p->elnum, tokensRefdInBlock) || GenAST ) { -/* MR10 */ gen3("%s = _t%d%d;\n", p->el_label, BlkLevel-1, p->elnum); -/* MR10 */ } else { -/* MR10 */ gen1("%s = (ANTLRTokenPtr)LT(1);\n", p->el_label); -/* MR10 */ }; -/* MR10 */ } else { -/* MR10 */ gen1("%s = zzaCur;\n", p->el_label); -/* MR10 */ }; -/* MR10 */ }; - - /* Do AST ptr */ - - if (GenAST && (ast_label_in_action || !(p->astnode == ASTexclude || r->noAST) )) /* MR27 */ - { - -/* MR10 */ if ( FoundGuessBlk ) { -/* MR10 */ if (! done_NON_GUESSMODE) { -/* MR10 */ done_NON_GUESSMODE=1; -/* MR10 */ if ( GenCC ) {gen("if ( !guessing ) {\n"); tab();} -/* MR10 */ else {gen("zzNON_GUESS_MODE {\n"); tab();} -/* MR10 */ }; -/* MR10 */ }; - - if ( GenCC ) { - gen3("%s_ast = _ast%d%d;\n", p->el_label, BlkLevel-1, p->elnum); - } - else {gen1("%s_ast = zzastCur;\n", p->el_label);} - } - -/* MR10 */ if (done_NON_GUESSMODE) { -/* MR10 */ gen("}\n"); tab(); -/* MR10 */ }; - - } - - /* Handle any actions immediately following action */ - if ( a != NULL ) /* MR10 */ /* MR11 */ - { - /* delay next token fetch until after action */ - _gen("\n"); - if ( a->is_predicate) - { -#if 0 -/* Disabled in MR30 ************************************************************ - And moved into genAction - ***************************************************************************** -*/ - - gen("if (!("); - - /* make sure that '#line n' is on front of line */ /* MR14 */ - if ( GenLineInfo && p->file != -1 ) _gen("\n"); /* MR14 */ - dumpPredAction(a,a->action, output, 0, a->file, a->line, 0); - -/* MR23 Change failed predicate macro to have three arguments: - - macro arg 1: The stringized predicate itself - macro arg 2: 0 => no user-defined error action - 1 => user-defined error action - macro arg 3: The user-defined error action - - This gives the user more control of the error action. -*/ - _gen(")) \n"); - tabs++; - gen3(" {zzfailed_pred(\"%s\",%s,{ %s } );}\n", /* MR23 */ - stringize(a->action), /* MR23 */ - (a->pred_fail == NULL ? /* MR23/MR27 */ - "0 /* report */" : "1 /* user action */"), /* MR23/MR27 */ - (a->pred_fail == NULL ? /* MR23 */ - "0; /* no user action */" : a->pred_fail)); /* MR23 */ - tabs--; -/* Disabled in MR30 ************************************************************ - And moved into genAction - ***************************************************************************** -*/ -#endif - } - else /* MR9 a regular action - not a predicate action */ - { - -/* MR23: Search an action which is not a predicate for LT(i), - LA(i), or LATEXT(i) in order to warn novice users that - it refers to the previous matched token, not the next - one. This is different than the case for semantic - predicates. -*/ - -/* MR23 */ if (GenCC) { -/* MR23 */ if (strstr(a->action, "LT(") != NULL) LTinTokenAction = 1; -/* MR23 */ } -/* MR23 */ else { -/* MR23 */ if (strstr(a->action, "LA(") != NULL) LTinTokenAction = 1; -/* MR23 */ if (strstr(a->action, "LATEXT(") != NULL) LTinTokenAction = 1; -/* MR23 */ } - - if ( FoundGuessBlk ) { - if ( GenCC ) {gen("if ( !guessing ) {\n");} - else gen("zzNON_GUESS_MODE {\n"); - } - dumpActionPlus(a, a->action, output, tabs, a->file, a->line, 1); /* MR21 */ - if ( FoundGuessBlk ) gen("}\n"); - a->done = 1; /* MR30 */ - } -/*** a->done = 1; MR30 Moved up into then branch for true actions, but not predicates ***/ - if ( !DemandLookahead ) { - if ( GenCC ) { - if ( FoundException && p->use_def_MT_handler ) gen("if (!_signal)"); - _gen(" consume();") - if ( FoundException && p->use_def_MT_handler ) - _gen(" _signal=NoSignal;"); - _gen("\n"); - } - else - { - if ( FoundException && p->use_def_MT_handler ) _gen("if (!_signal)"); - _gen(" zzCONSUME;\n"); - if ( FoundException && p->use_def_MT_handler ) _gen(" _signal=NoSignal;"); - _gen("\n"); - } - } - else gen("\n"); - if (a->done) { /* MR30 */ - TRANS( a->next ); /* MR30 */ - } /* MR30 */ - else { /* MR30 */ - TRANS( p->next ); /* MR30 */ - } /* MR30 */ - } - else - { - if ( !DemandLookahead ) { - if ( GenCC ) { - if (FoundException && p->use_def_MT_handler) _gen("if (!_signal)"); - _gen(" consume();") - if (FoundException&&p->use_def_MT_handler) _gen(" _signal=NoSignal;"); - _gen("\n"); - } - else { - if (FoundException && p->use_def_MT_handler) _gen("if (!_signal)"); - _gen(" zzCONSUME;"); - if ( FoundException && p->use_def_MT_handler ) _gen(" _signal=NoSignal;"); - _gen("\n"); - } - } - else _gen("\n"); - TRANS(p->next); - } -} - -/* MR21 - * - * There was a bug in the code generation for {...} which causes it - * to omit the optional tokens from the error messages. The easiest - * way to fix this was to make the opt block look like a sub block: - * - * { a | b | c } - * - * becomes (internally): - * - * ( a | b | c | ) - * - * The code for genOptBlk is now identical to genSubBlk except for - * cosmetic changes. - */ - -void -#ifdef __USE_PROTOS -genOptBlk( Junction *q ) -#else -genOptBlk( q ) -Junction *q; -#endif -{ - int max_k; - set f; - int need_right_curly; - set savetkref; - int lastAltEmpty; /* MR23 */ - savetkref = tokensRefdInBlock; - require(q->ntype == nJunction, "genOptBlk: not junction"); - require(q->jtype == aOptBlk, "genOptBlk: not opt block"); - - OutLineInfo(output,q->line,FileStr[q->file]); - BLOCK_Preamble(q); - BlkLevel++; - BlockPreambleOption(q,q->pFirstSetSymbol); /* MR21 */ - f = genBlk(q, aOptBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); -/* MR23 - Bypass error clause generation when exceptions are used in {...} block - See multi-line note in genBlk near call to isEmptyAlt. -*/ - if (! FoundException) { - if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */ );} - } - else { - gen("/* MR23 skip error clause for {...} when exceptions in use */\n"); - } - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - freeBlkFsets(q); - --BlkLevel; - BLOCK_Tail(); - - if ( q->guess ) - { - gen("zzGUESS_DONE\n"); - } - - /* must duplicate if (alpha)?; one guesses (validates), the - * second pass matches */ - if ( q->guess && analysis_point(q)==q ) - { - OutLineInfo(output,q->line,FileStr[q->file]); - BLOCK_Preamble(q); - BlkLevel++; - f = genBlk(q, aSubBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); - if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */ );} - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - freeBlkFsets(q); - --BlkLevel; - BLOCK_Tail(); - } - - tokensRefdInBlock = savetkref; - if (q->end->p1 != NULL) TRANS(q->end->p1); -} - -/* - * Generate code for a loop blk of form: - * - * |---| - * v | - * --o-G-o-->o-- - */ -void -#ifdef __USE_PROTOS -genLoopBlk( Junction *begin, Junction *q, Junction *start, int max_k ) -#else -genLoopBlk( begin, q, start, max_k ) -Junction *begin; -Junction *q; -Junction *start; /* where to start generating code from */ -int max_k; -#endif -{ - set f; - int need_right_curly; - set savetkref; - Junction *guessBlock; /* MR10 */ - int singleAlt; /* MR10 */ - int lastAltEmpty; /* MR23 */ - - savetkref = tokensRefdInBlock; - require(q->ntype == nJunction, "genLoopBlk: not junction"); - require(q->jtype == aLoopBlk, "genLoopBlk: not loop block"); - - if ( q->visited ) return; - q->visited = TRUE; - - /* first_item_is_guess_block doesn't care what kind of node it is */ - - guessBlock=first_item_is_guess_block( (Junction *) q->p1); /* MR10 */ - singleAlt=q->p2==NULL; /* MR10 */ - - if (singleAlt && !guessBlock) /* MR10 */ /* only one alternative? */ - { - if ( DemandLookahead ) { - if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);} - else gen1("look(%d);\n", max_k); - } - gen("while ( "); - if ( begin!=NULL ) genExpr(begin); - else genExpr(q); - /* if no predicates have been hoisted for this single alt (..)* - * do so now - */ - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - if ( ParseWithPredicates && begin->predicate==NULL ) - { - Predicate *a = MR_find_predicates_and_supp((Node *)q->p1); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - - if ( a!=NULL ) - { - _gen("&&"); - a=genPredTreeMain(a, (Node *)q); /* MR10 */ - } -/* MR10 */ if (MRhoisting) { -/* MR10 */ predicate_free(a); -/* MR10 */ }; - } - _gen(" ) {\n"); - tabs++; - TRANS(q->p1); - if ( !GenCC ) gen1("zzLOOP(zztasp%d);\n", BlkLevel-1); - if ( DemandLookahead ) { - if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);} - else gen1("look(%d);\n", max_k); - } - --tabs; - gen("}\n"); - freeBlkFsets(q); - q->visited = FALSE; - tokensRefdInBlock = savetkref; - return; - } - gen("for (;;) {\n"); /* MR20 G. Hobbelt */ - tabs++; -/* MR6 */ -/* MR6 "begin" can never be null when called from genLoopBegin */ -/* MR6 because q==(Junction *)begin->p1 and we know q is valid */ -/* MR6 */ -/* MR6 from genLoopBegin: */ -/* MR6 */ -/* MR6 if ( LL_k>1 && !set_nil(q->fset[2]) ) */ -/* MR6 genLoopBlk( q, (Junction *)q->p1, q, max_k ); */ -/* MR6 else genLoopBlk( q, (Junction *)q->p1, NULL, max_k ); */ -/* MR6 */ - if ( begin!=NULL ) - { - if ( DemandLookahead ) - { - if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);} - else gen1("look(%d);\n", max_k); - } - /* The bypass arc of the (...)* predicts what to do when you fail, but - * ONLY after having tested the loop start expression. To avoid this, - * we simply break out of the (...)* loop when we find something that - * is not in the prediction of the loop (all alts thereof). - */ - gen("if ( !("); - -/*** TJP says: It used to use the prediction expression for the bypass arc - of the (...)*. HOWEVER, if a non LL^1(k) decision was found, this - thing would miss the ftree stored in the aLoopBegin node and generate - an LL^1(k) decision anyway. - - *** genExpr((Junction *)begin->p2); - ***/ - - genExpr((Junction *)begin); - _gen(")) break;\n"); - - } - - /* generate code for terminating loop (this is optional branch) */ - - f = genBlk(q, aLoopBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); - set_free(f); - freeBlkFsets(q); - - /* generate code for terminating loop (this is optional branch) */ - -/* MR6 */ -/* MR6 30-May-97 Bug reported by Manuel Ornato */ -/* MR6 A definite bug involving the exit from a loop block */ -/* MR6 In 1.23 and later versions (including 1.33) Instead */ -/* MR6 exiting the block and reporting a syntax error the */ -/* MR6 code loops forever. */ -/* MR6 Looking at 1.20 which generates proper code it is not */ -/* MR6 clear which of two changes should be undone. */ -/* MR6 This is my best guess. */ -/* MR6 From earlier MR6 note we know that begin can never be */ -/* MR6 null when genLoopBlk called from genLoopBegin */ -/* MR6 */ -/* MR6 */ if ( begin==NULL) { -/* MR6 */ /* code for exiting loop "for sure" */ -/* MR6 */ gen("/* Suppressed by MR6 */ /*** else break; ***/\n"); -/* MR6 */ }; - -/* MR10 */if (singleAlt && guessBlock) { -/* MR10 */ tabs--; -/* MR6 */ gen("} else break; /* MR6 code for exiting loop \"for sure\" */\n"); -/* MR10 */ need_right_curly--; -/* MR10 */ } else { -/* MR6 */ gen("else break; /* MR6 code for exiting loop \"for sure\" */\n"); -/* MR10 */ }; - - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - if ( !GenCC ) gen1("zzLOOP(zztasp%d);\n", BlkLevel-1); - --tabs; - gen("}\n"); - q->visited = FALSE; - tokensRefdInBlock = savetkref; -} - -/* - * Generate code for a loop blk of form: - * - * |---| - * v | - * --o-->o-->o-G-o-->o-- - * | ^ - * v | - * o-----------o - * - * q->end points to the last node (far right) in the blk. - * - * Note that q->end->jtype must be 'EndBlk'. - * - * Generate code roughly of the following form: - * - * do { - * ... code for alternatives ... - * } while ( First Set of aLoopBlk ); - * - * OR if > 1 alternative - * - * do { - * ... code for alternatives ... - * else break; - * } while ( 1 ); - */ -void -#ifdef __USE_PROTOS -genLoopBegin( Junction *q ) -#else -genLoopBegin( q ) -Junction *q; -#endif -{ - set f; - int i; - int max_k; - set savetkref; - savetkref = tokensRefdInBlock; - require(q!=NULL, "genLoopBegin: invalid node and/or rule"); - require(q->ntype == nJunction, "genLoopBegin: not junction"); - require(q->jtype == aLoopBegin, "genLoopBegin: not loop block"); - require(q->p2!=NULL, "genLoopBegin: invalid Loop Graph"); - - OutLineInfo(output,q->line,FileStr[q->file]); - - BLOCK_Preamble(q); - BlkLevel++; - BlockPreambleOption(q,q->pFirstSetSymbol); /* MR21 */ - f = First(q, 1, aLoopBegin, &max_k); - /* If not simple LL(1), must specify to start at LoopBegin, not LoopBlk */ - if ( LL_k>1 && !set_nil(q->fset[2]) ) - genLoopBlk( q, (Junction *)q->p1, q, max_k ); - else genLoopBlk( q, (Junction *)q->p1, NULL, max_k ); - - for (i=1; i<=CLL_k; i++) set_free(q->fset[i]); - for (i=1; i<=CLL_k; i++) set_free(((Junction *)q->p2)->fset[i]); - --BlkLevel; - BLOCK_Tail(); - set_free(f); - tokensRefdInBlock = savetkref; -/* MR21 */ if (MR_BlkErr) { -/* MR21 */ set f, fArray[2]; -/* MR21 */ f = ComputeErrorSet(q,1,0 /* use plus block bypass ? */ ); -/* MR21 */ fArray[0]= empty; -/* MR21 */ fArray[1]= set_dup(f); -/* MR21 */ gen("if ("); -/* MR21 */ genExprSets(fArray,1); /* note: destroys set arguments */ -/* MR21 */ _gen(") { /* MR21 option -mrblksynerr */\n"); -/* MR21 */ tabs++; -/* MR21 */ tab(); -/* MR21 */ _gen("/* nothing */ }\n"); -/* MR21 */ tab(); -/* MR21 */ makeErrorClause(q,f,1,0 /* use plus block bypass ? */ ); /* frees set */ -/* MR21 */ tabs--; -/* MR21 */ }; - if (q->end->p1 != NULL) TRANS(q->end->p1); -} - -/* - * Generate code for a loop blk of form: - * - * |---| - * v | - * --o-G-o-->o-- - * - * q->end points to the last node (far right) in the blk. - * Note that q->end->jtype must be 'EndBlk'. - * - * Generate code roughly of the following form: - * - * do { - * ... code for alternatives ... - * } while ( First Set of aPlusBlk ); - * - * OR if > 1 alternative - * - * do { - * ... code for alternatives ... - * else if not 1st time through, break; - * } while ( 1 ); - */ -void -#ifdef __USE_PROTOS -genPlusBlk( Junction *q ) -#else -genPlusBlk( q ) -Junction *q; -#endif -{ - int max_k; - set f; - int need_right_curly; - int lastAltEmpty; /* MR23 */ - set savetkref; - Junction *guessBlock; /* MR10 */ - int singleAlt; /* MR10 */ - - savetkref = tokensRefdInBlock; - require(q!=NULL, "genPlusBlk: invalid node and/or rule"); - require(q->ntype == nJunction, "genPlusBlk: not junction"); - require(q->jtype == aPlusBlk, "genPlusBlk: not Plus block"); - require(q->p2 != NULL, "genPlusBlk: not a valid Plus block"); - - if ( q->visited ) return; - q->visited = TRUE; - OutLineInfo(output,q->line,FileStr[q->file]); - BLOCK_Preamble(q); - BlkLevel++; - - BlockPreambleOption((Junction *)q, q->pFirstSetSymbol); /* MR21 */ - - /* first_item_is_guess_block doesn't care what kind of node it is */ - - guessBlock=first_item_is_guess_block( (Junction *)q->p1); /* MR10 */ - - /* if the ignore flag is set on the 2nd alt and that alt is empty, - * then it is the implied optional alternative that we added for (...)+ - * and, hence, only 1 alt. - */ - -/* MR10 Reported by Pulkkinen Esa (esap@cs.tut.fi) - * Outer code for guess blocks ignored when there is only one alt - * for a (...)+ block. - * Force use of regular code rather than "optimized" code for that case - */ - - singleAlt=( ( (Junction *) q->p2)->p2 == NULL) && - ( ( (Junction *) q->p2)->ignore ); /* only one alternative? */ - - if (singleAlt && !guessBlock) /* MR10 */ - { - - Predicate *a=NULL; - /* if the only alt has a semantic predicate, hoist it; must test before - * entering loop. - */ - if ( ParseWithPredicates ) - { - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - a = MR_find_predicates_and_supp((Node *)q); - require(MR_PredRuleRefStack.count == 0,"PredRuleRef stack not empty"); - - if ( a!=NULL ) { - gen("if ("); - a=genPredTreeMain(a, (Node *)q); /* MR10 */ - _gen(") {\n"); - } - } - gen("do {\n"); - tabs++; - TRANS(q->p1); - if ( !GenCC ) gen1("zzLOOP(zztasp%d);\n", BlkLevel-1); - f = First(q, 1, aPlusBlk, &max_k); - if ( DemandLookahead ) { - if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);} - else gen1("look(%d);\n", max_k); - } - --tabs; - gen("} while ( "); - if ( q->parm!=NULL && q->predparm ) _gen1("(%s) && ", q->parm); - genExpr(q); - if ( ParseWithPredicates && a!=NULL ) - { - if (! MR_comparePredicates(q->predicate,a)) { - _gen("&&"); - a=genPredTreeMain(a, (Node *)q); /* MR10 */ - }; - } - _gen(" );\n"); - if ( ParseWithPredicates && a!=NULL ) gen("}\n"); - --BlkLevel; - BLOCK_Tail(); - q->visited = FALSE; - freeBlkFsets(q); - set_free(f); - tokensRefdInBlock = savetkref; -/* MR21 */ if (MR_BlkErr) { -/* MR21 */ set f, fArray[2]; -/* MR21 */ f = ComputeErrorSet(q,1,1 /* use plus block bypass ? */ ); -/* MR21 */ fArray[0]= empty; -/* MR21 */ fArray[1]= set_dup(f); -/* MR21 */ gen("if ("); -/* MR21 */ genExprSets(fArray,1); /* note: destroys set arguments */ -/* MR21 */ _gen(") { /* MR21 option -mrblksynerr */\n"); -/* MR21 */ tabs++; -/* MR21 */ tab(); -/* MR21 */ _gen("/* nothing */ }\n"); -/* MR21 */ tab(); -/* MR21 */ makeErrorClause(q,f,1,1 /* use plus block bypass ? */ ); /* frees set */ -/* MR21 */ tabs--; -/* MR21 */ }; - if (q->end->p1 != NULL) TRANS(q->end->p1); -/* MR10 */ if (MRhoisting) { -/* MR10 */ predicate_free(a); -/* MR10 */ }; - return; - } - gen("do {\n"); - tabs++; - f = genBlk(q, aPlusBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); -/* MR6 */ -/* MR6 Sinan Karasu (sinan@tardis.ds.boeing.com) */ -/* MR6 Failed to turn off guess mode when leaving block */ -/* MR6 */ -/* MR6 */ if ( has_guess_block_as_last_item(q) ) { -/* MR10 */ gen("else {\n"); -/* MR10 */ tabs++; -/* MR10 */ need_right_curly++; -/* MR10 */ gen("if ( !zzrv ) zzGUESS_DONE;\n"); -/* MR6 */ gen("if ( zzcnt > 1 ) break;\n"); -/* MR10 */ } else { -/* MR10 */ gen("else {\n"); -/* MR10 */ tabs++; -/* MR10 */ need_right_curly++; -/* MR10 */ gen("if ( zzcnt > 1 ) break;\n"); -/* MR10 */ }; - -/* MR21 */ if (MR_BlkErr && 1 >= max_k) { -/* MR21 */ set f; -/* MR21 */ f = ComputeErrorSet(q,1,0 /* use plus block bypass ? */ ); -/* MR21 */ tabs++; -/* MR21 */ tab(); -/* MR21 */ makeErrorClause(q,f,1,0 /* use plus block bypass ? */ ); /* frees set */ -/* MR21 */ tabs--; -/* MR21 */ } -/* MR21 */ else { - tab(); - makeErrorClause(q,f,max_k,1 /* use plus block bypass ? */); - /* MR21 I think this generates the wrong set ? */ - /* MR21 because it includes the plus block bypass ? */ - /* MR21 but I'm afraid to change it without additional checking */ - } - - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - freeBlkFsets(q); - gen("zzcnt++;"); - if ( !GenCC ) _gen1(" zzLOOP(zztasp%d);", BlkLevel-1); - _gen("\n"); - if ( DemandLookahead ) { - if ( !GenCC ) {gen1("LOOK(%d);\n", max_k);} - else gen1("look(%d);\n", max_k); - } - --tabs; - if ( q->parm!=NULL && q->predparm ) {gen1("} while (%s);\n", q->parm);} - else gen("} while ( 1 );\n"); - --BlkLevel; - BLOCK_Tail(); - q->visited = FALSE; - tokensRefdInBlock = savetkref; -/* MR21 */ if (MR_BlkErr) { -/* MR21 */ set f, fArray[2]; -/* MR21 */ f = ComputeErrorSet(q,1,1 /* use plus block bypass ? */ ); -/* MR21 */ fArray[0]= empty; -/* MR21 */ fArray[1]= set_dup(f); -/* MR21 */ gen("if ("); -/* MR21 */ genExprSets(fArray,1); /* note: destroys set arguments */ -/* MR21 */ _gen(") { /* MR21 option -mrblksynerr */\n"); -/* MR21 */ tabs++; -/* MR21 */ tab(); -/* MR21 */ _gen("/* nothing */ }\n"); -/* MR21 */ tab(); -/* MR21 */ makeErrorClause(q,f,1,1 /* use plus block bypass ? */ ); /* frees set */ -/* MR21 */ tabs--; -/* MR21 */ }; - if (q->end->p1 != NULL) TRANS(q->end->p1); -} - -/* - * Generate code for a sub blk of alternatives of form: - * - * --o-G1--o-- - * | ^ - * v /| - * o-G2-o| - * | ^ - * v | - * .......... - * | ^ - * v / - * o-Gn-o - * - * q points to the 1st junction of blk (upper-left). - * q->end points to the last node (far right) in the blk. - * Note that q->end->jtype must be 'EndBlk'. - * The last node in every alt points to q->end. - * - * Generate code of the following form: - * if ( First(G1) ) { - * ...code for G1... - * } - * else if ( First(G2) ) { - * ...code for G2... - * } - * ... - * else { - * ...code for Gn... - * } - */ - -void -#ifdef __USE_PROTOS -genSubBlk( Junction *q ) -#else -genSubBlk( q ) -Junction *q; -#endif -{ - int max_k; - set f; - int need_right_curly; - int lastAltEmpty; /* MR23 */ - set savetkref; - savetkref = tokensRefdInBlock; - require(q->ntype == nJunction, "genSubBlk: not junction"); - require(q->jtype == aSubBlk, "genSubBlk: not subblock"); - - OutLineInfo(output,q->line,FileStr[q->file]); - BLOCK_Preamble(q); - BlkLevel++; - BlockPreambleOption(q,q->pFirstSetSymbol); /* MR21 */ - f = genBlk(q, aSubBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); - -/* MR23 - Bypass error clause generation when exceptions are used in a sub block - in which the last alternative is epsilon. Example: "(A | B | )". - See multi-line note in genBlk near call to isEmptyAlt. -*/ - if (FoundException && lastAltEmpty) { - gen("/* MR23 skip error clause for (...| epsilon) when exceptions in use */\n"); - } - else { - if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */ );} - } - - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - freeBlkFsets(q); - --BlkLevel; - BLOCK_Tail(); - - if ( q->guess ) - { - gen("zzGUESS_DONE\n"); - } - - /* must duplicate if (alpha)?; one guesses (validates), the - * second pass matches */ - if ( q->guess && analysis_point(q)==q ) - { - OutLineInfo(output,q->line,FileStr[q->file]); - BLOCK_Preamble(q); - BlkLevel++; - f = genBlk(q, aSubBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); - if ( q->p2 != NULL ) {tab(); makeErrorClause(q,f,max_k,0 /* use plus block bypass ? */);} - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - freeBlkFsets(q); - --BlkLevel; - BLOCK_Tail(); - } - - tokensRefdInBlock = savetkref; - if (q->end->p1 != NULL) TRANS(q->end->p1); -} - -static int TnodesAllocatedPrevRule=0; - -/* - * Generate code for a rule. - * - * rule--> o-->o-Alternatives-o-->o - * Or, - * rule--> o-->o-Alternative-o-->o - * - * The 1st junction is a RuleBlk. The second can be a SubBlk or just a junction - * (one alternative--no block), the last is EndRule. - * The second to last is EndBlk if more than one alternative exists in the rule. - * - * To get to the init-action for a rule, we must bypass the RuleBlk, - * and possible SubBlk. - * Mark any init-action as generated so genBlk() does not regenerate it. - */ -void -#ifdef __USE_PROTOS -genRule( Junction *q ) -#else -genRule( q ) -Junction *q; -#endif -{ - - const char * returnValueInitializer; - -do { /* MR10 Change recursion into iteration */ - - int max_k; - set follow, rk, f; - ActionNode *a; - RuleEntry *r; - int lastAltEmpty; /* MR23 */ - static int file = -1; - int need_right_curly; - require(q->ntype == nJunction, "genRule: not junction"); - require(q->jtype == RuleBlk, "genRule: not rule"); - -/* MR14 */ require (MR_BackTraceStack.count == 0,"-alpha MR_BackTraceStack.count != 0"); -/* MR14 */ MR_pointerStackReset(&MR_BackTraceStack); -/* MR14 */ if (AlphaBetaTrace) MR_MaintainBackTrace=1; - - CurRule=q->rname; /* MR11 */ - - r = (RuleEntry *) hash_get(Rname, q->rname); - if ( r == NULL ) warnNoFL("Rule hash table is screwed up beyond belief"); - if ( q->file != file ) /* open new output file if need to */ - { -/* MR6 */ -/* MR6 Simpler to debug when output goes to stdout rather than a file */ -/* MR6 */ -/* MR6 */ if (UseStdout) { -/* MR6 */ output = stdout; -/* MR6 */ } else { -/* MR6 */ if ( output != NULL) fclose( output ); -/* MR6 */ output = fopen(OutMetaName(outname(FileStr[q->file])), "w"); -/* MR6 */ }; - require(output != NULL, "genRule: can't open output file"); - -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(outname(FileStr[q->file]))); /* MR1 */ -#endif - if ( file == -1 ) genHdr1(q->file); - else genHdr(q->file); - file = q->file; - } - - if (InfoM) { - fprintf(stderr," rule %s\n",q->rname); - fflush(output); - }; - -#if 0 - if (strcmp(q->rname,"***debug***") == 0) { - fprintf(stderr,"***debug*** %s reached\n",q->rname); - MR_break(); - }; -#endif - - DumpFuncHeader(q,r); - tabs++; - - /* MR23 - - If there is a single return value then it can be initialized in - the declaration using assignment syntax. If there are multiple - return values then antlr creates a struct and initialization takes - place element by element for each element of the struct. For - multiple elements the initialization is by assignment so we have - to wait until all declarations are done before emitting that code - - because of restrictions in C which don't exist in C++. - - In the past (before MR23) the only kind of initialization was - the PURIFY macro which was just a memset() of 0. Now we allow - the user to specify an initial value. PURIFY is still used in C - mode because C does not have constructors. However, PURIFY is - not used in C++ mode because it might overwrite information created - by elements which have their own ctor. - - */ - - if ( q->ret!=NULL ) - { - if ( hasMultipleOperands(q->ret) ) /* MR23 */ - { - - /* Emit initialization code later. */ - - gen1("struct _rv%d _retv;\n",r->rulenum); - } - else - { - /* Emit initialization code now. */ - - tab(); - DumpType(q->ret, output); - returnValueInitializer = getInitializer(q->ret); - if (returnValueInitializer == NULL) { /* MR23 */ - gen(" _retv;\n"); /* MR1 MR3 */ - } /* MR23 */ - else { /* MR23 */ - gen1(" _retv = %s;\n", returnValueInitializer); /* MR23 */ - } /* MR23 */ - } - } - - OutLineInfo(output,q->line,FileStr[q->file]); - - if (InfoM) { - fflush(output); - }; - - gen("zzRULE;\n"); - if ( FoundException ) - { - gen("int _sva=1;\n"); - } - if ( GenCC && GenAST ) - gen("ASTBase *_ast = NULL, *_sibling = NULL, *_tail = NULL;\n"); - if ( GenCC ) genTokenPointers(q); - if ( GenCC&&GenAST ) genASTPointers(q); - if ( q->el_labels!=NULL ) genElementLabels(q->el_labels); - if ( FoundException ) gen("int _signal=NoSignal;\n"); - - if ( !GenCC ) gen1("zzBLOCK(zztasp%d);\n", BlkLevel); - -/* MR10 */ /* move zzTRACEIN to before init action */ - -/* MR10 */ if ( TraceGen ) { -/* MR10 */ if ( GenCC ) {gen1("zzTRACEIN(\"%s\");\n", q->rname);} -/* MR10 */ else gen1("zzTRACEIN((ANTLRChar *)\"%s\");\n", q->rname); -/* MR10 */ } - -/* MR7 Moved PURIFY() to after all local variables have been declared */ -/* MR7 so that the generated code is valid C as well as C++ */ -/* MR7 Jan Mikkelsen 10-June-1997 */ - - - /* - MR23 Do the PURIFY macro only for C mode. - C++ users should use constructors or initialization expressions. - */ - - if ( q->ret != NULL ) /* MR7 */ - { /* MR7 */ - if (hasMultipleOperands(q->ret)) { /* MR23 */ - if (PURIFY == TRUE) { - gen1("PCCTS_PURIFY(_retv,sizeof(struct _rv%d))\n",r->rulenum); /* MR23 */ - } - } /* MR7 */ - else { /* MR7 */ - - /* MR23 - If there were only one return value operand and - it had an initializer then it would have been - initiailized in the declaration. - */ - - returnValueInitializer = getInitializer(q->ret); /* MR23 */ - if (returnValueInitializer == NULL) { /* MR23 */ - if (PURIFY == TRUE) { - gen("PCCTS_PURIFY(_retv,sizeof("); /* MR23 */ - DumpType(q->ret, output); /* MR7 */ - gen("))\n"); /* MR7 */ - } - } /* MR23 */ - } /* MR7 */ - - if (hasMultipleOperands(q->ret)) { /* MR23 */ - DumpInitializers(output, r, q->ret); /* MR23 */ - } - - } - if ( !GenCC ) gen("zzMake0;\n"); - if ( FoundException ) gen("*_retsignal = NoSignal;\n"); - - if ( !GenCC ) gen("{\n"); - - if ( has_guess_block_as_first_item((Junction *)q->p1) ) - { - gen("zzGUESS_BLOCK\n"); - } - - /* L o o k F o r I n i t A c t i o n */ - if ( ((Junction *)q->p1)->jtype == aSubBlk ) - a = findImmedAction( ((Junction *)q->p1)->p1 ); - else - a = findImmedAction( q->p1 ); /* only one alternative in rule */ - if ( a!=NULL && !a->is_predicate) - { - /* MR21 */ if (!a->noHoist) dumpActionPlus(a, a->action, output, tabs, a->file, a->line, 1); - a->done = 1; /* ignore action. We have already handled it */ - } - - BlkLevel++; - q->visited = TRUE; /* mark RULE as visited for FIRST/FOLLOW */ - BlockPreambleOption((Junction *)q->p1, NULL); /* MR21 */ - f = genBlk((Junction *)q->p1, RuleBlk, &max_k, &need_right_curly, &lastAltEmpty /* MR23 */); - if ( q->p1 != NULL ) - if ( ((Junction *)q->p1)->p2 != NULL ) - {tab(); makeErrorClause((Junction *)q->p1,f,max_k,0 /* use plus block bypass ? */);} - { int i; for (i=1; i<=need_right_curly; i++) {tabs--; gen("}\n");} } - freeBlkFsets((Junction *)q->p1); - q->visited = FALSE; - --BlkLevel; - if ( !GenCC ) gen1("zzEXIT(zztasp%d);\n", BlkLevel); - - genTraceOut(q); - - if ( q->ret!=NULL ) gen("return _retv;\n") else gen("return;\n"); - /* E r r o r R e c o v e r y */ - NewSet(); - rk = empty; - -/* MR14 */ if (r->dontComputeErrorSet) { -/* MR14 */ follow=empty; - } else { - MR_pointerStackReset(&MR_BackTraceStack); /* MR14 */ - MR_ErrorSetComputationActive=1; - REACH(q->end, 1, &rk, follow); - MR_ErrorSetComputationActive=0; - require (MR_BackTraceStack.count == 0,"K: MR_BackTraceStack.count != 0"); - } - - FillSet( follow ); - set_free( follow ); - - /* MR20 G. Hobbelt - Isn't it so that "fail:" is ONLY referenced when: - - !FoundException || FoundGuessBlk ? - - Therefore add the "if" around this piece of code generation... - - Should guessing mode also use _handler label instead of "fail" - when exception handling is active? gen can automatically put - "if (guessing)" there so as to skip all kinds of user code. - - */ - - if ( !FoundException || FoundGuessBlk ) /* MR20 G. Hobbelt */ - { /* MR20 G. Hobbelt */ - _gen("fail:\n"); - if ( !GenCC ) gen("zzEXIT(zztasp1);\n"); - if ( FoundGuessBlk ) { - if ( !GenCC ) {gen("if ( zzguessing ) zzGUESS_FAIL;\n");} - else gen("if ( guessing ) zzGUESS_FAIL;\n"); - } - if ( q->erraction!=NULL ) - dumpAction(q->erraction, output, tabs, q->file, q->line, 1); - if ( GenCC ) - { - gen1("syn(zzBadTok, %s, zzMissSet, zzMissTok, zzErrk);\n", - r->egroup==NULL?"(ANTLRChar *)\"\"":r->egroup); - } - else - { - gen1("zzsyn(zzMissText, zzBadTok, %s, zzMissSet, zzMissTok, zzErrk, zzBadText);\n", - r->egroup==NULL?"(ANTLRChar *)\"\"":r->egroup); - } - gen3("%sresynch(setwd%d, 0x%x);\n", GenCC?"":"zz", wordnum, 1<ret!=NULL ) { - genTraceOut(q); - gen("return _retv;\n"); - } else if ( q->exceptions!=NULL ) { - genTraceOut(q); - gen("return;\n"); - } else if (!FoundException) { /* MR10 */ - genTraceOut(q); /* MR10 */ - }; - - } /* MR20 G. Hobbelt */ - - if ( !GenCC ) gen("}\n"); - - /* Gen code for exception handlers */ - /* make sure each path out contains genTraceOut() */ - - if ( q->exceptions!=NULL ) - { - - gen("/* exception handlers */\n"); - - dumpExceptions(q->exceptions); - - if ( !r->has_rule_exception ) - { - _gen("_handler:\n"); - gen("zzdflthandlers(_signal,_retsignal);\n"); - } -/* MR20 G. Gobbelt The label "adios" is never referenced */ - -#if 0 - _gen("_adios:\n"); -#endif - if ( q->ret!=NULL ) { - genTraceOut(q); - gen("return _retv;\n"); - } - else { - genTraceOut(q); - gen("return;\n"); - } - } - else if ( FoundException ) - { - _gen("_handler:\n"); - gen("zzdflthandlers(_signal,_retsignal);\n"); - -/* MR1 */ -/* MR1 7-Apr-97 Fix suggested by: John Bair (jbair@iftime.com) */ -/* MR1 */ - - if ( q->ret != NULL) { /* MR1 */ - genTraceOut(q); /* MR10 */ - gen("return _retv;\n"); /* MR1 */ - } else { /* MR1 */ - genTraceOut(q); /* MR10 */ - gen("return;\n") ; /* MR1 */ - }; /* MR1 */ - } - - tabs--; - gen("}\n"); - -/* MR10 Tired of looking at stacks that are as deep as the number of */ -/* MR10 rules. Changes recursion to iteration. */ - - MR_releaseResourcesUsedInRule( (Node *) q ); /* MR10 */ - - if (InfoT) { - fprintf(output,"\n/* tnodes created for rule %s: %d */\n", - q->rname, (TnodesAllocated-TnodesAllocatedPrevRule) ); - }; - - TnodesAllocatedPrevRule=TnodesAllocated; - - if (q->p2 == NULL) dumpAfterActions( output ); - q=(Junction *)q->p2; - require(q==NULL || q->jtype==RuleBlk,"RuleBlk p2 does not point to another RuleBlk"); - -} while (q != NULL); - -/**** The old code ****/ -/**** if ( q->p2 != NULL ) {TRANS(q->p2);} ****/ /* generate code for next rule too */ -/**** else dumpAfterActions( output ); ****/ - -} - - -/* This is for the function definition, not the declaration. */ - -static void -#ifdef __USE_PROTOS -DumpFuncHeader( Junction *q, RuleEntry *r ) -#else -DumpFuncHeader( q, r ) -Junction *q; -RuleEntry *r; -#endif -{ -/* */ -/* MR1 10-Apr-97 MR1 Simplify insertion of commas in function header */ -/* */ - int needComma; /* MR1 */ - - - /* A N S I */ - _gen("\n"); - if ( q->ret!=NULL ) - { - if ( hasMultipleOperands(q->ret) ) /* MR23 */ - { - if (GenCC) gen2("%s::_rv%d\n", CurrentClassName, r->rulenum) - else gen1("struct _rv%d\n",r->rulenum); - } - else - { - DumpType(q->ret, output); - gen("\n"); - } - } - else - { - _gen("void\n"); - } -/* MR1 */ -/* MR1 10-Apr-97 133MR1 Replace __STDC__ with __USE_PROTOS */ -/* MR1 */ - if ( !GenCC ) _gen("#ifdef __USE_PROTOS\n"); /* MR1 */ - if ( !GenCC ) gen2("%s%s(", RulePrefix, q->rname) - else gen3("%s::%s%s(", CurrentClassName, RulePrefix,q->rname); - - /* If we generate C++ method names, we must hide default arguments */ - /* which can appear in the parameter declaration list. */ - /* NOTICE: this is done only here, for the method definition, but */ - /* not for the method declaration inside the class */ - /* definition. This is exactly the behaviour defined in */ - /* C++ standard for default paramters. */ - - DumpANSIFunctionArgDef(output,q, 0 /* emit initializers ? */); - _gen("\n"); - - if ( GenCC ) { - gen("{\n"); - return; - } - - /* K & R */ - gen("#else\n"); - gen2("%s%s(", RulePrefix, q->rname); - needComma=0; /* MR1 */ - if ( GenAST ) /* MR1 */ - { /* MR1 */ - _gen("_root"); /* MR1 */ - needComma=1; /* MR1 */ - } /* MR1 */ - if ( FoundException ) /* MR1 */ - { /* MR1 */ - if (needComma) {_gen(",");needComma=0;}; /* MR1 */ - _gen("_retsignal"); /* MR1 */ - needComma=1; /* MR1 */ - } /* MR1 */ -/* MR5 Change below by Jan Mikkelsen (janm@zeta.org.au) 26-May-97 MR5 */ - DumpListOfParmNames( q->pdecl, output, needComma ); /* MR5 */ - gen(")\n"); - if ( GenAST ) gen("AST **_root;\n"); - if ( FoundException ) gen("int *_retsignal;\n"); - DumpOldStyleParms( q->pdecl, output ); - gen("#endif\n"); - gen("{\n"); -} - -void -#ifdef __USE_PROTOS -DumpANSIFunctionArgDef(FILE *f, Junction *q, int bInitializer) -#else -DumpANSIFunctionArgDef(f,q,bInitializer) -FILE *f; -Junction *q; -int bInitializer; -#endif -{ - if ( GenAST ) - { - if ( GenCC ) {fprintf(f,"ASTBase **_root");} - else fprintf(f,"AST**_root"); - if ( !FoundException && q->pdecl!=NULL ) fprintf(f,","); - } - if ( FoundException ) - { - if ( GenAST ) fprintf(f,","); - fprintf(f,"int *_retsignal"); - if ( q->pdecl!=NULL ) { - fprintf(f,","); - } - } - if ( q->pdecl!=NULL ) { - DumpFormals(f, q->pdecl, bInitializer); /* MR23 */ - } - else { - if ( !GenAST && !FoundException ) { - fprintf(f,"void"); - } - } - fprintf(f,")"); -} - -void -#ifdef __USE_PROTOS -genJunction( Junction *q ) -#else -genJunction( q ) -Junction *q; -#endif -{ - require(q->ntype == nJunction, "genJunction: not junction"); - require(q->jtype == Generic, "genJunction: not generic junction"); - - if ( q->p1 != NULL ) TRANS(q->p1); - if ( q->p2 != NULL ) TRANS(q->p2); -} - -void -#ifdef __USE_PROTOS -genEndBlk( Junction *q ) -#else -genEndBlk( q ) -Junction *q; -#endif -{ -} - -void -#ifdef __USE_PROTOS -genEndRule( Junction *q ) -#else -genEndRule( q ) -Junction *q; -#endif -{ -} - -void -#ifdef __USE_PROTOS -genHdr( int file ) -#else -genHdr( file ) -int file; -#endif -{ - int i; - - _gen("/*\n"); - _gen(" * A n t l r T r a n s l a t i o n H e a d e r\n"); - _gen(" *\n"); - _gen(" * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n"); - _gen(" * Purdue University Electrical Engineering\n"); - _gen(" * With AHPCRC, University of Minnesota\n"); - _gen1(" * ANTLR Version %s\n", Version); - _gen(" *\n"); -/* MR10 */ _gen(" * "); -/* MR10 */ for (i=0 ; i < Save_argc ; i++) { -/* MR10 */ _gen(" "); -/* MR10 */ _gen(Save_argv[i]); -/* MR10 */ }; - _gen("\n"); - _gen(" *\n"); - _gen(" */\n\n"); - if (FirstAction != NULL ) dumpAction( FirstAction, output, 0, -1, 0, 1); /* MR11 MR15b */ - _gen1("#define ANTLR_VERSION %s\n", VersionDef); - _gen("#include \"pcctscfg.h\"\n"); - _gen("#include \"pccts_stdio.h\"\n"); - if ( strcmp(ParserName, DefaultParserName)!=0 ) - _gen2("#define %s %s\n", DefaultParserName, ParserName); - if ( strcmp(ParserName, DefaultParserName)!=0 ) - {_gen1("#include \"%s\"\n", RemapFileName);} - OutLineInfo(output,1,FileStr[file]); - if ( GenCC ) { - if ( UserTokenDefsFile != NULL ) - fprintf(output, "#include %s\n", UserTokenDefsFile); - else - fprintf(output, "#include \"%s\"\n", DefFileName); - } - - if ( HdrAction != NULL ) dumpAction( HdrAction, output, 0, -1, 0, 1); - if ( !GenCC && FoundGuessBlk ) - { - _gen("#define ZZCAN_GUESS\n"); - _gen("#include \"pccts_setjmp.h\"\n"); /* MR15 K.J. Cummings (cummings@peritus.com) */ - } - if ( FoundException ) - { - _gen("#define EXCEPTION_HANDLING\n"); - _gen1("#define NUM_SIGNALS %d\n", NumSignals); - } - if ( !GenCC && OutputLL_k > 1 ) _gen1("#define LL_K %d\n", OutputLL_k); - if ( GenAST&&!GenCC ) _gen("#define GENAST\n\n"); - if ( GenAST ) { - if ( GenCC ) {_gen1("#include \"%s\"\n\n", ASTBASE_H);} - else _gen("#include \"ast.h\"\n\n"); - } - if ( !GenCC && DemandLookahead ) _gen("#define DEMAND_LOOK\n\n"); -#ifdef DUM - if ( !GenCC && LexGen ) { - _gen1("#define zzEOF_TOKEN %d\n", (TokenInd!=NULL?TokenInd[EofToken]:EofToken)); - } -#endif - /* ###WARNING: This will have to change when SetWordSize changes */ - if ( !GenCC ) _gen1("#define zzSET_SIZE %d\n", NumWords(TokenNum-1)*sizeof(unsigned)); - if (TraceGen) { - _gen("#ifndef zzTRACE_RULES\n"); /* MR20 */ - _gen("#define zzTRACE_RULES\n"); /* MR20 */ - _gen("#endif\n"); /* MR22 */ - }; - if ( !GenCC ) {_gen("#include \"antlr.h\"\n");} - else { - _gen1("#include \"%s\"\n", APARSER_H); - _gen1("#include \"%s.h\"\n", CurrentClassName); - } - if ( !GenCC ) { - if ( UserDefdTokens ) - {_gen1("#include %s\n", UserTokenDefsFile);} - /* still need this one as it has the func prototypes */ - _gen1("#include \"%s\"\n", DefFileName); - } - /* still need this one as it defines the DLG interface */ - if ( !GenCC ) _gen("#include \"dlgdef.h\"\n"); - if ( LexGen && GenCC ) _gen1("#include \"%s\"\n", DLEXERBASE_H); - if ( GenCC ) _gen1("#include \"%s\"\n", ATOKPTR_H); - if ( !GenCC && LexGen ) _gen1("#include \"%s\"\n", ModeFileName); - -/* MR10 Ofer Ben-Ami (gremlin@cs.huji.ac.il) */ -/* MR10 Finally, a definition of the Purify macro */ - - if (PURIFY == TRUE) { /* MR23 */ - _gen("\n/* MR23 In order to remove calls to PURIFY use the antlr"); /* MR23 */ - _gen(" -nopurify option */\n\n"); /* MR23 */ - _gen("#ifndef PCCTS_PURIFY\n"); - _gen("#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\\0',(s));\n"); - _gen("#endif\n\n"); - } /* MR23 */ -} - -void -#ifdef __USE_PROTOS -genHdr1( int file ) -#else -genHdr1( file ) -int file; -#endif -{ - ListNode *p; - - genHdr(file); - if ( GenAST ) - { - if ( !GenCC ) { - _gen("#include \"ast.c\"\n"); - _gen("zzASTgvars\n\n"); - } - } - if ( !GenCC ) _gen("ANTLR_INFO\n"); - if ( BeforeActions != NULL ) - { - for (p = BeforeActions->next; p!=NULL; p=p->next) - { - UserAction *ua = (UserAction *)p->elem; - dumpAction( ua->action, output, 0, ua->file, ua->line, 1); - } - } - - if ( !FoundException ) return; - - if ( GenCC ) - { - _gen1("\nvoid %s::\n", CurrentClassName); - _gen("zzdflthandlers( int _signal, int *_retsignal )\n"); - _gen("{\n"); - } - else - { - _gen("\nvoid\n"); -/* MR1 */ -/* MR1 10-Apr-97 133MR1 Replace __STDC__ with __USE_PROTOS */ -/* MR1 */ - _gen("#ifdef __USE_PROTOS\n"); /* MR1 */ - _gen("zzdflthandlers( int _signal, int *_retsignal )\n"); - _gen("#else\n"); - _gen("zzdflthandlers( _signal, _retsignal )\n"); - _gen("int _signal;\n"); - _gen("int *_retsignal;\n"); - _gen("#endif\n"); - _gen("{\n"); - } - tabs++; - if ( DefaultExGroup!=NULL ) - { - dumpException(DefaultExGroup, 1); - if ( !hasDefaultException(DefaultExGroup) ) - { - gen("default :\n"); - tabs++; - gen("*_retsignal = _signal;\n"); - tabs--; - gen("}\n"); - } - } - else { - gen("*_retsignal = _signal;\n"); - } - - tabs--; - _gen("}\n\n"); -} - -void -#ifdef __USE_PROTOS -genStdPCCTSIncludeFile( FILE *f,char *gate ) /* MR10 */ -#else -genStdPCCTSIncludeFile( f , gate) /* MR10 */ -FILE *f; -char * gate; /* MR10 */ -#endif -{ -/* MR10 Ramanathan Santhanam (ps@kumaran.com) */ -/* MR10 Same preprocessor symbol use to gate stdpccts.h */ -/* MR10 even when two grammars are in use. */ -/* MR10 Derive gate symbol from -fh filename */ - - if (gate == NULL) { - fprintf(f,"#ifndef STDPCCTS_H\n"); /* MR10 */ - fprintf(f,"#define STDPCCTS_H\n"); /* MR10 */ - } else { - fprintf(f,"#ifndef STDPCCTS_%s_H\n",gate); /* MR10 */ - fprintf(f,"#define STDPCCTS_%s_H\n",gate); /* MR10 */ - }; - fprintf(f,"/*\n"); - if (gate == NULL) { - fprintf(f," * %s -- P C C T S I n c l u d e\n", stdpccts); - } else { - fprintf(f," * Standard PCCTS include file with -fh %s -- P C C T S I n c l u d e\n", stdpccts); - } - fprintf(f," *\n"); - fprintf(f," * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001\n"); - fprintf(f," * Purdue University Electrical Engineering\n"); - fprintf(f," * With AHPCRC, University of Minnesota\n"); - fprintf(f," * ANTLR Version %s\n", Version); - fprintf(f," */\n\n"); - - fprintf(f,"#ifndef ANTLR_VERSION\n"); - fprintf(f,"#define ANTLR_VERSION %s\n", VersionDef); - fprintf(f,"#endif\n\n"); - - if (FirstAction != NULL ) dumpAction(FirstAction, f, 0, -1, 0, 1); /* MR11 */ - - fprintf(f,"#include \"pcctscfg.h\"\n"); - fprintf(f,"#include \"pccts_stdio.h\"\n"); - if ( GenCC ) - { - if ( UserDefdTokens ) - fprintf(f, "#include %s\n", UserTokenDefsFile); - else { - fprintf(f, "#include \"%s\"\n", DefFileName); - } - - fprintf(f, "#include \"%s\"\n", ATOKEN_H); - - if ( HdrAction != NULL ) dumpAction( HdrAction, f, 0, -1, 0, 1); - - fprintf(f, "#include \"%s\"\n", ATOKENBUFFER_H); - - if ( OutputLL_k > 1 ) fprintf(f,"static const unsigned LL_K=%d;\n", OutputLL_k); - if ( GenAST ) { - fprintf(f, "#include \"%s\"\n", ASTBASE_H); - } - - if (TraceGen) { - fprintf(f,"#ifndef zzTRACE_RULES\n"); /* MR20 */ - fprintf(f,"#define zzTRACE_RULES\n"); /* MR20 */ - fprintf(f,"#endif\n"); /* MR22 */ - }; - - fprintf(f,"#include \"%s\"\n", APARSER_H); - fprintf(f,"#include \"%s.h\"\n", CurrentClassName); - if ( LexGen ) fprintf(f,"#include \"%s\"\n", DLEXERBASE_H); - fprintf(f, "#endif\n"); - return; - } - - if ( strcmp(ParserName, DefaultParserName)!=0 ) - fprintf(f, "#define %s %s\n", DefaultParserName, ParserName); - if ( strcmp(ParserName, DefaultParserName)!=0 ) - fprintf(f, "#include \"%s\"\n", RemapFileName); - if ( UserTokenDefsFile != NULL ) - fprintf(f, "#include %s\n", UserTokenDefsFile); - if ( HdrAction != NULL ) dumpAction( HdrAction, f, 0, -1, 0, 1); - if ( FoundGuessBlk ) - { - fprintf(f,"#define ZZCAN_GUESS\n"); - fprintf(f,"#include \"pccts_setjmp.h\"\n"); - } - if (TraceGen) { - fprintf(f,"#ifndef zzTRACE_RULES\n"); /* MR20 */ - fprintf(f,"#define zzTRACE_RULES\n"); /* MR20 */ - fprintf(f,"#endif\n"); /* MR22 */ - }; - if ( OutputLL_k > 1 ) fprintf(f,"#define LL_K %d\n", OutputLL_k); - if ( GenAST ) fprintf(f,"#define GENAST\n"); - if ( FoundException ) - { -/* MR1 7-Apr-97 1.33MR1 */ -/* MR1 Fix suggested by: */ -/* MR1 Francois-Xavier Fontaine (fontaine_f@istvax.ist.lu) */ - - fprintf(f,"#define EXCEPTION_HANDLING\n"); /* MR1 */ - fprintf(f,"#define NUM_SIGNALS %d\n", NumSignals); /* MR1 */ - } - if ( DemandLookahead ) fprintf(f,"#define DEMAND_LOOK\n"); -#ifdef DUM - if ( LexGen ) fprintf(f, "#define zzEOF_TOKEN %d\n", (TokenInd!=NULL?TokenInd[EofToken]:EofToken)); -#endif - /* ###WARNING: This will have to change when SetWordSize changes */ - fprintf(f, "#define zzSET_SIZE %d\n", NumWords(TokenNum-1)*sizeof(unsigned)); - if (TraceGen) { - fprintf(f,"#ifndef zzTRACE_RULES\n"); /* MR20 */ - fprintf(f,"#define zzTRACE_RULES\n"); /* MR20 */ - fprintf(f,"#endif\n"); /* MR22 */ - }; - fprintf(f,"#include \"antlr.h\"\n"); - if ( GenAST ) fprintf(f,"#include \"ast.h\"\n"); - if ( UserDefdTokens ) - fprintf(f, "#include %s\n", UserTokenDefsFile); - /* still need this one as it has the func prototypes */ - fprintf(f, "#include \"%s\"\n", DefFileName); - /* still need this one as it defines the DLG interface */ - fprintf(f,"#include \"dlgdef.h\"\n"); - /* don't need this one unless DLG is used */ - if ( LexGen ) fprintf(f,"#include \"%s\"\n", ModeFileName); - fprintf(f,"#endif\n"); -} - -/* dump action 's' to file 'output' starting at "local" tab 'tabs' - Dump line information in front of action if GenLineInfo is set - If file == -1 then GenLineInfo is ignored. - The user may redefine the LineInfoFormatStr to his/her liking - most compilers will like the default, however. - - June '93; changed so that empty lines are left alone so that - line information is correct for the compiler/debuggers. -*/ -void -#ifdef __USE_PROTOS -dumpAction( char *s, FILE *output, int tabs, int file, int line, -int final_newline ) -#else -dumpAction( s, output, tabs, file, line, final_newline ) -char *s; -FILE *output; -int tabs; -int file; -int line; -int final_newline; -#endif -{ - int inDQuote, inSQuote; - require(s!=NULL, "dumpAction: NULL action"); - require(output!=NULL, eMsg1("dumpAction: output FILE is NULL for %s",s)); - - if ( GenLineInfo && file != -1 ) - { - OutLineInfo(output,line,FileStr[file]); - } - PastWhiteSpace( s ); - /* don't print a tab if first non-white char is a # (preprocessor command) */ - if ( *s!='#' ) {TAB;} - inDQuote = inSQuote = FALSE; - while ( *s != '\0' ) - { - if ( *s == '\\' ) - { - fputc( *s++, output ); /* Avoid '"' Case */ - if ( *s == '\0' ) return; - if ( *s == '\'' ) fputc( *s++, output ); - if ( *s == '\"' ) fputc( *s++, output ); - } - if ( *s == '\'' ) - { - if ( !inDQuote ) inSQuote = !inSQuote; - } - if ( *s == '"' ) - { - if ( !inSQuote ) inDQuote = !inDQuote; - } - if ( *s == '\n' ) - { - fputc('\n', output); - s++; - PastWhiteSpace( s ); - if ( *s == '}' ) - { - --tabs; - TAB; - fputc( *s++, output ); - continue; - } - if ( *s == '\0' ) return; - if ( *s != '#' ) /* #define, #endif etc.. start at col 1 */ - { - TAB; - } - } - if ( *s == '}' && !(inSQuote || inDQuote) ) - { - --tabs; /* Indent one fewer */ - } - if ( *s == '{' && !(inSQuote || inDQuote) ) - { - tabs++; /* Indent one more */ - } - fputc( *s, output ); - s++; - } - if ( final_newline ) fputc('\n', output); -} - -static void -#ifdef __USE_PROTOS -dumpAfterActions( FILE *output ) -#else -dumpAfterActions( output ) -FILE *output; -#endif -{ - ListNode *p; - require(output!=NULL, "dumpAfterActions: output file was NULL for some reason"); - if ( AfterActions != NULL ) - { - for (p = AfterActions->next; p!=NULL; p=p->next) - { - UserAction *ua = (UserAction *)p->elem; - dumpAction( ua->action, output, 0, ua->file, ua->line, 1); - } - } - fclose( output ); -} - -/* - * Find the next action in the stream of execution. Do not pass - * junctions with more than one path leaving them. - * Only pass generic junctions. - * - * Scan forward while (generic junction with p2==NULL) - * If we stop on an action, return ptr to the action - * else return NULL; - */ -static ActionNode * -#ifdef __USE_PROTOS -findImmedAction( Node *q ) -#else -findImmedAction( q ) -Node *q; -#endif -{ - Junction *j; - require(q!=NULL, "findImmedAction: NULL node"); - require(q->ntype>=1 && q->ntype<=NumNodeTypes, "findImmedAction: invalid node"); - - while ( q->ntype == nJunction ) - { - j = (Junction *)q; - if ( j->jtype != Generic || j->p2 != NULL ) return NULL; - q = j->p1; - if ( q == NULL ) return NULL; - } - if ( q->ntype == nAction ) return (ActionNode *)q; - return NULL; -} - -static void -#ifdef __USE_PROTOS -dumpRetValAssign( char *retval, char *ret_def, RuleRefNode * ruleRef /* MR30 */) -#else -dumpRetValAssign( retval, ret_def, ruleRef /* MR30 */) -char *retval; -char *ret_def; -RuleRefNode *ruleRefNode; -#endif -{ - char *q = ret_def; - - tab(); - while ( *retval != '\0' && *q != '\0') - { - while ( isspace((*retval)) ) retval++; - while ( *retval!=',' && *retval!='\0' ) fputc(*retval++, output); - fprintf(output, " = _trv."); - - DumpNextNameInDef(&q, output); - while ( isspace(*q) ) q++; - fputc(';', output); fputc(' ', output); - if ( *retval == ',' ) retval++; - } - if (*retval == '\0' && *q != '\0') { -/* MR30 */ errFL("Fewer output values than output formals for rule reference", -/* MR30 */ FileStr[ruleRef->file],ruleRef->line); - } - if (*retval != '\0' && *q == '\0') { -/* MR30 */ errFL("More output actuals than output formals for rule reference", -/* MR30 */ FileStr[ruleRef->file],ruleRef->line); - } -} - -/* This function computes the set of tokens that can possibly be seen k - * tokens in the future from point j - */ - -static set -#ifdef __USE_PROTOS -ComputeErrorSet( Junction *j, int k, int usePlusBlockBypass) -#else -ComputeErrorSet( j, k, usePlusBlockBypass ) -Junction *j; -int k; -int usePlusBlockBypass; -#endif -{ - Junction *alt1; - set a, rk, f; - require(j->ntype==nJunction, "ComputeErrorSet: non junction passed"); - - f = rk = empty; - for (alt1=j; alt1!=NULL; alt1 = (Junction *)alt1->p2) - { - if (alt1->ignore && ! usePlusBlockBypass) continue; /* MR21 - Ignore aPlusBlk forward p2 */ - REACH(alt1->p1, k, &rk, a); - require(set_nil(rk), "ComputeErrorSet: rk != nil"); - set_free(rk); - set_orin(&f, a); - set_free(a); - } - return f; -} - -static char * -#ifdef __USE_PROTOS -tokenFollowSet(TokNode *p) -#else -tokenFollowSet(p) -TokNode *p; -#endif -{ - static char buf[100]; - set rk, a; - int n; - rk = empty; - - REACH(p->next, 1, &rk, a); - require(set_nil(rk), "rk != nil"); - set_free(rk); - n = DefErrSet( &a, 0, NULL ); - set_free(a); - if ( GenCC ) - sprintf(buf, "err%d", n); - else - sprintf(buf, "zzerr%d", n); - return buf; -} - -static void -#ifdef __USE_PROTOS -makeErrorClause( Junction *q, set f, int max_k, int usePlusBlockBypass ) -#else -makeErrorClause( q, f, max_k, usePlusBlockBypass ) -Junction *q; -set f; -int max_k; -int usePlusBlockBypass; -#endif -{ - char * handler_id=""; /* MR7 */ - int nilf=0; /* MR13 */ - RuleEntry *ruleEntry; /* MR14 */ - - if ( FoundException ) - { - _gen("else {\n"); - tabs++; - if ( FoundGuessBlk ) - { - if ( GenCC ) {gen("if ( guessing ) goto fail;\n");} - else gen("if ( zzguessing ) goto fail;\n"); - } - gen("if (_sva) _signal=NoViableAlt;\n"); - gen("else _signal=NoSemViableAlt;\n"); - if (q->outerEG != NULL) { - handler_id=q->outerEG->altID; -#if 0 - } else { - printf("q->curAltNum=%d q->exception_label=%s\n",q->curAltNum,q->exception_label); - gen("*** DEBUG *** outerEG==NULL\n"); -#endif - }; - gen1("goto %s_handler; /* MR7 */\n",handler_id); /* MR7 */ - tabs--; - gen("}\n"); - return; - } - - if ( max_k == 1 ) - { -/* MR13 */ nilf=set_nil(f); - if ( GenCC ) { - _gen1("else {FAIL(1,err%d", DefErrSet1(1,&f,1,NULL)); - } else { - _gen1("else {zzFAIL(1,zzerr%d", DefErrSet1(1,&f,1,NULL)); - }; - set_free(f); - } - else - { - int i; - set_free(f); - if ( GenCC ) {_gen1("else {FAIL(%d", max_k);} - else _gen1("else {zzFAIL(%d", max_k); - - ruleEntry = (RuleEntry *) hash_get(Rname,q->rname); - - for (i=1; i<=max_k; i++) - { -/* MR14 */ if (ruleEntry->dontComputeErrorSet) { -/* MR14 */ f=empty; - } else { - f = ComputeErrorSet(q, i, usePlusBlockBypass /* use plus block bypass ? */ ); - } - - if ( GenCC ) {_gen1(",err%d", DefErrSet( &f, 1, NULL ));} - else _gen1(",zzerr%d", DefErrSet( &f, 1, NULL )); - - set_free(f); - } - } - _gen(",&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}\n"); -/* MR13 */ if (nilf) { -/* MR13 */ errFL("empty error set for alt - probably because of undefined rule or infinite left recursion", -/* MR13 */ FileStr[q->file],q->line); -/* MR13 */ gen(" /* MR13 empty error set for this alt - undef rule ? infinite left recursion ? */"); -/* MR13 */ }; -} - -static /* MR7 */ -#ifdef __USE_PROTOS -char * findOuterHandlerLabel(ExceptionGroup *eg) /* MR7 */ -#else -char * findOuterHandlerLabel(eg) /* MR7 */ -ExceptionGroup *eg; /* MR7 */ -#endif -{ - char *label=NULL; /* MR7 */ - ExceptionGroup *outerEG; /* MR7 */ - - if (eg->forRule == 0) { /* MR7 */ - if (eg->labelEntry != NULL) { /* MR7 */ - outerEG=eg->labelEntry->outerEG; /* MR7 */ - if (outerEG != NULL) { /* MR7 */ - label=outerEG->altID; /* MR7 */ - outerEG->used=1; /* MR7 */ - }; /* MR7 */ - } else if (eg->outerEG != NULL) { /* MR7 */ - outerEG=eg->outerEG; /* MR7 */ - label=outerEG->altID; /* MR7 */ - outerEG->used=1; /* MR7 */ - }; /* MR7 */ - }; /* MR7 */ - return (label==NULL ? "" : label); /* MR7 */ -} /* MR7 */ - -/*** debug ***/ -#if 0 -** static /* MR7 */ -** #ifdef __USE_PROTOS -** char * findOuterAltHandlerLabel(Junction *startJ) /* MR7 */ -** #else -** char * findOuterAltHandlerLabel(startJ) /* MR7 */ -** Junction *startJ; /* MR7 */ -** #endif -** { /* MR7 */ -** char *label=NULL; /* MR7 */ -** Junction *alt; /* MR7 */ -** /* MR7 */ -** for (alt=startJ; alt != NULL; alt=alt->outerAltstart) { /* MR7 */ -** label=alt->exception_label; /* MR7 */ -** if (label != NULL) break; /* MR7 */ -** }; /* MR7 */ -** return (label==NULL ? "" : label); /* MR7 */ -** } /* MR7 */ -#endif - -#ifdef __USE_PROTOS -static void OutLineInfo(FILE *file,int line,char *fileName) -#else -static void OutLineInfo(file,line,fileName) - FILE * file; - int line; - char * fileName; -#endif -{ - static char * prevFileName=NULL; - static char * prevFileNameMS=NULL; - - char * p; - char * q; - - if (! GenLineInfo) return; - - if (!GenLineInfoMS) { - fprintf(file, LineInfoFormatStr,line,fileName); - } else { - if (fileName == prevFileName) { - fprintf(file, LineInfoFormatStr,line,prevFileNameMS); - } else { - if (prevFileNameMS != NULL) free (prevFileNameMS); - prevFileNameMS=(char *)calloc(1,strlen(fileName)+1); - require(prevFileNameMS != NULL,"why not do this in calloc wrapper"); - q=prevFileNameMS; - for (p=fileName; *p != 0; p++) { - *q=*p; - if (*q == '\\') *q='/'; - q++; - } - } - prevFileName=fileName; - }; -} - -#if 0 - -/* MR21 */ - -#ifdef __USE_PROTOS -void OutFirstSetSymbol(Junction *q, char * pSymbol) -#else -void OutFirstSetSymbol(q, pSymbol) - Junction* q; - char * pSymbol -#endif -{ - - set f; - if (pSymbol == NULL) return; - gen1("/** #FirstSetSymbol(%s) **/\n",pSymbol); - f = ComputeErrorSet(q, 1, 0 /* use plus block bypass ? */); - DefErrSetWithSuffix (0 /* nil ok */, &f,0 /* no substitute */, pSymbol, ""); - set_free(f); -} -#endif - -/* MR21 */ - -#ifdef __USE_PROTOS -void BlockPreambleOption(Junction *q, char * pSymbol) -#else -void BlockPreambleOption(q, pSymbol) - Junction* q; - char * pSymbol; -#endif -{ - set f = empty; - if (pSymbol != NULL) { - f = ComputeErrorSet(q, 1, 0 /* use plus block bypass ? */); - gen1("/** #FirstSetSymbol(%s) **/\n",pSymbol); - DefErrSetWithSuffix (0 /* nil ok */, &f,0 /* no substitute */, pSymbol, ""); - } - set_free(f); -} - -/* MR21 */ - -void -#ifdef __USE_PROTOS -dumpActionPlus(ActionNode *a, char *s, FILE *output, int tabs, int file, int line, -int final_newline ) -#else -dumpActionPlus(a, s, output, tabs, file, line, final_newline ) -ActionNode *a; -char *s; -FILE *output; -int tabs; -int file; -int line; -int final_newline; -#endif -{ - dumpAction(s,output,tabs,file,line,final_newline); -} - - -#if 0 -** #ifdef __USE_PROTOS -** void MR_ErrorSets(Junction *q, int max_k, int usePlusBlockBypass) -** #else -** void MR_ErrorSets(q, max_k, usePlusBlockBypass) -** Junction *q; -** int max_k; -** int usePlusBlockBypass; -** #endif -** { -** int k; -** set setResult; -** Junction* alt1; -** Junction* p; -** set rk; -** -** require (max_k <= CLL_k, "k > CLL_k"); -** -** -** for (k = 1; k <= CLL_k; k++) {set_clr(q->fset[k]); } -** -** for (k = 1; k <= max_k; k++) { -** for (alt1=q; alt1 != NULL; alt1 = (Junction *)alt1->p2) -** { -** if (alt1->ignore && ! usePlusBlockBypass) continue; -** p = analysis_point((Junction *)alt1->p1); -** REACH(p, k, &rk, setResult); -** require(set_nil(rk), "rk != nil"); -** set_orin(&q->fset[k], setResult); -** } -** } -** } -#endif - - -#ifdef __USE_PROTOS -void DumpInitializers(FILE* output, RuleEntry *r, char * pReturn) -#else -void DumpInitializers(output, r, pReturn) -FILE* output; -RuleEntry *r; -char * pReturn; -#endif -{ - char *p = pReturn; - char *pDataType; - char *pSymbol; - char *pEqualSign; - char *pValue; - char *pSeparator; - int nest = 0; - char *q; - - require(pReturn!=NULL, "DumpInitializer: invalid string"); - - while (*p != 0) { - p = endFormal(p, - &pDataType, - &pSymbol, - &pEqualSign, - &pValue, - &pSeparator, - &nest); - if (nest != 0) return; - if (pValue != NULL) { - tab(); - q = strBetween(pSymbol, pEqualSign, pSeparator); - fprintf(output, "_retv.%s", q); - q = strBetween(pValue, NULL, pSeparator); - fprintf(output, " = %s;\n", q); - } - } -} - -#ifdef __USE_PROTOS -void DumpFormals(FILE* output, char * pReturn, int bInitializer) -#else -void DumpFormals(output, pReturn, bInitializer) -FILE* output; -char * pReturn; -int bInitializer; -#endif -{ - char *p = pReturn; - char *pDataType; - char *pSymbol; - char *pEqualSign; - char *pValue; - char *pSeparator; - int nest = 0; - char *q; - int count = 0; - - require(pReturn!=NULL, "DumpFormals: invalid string"); - - while (*p != 0) { - p = endFormal(p, - &pDataType, - &pSymbol, - &pEqualSign, - &pValue, - &pSeparator, - &nest); - if (nest != 0) return; - if (count > 0) fprintf(output,","); - if (pDataType != NULL && pSymbol != NULL) { - q = strBetween(pDataType, pSymbol, pSeparator); - fprintf(output, "%s", q); - q = strBetween(pSymbol, pEqualSign, pSeparator); - fprintf(output," %s",q); - if (pValue != NULL) { - q = strBetween(pValue, NULL, pSeparator); - if (bInitializer != 0) { - fprintf(output, " = %s", q); - } - } - } - count++; - } -} - -/* MR23 Check for empty alt in a more intelligent way. - Previously, an empty alt for genBlk had to point directly - to the endBlock. This did not work once I changed {...} - blocks to look like (...|...| epsilon) since there were - intervening generics. This fixes the problem for this - particular case. Things like actions or empty blocks of - various kinds will still cause problems, but I wasnt't - prepared to handle pathological cases like (A|()*). It - does handle (A | ()), which is a recommended idiom for - epsilon. - - Actually, this isn't quite correct since it doesn't handle - the case of the ignore bit in the plus block bypass, but - I'm too tired to figure out the correct fix, and will just - work around it. -*/ - -#ifdef __USE_PROTOS -int isEmptyAlt(Node * alt, Node * endBlock) -#else -int isEmptyAlt(alt, endBlock) -Node * alt; -Node * endBlock; -#endif -{ - Node * n = alt; - Junction * j; - while (n != endBlock) { - switch (n->ntype) { - - case nRuleRef: - return 0; - - case nToken: - return 0; - - case nAction: - return 0; - - case nJunction: - goto JUNCTION; - - default: - fatal_internal("Invalid node type"); - return 0; - } -JUNCTION: - j = (Junction *) n; - - switch (j->jtype) { - case Generic: - { - n = j->p1; - goto NEXT; - } - - case aSubBlk: - { - n = j->p1; /* MR26 */ - goto NEXT; /* MR26 */ - } - - case EndBlk: - return 0; - - case EndRule: - return 1; - - default: - return 0; - } -NEXT: continue; - } - return 1; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/generic.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/generic.h deleted file mode 100644 index db5d71190..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/generic.h +++ /dev/null @@ -1,286 +0,0 @@ -/* - * generic.h -- generic include stuff for new PCCTS ANTLR. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#define StrSame 0 - -#define DefaultParserName "zzparser" - -/* MR9 JVincent@novell.com Allow user to override default ZZLEXBUFSIZE */ -/* MR11 thm Raise antlr's own default ZZLEXBUFSIZE to 8k */ -/* MR22 thm Raise antlr's own default ZZLEXBUFSIZE to 32k */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 32000 -#endif - -/* Tree/FIRST/FOLLOW defines -- valid only after all grammar has been read */ -#define ALT TokenNum+1 -#define SET TokenNum+2 -#define TREE_REF TokenNum+3 - - /* E r r o r M a c r o s */ - -#define fatal(err) fatalFL(err, __FILE__, __LINE__) -#define fatal_internal(err) fatal_intern(err, __FILE__, __LINE__) - - -#define eMsg1(s,a) eMsg3(s,a,NULL,NULL) -#define eMsg2(s,a,b) eMsg3(s,a,b,NULL) - - /* S a n i t y C h e c k i n g */ - -#ifndef require -#define require(expr, err) {if ( !(expr) ) fatal_internal(err);} -#endif - - /* L i s t N o d e s */ - -typedef struct _ListNode { - void *elem; /* pointer to any kind of element */ - struct _ListNode *next; - } ListNode; - -/* Define a Cycle node which is used to track lists of cycles for later - * reconciliation by ResolveFoCycles(). - */ -typedef struct _c { - int croot; /* cycle root */ - set cyclicDep; /* cyclic dependents */ - unsigned deg; /* degree of FOLLOW set of croot */ - } Cycle; - -typedef struct _e { - int tok; /* error class name == TokenStr[tok] */ - ListNode *elist; /* linked list of elements in error set */ - set eset; - int setdeg; /* how big is the set */ - int lexclass; /* which lex class is it in? */ - } ECnode; - -typedef struct _TCnode { - int tok; /* token class name */ - ListNode *tlist; /* linked list of elements in token set */ - set tset; - int lexclass; /* which lex class is it in? */ - unsigned char dumped; /* this def has been been dumped */ - unsigned char dumpedComplement; /* this def has been been dumped */ - unsigned setnum; /* which set number is this guy? (if dumped) */ - unsigned setnumComplement; /* MR23 */ - unsigned setnumErrSet; /* MR23 which set is this #tokclass error set (if dumped) */ - unsigned setnumErrSetComplement; /* MR23 */ - } TCnode; - -typedef struct _ft { - char *token; /* id of token type to remap */ - int tnum; /* move token type to which token position */ - } ForcedToken; - -typedef struct _ContextGuardPredicates { /* MR13 */ - Predicate *pred; /* MR13 */ - } ContextGuardPredicates; /* MR13 */ - -#define newListNode (ListNode *) calloc(1, sizeof(ListNode)); -#define newCycle (Cycle *) calloc(1, sizeof(Cycle)); -#define newECnode (ECnode *) calloc(1, sizeof(ECnode)); -#define newTCnode (TCnode *) calloc(1, sizeof(TCnode)); - - - /* H a s h T a b l e E n t r i e s */ - -typedef struct _t { /* Token name or expression */ - char *str; - struct _t *next; - int token; /* token number */ - unsigned char classname; /* is it a err/tok class name or token */ - TCnode *tclass; /* ptr to token class */ - char *action; - char *akaString; - } TermEntry; - -typedef struct _r { /* Rule name and ptr to start of rule */ - char *str; - struct _t *next; - int rulenum; /* RulePtr[rulenum]== ptr to RuleBlk junction */ - unsigned char noAST;/* gen AST construction code? (def==gen code) */ - char *egroup; /* which error group (err reporting stuff) */ -#if 0 - /* MR27 This appears to never be used. Delete this code later. */ - - ListNode *el_labels;/* list of element labels ref in all of rule */ -#endif - ListNode *ast_labels_in_actions; /* MR27 */ - unsigned char has_rule_exception; - char dontComputeErrorSet; /* MR14 - don't compute error set - special for rule in alpha part of - (alpha)? beta block */ - } RuleEntry; - -typedef struct _f { /* cache Fi/Fo set */ - char *str; /* key == (rulename, computation, k) */ - struct _f *next; - set fset; /* First/Follow of rule */ - set rk; /* set of k's remaining to be done after ruleref */ - int incomplete; /* only w/FOLLOW sets. Use only if complete */ - } CacheEntry; - -typedef struct _LabelEntry { /* element labels */ - char *str; - struct _f *next; - Node *elem; /* which element does it point to? */ - ExceptionGroup *ex_group; - /* Is there an exception attached to label? */ - ExceptionGroup *outerEG; /* MR7 */ - /* next EG if ex_group doesn't catch it MR7 */ - struct _LabelEntry *pendingLink; /* MR7 */ - /* too lazy to use ListNode ? MR7 */ - int curAltNum; /* MR7 */ - } LabelEntry; - -typedef struct _SignalEntry { - char *str; - struct _f *next; - int signum; /* unique signal number */ - } SignalEntry; - -typedef struct _PredEntry { /* MR11 predicate name and ptr to string */ - char *str; - struct _PredEntry *next; - int file; - int line; - Predicate *pred; - char *predLiteral; - } PredEntry; - -typedef struct _PointerStack { /* MR10 */ - int count; - int size; - void **data; - } PointerStack; - -#define newTermEntry(s) (TermEntry *) newEntry(s, sizeof(TermEntry)) -#define newRuleEntry(s) (RuleEntry *) newEntry(s, sizeof(RuleEntry)) -#define newCacheEntry(s) (CacheEntry *) newEntry(s, sizeof(CacheEntry)) -#define newLabelEntry(s) (LabelEntry *) newEntry(s, sizeof(LabelEntry)) -#define newSignalEntry(s) (SignalEntry *) newEntry(s, sizeof(SignalEntry)) -#define newPredEntry(s) (PredEntry *) newEntry(s,sizeof(PredEntry)) - -typedef struct _UserAction { - char *action; - int file, line; - } UserAction; - - - /* L e x i c a l C l a s s */ - -/* to switch lex classes, switch ExprStr and Texpr (hash table) */ -typedef struct _lc { - char *classnum, **exprs; - Entry **htable; - } LClass; - -typedef struct _exprOrder { - char *expr; - int lclass; - } Expr; - - -typedef Graph Attrib; - - /* M a x i m u m s */ - -/* MR20 Note G. Hobbelt These values are superceded by values in hash.h */ - -#ifndef HashTableSize -#define HashTableSize 253 -#endif -#ifndef StrTableSize -#define StrTableSize 15000 /* all tokens, nonterminals, rexprs stored here */ -#endif -#define MaxLexClasses 50 /* how many automatons */ -/* TokenStart and EofToken are ignored if #tokdefs meta-op is used */ -#define TokenStart 2 /* MUST be in 1 + EofToken */ -#define EofToken 1 /* Always predefined to be 1 */ - -#ifndef MaxNumFiles -#define MaxNumFiles 99 -#endif - -/**** MR9 JVincent@novell.com Move to pcctscfg.h */ -/**** #define MaxFileName 300 ****/ /* MR9 Move to pcctscfg.h */ /* largest file name size */ - -#define MaxRuleName 100 /* largest rule name size */ -#define TSChunk 100 /* how much to expand TokenStr/ExprStr each time */ -#define TIChunk TSChunk /* expand TokenInd by same as TokenStr to mirror them */ -#define FoStackSize 100 /* deepest FOLLOW recursion possible */ - -#define MaxClassDeclStuff 256 /* MR10 */ - -#define NumPredefinedSignals 3 - - /* S t a n d a r d S i g n a l s */ - -#define sigNoSignal 0 -#define sigMismatchedToken 1 -#define sigNoViableAlt 2 -#define sigNoSemViableAlt 3 - - - -/* AST token types */ -#define ASTexclude 0 -#define ASTchild 1 -#define ASTroot 2 -#define ASTinclude 3 /* include subtree made by rule ref */ - - -#define PredictionVariable "zzpr_expr" -#define PredictionLexClassSuffix "_zzpred" - -#define WildCardString "WildCard" - -#if 0 - /* Removed in version 1.33MR19 - Don't understand why this never caused problems before - */ - - /********************************************************* - #ifndef ANTLRm - #define ANTLRm(st, f, _m) zzbufsize = ZZLEXBUFSIZE;\ - zzmode(_m); \ - zzenterANTLR(f); \ - st; ++zzasp; \ - zzleaveANTLR(f); - #endif - *********************************************************/ -#endif - -#include "proto.h" -#include "pcctscfg.h" /* MR14 */ -#include diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/globals.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/globals.c deleted file mode 100644 index 3b7631f7f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/globals.c +++ /dev/null @@ -1,484 +0,0 @@ -/* - * globals.c -- File containing all variables/tables visible to all files. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include - -#include "pcctscfg.h" - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" - -char Version[] = "1.33MR33" ; /* PCCTS version number */ /* MRXXX */ -char VersionDef[] = "13333"; /* same (except int equiv for preproc symbol) */ /* MRXXX */ - -char LexStartSymbol[] = "START";/* Name of starting lexical class/automaton */ -char *RemapFileName = "remap.h"; -char *DlgFileName = "parser.dlg"; -char *DefFileName = "tokens.h"; -char *ErrFileName = "err.c"; -char *ModeFileName = "mode.h"; -char *StdMsgName = NULL; - -char *ParserName = DefaultParserName; - -/* list of PCCTS supplied support symbols; these are renamed when more than - * one ANTLR-generated parsers are linked together to avoid name conflicts. - * Can't use '##' ANSIC preprocessor concat operator with K&R and: - * #define zzskip zzparser ## skip - * will not work for ANSI/C++ as 'zzparserskip' is created w/o zzparser - * being substituted--ack!!! - */ -char *StandardSymbols[] = { -/* ANTLR stuff */ - "zzStackOvfMsg", - "zzasp", - "zzaStack", - "inf_tokens", - "inf_text", - "inf_text_buffer", - "inf_text_buffer_ptr", - "inf_text_buffer_size", - "inf_labase", - "inf_last", - "inf_lap", - "zztokenLA", - "zztextLA", - "zzlap", - "zzlabase", - "zztoktext", - "zztoken", - "zzdirty", - "zzguessing", - "zzguess_start", - "zzresynch", - "zzinf_tokens", - "zzinf_text", - "zzinf_text_buffer", - "zzinf_labase", - "zzinf_last", - "zzfill_inf_look", - "zzFAIL", - "zzsave_antlr_state", - "zzrestore_antlr_state", - "zzsyn", - "zzset_el", - "zzset_deg", - "zzedecode", - "_zzsetmatch", - "_zzmatch", - "_inf_zzgettok", - "zzconsumeUntil", - "zzconsumeUntilToken", - "_zzmatch_wsig", - "_zzsetmatch_wsig", - "_zzmatch_wdfltsig", - "_zzsetmatch_wdfltsig", - "zzdflthandlers", -/* DLG stuff */ - "zzreal_line", - "zzcharfull", - "zzerr", - "zzlextext", - "zzbegexpr", - "zzendexpr", - "zzbufsize", - "zzbegcol", - "zzendcol", - "zzline", - "zzchar", - "zzbufovf", - "zzrdstream", - "zzrdfunc", - "zzrdstr", - "zzclose_stream", - "zzsave_dlg_state", - "zzrestore_dlg_state", - "zzmode", - "zzskip", - "zzmore", - "zzreplchar", - "zzreplstr", - "zzgettok", - "zzadvance", - "zzerrstd", - "zzerr_in", - "zzconstr_attr", - "zzempty_attr", - "zzerraction", - "zztokens", /* list of token regular expressions */ - "dfa", - "accepts", - "actions", - "zzTraceOptionValue", /* MR10 */ - "zzTraceGuessOptionValue", /* MR10 */ - "zzTraceCurrentRuleName", /* MR10 */ - "zzTraceDepth", /* MR10 */ - "zzGuessSeq", /* MR10 */ - "zzSyntaxErrCount", /* MR11 */ - "zzLexErrCount", /* MR11 */ - "zzTraceGuessDone", /* MR13 - BJS */ - "zzTraceGuessFail", /* MR13 - BJS */ - "zzTraceGuessOption", /* MR13 - BJS */ - "zzTraceIn", /* MR13 - BJS */ - "zzTraceOption", /* MR13 - BJS */ - "zzTraceOut", /* MR13 - BJS */ - "zzTraceReset", /* MR13 - BJS */ - NULL /* must be present */ -}; - -/* list of PCCTS supplied support functions; these are renamed when more than - * one ANTLR-generated parsers are linked together to avoid name conflicts. - */ -char *ASTSymbols[] = { - "AST", - "zzast_sp", - "zzastStack", - "zzlink", - "zzastnew", - "zzsubchild", - "zzsubroot", - "zzpre_ast", - "zzfree_ast", - "zztmake", - "zzdup_ast", - "zztfree", - "zzdouble_link", - NULL /* must be present */ -}; - -/* Current ambiguity examination information */ -int CurAmbigAlt1, CurAmbigAlt2, CurAmbigline, CurAmbigfile; -char *CurAmbigbtype; - - - /* M e t h o d T a b l e s */ -/* - * The following tables are used to fill syntax diagram nodes with the correct - * function pointers for computing FIRST sets and printing themselves. - */ - -/* fpTraverse[node type] == pointer to function that calculates trees - * representing the FIRST sets for that node (maintains spatial info). - * We use 'struct _tree' not 'tree' due to a g++ 2.4.3 bug. - */ -#ifdef __cplusplus -struct _tree *(*fpTraverse[NumNodeTypes+1])(... /* Node *, int, set * */) = { - NULL, - (struct _tree *(*)(...)) tJunc, - (struct _tree *(*)(...)) tRuleRef, - (struct _tree *(*)(...)) tToken, - (struct _tree *(*)(...)) tAction -}; -#else -Tree *(*fpTraverse[NumNodeTypes+1])() = { - NULL, - tJunc, - tRuleRef, - tToken, - tAction -}; -#endif - -/* fpReach[node type] == pointer to function that calculates FIRST set for - * that node. (r stands for reach). We use 'struct _set' not 'set' - * due to a g++ 2.4.3 bug. - */ -#ifdef __cplusplus -struct _set (*fpReach[NumNodeTypes+1])(... /* Node *, int, set * */) = { - NULL, - (struct _set (*)(...)) rJunc, - (struct _set (*)(...)) rRuleRef, - (struct _set (*)(...)) rToken, - (struct _set (*)(...)) rAction -}; -#else -set (*fpReach[NumNodeTypes+1])() = { - NULL, - rJunc, - rRuleRef, - rToken, - rAction -}; -#endif - -/* fpPrint[node type] == pointer to function that knows how to print that node. */ -#ifdef __cplusplus -void (*fpPrint[NumNodeTypes+1])(... /* Node * */) = { - NULL, - (void (*)(...)) pJunc, - (void (*)(...)) pRuleRef, - (void (*)(...)) pToken, - (void (*)(...)) pAction -}; -#else -void (*fpPrint[NumNodeTypes+1])() = { - NULL, - pJunc, - pRuleRef, - pToken, - pAction -}; -#endif - -char *decodeJType[] = { - "invalid", - "aSubBlk", - "aOptBlk", - "aLoopBlk", - "EndBlk", - "RuleBlk", - "Generic", - "EndRule", - "aPlusBlk", - "aLoopBegin" -}; - - - /* H a s h T a b l e s */ - -Entry **Tname, /* Table of all token names (maps name to tok num)*/ - **Texpr, /* Table of all token expressions - (maps expr to tok num) */ - **Rname, /* Table of all Rules (has ptr to start of rule) */ - **Fcache, /* Cache of First/Follow Computations */ - **Tcache; /* Tree cache; First/Follow for permute trees */ -Entry **Elabel; /* Table of all element label names */ -Entry **Sname; /* Signal names */ -Entry **Pname; /* symbolic predicate names MR11 */ - - - /* V a r i a b l e s */ - -int Save_argc; /* MR10 */ -char **Save_argv; /* MR10 */ -int EpToken=0; /* Imaginary Epsilon token number */ -int WildCardToken=0; -int CurFile= -1; /* Index into FileStr table */ -char *CurPredName=NULL; /* MR11 */ -char *CurRule=NULL; /* Pointer to current rule name */ -int CurRuleDebug=0; /* MR13 debug flag */ -RuleEntry *CurRuleNode=NULL;/* Pointer to current rule node in syntax tree */ -char *CurRetDef=NULL; /* Pointer to current return type definition */ -char *CurParmDef=NULL; /* Pointer to current parameter definition */ -Junction *CurRuleBlk=NULL; /* Pointer to current block node for enclosing block */ -ListNode *CurExGroups=NULL; /* Current list of exception groups for rule/alts */ -ListNode *CurElementLabels=NULL; -ListNode *CurAstLabelsInActions=NULL; /* MR27 */ - -/* MR10 used by <<>>? to set "label_used_in_semantic_pred" */ -/* MR10 this will force LT(i) assignment even in guess mode */ - -ListNode *CurActionLabels=NULL; /* MR10 Element Labels appearing in last action */ -int numericActionLabel=0 ; /* MR10 << ... $1 ... >> or << ... $1 ... >>? */ -ListNode *NumericPredLabels=NULL; /* MR10 << ... $1 ... >>? ONLY */ -ListNode *ContextGuardPredicateList=NULL; /* MR13 for re-evaluating predicates - after meta tokens are defined */ - -int CurBlockID=0; /* Unique int for each block */ -int CurAltNum=0; -Junction *CurAltStart = NULL; /* Junction node that starts the alt */ -Junction *OuterAltStart = NULL; /* For chaining exception groups MR7 */ -int NumRules=0; /* Rules are from 1 to n */ -FILE *output=NULL; /* current parser output file */ -FILE *input=NULL; /* current grammar input file */ -char *FileStr[MaxNumFiles];/* Ptr to array of file names on command-line */ -int NumFiles=0; /* current grammar file number */ -#ifdef __cplusplus -void (**fpTrans)(...), /* array of ptrs to funcs that translate nodes */ - (**fpJTrans)(...); /* ... that translate junctions */ -#else -void (**fpTrans)(), /* array of ptrs to funcs that translate nodes */ - (**fpJTrans)(); /* ... that translate junctions */ -#endif -int **FoStack; /* Array of LL_k ptrs to stacks of rule numbers */ -int **FoTOS; /* FOLLOW stack top-of-stack pointers */ -Junction *SynDiag = NULL; /* Pointer to start of syntax diagram */ -int BlkLevel=1; /* Current block level. Set by antlr.g, used by - * scanner to translate $i.j attributes */ -set reserved_positions; /* set of token positions reserved by '#token T=i' cmds */ -set all_tokens; /* set of all token types */ -set imag_tokens; /* set of all imaginary token types (EpToken, errclasses...) */ -set tokclasses; /* set of all token class token types */ -ListNode *ForcedTokens = 0; /* list of token_id/token_num pairs to remap */ -ListNode *MetaTokenNodes=NULL; /* list of meta token refs such as token classes etc... */ -int *TokenInd=NULL; /* an indirection level between token num and position - * of that token def in TokenStr and ExprStr */ -int LastTokenCounted=0; /* ==TokenNum if no token renumbering (same as old TokenNum) */ -int TokenNum=TokenStart; -char **TokenStr=NULL; /* map token # to token name */ -char **ExprStr=NULL; /* map token # to expr */ -Junction **RulePtr=NULL; /* map rule # to RuleBlk node of rule */ -ListNode *ExprOrder=NULL; /* list of exprs as they are found in grammar */ -ListNode *BeforeActions=NULL;/* list of grammar actions before rules */ -ListNode *AfterActions=NULL;/* list of grammar actions after rules */ -ListNode *LexActions=NULL; /* list of lexical actions */ - -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via #lexmember <<....>> */ -/* MR1 via #lexprefix <<....>> */ -/* MR1 */ - -ListNode *LexMemberActions=NULL;/* list of lexical header member decl MR1 */ -ListNode *LexPrefixActions=NULL;/* list of lexical header #include decl MR1 */ -ListNode **Cycles=NULL; /* list of cycles (for each k) found when - doing FOLLOWs */ -ListNode *eclasses=NULL; /* list of error classes */ -ListNode *tclasses=NULL; /* list of token classes */ -LClass lclass[MaxLexClasses]; /* array of lex class definitions */ -int CurrentLexClass; /* index into lclass */ -int NumLexClasses=0; /* in range 1..MaxLexClasses (init 0) */ - -char *HdrAction=NULL; /* action defined with #header */ -char *FirstAction=NULL; /* action defined with #first MR11 */ -FILE *ErrFile; /* sets and error recovery stuff */ -FILE *DefFile=NULL; /* list of tokens, return value structs, setwd defs */ -FILE *MRinfoFile=NULL; /* MR10 information file */ -int MRinfo=0; /* MR10 */ -int MRinfoSeq=0; /* MR10 */ -int InfoP=0; /* MR10 predicates */ -int InfoT=0; /* MR10 tnodes */ -int InfoF=0; /* MR10 first/follow sets */ -int InfoM=0; /* MR10 monitor progress */ -int InfoO=0; /* MR12 orphan rules */ -int TnodesInUse=0; /* MR10 */ -int TnodesPeak=0; /* MR10 */ -int TnodesAllocated=0; /* MR10 */ -int TnodesReportThreshold=0; /* MR11 */ -int PotentialSuppression=0; /* MR10 */ -int PotentialDummy=0; /* MR10 */ -int CannotContinue=FALSE; -int OutputLL_k = 1; /* LL_k for parsing must be power of 2 */ -int action_file; /* used to track start of action */ -int action_line; -int FoundGuessBlk=0; /* there is a (...)? block somewhere in grammar */ -int FoundException=0; /* there is an exception somewhere in grammar */ -/* MR6 Distinguish between @ operator and real exception */ -/* MR6 by keeping separate flags for @ operator and real exceptions */ -int FoundAtOperator=0; /* MR6 */ -int FoundExceptionGroup=0; /* MR6 */ -int pLevel=0; /* print Level */ -int pAlt1,pAlt2; /* print "==>" in front of these alts */ - -/* C++ output stuff */ -FILE *Parser_h, /* where subclass of ANTLRParser goes */ - *Parser_c; /* where code for subclass of ANTLRParser goes */ -char Parser_h_Name[MaxFileName+1] = ""; -char Parser_c_Name[MaxFileName+1] = ""; -char MRinfoFile_Name[MaxFileName+1] = ""; /* MR10 */ -char *ClassDeclStuff=NULL; /* MR10 */ -char *BaseClassName=NULL; /* MR22 */ -/* list of actions inside the #class {...} defs */ -ListNode *class_before_actions=NULL; -ListNode *class_after_actions=NULL; - -char CurrentClassName[MaxRuleName]=""; -int no_classes_found=1; -char *UserTokenDefsFile; -int UserDefdTokens=0; /* found #tokdefs? */ -char *OutputDirectory=TopDirectory; -ExceptionGroup *DefaultExGroup = NULL; -int NumSignals = NumPredefinedSignals; -int ContextGuardTRAV=0; - -char *MR_AmbAidRule=NULL; /* MR11 */ -int MR_AmbAidLine=0; /* MR11 */ -int MR_AmbAidDepth=0; /* MR11 */ -int MR_AmbAidMultiple=0; /* MR11 */ -int MR_skipped_e3_report=0; /* MR11 */ -int MR_usingPredNames=0; /* MR11 */ -int MR_BadExprSets=0; /* MR13 */ -int MR_Inhibit_Tokens_h_Gen=0; /* MR13 */ -int NewAST=0; /* MR13 */ -int tmakeInParser=0; /* MR23 */ -int AlphaBetaTrace=0; /* MR14 */ -int MR_BlkErr=0; /* MR21 */ -int MR_AlphaBetaMessageCount=0; /* MR14 */ -int MR_AlphaBetaWarning=0; /* MR14 */ -int MR_ErrorSetComputationActive=0; /* MR14 */ -int MR_MaintainBackTrace=0; /* MR14 */ -set MR_CompromisedRules; /* MR14 */ - -Junction *MR_RuleBlkWithHalt; /* MR10 */ - - /* C m d - L i n e O p t i o n s */ - -int LL_k=1; /* how many tokens of full lookahead */ -int CLL_k= -1; /* how many tokens of compressed lookahead */ -int PrintOut = FALSE; /* print out the grammar */ -int PrintAnnotate = FALSE;/* annotate printout with FIRST sets */ -int CodeGen=TRUE; /* Generate output code? */ -int LexGen=TRUE; /* Generate lexical files? (tokens.h, parser.dlg) */ -int GenAST=FALSE; /* Generate AST's? */ -int GenANSI=FALSE; /* Generate ANSI code where necessary */ -int GenExprSetsOpt=TRUE;/* use sets not (LA(1)==tok) expression lists */ -int GenCR=FALSE; /* Generate cross reference? */ -int GenLineInfo=FALSE; /* Generate # line "file" stuff? */ -int GenLineInfoMS=FALSE;/* Like -gl but replace "\" with "/" for MS C/C++ systems */ -int TraceGen=FALSE; /* Generate code to trace rule invocation */ -int elevel=1; /* error level for ambiguity messages */ -int GenEClasseForRules=0;/* don't generate eclass for each rule */ -int TreeResourceLimit= -1;/* don't limit tree resource */ -int DemandLookahead = 0;/* demand/delayed lookahead or not */ -char *RulePrefix = ""; /* prefix each generated rule with this */ -char *stdpccts = "stdpccts.h";/* where to generate std pccts include file */ -int GenStdPccts = 0; /* don't gen stdpccts.h? */ -int ParseWithPredicates = 1; -int WarningLevel = 1; -int UseStdout = 0; /* MR6 */ -int TabWidth = 2; /* MR6 */ /* MR27 */ -int HoistPredicateContext = 0; -int MRhoisting = 0; /* MR9 */ -int MRhoistingk = 0; /* MR13 */ -int MR_debugGenRule=0; /* MR11 */ - -int GenCC = 0; /* Generate C++ output */ - -PointerStack MR_BackTraceStack={0,0,NULL}; /* MR10 */ -PointerStack MR_PredRuleRefStack={0,0,NULL}; /* MR10 */ -PointerStack MR_RuleBlkWithHaltStack={0,0,NULL}; /* MR10 */ - -/* DontCopyTokens and Pragma_DupLabeledTokens were a bad idea. I've just - turned them off rather than backpatching the code. Who knows? We - may need them in the future. - */ -int DontCopyTokens = 1; /* in C++, don't copy ANTLRToken passed to ANTLR */ - -/* Remember if LT(i), LA(i), or LATEXT(i) used in an action which is not - a predicate. If so, give a warning for novice users. -*/ - -int LTinTokenAction = 0; /* MR23 */ -int PURIFY = 1; /* MR23 */ - -int CurBlockID_array[MAX_BLK_LEVEL]; /* MR23 */ -int CurAltNum_array[MAX_BLK_LEVEL]; /* MR23 */ diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.c deleted file mode 100644 index 083f941df..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * hash.c - * - * Manage hash tables. - * - * The following functions are visible: - * - * char *mystrdup(char *); Make space and copy string - * Entry **newHashTable(); Create and return initialized hash table - * Entry *hash_add(Entry **, char *, Entry *) - * Entry *hash_get(Entry **, char *) - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "pcctscfg.h" -#include "hash.h" - -#ifdef __USE_PROTOS -#include -#else -#ifdef VAXC -#include -#else -#include -#endif -#endif -#include - -#define StrSame 0 - -#define fatal(err) \ - {fprintf(stderr, "%s(%d):", __FILE__, __LINE__); \ - fprintf(stderr, " %s\n", err); exit(PCCTS_EXIT_FAILURE);} -#define require(expr, err) {if ( !(expr) ) fatal(err);} - -static unsigned size = HashTableSize; -static char *strings = NULL; -static char *strp; -static unsigned strsize = StrTableSize; - -/* create the hash table and string table for terminals (string table only once) */ -Entry ** -#ifdef __USE_PROTOS -newHashTable( void ) -#else -newHashTable( ) -#endif -{ - Entry **table; - - table = (Entry **) calloc(size, sizeof(Entry *)); - require( table != NULL, "cannot allocate hash table"); - if ( strings == NULL ) - { - strings = (char *) calloc(strsize, sizeof(char)); - require( strings != NULL, "cannot allocate string table"); - strp = strings; - } - return table; -} - -void -#ifdef __USE_PROTOS -killHashTable( Entry **table ) -#else -killHashTable( table ) -Entry **table; -#endif -{ - /* for now, just free table, forget entries */ - free( (char *) table ); /* MR10 cast */ -} - -/* Given a table, add 'rec' with key 'key' (add to front of list). return ptr to entry */ -Entry * -#ifdef __USE_PROTOS -hash_add( Entry **table, char *key, Entry *rec ) -#else -hash_add( table, key, rec ) -Entry **table; -char *key; -Entry *rec; -#endif -{ - unsigned h=0; - char *p=key; - require(table!=NULL && key!=NULL && rec!=NULL, "add: invalid addition"); - - Hash(p,h,size); - rec->next = table[h]; /* Add to singly-linked list */ - table[h] = rec; - return rec; -} - -/* Return ptr to 1st entry found in table under key (return NULL if none found) */ -Entry * -#ifdef __USE_PROTOS -hash_get( Entry **table, char *key ) -#else -hash_get( table, key ) -Entry **table; -char *key; -#endif -{ - unsigned h=0; - char *p=key; - Entry *q; -/* require(table!=NULL && key!=NULL, "get: invalid table and/or key");*/ - if ( !(table!=NULL && key!=NULL) ) *((char *) 34) = 3; - - Hash(p,h,size); - for (q = table[h]; q != NULL; q = q->next) - { - if ( strcmp(key, q->str) == StrSame ) return( q ); - } - return( NULL ); -} - -#ifdef DEBUG_HASH -void -#ifdef __USE_PROTOS -hashStat( Entry **table ) -#else -hashStat( table ) -Entry **table; -#endif -{ - static unsigned short count[20]; - int i,n=0,low=0, hi=0; - Entry **p; - float avg=0.0; - - for (i=0; i<20; i++) count[i] = 0; - for (p=table; p<&(table[size]); p++) - { - Entry *q = *p; - int len; - - if ( q != NULL && low==0 ) low = p-table; - len = 0; - if ( q != NULL ) fprintf(stderr, "[%d]", p-table); - while ( q != NULL ) - { - len++; - n++; - fprintf(stderr, " %s", q->str); - q = q->next; - if ( q == NULL ) fprintf(stderr, "\n"); - } - count[len]++; - if ( *p != NULL ) hi = p-table; - } - - fprintf(stderr, "Storing %d recs used %d hash positions out of %d\n", - n, size-count[0], size); - fprintf(stderr, "%f %% utilization\n", - ((float)(size-count[0]))/((float)size)); - for (i=0; i<20; i++) - { - if ( count[i] != 0 ) - { - avg += (((float)(i*count[i]))/((float)n)) * i; - fprintf(stderr, "Bucket len %d == %d (%f %% of recs)\n", - i, count[i], ((float)(i*count[i]))/((float)n)); - } - } - fprintf(stderr, "Avg bucket length %f\n", avg); - fprintf(stderr, "Range of hash function: %d..%d\n", low, hi); -} -#endif - -/* Add a string to the string table and return a pointer to it. - * Bump the pointer into the string table to next avail position. - */ -char * -#ifdef __USE_PROTOS -mystrdup( char *s ) -#else -mystrdup( s ) -char *s; -#endif -{ - char *start=strp; - require(s!=NULL, "mystrdup: NULL string"); - - while ( *s != '\0' ) - { - require( strp <= &(strings[strsize-2]), - "string table overflow\nIncrease StrTableSize in hash.h and recompile hash.c\n"); - *strp++ = *s++; - } - *strp++ = '\0'; - - return( start ); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.h deleted file mode 100644 index 8295c2cdb..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/hash.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * hash.h -- define hash table entries, sizes, hash function... - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - - /* H a s h T a b l e S t u f f */ - -#ifndef HashTableSize -#define HashTableSize 553 -#endif - -#ifndef StrTableSize -#ifdef PC32 -#define StrTableSize 1000000 -#endif -#endif - -#ifndef StrTableSize -#ifdef PC -#define StrTableSize 655200 -#endif -#endif - -#ifndef StrTableSize -#define StrTableSize 1000000 -#endif - -typedef struct _entry { /* Minimum hash table entry -- superclass */ - char *str; - struct _entry *next; - } Entry; - -/* Hash 's' using 'size', place into h (s is modified) */ -#define Hash(s,h,size) \ - {while ( *s != '\0' ) h = (h<<1) + *s++; \ - h %= size;} - -#ifdef __USE_PROTOS -Entry *hash_get(Entry **, char *), - **newHashTable(void), - *hash_add(Entry **, char *, Entry *); - -void killHashTable(Entry **); - -#else -Entry *hash_get(), **newHashTable(), *hash_add(); -void killHashTable(); /* MR9 23-Sep-97 */ -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/lex.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/lex.c deleted file mode 100644 index 849b5c606..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/lex.c +++ /dev/null @@ -1,876 +0,0 @@ -/* - * lex.c -- Generate all of the lexical type files: parser.dlg tokens.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include -/* MR1 */ -/* MR1 10-Apr-97 MR1 Replace use of __STDC__ with __USE_PROTOS */ -/* MR1 */ -#include "pcctscfg.h" -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" - -#define DLGErrorString "invalid token" - -/* Generate a complete lexical description of the lexemes found in the grammar */ -void -#ifdef __USE_PROTOS -genLexDescr( void ) -#else -genLexDescr( ) -#endif -{ - ListNode *p; - FILE *dlgFile = fopen(OutMetaName(DlgFileName), "w"); - require(dlgFile!=NULL, eMsg1("genLexFile: cannot open %s", OutMetaName(DlgFileName)) ); -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(DlgFileName)); /* MR1 */ -#endif - fprintf(dlgFile, "<<\n"); - fprintf(dlgFile, "/* %s -- DLG Description of scanner\n", DlgFileName); - fprintf(dlgFile, " *\n"); - fprintf(dlgFile, " * Generated from:"); - {int i; for (i=0; i 1 ) fprintf(dlgFile, "#define LL_K %d\n", OutputLL_k); - if ( DemandLookahead ) fprintf(dlgFile, "#define DEMAND_LOOK\n"); - if (TraceGen) { - fprintf(dlgFile,"#ifndef zzTRACE_RULES\n"); /* MR20 */ - fprintf(dlgFile,"#define zzTRACE_RULES\n"); /* MR20 */ - fprintf(dlgFile,"#endif\n"); /* MR22 */ - }; - fprintf(dlgFile, "#include \"antlr.h\"\n"); - if ( GenAST ) { - fprintf(dlgFile, "#include \"ast.h\"\n"); - } - if ( UserDefdTokens ) - fprintf(dlgFile, "#include %s\n", UserTokenDefsFile); - /* still need this one as it has the func prototypes */ - fprintf(dlgFile, "#include \"%s\"\n", DefFileName); - fprintf(dlgFile, "#include \"dlgdef.h\"\n"); - fprintf(dlgFile, "LOOKAHEAD\n"); - fprintf(dlgFile, "\n"); - fprintf(dlgFile, "void\n"); - fprintf(dlgFile, "#ifdef __USE_PROTOS\n"); - fprintf(dlgFile, "zzerraction()\n"); - fprintf(dlgFile, "#else\n"); - fprintf(dlgFile, "zzerraction()\n"); - fprintf(dlgFile, "#endif\n"); - fprintf(dlgFile, "{\n"); - fprintf(dlgFile, "\t(*zzerr)(\"%s\");\n", DLGErrorString); - fprintf(dlgFile, "\tzzadvance();\n"); - fprintf(dlgFile, "\tzzskip();\n"); - fprintf(dlgFile, "}\n"); - } - fprintf(dlgFile, ">>\n\n"); - - /* dump all actions */ - -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via <<%%lexmember ....>> & <<%%lexprefix ...>> */ -/* MR1 */ - if (LexActions != NULL) { - for (p = LexActions->next; p!=NULL; p=p->next) - { -/* MR1 */ fprintf(dlgFile, "<<%%%%lexaction\n"); - dumpAction( (char *)p->elem, dlgFile, 0, -1, 0, 1 ); - fprintf(dlgFile, ">>\n\n"); - } - }; - -/* MR1 */ if (GenCC) { -/* MR1 */ fprintf(dlgFile,"<<%%%%parserclass %s>>\n\n",CurrentClassName); -/* MR1 */ }; - -/* MR1 */ if (LexPrefixActions != NULL) { -/* MR1 */ for (p = LexPrefixActions->next; p!=NULL; p=p->next) -/* MR1 */ { -/* MR1 */ fprintf(dlgFile, "<<%%%%lexprefix\n"); -/* MR1 */ dumpAction( (char *)p->elem, dlgFile, 0, -1, 0, 1 ); -/* MR1 */ fprintf(dlgFile, ">>\n\n"); -/* MR1 */ } -/* MR1 */ }; - -/* MR1 */ if (LexMemberActions != NULL) { -/* MR1 */ for (p = LexMemberActions->next; p!=NULL; p=p->next) -/* MR1 */ { -/* MR1 */ fprintf(dlgFile, "<<%%%%lexmember\n"); -/* MR1 */ dumpAction( (char *)p->elem, dlgFile, 0, -1, 0, 1 ); -/* MR1 */ fprintf(dlgFile, ">>\n\n"); -/* MR1 */ } -/* MR1 */ }; - - /* dump all regular expression rules/actions (skip sentinel node) */ - if ( ExprOrder == NULL ) { - warnNoFL("no regular expressions found in grammar"); - } - else dumpLexClasses(dlgFile); - fprintf(dlgFile, "%%%%\n"); - fclose( dlgFile ); -} - -/* For each lexical class, scan ExprOrder looking for expressions - * in that lexical class. Print out only those that match. - * Each element of the ExprOrder list has both an expr and an lclass - * field. - */ -void -#ifdef __USE_PROTOS -dumpLexClasses( FILE *dlgFile ) -#else -dumpLexClasses( dlgFile ) -FILE *dlgFile; -#endif -{ - int i; - TermEntry *t; - ListNode *p; - Expr *q; - - for (i=0; inext; p!=NULL; p=p->next) - { - q = (Expr *) p->elem; - if ( q->lclass != i ) continue; - lexmode(i); - t = (TermEntry *) hash_get(Texpr, q->expr); - require(t!=NULL, eMsg1("genLexDescr: rexpr %s not in hash table",q->expr) ); - if ( t->token == EpToken ) continue; - fprintf(dlgFile, "%s\n\t<<\n", StripQuotes(q->expr)); - /* replace " killed by StripQuotes() */ - q->expr[ strlen(q->expr) ] = '"'; - if ( !GenCC ) { - if ( TokenString(t->token) != NULL ) - fprintf(dlgFile, "\t\tNLA = %s;\n", TokenString(t->token)); - else - fprintf(dlgFile, "\t\tNLA = %d;\n", t->token); - } - if ( t->action != NULL ) dumpAction( t->action, dlgFile, 2,-1,0,1 ); - if ( GenCC ) { - if ( TokenString(t->token) != NULL ) - fprintf(dlgFile, "\t\treturn %s;\n", TokenString(t->token)); - else - fprintf(dlgFile, "\t\treturn (ANTLRTokenType)%d;\n", t->token); - } - fprintf(dlgFile, "\t>>\n\n"); - } - } -} - -/* Strip the leading path (if any) from a filename */ -char * -#ifdef __USE_PROTOS -StripPath( char *fileName ) -#else -StripPath( fileName ) -char *fileName; -#endif -{ - char *p; - static char dirSym[2] = DirectorySymbol; - - if(NULL != (p = strrchr(fileName, dirSym[0]))) - p++; - else - p = fileName; - - return(p); -} - -/* Generate a list of #defines && list of struct definitions for - * aggregate retv's */ -void -#ifdef __USE_PROTOS -genDefFile( void ) -#else -genDefFile( ) -#endif -{ - int i; - - /* If C++ mode and #tokdef used, then don't need anything in here since - * C++ puts all definitions in the class file name. - */ - if ( GenCC && UserTokenDefsFile ) return; - if ( MR_Inhibit_Tokens_h_Gen) return; - - DefFile = fopen(OutMetaName(DefFileName), "w"); - require(DefFile!=NULL, eMsg1("genDefFile: cannot open %s", OutMetaName(DefFileName)) ); -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(DefFileName)); /* MR1 */ -#endif - fprintf(DefFile, "#ifndef %s\n", StripPath(gate_symbol(DefFileName))); - fprintf(DefFile, "#define %s\n", StripPath(gate_symbol(DefFileName))); - - fprintf(DefFile, "/* %s -- List of labelled tokens and stuff\n", DefFileName); - fprintf(DefFile, " *\n"); - fprintf(DefFile, " * Generated from:"); - for (i=0; i1 ) - { - int j; - /* look in all lexclasses for the reg expr */ - -/* MR10 Derek Pappas */ -/* MR10 A #tokclass doesn't have associated regular expressiones */ -/* MR10 so don't warn user about it's omission */ - - p = (TermEntry *) hash_get(Tname, TokenString(i)); - - if (p != NULL && ! p->classname) { - for (j=0; j=NumLexClasses ) - { - warnNoFL(eMsg1("token label has no associated rexpr: %s",TokenString(i))); - } - }; - } - require((p=(TermEntry *)hash_get(Tname, TokenString(i))) != NULL, - "token not in sym tab when it should be"); - if ( !p->classname ) - { - if ( GenCC ) { - if ( !first ) fprintf(DefFile, ",\n"); - first = 0; - fprintf(DefFile, "\t%s=%d", TokenString(i), i); - } - else - fprintf(DefFile, "#define %s %d\n", TokenString(i), i); - } - } - } -/* MR1 */ -/* MR1 10-Apr-97 133MR1 Prevent use of varying sizes of integer */ -/* MR1 for the enum ANTLRTokenType */ -/* MR1 */ - if ( GenCC ) { /* MR1 */ - if ( !first ) fprintf(DefFile, ",\n"); /* MR14 */ - fprintf(DefFile, "\tDLGminToken=0"); /* MR1 */ - fprintf(DefFile, ",\n\tDLGmaxToken=9999};\n"); /* MR1 */ - }; /* MR1 */ - } - - if ( !GenCC ) GenRulePrototypes(DefFile, SynDiag); -} - -void -#ifdef __USE_PROTOS -GenRemapFile( void ) -#else -GenRemapFile( ) -#endif -{ - if ( strcmp(ParserName, DefaultParserName)!=0 ) - { - FILE *f; - int i; - - f = fopen(OutMetaName(RemapFileName), "w"); - require(f!=NULL, eMsg1("GenRemapFile: cannot open %s", OutMetaName(RemapFileName)) ); -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(RemapFileName)); /* MR1 */ -#endif - fprintf(f, "/* %s -- List of symbols to remap\n", RemapFileName); - fprintf(f, " *\n"); - fprintf(f, " * Generated from:"); - for (i=0; irname, ParserName, p->rname); - p = (Junction *)p->p2; - } -} - -/* Generate a bunch of #defines that rename all standard symbols to be - * "ParserName_symbol". The list of standard symbols to change is in - * globals.c. - */ -void -#ifdef __USE_PROTOS -GenPredefinedSymbolRedefs( FILE *f ) -#else -GenPredefinedSymbolRedefs( f ) -FILE *f; -#endif -{ - char **p; - - fprintf(f, "\n/* rename PCCTS-supplied symbols to be 'ParserName_symbol' */\n"); - for (p = &StandardSymbols[0]; *p!=NULL; p++) - { - fprintf(f, "#define %s %s_%s\n", *p, ParserName, *p); - } -} - -/* Generate a bunch of #defines that rename all AST symbols to be - * "ParserName_symbol". The list of AST symbols to change is in - * globals.c. - */ -void -#ifdef __USE_PROTOS -GenASTSymbolRedefs( FILE *f ) -#else -GenASTSymbolRedefs( f ) -FILE *f; -#endif -{ - char **p; - - fprintf(f, "\n/* rename PCCTS-supplied AST symbols to be 'ParserName_symbol' */\n"); - for (p = &ASTSymbols[0]; *p!=NULL; p++) - { - fprintf(f, "#define %s %s_%s\n", *p, ParserName, *p); - } -} - -/* redefine all sets generated by ANTLR; WARNING: 'zzerr', 'setwd' must match - * use in bits.c (DumpSetWd() etc...) - */ -void -#ifdef __USE_PROTOS -GenSetRedefs( FILE *f ) -#else -GenSetRedefs( f ) -FILE *f; -#endif -{ - int i; - - for (i=1; i<=wordnum; i++) - { - fprintf(f, "#define setwd%d %s_setwd%d\n", i, ParserName, i); - } - for (i=1; i<=esetnum; i++) - { - fprintf(f, "#define zzerr%d %s_err%d\n", i, ParserName, i); - } -} - -/* Find all return types/parameters that require structs and def - * all rules with ret types. - * - * This is for the declaration, not the definition. - */ -void -#ifdef __USE_PROTOS -GenRulePrototypes( FILE *f, Junction *p ) -#else -GenRulePrototypes( f, p ) -FILE *f; -Junction *p; -#endif -{ - int i; - - i = 1; - while ( p!=NULL ) - { - if ( p->ret != NULL ) - { -/* MR23 */ if ( hasMultipleOperands(p->ret) ) - { - DumpRetValStruct(f, p->ret, i); - } - fprintf(f, "\n#ifdef __USE_PROTOS\n"); -/* MR23 */ if ( hasMultipleOperands(p->ret) ) - { - fprintf(f, "extern struct _rv%d", i); - } - else - { - fprintf(f, "extern "); - DumpType(p->ret, f); - } - fprintf(f, " %s%s(", RulePrefix, p->rname); - DumpANSIFunctionArgDef(f,p,1 /* emit initializers ? */); - fprintf(f, ";\n"); - fprintf(f, "#else\n"); -/* MR23 */ if ( hasMultipleOperands(p->ret) ) - { - fprintf(f, "extern struct _rv%d", i); - } - else - { - fprintf(f, "extern "); - DumpType(p->ret, f); - } - fprintf(f, " %s%s();\n", RulePrefix, p->rname); - fprintf(f, "#endif\n"); - } - else - { - fprintf(f, "\n#ifdef __USE_PROTOS\n"); - fprintf(f, "void %s%s(", RulePrefix, p->rname); - DumpANSIFunctionArgDef(f,p, 1 /* emit initializers ? */ ); - fprintf(f, ";\n"); -#ifdef OLD - if ( p->pdecl != NULL || GenAST ) - { - if ( GenAST ) { - fprintf(f, "AST **%s",(p->pdecl!=NULL)?",":""); - } - if ( p->pdecl!=NULL ) fprintf(f, "%s", p->pdecl); - } - else fprintf(f, "void"); - fprintf(f, ");\n"); -#endif - fprintf(f, "#else\n"); - fprintf(f, "extern void %s%s();\n", RulePrefix, p->rname); - fprintf(f, "#endif\n"); - } - i++; - p = (Junction *)p->p2; - } -} - -/* Define all rules in the class.h file; generate any required - * struct definitions first, however. - */ -void -#ifdef __USE_PROTOS -GenRuleMemberDeclarationsForCC( FILE *f, Junction *q ) -#else -GenRuleMemberDeclarationsForCC( f, q ) -FILE *f; -Junction *q; -#endif -{ - Junction *p = q; - int i; - - fprintf(f, "private:\n"); - - /* Dump dflt handler declaration */ - fprintf(f, "\tvoid zzdflthandlers( int _signal, int *_retsignal );\n\n"); - - fprintf(f, "public:\n"); - - /* Dump return value structs */ - i = 1; - while ( p!=NULL ) - { - if ( p->ret != NULL ) - { -/* MR23 */ if ( hasMultipleOperands(p->ret) ) - { - DumpRetValStruct(f, p->ret, i); - } - } - i++; - p = (Junction *)p->p2; - } - - /* Dump member func defs && CONSTRUCTOR */ - fprintf(f, "\t%s(ANTLRTokenBuffer *input);\n", CurrentClassName); -/* - fprintf(f, "\t%s(ANTLRTokenBuffer *input, ANTLRTokenType eof);\n", - CurrentClassName); -*/ - - i = 1; - p = q; - while ( p!=NULL ) - { - if ( p->ret != NULL ) - { -/* MR23 */ if ( hasMultipleOperands(p->ret) ) - { - fprintf(f, "\tstruct _rv%d", i); - } - else - { - fprintf(f, "\t"); - DumpType(p->ret, f); - } - fprintf(f, " %s%s(",RulePrefix,p->rname); - DumpANSIFunctionArgDef(f,p, 1 /* emit initializers ? */ ); - fprintf(f, ";\n"); -#ifdef OLD - if ( p->pdecl != NULL || GenAST ) - { - if ( GenAST ) fprintf(f, "ASTBase **%s",(p->pdecl!=NULL)?",":""); - if ( p->pdecl!=NULL ) fprintf(f, "%s", p->pdecl); - } - fprintf(f, ");\n"); -#endif - } - else - { - fprintf(f, "\tvoid %s%s(",RulePrefix,p->rname); - DumpANSIFunctionArgDef(f,p, 1 /* emit initializers ? */); - fprintf(f, ";\n"); -#ifdef OLD - if ( p->pdecl != NULL || GenAST ) - { - if ( GenAST ) fprintf(f, "ASTBase **%s",(p->pdecl!=NULL)?",":""); - if ( p->pdecl!=NULL ) fprintf(f, "%s", p->pdecl); - } - fprintf(f, ");\n"); -#endif - } - i++; - p = (Junction *)p->p2; - } -} - -/* Given a list of ANSI-style parameter declarations, print out a - * comma-separated list of the symbols (w/o types). - * Basically, we look for a comma, then work backwards until start of - * the symbol name. Then print it out until 1st non-alnum char. Now, - * move on to next parameter. - * - */ - -/* MR5 Jan Mikkelsen 26-May-97 - added initalComma parameter */ - -void -#ifdef __USE_PROTOS -DumpListOfParmNames(char *pdecl, FILE *output, int initialComma) /* MR5 */ -#else -DumpListOfParmNames(pdecl, output, initialComma) /* MR5 */ -char *pdecl; /* MR5 */ -FILE *output; /* MR5 */ -int initialComma; /* MR5 */ -#endif -{ - int firstTime = 1, done = 0; - require(output!=NULL, "DumpListOfParmNames: NULL parm"); - - if ( pdecl == NULL ) return; - while ( !done ) - { - if ( !firstTime || initialComma ) putc(',', output); /* MR5 */ - done = DumpNextNameInDef(&pdecl, output); - firstTime = 0; - } -} - -/* given a list of parameters or return values, dump the next - * name to output. Return 1 if last one just printed, 0 if more to go. - */ - -/* MR23 Total rewrite */ - -int -#ifdef __USE_PROTOS -DumpNextNameInDef( char **q, FILE *output ) -#else -DumpNextNameInDef( q, output ) -char **q; -FILE *output; -#endif -{ - char *p; - char *t; - char *pDataType; - char *pSymbol; - char *pEqualSign; - char *pValue; - char *pSeparator; - int nest = 0; - - p = endFormal(*q, - &pDataType, - &pSymbol, - &pEqualSign, - &pValue, - &pSeparator, - &nest); - - /* MR26 Handle rule arguments such as: IIR_Bool (IIR_Decl::*contstraint)() - For this we need to strip off anything which follows the symbol. - */ - -/* MR26 */ t = pSymbol; -/* MR26 */ if (t != NULL) { -/* MR26 */ for (t = pSymbol; *t != 0; t++) { -/* MR26 */ if (! (isalpha(*t) || isdigit(*t) || *t == '_' || *t == '$')) break; -/* MR26 */ } -/* MR26 */ } -/* MR26 */ fprintf(output,strBetween(pSymbol, t, pSeparator)); - - *q = p; - return (*pSeparator == 0); -} - -/* Given a list of ANSI-style parameter declarations, dump K&R-style - * declarations, one per line for each parameter. Basically, convert - * comma to semi-colon, newline. - */ -void -#ifdef __USE_PROTOS -DumpOldStyleParms( char *pdecl, FILE *output ) -#else -DumpOldStyleParms( pdecl, output ) -char *pdecl; -FILE *output; -#endif -{ - require(output!=NULL, "DumpOldStyleParms: NULL parm"); - - if ( pdecl == NULL ) return; - while ( *pdecl != '\0' ) - { - if ( *pdecl == ',' ) - { - pdecl++; - putc(';', output); putc('\n', output); - while ( *pdecl==' ' || *pdecl=='\t' || *pdecl=='\n' ) pdecl++; - } - else {putc(*pdecl, output); pdecl++;} - } - putc(';', output); - putc('\n', output); -} - -/* Take in a type definition (type + symbol) and print out type only */ -/* MR23 Total rewrite */ - -void -#ifdef __USE_PROTOS -DumpType( char *s, FILE *f ) -#else -DumpType( s, f ) -char *s; -FILE *f; -#endif -{ - char *p; - char *pDataType; - char *pSymbol; - char *pEqualSign; - char *pValue; - char *pSeparator; - int nest = 0; - - require(s!=NULL, "DumpType: invalid type string"); - - p = endFormal(s, - &pDataType, - &pSymbol, - &pEqualSign, - &pValue, - &pSeparator, - &nest); - fprintf(f,strBetween(pDataType, pSymbol, pSeparator)); -} - -/* check to see if string e is a word in string s */ -int -#ifdef __USE_PROTOS -strmember( char *s, char *e ) -#else -strmember( s, e ) -char *s; -char *e; -#endif -{ - register char *p; - require(s!=NULL&&e!=NULL, "strmember: NULL string"); - - if ( *e=='\0' ) return 1; /* empty string is always member */ - do { - while ( *s!='\0' && !isalnum(*s) && *s!='_' ) - ++s; - p = e; - while ( *p!='\0' && *p==*s ) {p++; s++;} - if ( *p=='\0' ) { - if ( *s=='\0' ) return 1; - if ( !isalnum (*s) && *s != '_' ) return 1; - } - while ( isalnum(*s) || *s == '_' ) - ++s; - } while ( *s!='\0' ); - return 0; -} - -#if 0 - -/* MR23 Replaced by hasMultipleOperands() */ - -int -#ifdef __USE_PROTOS -HasComma( char *s ) -#else -HasComma( s ) -char *s; -#endif -{ - while (*s!='\0') - if ( *s++ == ',' ) return 1; - return 0; -} -#endif - - -/* MR23 Total rewrite */ - -void -#ifdef __USE_PROTOS -DumpRetValStruct( FILE *f, char *ret, int i ) -#else -DumpRetValStruct( f, ret, i ) -FILE *f; -char *ret; -int i; -#endif -{ - char *p = ret; - char *pDataType; - char *pSymbol; - char *pEqualSign; - char *pValue; - char *pSeparator; - int nest = 0; - - fprintf(f, "\nstruct _rv%d {\n", i); - while (*p != 0 && nest == 0) { - p = endFormal(p, - &pDataType, - &pSymbol, - &pEqualSign, - &pValue, - &pSeparator, - &nest); - fprintf(f,"\t"); - fprintf(f,strBetween(pDataType, pSymbol, pSeparator)); - fprintf(f," "); - fprintf(f,strBetween(pSymbol, pEqualSign, pSeparator)); - fprintf(f,";\n"); - } - fprintf(f,"};\n"); -} - -/* given "s" yield s -- DESTRUCTIVE (we modify s if starts with " else return s) */ -char * -#ifdef __USE_PROTOS -StripQuotes( char *s ) -#else -StripQuotes( s ) -char *s; -#endif -{ - if ( *s == '"' ) - { - s[ strlen(s)-1 ] = '\0'; /* remove last quote */ - return( s+1 ); /* return address past initial quote */ - } - return( s ); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/main.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/main.c deleted file mode 100644 index d38c75500..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/main.c +++ /dev/null @@ -1,1750 +0,0 @@ -/* - * main.c -- main program for PCCTS ANTLR. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -/* To set a breakpoint just before exit look for "cleanUp". */ -/* To set a breakpoint for fatal error look for "fatal_intern" */ - -#include - -#include "pcctscfg.h" -#include "stdpccts.h" - -#define MAX_INT_STACK 50 -static int istack[MAX_INT_STACK]; /* Int stack */ -static int isp = MAX_INT_STACK; - -static int DontAcceptFiles = 0; /* if stdin, don't read files */ -static int DontAcceptStdin = 0; /* if files seen first, don't accept stdin */ - -static int tnodes_used_in_guard_predicates_etc; /* MR10 */ - - /* C m d - L i n e O p t i o n S t r u c t & F u n c s */ - -typedef struct _Opt { - char *option; - int arg; -#ifdef __cplusplus - void (*process)(...); -#else - void (*process)(); -#endif - char *descr; - } Opt; - -#ifdef __USE_PROTOS -extern void ProcessArgs(int, char **, Opt *); -#else -extern void ProcessArgs(); -#endif - -#ifdef __USE_PROTOS -int ci_strequ(char *a,char *b) -#else -int ci_strequ(a,b) - char *a; - char *b; -#endif -{ - for ( ;*a != 0 && *b != 0; a++, b++) { - if (toupper(*a) != toupper(*b)) return 0; - } - return (*a == *b); -} - -static void -#ifdef __USE_PROTOS -pStdin( void ) -#else -pStdin( ) -#endif -{ - if ( DontAcceptStdin ) - { - warnNoFL("'-' (stdin) ignored as files were specified first"); - return; - } - - require(NumFiles 8 ) { /* MR6 */ - warnNoFL("tab width must be between 1 and 8"); /* MR6 */ - TabWidth=0; /* MR6 */ - } /* MR6 */ -} /* MR6 */ - -static int ambAidDepthSpecified=0; /* MR11 */ - -static void /* MR11 */ -#ifdef __USE_PROTOS -pAAd( char *s, char *t ) /* MR11 */ -#else -pAAd( s, t ) /* MR11 */ -char *s; /* MR11 */ -char *t; /* MR11 */ -#endif -{ /* MR11 */ - ambAidDepthSpecified=1; /* MR11 */ - MR_AmbAidDepth = atoi(t); /* MR11 */ -} /* MR11 */ - -static void /* MR11 */ -#ifdef __USE_PROTOS -pTreport( char *s, char *t ) /* MR11 */ -#else -pTreport( s, t ) /* MR11 */ - char *s; /* MR11 */ - char *t; /* MR11 */ -#endif -{ /* MR11 */ - TnodesReportThreshold = atoi(t); /* MR11 */ -} /* MR11 */ - -#ifdef __USE_PROTOS -void chkGTFlag(void) /* 7-Apr-97 MR1 */ -#else -void chkGTFlag() /* 7-Apr-97 MR1 */ -#endif -{ - if ( !GenAST ) - warn("#-variable or other AST item referenced w/o -gt option"); -} - - -#ifdef __USE_PROTOS -static void pInfo(char *s, char *t) /* MR10 */ -#else -static void pInfo(s,t) /* MR10 */ - char *s; - char *t; -#endif -{ - char *p; - int q; - for (p=t; *p != 0; p++) { - q=tolower(*p); - if (q=='t') { - InfoT=1; - } else if (q=='p') { - InfoP=1; - } else if (q=='m') { - InfoM=1; - } else if (q=='o') { - InfoO=1; - } else if (q=='0') { - ; /* nothing */ - } else if (q=='f') { - InfoF=1; - } else { - warnNoFL(eMsgd("unrecognized -info option \"%c\"",(int)*p)); - }; - }; -} - -#ifdef __USE_PROTOS -static void pCGen(void) { CodeGen = FALSE; LexGen = FALSE; } -static void pLGen(void) { LexGen = FALSE; } -static void pXTGen(void){ MR_Inhibit_Tokens_h_Gen = TRUE; } -static void pTGen(void) { TraceGen = TRUE; } -static void pSGen(void) { GenExprSetsOpt = FALSE; } -static void pPrt(void) { PrintOut = TRUE; pCGen(); pLGen(); } -static void pPrtA(void) { PrintOut = TRUE; PrintAnnotate = TRUE; pCGen(); pLGen(); } -static void pAst(void) { GenAST = TRUE; } -static void pANSI(void) { GenANSI = TRUE; } -static void pCr(void) { GenCR = TRUE; } -static void pNOPURIFY(void) { PURIFY = FALSE; } -/*static void pCt(void) { warnNoFL("-ct option is now the default"); }*/ -static void pLI(void) { GenLineInfo = TRUE; GenLineInfoMS = FALSE; } /* MR14 */ -static void pLIms(void) { GenLineInfo = TRUE; GenLineInfoMS = TRUE; } /* MR14 */ -static void pFr(char *s, char *t) {RemapFileName = t;} -static void pFe(char *s, char *t) {ErrFileName = t;} -static void pFl(char *s, char *t) {DlgFileName = t;} -static void pFm(char *s, char *t) {ModeFileName = t;} -static void pFt(char *s, char *t) {DefFileName = t;} - -static void pE1(void) { elevel = 1; } -static void pE2(void) { elevel = 2; } -static void pE3(void) { elevel = 3; } -static void pEGen(void) { GenEClasseForRules = 1; } -static void pDL(void) - { - DemandLookahead = 1; - if ( GenCC ) { - warnNoFL("-gk does not work currently in C++ mode; -gk turned off"); - DemandLookahead = 0; - } - } - -static void pAA(char *s,char *t) {MR_AmbAidRule = t;} /* MR11 */ -static void pAAm(char *s){MR_AmbAidMultiple = 1;} /* MR11 */ -static void pGHdr(void) { GenStdPccts = 1; } -static void pFHdr(char *s, char *t) { stdpccts = t; pGHdr(); } -static void pW1(void) { WarningLevel = 1; } -static void pNewAST(void) { NewAST = 1; } /* MR13 */ -static void ptmakeInParser(void) { tmakeInParser = 1; } /* MR23 */ -static void pAlpha(void) { AlphaBetaTrace = 1; } /* MR14 */ -static void pMR_BlkErr(void) { MR_BlkErr = 1; } /* MR21 */ -static void pStdout(void) {UseStdout = 1; } /* MR6 */ -static void pW2(void) { WarningLevel = 2; } -static void pCC(void) { GenCC = TRUE; } -#else -static void pCGen() { CodeGen = FALSE; LexGen = FALSE; } -static void pLGen() { LexGen = FALSE; } -static void pXTGen(){ MR_Inhibit_Tokens_h_Gen = TRUE; } /* MR14 */ -static void pTGen() { TraceGen = TRUE; } -static void pSGen() { GenExprSetsOpt = FALSE; } -static void pPrt() { PrintOut = TRUE; pCGen(); pLGen(); } -static void pPrtA() { PrintOut = TRUE; PrintAnnotate = TRUE; pCGen(); pLGen(); } -static void pAst() { GenAST = TRUE; } -static void pANSI() { GenANSI = TRUE; } -static void pCr() { GenCR = TRUE; } -static void pNOPURIFY() { PURIFY = FALSE; } - -/*static void pCt() { warnNoFL("-ct option is now the default"); }*/ -static void pLI() { GenLineInfo = TRUE; GenLineInfoMS = FALSE; } /* MR14 */ -static void pLIms() { GenLineInfo = TRUE; GenLineInfoMS = TRUE; } /* MR14 */ -static void pFr(s,t) char *s, *t; {RemapFileName = t;} -static void pFe(s,t) char *s, *t; {ErrFileName = t;} -static void pFl(s,t) char *s, *t; {DlgFileName = t;} -static void pFm(s,t) char *s, *t; {ModeFileName = t;} -static void pFt(s,t) char *s, *t; {DefFileName = t;} - -static void pE1() { elevel = 1; } -static void pE2() { elevel = 2; } -static void pE3() { elevel = 3; } -static void pEGen() { GenEClasseForRules = 1; } -static void pDL() - { - DemandLookahead = 1; - if ( GenCC ) { - warnNoFL("-gk does not work currently in C++ mode; -gk turned off"); - DemandLookahead = 0; - } - } - -static void pAA(s,t) char *s; char *t; {MR_AmbAidRule = t;} /* MR11 BJS 20-Mar-98 */ -static void pAAm(s) char *s; {MR_AmbAidMultiple = 1;} /* MR11 BJS 20-Mar-98 */ -static void pGHdr() { GenStdPccts = 1; } -static void pFHdr(s,t) char *s, *t; { stdpccts = t; pGHdr(); } -static void pW1() { WarningLevel = 1; } -static void pNewAST() { NewAST = 1; } /* MR13 */ -static void ptmakeInParser() { tmakeInParser = 1; } /* MR23 */ -static void pAlpha() { AlphaBetaTrace = 1; } /* MR14 */ -static void pMR_BlkErr() { MR_BlkErr = 1; } /* MR21 */ -static void pStdout() {UseStdout = 1; } /* MR6 */ -static void pW2() { WarningLevel = 2; } -static void pCC() { GenCC = TRUE; } -#endif - -static void -#ifdef __USE_PROTOS -pPre( char *s, char *t ) -#else -pPre( s, t ) -char *s; -char *t; -#endif -{ - RulePrefix = t; -} - -static void -#ifdef __USE_PROTOS -pOut( char *s, char *t ) -#else -pOut( s, t ) -char *s; -char *t; -#endif -{ - OutputDirectory = t; -} - -static void -#ifdef __USE_PROTOS -pPred( void ) -#else -pPred( ) -#endif -{ - warnNoFL("-pr is no longer used (predicates employed if present); see -prc, -mrhoist, -mrhoistk"); -/* -** if ( DemandLookahead ) -** warnNoFL("-gk conflicts with -pr; -gk turned off"); -** DemandLookahead = 0; -** HoistPredicateContext = 0; -*/ -} - -static void -#ifdef __USE_PROTOS -pPredCtx( char *s, char *t ) -#else -pPredCtx(s,t) -char *s; -char *t; -#endif -{ - if ( ci_strequ(t,"on")) HoistPredicateContext = 1; - else if ( ci_strequ(t,"off")) HoistPredicateContext = 0; - if ( DemandLookahead ) - { - warnNoFL("-gk incompatible with semantic predicate usage; -gk turned off"); - DemandLookahead = 0; - } -} - -static void -#ifdef __USE_PROTOS -pMRhoist( char *s, char *t ) -#else -pMRhoist(s,t) -char *s; -char *t; -#endif -{ - if ( ci_strequ(t,"on")) MRhoisting = 1; - else if ( ci_strequ(t,"off")==0 ) MRhoisting = 0; - if (MRhoisting) { - fprintf(stderr,"Maintenance Release style hoisting enabled for predicates with lookahead depth = 1\n"); - fprintf(stderr," No longer considered experimental\n"); - fprintf(stderr," Can't consider suppression for predicates with lookahead depth > 1\n"); - fprintf(stderr," Implies -prc on but does *not* imply -mrhoistk for k>1 predicates\n"); - fprintf(stderr," This is a reminder, not a warning or error.\n"); - }; -} - -static void -#ifdef __USE_PROTOS -pMRhoistk( char *s, char *t ) -#else -pMRhoistk(s,t) -char *s; -char *t; -#endif -{ - if ( ci_strequ(t,"on")) MRhoistingk = 1; - else if ( ci_strequ(t,"off")==0 ) MRhoistingk = 0; - if (MRhoistingk) { - fprintf(stderr,"EXPERIMENTAL Maintenance Release style hoisting enabled\n"); - fprintf(stderr," Applies to predicates with lookahead depth > 1\n"); - fprintf(stderr," Implies -prc on and -mrhoist on\n"); - }; -} - -static void -#ifdef __USE_PROTOS -pTRes( char *s, char *t ) -#else -pTRes( s, t ) -char *s; -char *t; -#endif -{ - TreeResourceLimit = atoi(t); - if ( TreeResourceLimit <= 0 ) - { - warnNoFL("analysis resource limit (# of tree nodes) must be greater than 0"); - TreeResourceLimit = -1; /* set to no limit */ - } -} - -Opt options[] = { -#ifdef __cplusplus - { "-CC", 0, (void (*)(...)) pCC, "Generate C++ output (default=FALSE)"}, - { "-ck", 1, (void (*)(...)) pCk, "Set compressed lookahead depth; fast approximate lookahead"}, - { "-cr", 0, (void (*)(...)) pCr, "Generate cross reference (default=FALSE)"}, - { "-e1", 0, (void (*)(...)) pE1, "Ambiguities/errors shown in low detail (default)"}, - { "-e2", 0, (void (*)(...)) pE2, "Ambiguities/errors shown in more detail"}, - { "-e3", 0, (void (*)(...)) pE3, - "Ambiguities for k>1 grammars shown with exact tuples (not lookahead sets)"}, - { "-f", 1, (void (*)(...)) pFileList,"Read names of grammar files from specified file"}, /* MR14 */ - { "-fe", 1, (void (*)(...)) pFe, "Rename err.c"}, - { "-fh", 1, (void (*)(...)) pFHdr, "Rename stdpccts.h header (turns on -gh)"}, - { "-fl", 1, (void (*)(...)) pFl, "Rename lexical output--parser.dlg"}, - { "-fm", 1, (void (*)(...)) pFm, "Rename mode.h"}, - { "-fr", 1, (void (*)(...)) pFr, "Rename remap.h"}, - { "-ft", 1, (void (*)(...)) pFt, "Rename tokens.h"}, - { "-ga", 0, (void (*)(...)) pANSI, "Generate ANSI-compatible code (default=FALSE)"}, - { "-gc", 0, (void (*)(...)) pCGen, "Do not generate output parser code (default=FALSE)"}, - { "-gd", 0, (void (*)(...)) pTGen, "Generate code to trace rule invocation (default=FALSE)"}, - { "-ge", 0, (void (*)(...)) pEGen, "Generate an error class for each non-terminal (default=FALSE)"}, - { "-gh", 0, (void (*)(...)) pGHdr, "Generate stdpccts.h for non-ANTLR-generated-files to include"}, - { "-gk", 0, (void (*)(...)) pDL, "Generate parsers that delay lookahead fetches until needed"}, - { "-gl", 0, (void (*)(...)) pLI, "Generate line info about grammar actions in parser"}, - { "-glms", 0, (void (*)(...)) pLIms,"Like -gl but replace '\\' with '/' in #line filenames for MS C/C++ systems"}, - { "-gp", 1, (void (*)(...)) pPre, "Prefix all generated rule functions with a string"}, - { "-gs", 0, (void (*)(...)) pSGen, "Do not generate sets for token expression lists (default=FALSE)"}, - { "-gt", 0, (void (*)(...)) pAst, "Generate code for Abstract-Syntax-Trees (default=FALSE)"}, - { "-gx", 0, (void (*)(...)) pLGen, "Do not generate lexical (dlg-related) files (default=FALSE)"}, - { "-gxt",0, (void (*)(...)) pXTGen, "Do not generate tokens.h (default=FALSE)"}, - { "-k", 1, (void (*)(...)) pLLK, "Set full LL(k) lookahead depth (default==1)"}, - { "-o", 1, (void (*)(...)) pOut, OutputDirectoryOption}, - { "-p", 0, (void (*)(...)) pPrt, "Print out the grammar w/o actions (default=no)"}, - { "-pa", 0, (void (*)(...)) pPrtA, "Print out the grammar w/o actions & w/FIRST sets (default=no)"}, - { "-pr",0, (void (*)(...)) pPred, "no longer used; predicates employed if present"}, - { "-prc", 1, (void (*)(...)) pPredCtx,"Turn on/off computation of context for hoisted predicates"}, - { "-rl", 1, (void (*)(...)) pTRes, "Limit max # of tree nodes used by grammar analysis"}, - { "-stdout",0, (void (*)(...)) pStdout,"Send grammar.c/grammar.cpp to stdout"}, /* MR6 */ - { "-tab", 1, (void (*)(...)) pTab, "Width of tabs (1 to 8) for grammar.c/grammar.cpp files"}, /* MR6 */ - { "-w1", 0, (void (*)(...)) pW1, "Set the warning level to 1 (default)"}, - { "-w2", 0, (void (*)(...)) pW2, "Ambiguities yield warnings even if predicates or (...)? block"}, - { "-", 0, (void (*)(...)) pStdin, "Read grammar from stdin" }, - { "-mrhoist",1, (void (*)(...)) pMRhoist, /* MR9 */ - "Turn on/off k=1 Maintenance Release style hoisting"}, /* MR9 */ - { "-mrhoistk",1, (void (*)(...)) pMRhoistk, /* MR9 */ - "Turn on/off EXPERIMENTAL k>1 Maintenance Release style hoisting"}, /* MR13 */ - { "-aa" , 1, (void (*)(...)) pAA, "Ambiguity aid for a rule (rule name or line number)"}, /* MR11 */ - { "-aam" , 0, (void (*)(...)) pAAm, - "Lookahead token may appear multiple times in -aa listing"}, /* MR11 */ - { "-aad" , 1, (void (*)(...)) pAAd, - "Limits exp growth of -aa listing - default=1 (max=ck value)"}, /* MR11 */ - { "-info", 1, (void (*)(...)) pInfo, - "Extra info: p=pred t=tnodes f=first/follow m=monitor o=orphans 0=noop"}, /* MR12 */ - { "-treport",1,(void (*)(...)) pTreport, - "Report when tnode usage exceeds value during ambiguity resolution"}, /* MR11 */ - { "-newAST", 0, (void (*)(...)) pNewAST, - "In C++ mode use \"newAST(...)\" rather than \"new AST(...)\""}, /* MR13 */ - { "-tmake", 0, (void (*)(...)) ptmakeInParser, - "In C++ mode use parser's tmake method rather than \"ASTBase::tmake(...)\""}, /* MR23 */ - { "-alpha",0,(void (*)(...)) pAlpha, - "Provide additional information for \"(alpha)? beta\" error messages"}, /* MR14 */ - { "-mrblkerr",0,(void (*)(...)) pMR_BlkErr, /* MR21 */ - "EXPERIMENTAL change to (...)* and (...)+ syntax error sets"}, /* MR21 */ - { "-nopurify",0,(void (*)(...)) pNOPURIFY, - "Don't use the notorious PURIFY macro (replaced by MR23 initial value syntax) to zero return arguments of rules"}, /* MR23 */ - { "*", 0, (void (*)(...)) pFile, "" }, /* anything else is a file */ -#else - { "-CC", 0, pCC, "Generate C++ output (default=FALSE)"}, - { "-cr", 0, pCr, "Generate cross reference (default=FALSE)"}, - { "-ck", 1, pCk, "Set compressed lookahead depth; fast approximate lookahead"}, - { "-e1", 0, pE1, "Ambiguities/errors shown in low detail (default)"}, - { "-e2", 0, pE2, "Ambiguities/errors shown in more detail"}, - { "-e3", 0, pE3, "Ambiguities for k>1 grammars shown with exact tuples (not lookahead sets)"}, - { "-f", 1, pFileList,"Read names of grammar files from specified file"}, /* MR14 */ - { "-fe", 1, pFe, "Rename err.c"}, - { "-fh", 1, pFHdr, "Rename stdpccts.h header (turns on -gh)"}, - { "-fl", 1, pFl, "Rename lexical output--parser.dlg"}, - { "-fm", 1, pFm, "Rename mode.h"}, - { "-fr", 1, pFr, "Rename remap.h"}, - { "-ft", 1, pFt, "Rename tokens.h"}, - { "-ga", 0, pANSI, "Generate ANSI-compatible code (default=FALSE)"}, - { "-gc", 0, pCGen, "Do not generate output parser code (default=FALSE)"}, - { "-gd", 0, pTGen, "Generate code to trace rule invocation (default=FALSE)"}, - { "-ge", 0, pEGen, "Generate an error class for each non-terminal (default=FALSE)"}, - { "-gh", 0, pGHdr, "Generate stdpccts.h for non-ANTLR-generated-files to include"}, - { "-gk", 0, pDL, "Generate parsers that delay lookahead fetches until needed"}, - { "-gl", 0, pLI, "Generate line info about grammar actions in C parser"}, - { "-glms", 0, pLIms,"Like -gl but replace '\\' with '/' in #line filenames for MS C/C++ systems"}, - { "-gp", 1, pPre, "Prefix all generated rule functions with a string"}, - { "-gs", 0, pSGen, "Do not generate sets for token expression lists (default=FALSE)"}, - { "-gt", 0, pAst, "Generate code for Abstract-Syntax-Trees (default=FALSE)"}, - { "-gx", 0, pLGen, "Do not generate lexical (dlg-related) files (default=FALSE)"}, - { "-gxt",0, pXTGen, "Do not generate tokens.h (default=FALSE)"}, - { "-k", 1, pLLK, "Set full LL(k) lookahead depth (default==1)"}, - { "-o", 1, pOut, OutputDirectoryOption}, - { "-p", 0, pPrt, "Print out the grammar w/o actions (default=no)"}, - { "-pa", 0, pPrtA, "Print out the grammar w/o actions & w/FIRST sets (default=no)"}, - { "-pr",0, pPred, "no longer used; predicates employed if present"}, - { "-prc", 1, pPredCtx,"Turn on/off computation of context for hoisted predicates"}, - { "-rl", 1, pTRes, "Limit max # of tree nodes used by grammar analysis"}, - { "-stdout",0, pStdout, "Send grammar.c/grammar.cpp to stdout"}, /* MR6 */ - { "-tab", 1, pTab, "Width of tabs (1 to 8) for grammar.c/grammar.cpp files"}, /* MR6 */ - { "-w1", 0, pW1, "Set the warning level to 1 (default)"}, - { "-w2", 0, pW2, "Ambiguities yield warnings even if predicates or (...)? block"}, - { "-mrhoist",1,pMRhoist, /* MR9 */ - "Turn on/off k=1 Maintenance Release style hoisting"}, /* MR9 */ - { "-mrhoistk",1,pMRhoistk, /* MR13 */ - "Turn on/off k>1 EXPERIMENTAL Maintenance Release style hoisting"}, /* MR13 */ - { "-aa" ,1,pAA, "Ambiguity aid for a rule (rule name or line number)"}, /* MR11 */ - { "-aam" ,0,pAAm, - "Lookahead token may appear multiple times in -aa listing"}, /* MR11 */ - { "-aad" ,1,pAAd, - "Limits exp growth of -aa listing - default=1 (max=ck value)"}, /* MR11 */ - { "-info",1,pInfo, - "Extra info: p=pred t=tnodes f=first/follow m=monitor o=orphans 0=noop"}, /* MR11 */ - { "-treport",1,pTreport, - "Report when tnode usage exceeds value during ambiguity resolution"}, /* MR11 */ - { "-newAST", 0, pNewAST, - "In C++ mode use \"newAST(...)\" rather than \"new AST(...)\""}, /* MR13 */ - { "-tmake", 0, ptmakeInParser, - "In C++ mode use parser's tmake method rather than \"ASTBase::tmake(...)\""}, /* MR23 */ - { "-alpha",0, pAlpha, - "Provide additional information for \"(alpha)? beta\" error messages"}, /* MR14 */ - { "-mrblkerr",0,pMR_BlkErr, /* MR21 */ - "EXPERIMENTAL change to (...)* and (...)+ syntax error sets"}, /* MR21 */ - { "-nopurify",0,pNOPURIFY, - "Don't use the notorious PURIFY macro (replaced by MR23 initial value syntax) to zero return arguments of rules"}, /* MR23 */ - { "-", 0, pStdin, "Read grammar from stdin" }, - { "*", 0, pFile, "" }, /* anything else is a file */ -#endif - { NULL, 0, NULL } - }; - -void readDescr(); -void cleanUp(); - -#ifdef __USE_PROTOS -static void buildRulePtr( void ); -static void help( void ); -static void init( void ); -static void CompleteTokenSetRefs( void ); -static void ensure_no_C_file_collisions(char *); -static void CompleteContextGuards(void); -#else -static void buildRulePtr( ); -static void help( ); -static void init( ); -static void CompleteTokenSetRefs( ); -static void ensure_no_C_file_collisions(); -static void CompleteContextGuards(); -#endif - -static void -#ifdef __USE_PROTOS /* */ -report_numericPredLabels(ActionNode *a) -#else -report_numericPredLabels(a) -ActionNode *a; -#endif -{ /* MR10 */ - warnFL("numeric references to attributes (e.g. $i or $i.j) in semantic pred will be null during guess mode", /* MR10 */ - FileStr[a->file],a->line); /* MR10 */ -} /* MR10 */ - - /* M a i n */ - -int -#ifdef __USE_PROTOS -main( int argc, char *argv[] ) -#else -main( argc, argv ) -int argc; -char *argv[]; -#endif -{ - int i; - static char EPSTR[] = "[Ep]"; - - Save_argc=argc; /* MR10 */ - Save_argv=argv; /* MR10 */ - -/* malloc_debug(8);*/ - -#ifdef SPECIAL_INITS - special_inits(); /* MR1 */ -#endif - fprintf(stderr, "Antlr parser generator Version %s 1989-2001\n", Version); - if ( argc == 1 ) { help(); zzDIE; } - ProcessArgs(argc-1, &(argv[1]), options); - -/* MR14 */ if (MR_AmbAidRule && AlphaBetaTrace) { -/* MR14 */ fatal("Can't specify both -aa (ambiguity aid) and -alpha (\"(alpha)? beta\" aid)"); -/* MR14 */ } - - if (MRhoistingk) { /* MR13 */ - HoistPredicateContext=1; /* MR13 */ - MRhoisting=1; /* MR13 */ - }; /* MR13 */ - if (MRhoisting && ! HoistPredicateContext) { -/*** warnNoFL("Using \"-mrhoist\" forces \"-prc on\""); ***/ - HoistPredicateContext=1; - }; - if (HoistPredicateContext && ! MRhoisting) { - warnNoFL("When using predicate context (-prc on) -mrhoist on is recommended"); - } - /* Fix lookahead depth */ - /* Compressed lookahead must always be larger than or equal to full lookahead */ - if ( CLL_k < LL_k && CLL_k>0 ) - { - warnNoFL("must have compressed lookahead >= full LL(k) lookahead (setting -ck to -k)"); - CLL_k = LL_k; - } - if ( CLL_k == -1 ) CLL_k = LL_k; - OutputLL_k = CLL_k; - if ( ((CLL_k-1)&CLL_k)!=0 ) { /* output ll(k) must be power of 2 */ - int n; - for(n=1; n 1) { - warnNoFL("The -mrblkerr option is designed only for k=1 ck=1 grammars"); - } - }; - - if ( ! ambAidDepthSpecified) { - MR_AmbAidDepth=1; - } else { - if (MR_AmbAidDepth > CLL_k || MR_AmbAidDepth <= 0) { - warnNoFL(eMsgd( - "Ambiguity aid depth (\"-aad ...\") must be a number between 1 and max(k,ck)=%d",CLL_k)); - MR_AmbAidDepth=1; - }; - if (MR_AmbAidDepth == 0) { - MR_AmbAidDepth=2; - }; - }; - - if (MR_AmbAidRule != NULL) MR_AmbAidLine=atoi(MR_AmbAidRule); - - fpTrans = &(C_Trans[0]); /* Translate to C Language */ - fpJTrans = &(C_JTrans[0]); - init(); - lexclass(LexStartSymbol); - - readDescr(); - LastTokenCounted = TokenNum; - RemapForcedTokens(); - if ( CannotContinue ) {cleanUp(); zzDIE;} - if ( GenCC && no_classes_found ) fatal("required grammar class not found (exiting...)"); - if ( WarningLevel>1 && HdrAction == NULL ) - warnNoFL("no #header action was found"); - if ( FoundAtOperator && ! FoundExceptionGroup) { - warnNoFL("found the exception operator '@' - but no exception group was found"); - }; - EpToken = addTname(EPSTR); /* add imaginary token epsilon */ - set_orel(EpToken, &imag_tokens); - - /* this won't work for hand-built scanners since EofToken is not - * known. Forces EOF to be token type 1. - */ - set_orel(EofToken, &imag_tokens); - - set_size(NumWords(TokenNum-1)); - - /* compute the set of all known token types - * It represents the set of tokens from 1 to last_token_num + the - * reserved positions above that (if any). Don't include the set of - * imaginary tokens such as the token/error classes or EOF. - */ - { - set a; - a = set_dup(reserved_positions); - for (i=1; inext; p!=NULL; p=p->next) - { - UserAction *ua = (UserAction *)p->elem; - dumpAction( ua->action, Parser_h, 0, ua->file, ua->line, 1); - } - } - GenParser_c_Hdr(); - fprintf(Parser_h, "protected:\n"); /* MR20 */ - NewSetWd(); - TRANS(SynDiag); /* Translate to the target language */ - DumpSetWd(); - GenRuleMemberDeclarationsForCC(Parser_h, SynDiag); - if ( class_after_actions != NULL ) - { - ListNode *p; - for (p = class_after_actions->next; p!=NULL; p=p->next) - { - UserAction *ua = (UserAction *)p->elem; - dumpAction( ua->action, Parser_h, 0, ua->file, ua->line, 1); - } - } - DumpRemainingTokSets(); - fprintf(Parser_h, "};\n"); - fprintf(Parser_h, "\n#endif /* %s_h */\n", CurrentClassName); - fclose( Parser_h ); - fclose( Parser_c ); - } - } - - MR_orphanRules(stderr); - if (LTinTokenAction && WarningLevel >= 2) { - if (GenCC) { - warnNoFL("At least one <> following a token match contains a reference to LT(...)\n this will reference the immediately preceding token,\n not the one which follows as is the case with semantic predicates."); - } - warnNoFL("At least one <> following a token match contains a reference to LA(...) or LATEXT(...)\n this will reference the immediately preceding token,\n not the one which follows as is the case with semantic predicates."); - } - - if ( PrintOut ) - { - if ( SynDiag == NULL ) {warnNoFL("no grammar description recognized");} - else PRINT(SynDiag); - } - -#ifdef DBG_LL1 -#endif - GenRemapFile(); /* create remap.h */ -/* MR10 */ if (FoundGuessBlk) { -#ifdef __cplusplus__ -/* MR10 */ list_apply(NumericPredLabels, (void (*)(void *))report_numericPredLabels); -#else -#ifdef __USE_PROTOS -/* MR10 */ list_apply(NumericPredLabels, (void (*)(void *))report_numericPredLabels); -#else -/* MR10 */ list_apply(NumericPredLabels,report_numericPredLabels); -#endif -#endif -/* MR10 */ }; - - if (InfoT && TnodesAllocated > 0) { - if (TnodesPeak > 10000) { - fprintf(stdout,"\nTree Nodes: peak %dk created %dk lost %d\n", - (TnodesPeak/1000), - (TnodesAllocated/1000), - TnodesInUse-tnodes_used_in_guard_predicates_etc); - } else { - fprintf(stdout,"\nTree Nodes: peak %d created %d lost %d\n", - TnodesPeak, - TnodesAllocated, - TnodesInUse-tnodes_used_in_guard_predicates_etc); - }; - }; - if (InfoF) { - DumpFcache(); - }; - if (MR_skipped_e3_report) { - fprintf(stderr,"note: use -e3 to get exact information on ambiguous tuples\n"); - }; - if (MR_BadExprSets != 0) { - fprintf(stderr,"note: Unreachable C or C++ code was generated for empty expression sets,\n"); - fprintf(stderr," probably due to undefined rules or infinite left recursion.\n"); - fprintf(stderr," To locate: search the generated code for \"empty set expression\"\n"); - }; - if (MR_AmbAidRule != NULL && MR_matched_AmbAidRule==0) { - RuleEntry *q = (RuleEntry *) hash_get(Rname,MR_AmbAidRule); - if (MR_AmbAidLine == 0 && q == NULL) { - warnNoFL(eMsg2("there is no rule \"%s\" so \"-aa %s\" will never match", - MR_AmbAidRule,MR_AmbAidRule)); - } else { - warnNoFL(eMsg1("there was no ambiguity that matched \"-aa %s\"",MR_AmbAidRule)); - }; - }; - if (AlphaBetaTrace) { - - if (MR_AlphaBetaMessageCount == 0) { - fprintf(stderr,"note: there were no messages about \"(alpha)? beta\" blocks added to the generated code\n"); - } else { - fprintf(stderr,"note: there were %d messages about \"(alpha)? beta\" blocks added to the generated code\n", - MR_AlphaBetaMessageCount); - } - - if (set_null(MR_CompromisedRules)) { - fprintf(stderr,"note: the list of rules with compromised follow sets is empty\n"); - } else { - fprintf(stderr,"note: the following is a list of rules which *may* have incorrect\n"); - fprintf(stderr," follow sets computed as a result of an \"(alpha)? beta\" block\n"); - fprintf(stderr,"\n"); - MR_dumpRuleSet(MR_CompromisedRules); - fprintf(stderr,"\n"); - } - } - cleanUp(); - exit(PCCTS_EXIT_SUCCESS); - return 0; /* MR11 make compilers happy */ -} - -static void -#ifdef __USE_PROTOS -init( void ) -#else -init( ) -#endif -{ - SignalEntry *q; - - Tname = newHashTable(); - Rname = newHashTable(); - Fcache = newHashTable(); - Tcache = newHashTable(); - Sname = newHashTable(); - Pname = newHashTable(); /* MR11 */ - - /* Add default signal names */ - q = (SignalEntry *)hash_add(Sname, - "NoViableAlt", - (Entry *)newSignalEntry("NoViableAlt")); - require(q!=NULL, "cannot alloc signal entry"); - q->signum = sigNoViableAlt; - q = (SignalEntry *)hash_add(Sname, - "MismatchedToken", - (Entry *)newSignalEntry("MismatchedToken")); - require(q!=NULL, "cannot alloc signal entry"); - q->signum = sigMismatchedToken; - q = (SignalEntry *)hash_add(Sname, - "NoSemViableAlt", - (Entry *)newSignalEntry("NoSemViableAlt")); - require(q!=NULL, "cannot alloc signal entry"); - q->signum = sigNoSemViableAlt; - - reserved_positions = empty; - all_tokens = empty; - imag_tokens = empty; - tokclasses = empty; - TokenStr = (char **) calloc(TSChunk, sizeof(char *)); - require(TokenStr!=NULL, "main: cannot allocate TokenStr"); - FoStack = (int **) calloc(CLL_k+1, sizeof(int *)); - require(FoStack!=NULL, "main: cannot allocate FoStack"); - FoTOS = (int **) calloc(CLL_k+1, sizeof(int *)); - require(FoTOS!=NULL, "main: cannot allocate FoTOS"); - Cycles = (ListNode **) calloc(CLL_k+1, sizeof(ListNode *)); - require(Cycles!=NULL, "main: cannot allocate Cycles List"); - MR_CompromisedRules=empty; /* MR14 */ -} - -static void -#ifdef __USE_PROTOS -help( void ) -#else -help( ) -#endif -{ - Opt *p = options; - fprintf(stderr, "antlr [options] f1 f2 ... fn\n"); - while ( *(p->option) != '*' ) - { - fprintf(stderr, " %-9s%s %s\n", - p->option, - (p->arg)?"___":" ", - p->descr); - p++; - } -} - -/* The RulePtr array is filled in here. RulePtr exists primarily - * so that sets of rules can be maintained for the FOLLOW caching - * mechanism found in rJunc(). RulePtr maps a rule num from 1 to n - * to a pointer to its RuleBlk junction where n is the number of rules. - */ -static void -#ifdef __USE_PROTOS -buildRulePtr( void ) -#else -buildRulePtr( ) -#endif -{ - int r=1; - Junction *p = SynDiag; - RulePtr = (Junction **) calloc(NumRules+1, sizeof(Junction *)); - require(RulePtr!=NULL, "cannot allocate RulePtr array"); - - while ( p!=NULL ) - { - require(r<=NumRules, "too many rules???"); - RulePtr[r++] = p; - p = (Junction *)p->p2; - } -} - -void -#ifdef __USE_PROTOS -dlgerror(const char *s) -#else -dlgerror(s) -char *s; -#endif -{ - fprintf(stderr, ErrHdr, FileStr[CurFile], zzline); - fprintf(stderr, " lexical error: %s (text was '%s')\n", - ((s == NULL) ? "Lexical error" : s), zzlextext); -} - -void -#ifdef __USE_PROTOS -readDescr( void ) -#else -readDescr( ) -#endif -{ - zzerr = dlgerror; - input = NextFile(); - if ( input==NULL ) fatal("No grammar description found (exiting...)"); - ANTLR(grammar(), input); - tnodes_used_in_guard_predicates_etc=TnodesInUse; /* MR10 */ -} - -FILE * -#ifdef __USE_PROTOS -NextFile( void ) -#else -NextFile( ) -#endif -{ - FILE *f; - - for (;;) - { - CurFile++; - if ( CurFile >= NumFiles ) return(NULL); - if ( ci_strequ(FileStr[CurFile],"stdin")) return stdin; - f = fopen(FileStr[CurFile], "r"); - if ( f == NULL ) - { - warnNoFL( eMsg1("file %s doesn't exist; ignored", FileStr[CurFile]) ); - } - else - { - return(f); - } - } -} - -/* - * Return a string corresponding to the output file name associated - * with the input file name passed in. - * - * Observe the following rules: - * - * f.e --> f".c" - * f --> f".c" - * f. --> f".c" - * f.e.g --> f.e".c" - * - * Where f,e,g are arbitrarily long sequences of characters in a file - * name. - * - * In other words, if a ".x" appears on the end of a file name, make it - * ".c". If no ".x" appears, append ".c" to the end of the file name. - * - * C++ mode using .cpp not .c. - * - * Use malloc() for new string. - */ - -char * -#ifdef __USE_PROTOS -outname( char *fs ) -#else -outname( fs ) -char *fs; -#endif -{ - if ( GenCC) { - return outnameX(fs,CPP_FILE_SUFFIX); - } else { - return outnameX(fs,".c"); - }; -} - -char * -#ifdef __USE_PROTOS -outnameX( char *fs ,char *suffix) -#else -outnameX( fs , suffix ) -char *fs; -char *suffix; -#endif -{ - static char buf[MaxFileName+1]; - char *p; - require(fs!=NULL&&*fs!='\0', "outname: NULL filename"); - - p = buf; - strcpy(buf, fs); - while ( *p != '\0' ) {p++;} /* Stop on '\0' */ - while ( *p != '.' && p != buf ) {--p;} /* Find '.' */ - if ( p != buf ) *p = '\0'; /* Found '.' */ - require(strlen(buf) + 2 < (size_t)MaxFileName, "outname: filename too big"); - strcat(buf,suffix); - return( buf ); -} - -void -#ifdef __USE_PROTOS -fatalFL( char *err_, char *f, int l ) -#else -fatalFL( err_, f, l ) -char *err_; -char *f; -int l; -#endif -{ - fprintf(stderr, ErrHdr, f, l); - fprintf(stderr, " %s\n", err_); - cleanUp(); - exit(PCCTS_EXIT_FAILURE); -} - -void -#ifdef __USE_PROTOS -fatal_intern( char *err_, char *f, int l ) -#else -fatal_intern( err_, f, l ) -char *err_; -char *f; -int l; -#endif -{ - fprintf(stderr, ErrHdr, f, l); - fprintf(stderr, " #$%%*&@# internal error: %s\n", err_); - fprintf(stderr, ErrHdr, f, l); - fprintf(stderr, " [complain to nearest government official\n"); - fprintf(stderr, ErrHdr, f, l); - fprintf(stderr, " or send hate-mail to parrt@parr-research.com;\n"); - fprintf(stderr, ErrHdr, f, l); - fprintf(stderr, " please pray to the ``bug'' gods that there is a trival fix.]\n"); - cleanUp(); - exit(PCCTS_EXIT_FAILURE); -} - -void -#ifdef __USE_PROTOS -cleanUp( void ) -#else -cleanUp( ) -#endif -{ - if ( DefFile != NULL) { - fprintf(DefFile, "\n#endif /* %s */\n", gate_symbol(DefFileName)); - fclose( DefFile ); - } -} - -/* sprintf up to 3 strings */ -char * -#ifdef __USE_PROTOS -eMsg3( char *s, char *a1, char *a2, char *a3 ) -#else -eMsg3( s, a1, a2, a3 ) -char *s; -char *a1; -char *a2; -char *a3; -#endif -{ - static char buf[250]; /* DANGEROUS as hell !!!!!! */ - - sprintf(buf, s, a1, a2, a3); - return( buf ); -} - -/* sprintf a decimal */ -char * -#ifdef __USE_PROTOS -eMsgd( char *s, int d ) -#else -eMsgd( s, d ) -char *s; -int d; -#endif -{ - static char buf[250]; /* DANGEROUS as hell !!!!!! */ - - sprintf(buf, s, d); - return( buf ); -} - -char * -#ifdef __USE_PROTOS -eMsgd2( char *s, int d1,int d2) -#else -eMsgd2( s, d1, d2 ) -char *s; -int d1; -int d2; -#endif -{ - static char buf[250]; /* DANGEROUS as hell !!!!!! */ - - sprintf(buf, s, d1, d2); - return( buf ); -} - -void -#ifdef __USE_PROTOS -s_fprT( FILE *f, set e ) -#else -s_fprT( f, e ) -FILE *f; -set e; -#endif -{ - register unsigned *p; - unsigned *q; - - if ( set_nil(e) ) return; - if ( (q=p=set_pdq(e)) == NULL ) fatal_internal("Can't alloc space for set_pdq"); - fprintf(f, "{"); - while ( *p != nil ) - { - fprintf(f, " %s", TerminalString(*p)); - p++; - } - fprintf(f, " }"); - free((char *)q); -} - -/* Return the token name or regular expression for a token number. */ -char * -#ifdef __USE_PROTOS -TerminalString( int token ) -#else -TerminalString( token ) -int token; -#endif -{ - int j; - static char imag_name[20]; - - /* look in all lexclasses for the token */ - if ( TokenString(token) != NULL ) return TokenString(token); - for (j=0; j0, "pushint: stack overflow"); - istack[--isp] = i; -} - -int -#ifdef __USE_PROTOS -popint( void ) -#else -popint( ) -#endif -{ - require(isp 0 ) - { - p = options; - while ( p->option != NULL ) - { - if ( strcmp(p->option, "*") == 0 || - ci_strequ(p->option, *argv) == 1 ) - { - if ( p->arg ) - { -/* MR9 26-Sep-97 Check for argv valid */ - if (argc-- > 0) { - (*p->process)( *argv, *(argv+1) ); - argv++; - } else { -fprintf(stderr,"error: required argument for option %s omitted\n",*argv); -exit(PCCTS_EXIT_FAILURE); - }; - } - else - (*p->process)( *argv ); - break; - } - p++; - } - argv++; - } -} - -static void -#ifdef __USE_PROTOS -CompleteContextGuards(void) -#else -CompleteContextGuards() -#endif -{ - ListNode * p; - Predicate * pred; - - if (ContextGuardPredicateList == NULL) return; - - for (p=ContextGuardPredicateList->next; p != NULL; p=p->next) { - pred=(Predicate *)p->elem; - recomputeContextGuard(pred); - } -} - -/* Go back into the syntax diagram and compute all meta tokens; i.e. - * turn all '.', ranges, token class refs etc... into actual token sets - */ -static void -#ifdef __USE_PROTOS -CompleteTokenSetRefs(void) -#else -CompleteTokenSetRefs() -#endif -{ - ListNode *p; - - if ( MetaTokenNodes==NULL ) return; - for (p = MetaTokenNodes->next; p!=NULL; p=p->next) - { - set a,b; - - TokNode *q = (TokNode *)p->elem; - if ( q->wild_card ) - { - q->tset = all_tokens; - } - else if ( q->tclass!=NULL ) - { - if ( q->complement ) q->tset = set_dif(all_tokens, q->tclass->tset); - else q->tset = q->tclass->tset; - } - else if ( q->upper_range!=0 ) - { - /* we have a range on our hands: make a set from q->token .. q->upper_range */ - int i; - a = empty; - for (i=q->token; i<=q->upper_range; i++) { set_orel(i, &a); } /* MR13 */ - -/* MR13 */ if (q->complement) { -/* MR13 */ q->tset = set_dif(all_tokens, a); -/* MR13 */ set_free(a); -/* MR13 */ } else { -/* MR13 */ q->tset = a; -/* MR13 */ } - - } - - /* at this point, it can only be a complemented single token */ - else if ( q->complement ) - { - a = set_of(q->token); - b = set_dif(all_tokens, a); - set_free(a); - q->tset=b; - } - else fatal("invalid meta token"); - } -} - -/* MR10: Jeff Vincent - MR10: Changed to remove directory information from n only if - MR10: if OutputDirectory was changed by user (-o option) -*/ - -char * -#ifdef __USE_PROTOS -OutMetaName(char *n) -#else -OutMetaName(n) -char *n; -#endif -{ - static char *dir_sym = DirectorySymbol; - static char newname[MaxFileName+1]; - char *p; - - /* If OutputDirectory is same as TopDirectory (platform default) then leave n alone. */ - if (strcmp(OutputDirectory, TopDirectory) == 0) /* TopDirectory is "." on Unix. */ - return n; - - /* p will point to filename without path information */ - if ((p = strrchr(n, *dir_sym)) != NULL) /* Directory symbol is "/" on Unix. */ - p++; - else - p = n; - - /* Copy new output directory into newname[] */ - strcpy(newname, OutputDirectory); - - /* if new output directory does not have trailing dir_sym, add it! */ - if (newname[strlen(newname)-1] != *dir_sym) { - strcat(newname, dir_sym); - } - strcat(newname, p); - return newname; -} - -char * -#ifdef __USE_PROTOS -pcctsBaseName(char *n) /* MR32 */ -#else -pcctsBaseName(n) -char *n; -#endif -{ - static char newname[MaxFileName+1]; - static char* dir_sym = DirectorySymbol; - int count = 0; - char *p; - - p = n; - - while ( *p != '\0' ) {p++;} /* go to end of string */ - while ( (*p != *dir_sym) && (p != n) ) {--p;} /* Find last DirectorySymbol */ - while ( *p == *dir_sym) p++; /* step forward if we're on a dir symbol */ - while ( *p != '\0' && *p != '.') - { - newname[count++] = *p; - p++; - } /* create a new name */ - newname[count] = '\0'; - return newname; -} - -static void -#ifdef __USE_PROTOS -ensure_no_C_file_collisions(char *class_c_file) -#else -ensure_no_C_file_collisions(class_c_file) -char *class_c_file; -#endif -{ - int i; - - for (i=0; i= NumFiles && CurFile >= 1 ) CurFile--; - fprintf(stderr, ErrHdr, FileStr[CurFile], zzline); - fprintf(stderr, " warning: %s\n", err); -} - -void -#ifdef __USE_PROTOS -warnNoCR( char *err ) -#else -warnNoCR( err ) -char *err; -#endif -{ - /* back up the file number if we hit an error at the end of the last file */ - if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--; - fprintf(stderr, ErrHdr, FileStr[CurFile], zzline); - fprintf(stderr, " warning: %s", err); -} - -void -#ifdef __USE_PROTOS -errNoFL(char *err) -#else -errNoFL(err) -char *err; -#endif -{ - fprintf(stderr, "error: %s\n", err); -} - -void -#ifdef __USE_PROTOS -errFL(char *err,char *f,int l) -#else -errFL(err,f,l) -char *err; -char *f; -int l; -#endif -{ - fprintf(stderr, ErrHdr, f, l); - fprintf(stderr, " error: %s\n", err); -} - -void -#ifdef __USE_PROTOS -err(char *err) -#else -err(err) -char *err; -#endif -{ - /* back up the file number if we hit an error at the end of the last file */ - if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--; - fprintf(stderr, ErrHdr, FileStr[CurFile], zzline); - fprintf(stderr, " error: %s\n", err); -} - -void -#ifdef __USE_PROTOS -errNoCR( char *err ) -#else -errNoCR( err ) -char *err; -#endif -{ - /* back up the file number if we hit an error at the end of the last file */ - if ( CurFile >= NumFiles && CurFile >= 1 ) CurFile--; - fprintf(stderr, ErrHdr, FileStr[CurFile], zzline); - fprintf(stderr, " error: %s", err); -} - -UserAction * -#ifdef __USE_PROTOS -newUserAction(char *s) -#else -newUserAction(s) -char *s; -#endif -{ - UserAction *ua = (UserAction *) calloc(1, sizeof(UserAction)); - require(ua!=NULL, "cannot allocate UserAction"); - - ua->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); - strcpy(ua->action, s); - return ua; -} - -/* Added by TJP September 1994 */ -/* Take in file.h and return file_h; names w/o '.'s are left alone */ -char * -#ifdef __USE_PROTOS -gate_symbol(char *name) -#else -gate_symbol(name) -char *name; -#endif -{ - static char buf[100]; - char *p; - sprintf(buf, "%s", name); - - for (p=buf; *p!='\0'; p++) - { - if ( *p=='.' ) *p = '_'; - } - return buf; -} - -char * -#ifdef __USE_PROTOS -makeAltID(int blockid, int altnum) -#else -makeAltID(blockid, altnum) -int blockid; -int altnum; -#endif -{ - static char buf[100]; - char *p; - sprintf(buf, "_blk%d_alt%d", blockid, altnum); - p = (char *)malloc(strlen(buf)+1); - strcpy(p, buf); - return p; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile deleted file mode 100755 index be5c8b0d4..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile +++ /dev/null @@ -1,219 +0,0 @@ -# -# Makefile for ANTLR 1.33 -# -# SOFTWARE RIGHTS -# -# We reserve no LEGAL rights to the Purdue Compiler Construction Tool -# Set (PCCTS) -- PCCTS is in the public domain. An individual or -# company may do whatever they wish with source code distributed with -# PCCTS or the code generated by PCCTS, including the incorporation of -# PCCTS, or its output, into commerical software. -# -# We encourage users to develop software with PCCTS. However, we do ask -# that credit is given to us for developing PCCTS. By "credit", -# we mean that if you incorporate our source code into one of your -# programs (commercial product, research project, or otherwise) that you -# acknowledge this fact somewhere in the documentation, research report, -# etc... If you like PCCTS and have developed a nice tool with the -# output, please mention that you developed it using PCCTS. In -# addition, we ask that this header remain intact in our source code. -# As long as these guidelines are kept, we expect to continue enhancing -# this system and expect to make other tools available as they are -# completed. -# -# ANTLR 1.33 -# Terence Parr -# Parr Research Corporation -# with Purdue University -# and AHPCRC, University of Minnesota -# 1989-1995 -# -# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by -# Ed Harfmann -# Micro Data Base Systems -# Lafayette, Indiana -# -SET=../support/set -PCCTS_H=../h - -## -## Uncomment the appropriate section to build -## (both targets and 'make' variable definitions) -## Note that UNIX is the default -## - -# -# OS/2 & DOS 16 bit using MSC 6.0 -# -#CC=cl -#ANTLR=..\bin\antlr -#DLG=..\bin\dlg -#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /AL /Za /W3 -DPC -DUSER_ZZSYN -#OUT_OBJ = -Fo -#LIBS=/NOD:LLIBCE LLIBCEP -#OBJ_EXT = obj -# -#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \ -# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \ -# misc.obj set.obj pred.obj egamn.obj -# link @<< -#$** /NOI -#$@ /STACK:14336 -# -#$(LIBS: = +^ -#) -#$(DEF_FILE) $(LFLAGS) ; -#<< -# bind $@ c:\os2\doscalls.lib -# copy *.exe ..\bin -# - -# -# Borland C++ for DOS -# -#CC=bcc -#ANTLR=..\bin\antlr -#DLG=..\bin\dlg -#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -ml -ff- -w- -DPC -DUSER_ZZSYN -#OUT_OBJ = -o -#LIBS= emu mathl cl -#OBJ_EXT = obj -# -#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \ -# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \ -# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj -# tlink @&&| -#C0L $** -#$@ /Tde /c -# -#$(LIBS) -#$(DEF_FILE) $(LFLAGS) ; -#| -# copy *.exe ..\bin -# - -# -# C-Set/2 for OS/2 -# -#CC=icc -#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) /Sa /W3 -DUSER_ZZSYN -D__STDC__ -#OUT_OBJ = -Fo -#LIBS= -#ANTLR=..\bin\antlr -#DLG=..\bin\dlg -#OBJ_EXT = obj -# -#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \ -# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \ -# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj -# link386 @<< -#$** /NOI -#$@ /STACK:32768 -# -#$(LIBS: = +^ -#) -#$(DEF_FILE) $(LFLAGS) ; -#<< -# copy *.exe ..\bin -# - -# -# Borland C++ for OS/2 -# -#CC=bcc -#CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -w- -v -DUSER_ZZSYN -#OUT_OBJ = -o -#LIBS= c2 os2 -# -#ANTLR=..\bin\antlr -#DLG=..\bin\dlg -#OBJ_EXT = obj -#antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj \ -# fset.obj gen.obj globals.obj hash.obj lex.obj main.obj \ -# misc.obj set.obj pred.obj egman.obj mrhoist.obj fcache.obj -# tlink @&&| -#c02 $** -c -v -#antlr.exe -# -#C2 os2 -# -#| -# copy *.exe ..\bin -# - -# *********** Target list of PC machines *********** -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# -#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g -# $(ANTLR) antlr.g -# -#antlr.$(OBJ_EXT): antlr.c mode.h tokens.h -# -#scan.$(OBJ_EXT): scan.c mode.h tokens.h -# -#scan.c mode.h: parser.dlg -# $(DLG) -C2 parser.dlg scan.c -# -#set.$(OBJ_EXT): $(SET)/set.c -# $(CC) $(CFLAGS) -c $(OUT_OBJ)set.$(OBJ_EXT) $(SET)/set.c - - - -# -# UNIX (default) -# -CC=cc -COPT=-O -ANTLR=../bin/antlr -DLG=../bin/dlg -OBJ_EXT=o -OUT_OBJ = -o -CFLAGS= $(COPT) -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) -DZZLEXBUFSIZE=32000 -# -# SGI Users, use this CFLAGS -# -#CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262 -OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \ - globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o - -antlr : $(OBJ) $(SRC) - $(CC) $(CFLAGS) -o antlr $(OBJ) - mv antlr ../bin/. - -# what files does PCCTS generate (both ANTLR and DLG) -PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h - -SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \ - hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c - -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# -#antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g -# $(ANTLR) -gh antlr.g - -antlr.o : antlr.c mode.h tokens.h - -scan.o : scan.c mode.h tokens.h - -#scan.c mode.h: parser.dlg -# $(DLG) -C2 parser.dlg scan.c - -set.o : $(SET)/set.c - $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c - - -# -# ****** These next targets are common to UNIX and PC world ******** -# - -#clean up all the intermediate files -clean: - rm -f *.$(OBJ_EXT) core - -#remove everything in clean plus the PCCTS files generated -scrub: - rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile.VMS b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile.VMS deleted file mode 100644 index bd4e9f26c..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile.VMS +++ /dev/null @@ -1,45 +0,0 @@ -$! File: MAKE.COM - Makefile for ANTLR 1.33 on OpenVMS, DECC -$! -$! History: -$! --------- -$! 20-Mar-1992 Fred Scholldorf Hacked together for VAX/VMS. -$! 24-Mar-1992 Fred Scholldorf LINK against VAXCRTL sharable library. -$! 24-Aug-1993 Fred Scholldorf Upgrade for ANTLR V1.10. -$! 27-Jan-1998 J.F. Pieronne Upgrade for ANTLR V1.33, DECC -$! -$ set noon !Don't stop on errors. -$! -$ if P1 .eqs. "LINK" then goto relink -$! -$ define/nolog pccts_h "[-.h]" -$ define/nolog support_set "[-.support.set]" -$! -$ delete/nolog *.obj;* !Get rid of existing .OBJ files. -$! -$ options = "/INCLUDE=(pccts_h,support_set)/define=(USER_ZZSYN)" -$ CC 'options' antlr -$ CC 'options' scan -$ CC 'options' err -$ CC 'options' bits -$ CC 'options' build -$ CC 'options' fset2 -$ CC 'options' fset -$ CC 'options' gen -$ CC 'options' globals -$ CC 'options' hash -$ CC 'options' lex -$ CC 'options' main -$ CC 'options' misc -$ CC 'options' pred -$ CC 'options' egman -$ CC 'options' mrhoist -$ CC 'options' fcache -$ CC 'options' [-.support.set]set -$! -$relink: -$ LINK antlr,scan,err,bits,build, - - fset2,fset,gen,globals,hash, - - lex,main,misc,pred,egman,mrhoist,fcache,set, - - sys$input:/options -! sys$share:vaxcrtl.exe/share -$ EXIT diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile1 b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile1 deleted file mode 100644 index 6af285a1d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/makefile1 +++ /dev/null @@ -1,96 +0,0 @@ -# -# Makefile for ANTLR 1.33 -# -# SOFTWARE RIGHTS -# -# We reserve no LEGAL rights to the Purdue Compiler Construction Tool -# Set (PCCTS) -- PCCTS is in the public domain. An individual or -# company may do whatever they wish with source code distributed with -# PCCTS or the code generated by PCCTS, including the incorporation of -# PCCTS, or its output, into commerical software. -# -# We encourage users to develop software with PCCTS. However, we do ask -# that credit is given to us for developing PCCTS. By "credit", -# we mean that if you incorporate our source code into one of your -# programs (commercial product, research project, or otherwise) that you -# acknowledge this fact somewhere in the documentation, research report, -# etc... If you like PCCTS and have developed a nice tool with the -# output, please mention that you developed it using PCCTS. In -# addition, we ask that this header remain intact in our source code. -# As long as these guidelines are kept, we expect to continue enhancing -# this system and expect to make other tools available as they are -# completed. -# -# ANTLR 1.33 -# Terence Parr -# Parr Research Corporation -# with Purdue University -# and AHPCRC, University of Minnesota -# 1989-1995 -# -# Ported to Borland C++, IBM C-Set/2 and Microsoft 6.0 by -# Ed Harfmann -# Micro Data Base Systems -# Lafayette, Indiana -# -SET=../support/set -PCCTS_H=../h - -# -# UNIX (default) -# -CC=cc -ANTLR=../bin/antlr -DLG=../bin/dlg -OBJ_EXT=o -OUT_OBJ = -o -ANSI=-ansi -AOTHER= -CFLAGS= -O0 -g -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN $(COTHER) $(ANSI) -DZZLEXBUFSIZE=32000 -# -# SGI Users, use this CFLAGS -# -#CFLAGS= -O -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -woff 3262 - -OBJ=antlr.o scan.o err.o bits.o build.o fset2.o fset.o gen.o \ - globals.o hash.o lex.o main.o misc.o set.o pred.o egman.o mrhoist.o fcache.o $(OBJOTHER) - -antlr : $(OBJ) $(SRC) - $(CC) $(CFLAGS) -o antlr $(OBJ) - mv antlr ../bin - -# what files does PCCTS generate (both ANTLR and DLG) -PCCTS_GEN=antlr.c scan.c err.c tokens.h mode.h parser.dlg stdpccts.h remap.h - -SRC=antlr.c scan.c err.c bits.c build.c fset2.c fset.c gen.c globals.c \ - hash.c lex.c main.c misc.c $(SET)/set.c pred.c egman.c mrhoist.c fcache.c - -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# -antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g - $(ANTLR) -gh antlr.g $(AOTHER) - -antlr.o : antlr.c mode.h tokens.h - -scan.o : scan.c mode.h tokens.h - -scan.c mode.h: parser.dlg - $(DLG) -C2 parser.dlg scan.c - -set.o : $(SET)/set.c - $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c - - -# -# ****** These next targets are common to UNIX and PC world ******** -# - -#clean up all the intermediate files -clean: - rm -f *.$(OBJ_EXT) core - -#remove everything in clean plus the PCCTS files generated -scrub: - rm -f $(PCCTS_GEN) *.$(OBJ_EXT) core diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/misc.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/misc.c deleted file mode 100644 index 9cad6c0d2..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/misc.c +++ /dev/null @@ -1,1864 +0,0 @@ -/* - * misc.c - * - * Manage tokens, regular expressions. - * Print methods for debugging - * Compute follow lists onto tail ends of rules. - * - * The following functions are visible: - * - * int addTname(char *); Add token name - * int addTexpr(char *); Add token expression - * int Tnum(char *); Get number of expr/token - * void Tklink(char *, char *); Link a name with an expression - * int hasAction(expr); Does expr already have action assigned? - * void setHasAction(expr); Indicate that expr now has an action - * Entry *newEntry(char *,int); Create new table entry with certain size - * void list_add(ListNode **list, char *e) - * void list_free(ListNode **list, int freeData); *** MR10 *** - * void list_apply(ListNode *list, void (*f)()) - * void lexclass(char *m); switch to new/old lexical class - * void lexmode(int i); switch to old lexical class i - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "pcctscfg.h" -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" -#include - -static int tsize=TSChunk; /* size of token str arrays */ - -static void -#ifdef __USE_PROTOS -RemapForcedTokensInSyntaxDiagram(Node *); -#else -RemapForcedTokensInSyntaxDiagram(); -#endif - - /* T o k e n M a n i p u l a t i o n */ - -/* - * add token 't' to the TokenStr/Expr array. Make more room if necessary. - * 't' is either an expression or a token name. - * - * There is only one TokenStr array, but multiple ExprStr's. Therefore, - * for each lex class (element of lclass) we must extend the ExprStr array. - * ExprStr's and TokenStr are always all the same size. - * - * Also, there is a Texpr hash table for each automaton. - */ -static void -#ifdef __USE_PROTOS -Ttrack( char *t ) -#else -Ttrack( t ) -char *t; -#endif -{ - if ( TokenNum >= tsize ) /* terminal table overflow? */ - { - char **p; - int i, more, j; - - more = TSChunk * (1 + ((TokenNum-tsize) / TSChunk)); - tsize += more; - TokenStr = (char **) realloc((char *)TokenStr, tsize*sizeof(char *)); - require(TokenStr != NULL, "Ttrack: can't extend TokenStr"); - for (i=0; iexpr = e; - p->lclass = CurrentLexClass; - return p; -} - -/* switch to lexical class/mode m. This amounts to creating a new - * lex mode if one does not already exist and making ExprStr point - * to the correct char string array. We must also switch Texpr tables. - * - * BTW, we need multiple ExprStr arrays because more than one automaton - * may have the same label for a token, but with different expressions. - * We need to track an expr for each automaton. If we disallowed this - * feature, only one ExprStr would be required. - */ -void -#ifdef __USE_PROTOS -lexclass( char *m ) -#else -lexclass( m ) -char *m; -#endif -{ - int i; - TermEntry *p; - static char EOFSTR[] = "\"@\""; - - if ( hash_get(Tname, m) != NULL ) - { - warn(eMsg1("lexclass name conflicts with token/errclass label '%s'",m)); - } - /* does m already exist? */ - i = LexClassIndex(m); - if ( i != -1 ) {lexmode(i); return;} - /* must make new one */ - NumLexClasses++; - CurrentLexClass = NumLexClasses-1; - require(NumLexClasses<=MaxLexClasses, "number of allowable lexclasses exceeded\nIncrease MaxLexClasses in generic.h and recompile all C files"); - lclass[CurrentLexClass].classnum = m; - lclass[CurrentLexClass].exprs = (char **) calloc(tsize, sizeof(char *)); - require(lclass[CurrentLexClass].exprs!=NULL, - "lexclass: cannot allocate ExprStr"); - lclass[CurrentLexClass].htable = newHashTable(); - ExprStr = lclass[CurrentLexClass].exprs; - Texpr = lclass[CurrentLexClass].htable; - /* define EOF for each automaton */ - p = newTermEntry( EOFSTR ); - p->token = EofToken; /* couldn't have remapped tokens yet, use EofToken */ - hash_add(Texpr, EOFSTR, (Entry *)p); - list_add(&ExprOrder, (void *)newExpr(EOFSTR)); - /* note: we use the actual ExprStr array - * here as TokenInd doesn't exist yet - */ - ExprStr[EofToken] = EOFSTR; -} - -void -#ifdef __USE_PROTOS -lexmode( int i ) -#else -lexmode( i ) -int i; -#endif -{ - require(iaction!=NULL); -} - -void -#ifdef __USE_PROTOS -setHasAction( char *expr, char *action ) -#else -setHasAction( expr, action ) -char *expr; -char *action; -#endif -{ - TermEntry *p; - require(expr!=NULL, "setHasAction: invalid expr"); - - p = (TermEntry *) hash_get(Texpr, expr); - require(p!=NULL, eMsg1("setHasAction: expr '%s' doesn't exist",expr)); - p->action = action; -} - -ForcedToken * -#ifdef __USE_PROTOS -newForcedToken(char *token, int tnum) -#else -newForcedToken(token, tnum) -char *token; -int tnum; -#endif -{ - ForcedToken *ft = (ForcedToken *) calloc(1, sizeof(ForcedToken)); - require(ft!=NULL, "out of memory"); - ft->token = token; - ft->tnum = tnum; - return ft; -} - -/* - * Make a token indirection array that remaps token numbers and then walk - * the appropriate symbol tables and SynDiag to change token numbers - */ -void -#ifdef __USE_PROTOS -RemapForcedTokens(void) -#else -RemapForcedTokens() -#endif -{ - ListNode *p; - ForcedToken *q; - int max_token_number=0; /* MR9 23-Sep-97 Removed "unsigned" */ - int i; - - if ( ForcedTokens == NULL ) return; - - /* find max token num */ - for (p = ForcedTokens->next; p!=NULL; p=p->next) - { - q = (ForcedToken *) p->elem; - if ( q->tnum > max_token_number ) max_token_number = q->tnum; - } - fprintf(stderr, "max token number is %d\n", max_token_number); - - /* make token indirection array */ - TokenInd = (int *) calloc(max_token_number+1, sizeof(int)); - LastTokenCounted = TokenNum; - TokenNum = max_token_number+1; - require(TokenInd!=NULL, "RemapForcedTokens: cannot allocate TokenInd"); - - /* fill token indirection array and change token id htable ; swap token indices */ - for (i=1; inext; p!=NULL; p=p->next) - { - TermEntry *te; - int old_pos, t; - - q = (ForcedToken *) p->elem; - fprintf(stderr, "%s forced to %d\n", q->token, q->tnum); - te = (TermEntry *) hash_get(Tname, q->token); - require(te!=NULL, "RemapForcedTokens: token not in hash table"); - old_pos = te->token; - fprintf(stderr, "Before: TokenInd[old_pos==%d] is %d\n", old_pos, TokenInd[old_pos]); - fprintf(stderr, "Before: TokenInd[target==%d] is %d\n", q->tnum, TokenInd[q->tnum]); - q = (ForcedToken *) p->elem; - t = TokenInd[old_pos]; - TokenInd[old_pos] = q->tnum; - TokenInd[q->tnum] = t; - te->token = q->tnum; /* update token type id symbol table */ - fprintf(stderr, "After: TokenInd[old_pos==%d] is %d\n", old_pos, TokenInd[old_pos]); - fprintf(stderr, "After: TokenInd[target==%d] is %d\n", q->tnum, TokenInd[q->tnum]); - - /* Change the token number in the sym tab entry for the exprs - * at the old position of the token id and the target position - */ - /* update expr at target (if any) of forced token id */ - if ( q->tnum < TokenNum ) /* is it a valid position? */ - { - for (i=0; itnum]!=NULL ) - { - /* update the symbol table for this expr */ - TermEntry *e = (TermEntry *) hash_get(lclass[i].htable, lclass[i].exprs[q->tnum]); - require(e!=NULL, "RemapForcedTokens: expr not in hash table"); - e->token = old_pos; - fprintf(stderr, "found expr '%s' at target %d in lclass[%d]; changed to %d\n", - lclass[i].exprs[q->tnum], q->tnum, i, old_pos); - } - } - } - /* update expr at old position (if any) of forced token id */ - for (i=0; itoken = q->tnum; - fprintf(stderr, "found expr '%s' for id %s in lclass[%d]; changed to %d\n", - lclass[i].exprs[old_pos], q->token, i, q->tnum); - } - } - } - - /* Update SynDiag */ - RemapForcedTokensInSyntaxDiagram((Node *)SynDiag); -} - -static void -#ifdef __USE_PROTOS -RemapForcedTokensInSyntaxDiagram(Node *p) -#else -RemapForcedTokensInSyntaxDiagram(p) -Node *p; -#endif -{ - Junction *j = (Junction *) p; - RuleRefNode *r = (RuleRefNode *) p; - TokNode *t = (TokNode *)p; - - if ( p==NULL ) return; - require(p->ntype>=1 && p->ntype<=NumNodeTypes, "Remap...: invalid diagram node"); - switch ( p->ntype ) - { - case nJunction : - if ( j->visited ) return; - if ( j->jtype == EndRule ) return; - j->visited = TRUE; - RemapForcedTokensInSyntaxDiagram( j->p1 ); - RemapForcedTokensInSyntaxDiagram( j->p2 ); - j->visited = FALSE; - return; - case nRuleRef : - RemapForcedTokensInSyntaxDiagram( r->next ); - return; - case nToken : - if ( t->remapped ) return; /* we've been here before */ - t->remapped = 1; - fprintf(stderr, "remapping %d to %d\n", t->token, TokenInd[t->token]); - t->token = TokenInd[t->token]; - RemapForcedTokensInSyntaxDiagram( t->next ); - return; - case nAction : - RemapForcedTokensInSyntaxDiagram( ((ActionNode *)p)->next ); - return; - default : - fatal_internal("invalid node type"); - } -} - -/* - * Add a token name. Return the token number associated with it. If it already - * exists, then return the token number assigned to it. - * - * Track the order in which tokens are found so that the DLG output maintains - * that order. It also lets us map token numbers to strings. - */ -int -#ifdef __USE_PROTOS -addTname( char *token ) -#else -addTname( token ) -char *token; -#endif -{ - TermEntry *p; - require(token!=NULL, "addTname: invalid token name"); - - if ( (p=(TermEntry *)hash_get(Tname, token)) != NULL ) return p->token; - p = newTermEntry( token ); - Ttrack( p->str ); - p->token = TokenNum++; - hash_add(Tname, token, (Entry *)p); - return p->token; -} - -/* This is the same as addTname except we force the TokenNum to be tnum. - * We don't have to use the Forced token stuff as no tokens will have - * been defined with #tokens when this is called. This is only called - * when a #tokdefs meta-op is used. - */ -int -#ifdef __USE_PROTOS -addForcedTname( char *token, int tnum ) -#else -addForcedTname( token, tnum ) -char *token; -int tnum; -#endif -{ - TermEntry *p; - require(token!=NULL, "addTname: invalid token name"); - - if ( (p=(TermEntry *)hash_get(Tname, token)) != NULL ) return p->token; - p = newTermEntry( token ); - Ttrack( p->str ); - p->token = tnum; - hash_add(Tname, token, (Entry *)p); - return p->token; -} - -/* - * Add a token expr. Return the token number associated with it. If it already - * exists, then return the token number assigned to it. - */ -int -#ifdef __USE_PROTOS -addTexpr( char *expr ) -#else -addTexpr( expr ) -char *expr; -#endif -{ - TermEntry *p; - require(expr!=NULL, "addTexpr: invalid regular expression"); - - if ( (p=(TermEntry *)hash_get(Texpr, expr)) != NULL ) return p->token; - p = newTermEntry( expr ); - Ttrack( p->str ); - /* track the order in which they occur */ - list_add(&ExprOrder, (void *)newExpr(p->str)); - p->token = TokenNum++; - hash_add(Texpr, expr, (Entry *)p); - return p->token; -} - -/* return the token number of 'term'. Return 0 if no 'term' exists */ -int -#ifdef __USE_PROTOS -Tnum( char *term ) -#else -Tnum( term ) -char *term; -#endif -{ - TermEntry *p; - require(term!=NULL, "Tnum: invalid terminal"); - - if ( *term=='"' ) p = (TermEntry *) hash_get(Texpr, term); - else p = (TermEntry *) hash_get(Tname, term); - if ( p == NULL ) return 0; - else return p->token; -} - -/* associate a Name with an expr. If both have been already assigned - * token numbers, then an error is reported. Add the token or expr - * that has not been added if no error. This 'represents' the #token - * ANTLR pseudo-op. If both have not been defined, define them both - * linked to same token number. - */ -void -#ifdef __USE_PROTOS -Tklink( char *token, char *expr ) -#else -Tklink( token, expr ) -char *token; -char *expr; -#endif -{ - TermEntry *p, *q; - require(token!=NULL && expr!=NULL, "Tklink: invalid token name and/or expr"); - - p = (TermEntry *) hash_get(Tname, token); - q = (TermEntry *) hash_get(Texpr, expr); - if ( p != NULL && q != NULL ) /* both defined */ - { - warn( eMsg2("token name %s and rexpr %s already defined; ignored", - token, expr) ); - return; - } - if ( p==NULL && q==NULL ) /* both not defined */ - { - int t = addTname( token ); - q = newTermEntry( expr ); - hash_add(Texpr, expr, (Entry *)q); - q->token = t; - /* note: we use the actual ExprStr array - * here as TokenInd doesn't exist yet - */ - ExprStr[t] = q->str; - /* track the order in which they occur */ - list_add(&ExprOrder, (void *)newExpr(q->str)); - return; - } - if ( p != NULL ) /* one is defined, one is not */ - { - q = newTermEntry( expr ); - hash_add(Texpr, expr, (Entry *)q); - q->token = p->token; - ExprStr[p->token] = q->str; /* both expr and token str defined now */ - list_add(&ExprOrder, (void *)newExpr(q->str)); - } - else /* trying to associate name with expr here*/ - { - p = newTermEntry( token ); - hash_add(Tname, token, (Entry *)p); - p->token = q->token; - TokenStr[p->token] = p->str;/* both expr and token str defined now */ - } -} - -/* - * Given a string, this function allocates and returns a pointer to a - * hash table record of size 'sz' whose "str" pointer is reset to a position - * in the string table. - */ -Entry * -#ifdef __USE_PROTOS -newEntry( char *text, int sz ) -#else -newEntry( text, sz ) -char *text; -int sz; -#endif -{ - Entry *p; - require(text!=NULL, "new: NULL terminal"); - - if ( (p = (Entry *) calloc(1,sz)) == 0 ) - { - fatal_internal("newEntry: out of memory for terminals\n"); - exit(PCCTS_EXIT_FAILURE); - } - p->str = mystrdup(text); - - return(p); -} - -/* - * add an element to a list. - * - * Any non-empty list has a sentinel node whose 'elem' pointer is really - * a pointer to the last element. (i.e. length(list) = #elemIn(list)+1). - * Elements are appended to the list. - */ -void -#ifdef __USE_PROTOS -list_add( ListNode **list, void *e ) -#else -list_add( list, e ) -ListNode **list; -void *e; -#endif -{ - ListNode *p, *tail; - require(e!=NULL, "list_add: attempting to add NULL list element"); - - p = newListNode; - require(p!=NULL, "list_add: cannot alloc new list node"); - p->elem = e; - if ( *list == NULL ) - { - ListNode *sentinel = newListNode; - require(sentinel!=NULL, "list_add: cannot alloc sentinel node"); - *list=sentinel; - sentinel->next = p; - sentinel->elem = (char *)p; /* set tail pointer */ - } - else /* find end of list */ - { - tail = (ListNode *) (*list)->elem; /* get tail pointer */ - tail->next = p; - (*list)->elem = (char *) p; /* reset tail */ - } -} - -/* MR10 list_free() frees the ListNode elements in the list */ -/* MR10 if freeData then free the data elements of the list too */ - -void -#ifdef __USE_PROTOS -list_free(ListNode **list,int freeData) -#else -list_free(list,freeData) - ListNode **list; - int freeData; -#endif -{ - ListNode *p; - ListNode *next; - - if (list == NULL) return; - if (*list == NULL) return; - for (p=*list; p != NULL; p=next) { - next=p->next; - if (freeData && p->elem != NULL) { - free( (char *) p->elem); - }; - free( (char *) p); - }; - *list=NULL; -} - -void -#ifdef __USE_PROTOS -list_apply( ListNode *list, void (*f)(void *) ) -#else -list_apply( list, f ) -ListNode *list; -void (*f)(); -#endif -{ - ListNode *p; - require(f!=NULL, "list_apply: NULL function to apply"); - - if ( list == NULL ) return; - for (p = list->next; p!=NULL; p=p->next) (*f)( p->elem ); -} - -/* MR27 */ - -#ifdef __USE_PROTOS -int list_search_cstring(ListNode *list, char * cstring) -#else -int list_search_cstring(list, cstring) - ListNode * list; - char * cstring; -#endif -{ - ListNode *p; - if (list == NULL ) return 0; - for (p = list->next; p!=NULL; p=p->next) { - if (p->elem == NULL) continue; - if (0 == strcmp((char *) p->elem , cstring)) return 1; - } - return 0; -} - - /* F O L L O W C y c l e S t u f f */ - -/* make a key based upon (rulename, computation, k value). - * Computation values are 'i'==FIRST, 'o'==FOLLOW. - */ - -/* MR10 Make the key all characters so it can be read easily */ -/* MR10 by a simple dump program. Also, separates */ -/* MR10 'o' and 'i' from rule name */ - -char * -#ifdef __USE_PROTOS -Fkey( char *rule, int computation, int k ) -#else -Fkey( rule, computation, k ) -char *rule; -int computation; -int k; -#endif -{ - static char key[MaxRuleName+2+2+1]; /* MR10 */ - int i; - - if ( k > 99 ) /* MR10 */ - fatal("k>99 is too big for this implementation of ANTLR!\n"); /* MR10 */ - if ( (i=strlen(rule)) > MaxRuleName ) /* MR10 */ - fatal( eMsgd("rule name > max of %d\n", MaxRuleName) ); /* MR10 */ - strcpy(key,rule); - -/* MR10 */ key[i]='*'; -/* MR10 */ key[i+1] = (char) computation; /* MR20 G. Hobbelt */ -/* MR10 */ if (k < 10) { -/* MR10 */ key[i+2] = (char) ( '0' + k); -/* MR10 */ key[i+3] = '\0'; -/* MR10 */ } else { -/* MR10 */ key[i+2] = (char) ( '0' + k/10); -/* MR10 */ key[i+3] = (char) ( '0' + k % 10); -/* MR10 */ key[i+4] = '\0'; -/* MR10 */ }; - - return key; -} - -/* Push a rule onto the kth FOLLOW stack */ -void -#ifdef __USE_PROTOS -FoPush( char *rule, int k ) -#else -FoPush( rule, k ) -char *rule; -int k; -#endif -{ - RuleEntry *r; - require(rule!=NULL, "FoPush: tried to push NULL rule"); - require(k<=CLL_k, "FoPush: tried to access non-existent stack"); - - /*fprintf(stderr, "FoPush(%s)\n", rule);*/ - r = (RuleEntry *) hash_get(Rname, rule); - if ( r == NULL ) {fatal_internal( eMsg1("rule %s must be defined but isn't", rule) );} - if ( FoStack[k] == NULL ) /* Does the kth stack exist yet? */ - { - /*fprintf(stderr, "allocating FoStack\n");*/ - FoStack[k] = (int *) calloc(FoStackSize, sizeof(int)); - require(FoStack[k]!=NULL, "FoPush: cannot allocate FOLLOW stack\n"); - } - if ( FoTOS[k] == NULL ) - { - FoTOS[k]=FoStack[k]; - *(FoTOS[k]) = r->rulenum; - } - else - { -#ifdef MEMCHK - require(valid(FoStack[k]), "FoPush: invalid FoStack"); -#endif - if ( FoTOS[k] >= &(FoStack[k][FoStackSize-1]) ) - fatal( eMsgd("exceeded max depth of FOLLOW recursion (%d)\n", - FoStackSize) ); - require(FoTOS[k]>=FoStack[k], - eMsg1("FoPush: FoStack stack-ptr is playing out of its sandbox", - rule)); - ++(FoTOS[k]); - *(FoTOS[k]) = r->rulenum; - } - { - /* -**** int *p; -**** fprintf(stderr, "FoStack[k=%d]:\n", k); -**** for (p=FoStack[k]; p<=FoTOS[k]; p++) -**** { -**** fprintf(stderr, "\t%s\n", RulePtr[*p]->rname); -**** } - */ - } -} - -/* Pop one rule off of the FOLLOW stack. TOS ptr is NULL if empty. */ -void -#ifdef __USE_PROTOS -FoPop( int k ) -#else -FoPop( k ) -int k; -#endif -{ - require(k<=CLL_k, "FoPop: tried to access non-existent stack"); - /*fprintf(stderr, "FoPop\n");*/ - require(FoTOS[k]>=FoStack[k]&&FoTOS[k]<=&(FoStack[k][FoStackSize-1]), - "FoPop: FoStack stack-ptr is playing out of its sandbox"); - if ( FoTOS[k] == FoStack[k] ) FoTOS[k] = NULL; - else (FoTOS[k])--; -} - -/* Compute FOLLOW cycle. - * Mark all FOLLOW sets for rules in cycle as incomplete. - * Then, save cycle on the cycle list (Cycles) for later resolution. - * The Cycle is stored in the form: - * (head of cycle==croot, rest of rules in cycle==cyclicDep) - * - * e.g. (Fo means "FOLLOW of", "-->" means requires or depends on) - * - * Fo(x)-->Fo(a)-->Fo(b)-->Fo(c)-->Fo(x) - * ^----Infinite recursion (cycle) - * - * the cycle would be: x -> {a,b,c} or stored as (x,{a,b,c}). Fo(x) depends - * on the FOLLOW of a,b, and c. The root of a cycle is always complete after - * Fo(x) finishes. Fo(a,b,c) however are not. It turns out that all rules - * in a FOLLOW cycle have the same FOLLOW set. - */ -void -#ifdef __USE_PROTOS -RegisterCycle( char *rule, int k ) -#else -RegisterCycle( rule, k ) -char *rule; -int k; -#endif -{ - CacheEntry *f; - Cycle *c; - int *p; - RuleEntry *r; - require(rule!=NULL, "RegisterCycle: tried to register NULL rule"); - require(k<=CLL_k, "RegisterCycle: tried to access non-existent stack"); - - /*fprintf(stderr, "RegisterCycle(%s)\n", rule);*/ - /* Find cycle start */ - r = (RuleEntry *) hash_get(Rname, rule); - require(r!=NULL,eMsg1("rule %s must be defined but isn't", rule)); - require(FoTOS[k]>=FoStack[k]&&FoTOS[k]<=&(FoStack[k][FoStackSize-1]), - eMsg1("RegisterCycle(%s): FoStack stack-ptr is playing out of its sandbox", - rule)); -/*** if ( FoTOS[k]&(FoStack[k][FoStackSize-1]) ) -**** { -**** fprintf(stderr, "RegisterCycle(%s): FoStack stack-ptr is playing out of its sandbox\n", -**** rule); -**** fprintf(stderr, "RegisterCycle: sp==0x%x out of bounds 0x%x...0x%x\n", -**** FoTOS[k], FoStack[k], &(FoStack[k][FoStackSize-1])); -**** exit(PCCTS_EXIT_FAILURE); -**** } -****/ - -#ifdef MEMCHK - require(valid(FoStack[k]), "RegisterCycle: invalid FoStack"); -#endif - for (p=FoTOS[k]; *p != r->rulenum && p >= FoStack[k]; --p) {;} - require(p>=FoStack[k], "RegisterCycle: FoStack is screwed up beyond belief"); - if ( p == FoTOS[k] ) return; /* don't worry about cycles to oneself */ - - /* compute cyclic dependents (rules in cycle except head) */ - c = newCycle; - require(c!=NULL, "RegisterCycle: couldn't alloc new cycle"); - c->cyclicDep = empty; - c->croot = *p++; /* record root of cycle */ - for (; p<=FoTOS[k]; p++) - { - /* Mark all dependent rules as incomplete */ - f = (CacheEntry *) hash_get(Fcache, Fkey(RulePtr[*p]->rname,'o',k)); - if ( f==NULL ) - { - f = newCacheEntry( Fkey(RulePtr[*p]->rname,'o',k) ); - hash_add(Fcache, Fkey(RulePtr[*p]->rname,'o',k), (Entry *)f); - } - f->incomplete = TRUE; - - set_orel(*p, &(c->cyclicDep)); /* mark rule as dependent of croot */ - } - list_add(&(Cycles[k]), (void *)c); -} - -/* make all rules in cycle complete - * - * while ( some set has changed ) do - * for each cycle do - * if degree of FOLLOW set for croot > old degree then - * update all FOLLOW sets for rules in cyclic dependency - * change = TRUE - * endif - * endfor - * endwhile - */ -void -#ifdef __USE_PROTOS -ResolveFoCycles( int k ) -#else -ResolveFoCycles( k ) -int k; -#endif -{ - ListNode *p, *q; - Cycle *c; - int changed = 1; - CacheEntry *f,*g; - int r; -/* int i; */ /* MR10 not useful */ - unsigned d; - - unsigned *cursor; /* MR10 */ - unsigned *origin; /* MR10 */ - - /*fprintf(stderr, "Resolving following cycles for %d\n", k);*/ - while ( changed ) - { - changed = 0; -/* MR10 i = 0; */ - for (p = Cycles[k]->next; p!=NULL; p=p->next) - { - c = (Cycle *) p->elem; - /*fprintf(stderr, "cycle %d: %s -->", i++, RulePtr[c->croot]->rname);*/ - /*s_fprT(stderr, c->cyclicDep);*/ - /*fprintf(stderr, "\n");*/ - f = (CacheEntry *) - hash_get(Fcache, Fkey(RulePtr[c->croot]->rname,'o',k)); - require(f!=NULL, eMsg1("FOLLOW(%s) must be in cache but isn't", RulePtr[c->croot]->rname) ); - if ( (d=set_deg(f->fset)) > c->deg ) - { - /*fprintf(stderr, "Fo(%s) has changed\n", RulePtr[c->croot]->rname);*/ - changed = 1; - c->deg = d; /* update cycle FOLLOW set degree */ - -/* MR10 */ origin=set_pdq(c->cyclicDep); -/* MR10 */ for (cursor=origin; *cursor != nil; cursor++) { -/* MR10 */ r=*cursor; - -/******** while ( !set_nil(c->cyclicDep) ) { *****/ -/******** r = set_int(c->cyclicDep); *****/ -/******** set_rm(r, c->cyclicDep); *****/ - - /*fprintf(stderr, "updating Fo(%s)\n", RulePtr[r]->rname);*/ - g = (CacheEntry *) - hash_get(Fcache, Fkey(RulePtr[r]->rname,'o',k)); - require(g!=NULL, eMsg1("FOLLOW(%s) must be in cache but isn't", RulePtr[r]->rname) ); - set_orin(&(g->fset), f->fset); - g->incomplete = FALSE; - } -/* MR10 */ free( (char *) origin); -/* MR10 */ origin=NULL; - } - } -/* MR10 - this if statement appears to be meaningless since i is always 0 */ -/* MR10 if ( i == 1 ) changed = 0; */ /* if only 1 cycle, no need to repeat */ - } - /* kill Cycle list */ - for (q = Cycles[k]->next; q != NULL; q=p) - { - p = q->next; - set_free( ((Cycle *)q->elem)->cyclicDep ); - free((char *)q); - } - free( (char *)Cycles[k] ); - Cycles[k] = NULL; -} - - - /* P r i n t i n g S y n t a x D i a g r a m s */ - -static void -#ifdef __USE_PROTOS -pBlk( Junction *q, int btype ) -#else -pBlk( q, btype ) -Junction *q; -int btype; -#endif -{ - int k,a; - Junction *alt, *p; - - q->end->pvisited = TRUE; - if ( btype == aLoopBegin ) - { - require(q->p2!=NULL, "pBlk: invalid ()* block"); - PRINT(q->p1); - alt = (Junction *)q->p2; - PRINT(alt->p1); - if ( PrintAnnotate ) - { - printf(" /* Opt "); - k = 1; - while ( !set_nil(alt->fset[k]) ) - { - s_fprT(stdout, alt->fset[k]); - if ( k++ == CLL_k ) break; - if ( !set_nil(alt->fset[k]) ) printf(", "); - } - printf(" */\n"); - } - return; - } - for (a=1,alt=q; alt != NULL; alt= (Junction *) alt->p2, a++) - { - if ( alt->p1 != NULL ) PRINT(alt->p1); - if ( PrintAnnotate ) - { - printf( " /* [%d] ", alt->altnum); - k = 1; - while ( !set_nil(alt->fset[k]) ) - { - s_fprT(stdout, alt->fset[k]); - if ( k++ == CLL_k ) break; - if ( !set_nil(alt->fset[k]) ) printf(", "); - } - if ( alt->p2 == NULL && btype == aOptBlk ) - printf( " (optional branch) */\n"); - else printf( " */\n"); - } - - /* ignore implied empty alt of Plus blocks */ - if ( alt->p2 != NULL && ((Junction *)alt->p2)->ignore ) break; - - if ( alt->p2 != NULL && !(((Junction *)alt->p2)->p2==NULL && btype == aOptBlk) ) - { - if ( pLevel == 1 ) - { - printf("\n"); - if ( a+1==pAlt1 || a+1==pAlt2 ) printf("=>"); - printf("\t"); - } - else printf(" "); - printf("|"); - if ( pLevel == 1 ) - { - p = (Junction *) ((Junction *)alt->p2)->p1; - while ( p!=NULL ) - { - if ( p->ntype==nAction ) - { - p=(Junction *)((ActionNode *)p)->next; - continue; - } - if ( p->ntype!=nJunction ) - { - break; - } - if ( p->jtype==EndBlk || p->jtype==EndRule ) - { - p = NULL; - break; - } - p = (Junction *)p->p1; - } - if ( p==NULL ) printf("\n\t"); /* Empty alt? */ - } - } - } - q->end->pvisited = FALSE; -} - -/* How to print out a junction */ -void -#ifdef __USE_PROTOS -pJunc( Junction *q ) -#else -pJunc( q ) -Junction *q; -#endif -{ - int dum_k; - int doing_rule; - require(q!=NULL, "pJunc: NULL node"); - require(q->ntype==nJunction, "pJunc: not junction"); - - if ( q->pvisited == TRUE ) return; - q->pvisited = TRUE; - switch ( q->jtype ) - { - case aSubBlk : - if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k); - if ( q->end->p1 != NULL && ((Junction *)q->end->p1)->ntype==nJunction && - ((Junction *)q->end->p1)->jtype == EndRule ) doing_rule = 1; - else doing_rule = 0; - pLevel++; - if ( pLevel==1 ) - { - if ( pAlt1==1 ) printf("=>"); - printf("\t"); - } - else printf(" "); - if ( doing_rule ) - { - if ( pLevel==1 ) printf(" "); - pBlk(q,q->jtype); - } - else { - printf("("); - if ( pLevel==1 ) printf(" "); - pBlk(q,q->jtype); - if ( pLevel>1 ) printf(" "); - printf(")"); - } - if ( q->guess ) printf("?"); - pLevel--; - if ( PrintAnnotate ) freeBlkFsets(q); - if ( q->end->p1 != NULL ) PRINT(q->end->p1); - break; - case aOptBlk : - if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k); - pLevel++; - if ( pLevel==1 ) - { - if ( pAlt1==1 ) printf("=>"); - printf("\t"); - } - else printf(" "); - printf("{"); - if ( pLevel==1 ) printf(" "); - pBlk(q,q->jtype); - if ( pLevel>1 ) printf(" "); - else printf("\n\t"); - printf("}"); - pLevel--; - if ( PrintAnnotate ) freeBlkFsets(q); - if ( q->end->p1 != NULL ) PRINT(q->end->p1); - break; - case aLoopBegin : - if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k); - pLevel++; - if ( pLevel==1 ) - { - if ( pAlt1==1 ) printf("=>"); - printf("\t"); - } - else printf(" "); - printf("("); - if ( pLevel==1 ) printf(" "); - pBlk(q,q->jtype); - if ( pLevel>1 ) printf(" "); - else printf("\n\t"); - printf(")*"); - pLevel--; - if ( PrintAnnotate ) freeBlkFsets(q); - if ( q->end->p1 != NULL ) PRINT(q->end->p1); - break; - case aLoopBlk : - if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k); - pBlk(q,q->jtype); - if ( PrintAnnotate ) freeBlkFsets(q); - break; - case aPlusBlk : - if ( PrintAnnotate ) First(q, 1, q->jtype, &dum_k); - pLevel++; - if ( pLevel==1 ) - { - if ( pAlt1==1 ) printf("=>"); - printf("\t"); - } - else printf(" "); - printf("("); - if ( pLevel==1 ) printf(" "); - pBlk(q,q->jtype); - if ( pLevel>1 ) printf(" "); - printf(")+"); - pLevel--; - if ( PrintAnnotate ) freeBlkFsets(q); - if ( q->end->p1 != NULL ) PRINT(q->end->p1); - break; - case EndBlk : - break; - case RuleBlk : - printf( "\n%s :\n", q->rname); - PRINT(q->p1); - if ( q->p2 != NULL ) PRINT(q->p2); - break; - case Generic : - if ( q->p1 != NULL ) PRINT(q->p1); - q->pvisited = FALSE; - if ( q->p2 != NULL ) PRINT(q->p2); - break; - case EndRule : - printf( "\n\t;\n"); - break; - } - q->pvisited = FALSE; -} - -/* How to print out a rule reference node */ -void -#ifdef __USE_PROTOS -pRuleRef( RuleRefNode *p ) -#else -pRuleRef( p ) -RuleRefNode *p; -#endif -{ - require(p!=NULL, "pRuleRef: NULL node"); - require(p->ntype==nRuleRef, "pRuleRef: not rule ref node"); - - printf( " %s", p->text); - PRINT(p->next); -} - -/* How to print out a terminal node */ -void -#ifdef __USE_PROTOS -pToken( TokNode *p ) -#else -pToken( p ) -TokNode *p; -#endif -{ - require(p!=NULL, "pToken: NULL node"); - require(p->ntype==nToken, "pToken: not token node"); - - if ( p->wild_card ) printf(" ."); - printf( " %s", TerminalString(p->token)); - PRINT(p->next); -} - -/* How to print out a terminal node */ -void -#ifdef __USE_PROTOS -pAction( ActionNode *p ) -#else -pAction( p ) -ActionNode *p; -#endif -{ - require(p!=NULL, "pAction: NULL node"); - require(p->ntype==nAction, "pAction: not action node"); - - PRINT(p->next); -} - - /* F i l l F o l l o w L i s t s */ - -/* - * Search all rules for all rule reference nodes, q to rule, r. - * Add q->next to follow list dangling off of rule r. - * i.e. - * - * r: -o-R-o-->o--> Ptr to node following rule r in another rule - * | - * o--> Ptr to node following another reference to r. - * - * This is the data structure employed to avoid FOLLOW set computation. We - * simply compute the FIRST (reach) of the EndRule Node which follows the - * list found at the end of all rules which are referenced elsewhere. Rules - * not invoked by other rules have no follow list (r->end->p1==NULL). - * Generally, only start symbols are not invoked by another rule. - * - * Note that this mechanism also gives a free cross-reference mechanism. - * - * The entire syntax diagram is layed out like this: - * - * SynDiag - * | - * v - * o-->R1--o - * | - * o-->R2--o - * | - * ... - * | - * o-->Rn--o - * - */ -void -#ifdef __USE_PROTOS -FoLink( Node *p ) -#else -FoLink( p ) -Node *p; -#endif -{ - RuleEntry *q; - Junction *j = (Junction *) p; - RuleRefNode *r = (RuleRefNode *) p; - - if ( p==NULL ) return; - require(p->ntype>=1 && p->ntype<=NumNodeTypes, - eMsgd("FoLink: invalid diagram node: ntype==%d",p->ntype)); - switch ( p->ntype ) - { - case nJunction : - if ( j->fvisited ) return; - if ( j->jtype == EndRule ) return; - j->fvisited = TRUE; - FoLink( j->p1 ); - FoLink( j->p2 ); -/* MR14 */ -/* MR14 */ /* Need to determine whether the guess block is an */ -/* MR14 */ /* of the form (alpha)? beta before follow sets are */ -/* MR14 */ /* computed. This is necessary to solve problem */ -/* MR14 */ /* of doing follow on the alpha of an (alpha)? beta block. */ -/* MR14 */ -/* MR14 */ /* This is performed by analysis_point as a side-effect. */ -/* MR14 */ -/* MR14 */ -/* MR14 */ if (j->jtype == aSubBlk && j->guess) { -/* MR14 */ Junction *ignore; -/* MR14 */ ignore=analysis_point(j); -/* MR14 */ } -/* MR14 */ - return; - case nRuleRef : - if ( r->linked ) return; - q = (RuleEntry *) hash_get(Rname, r->text); - if ( q == NULL ) - { - warnFL( eMsg1("rule %s not defined",r->text), FileStr[r->file], r->line ); - } - else - { - if ( r->parms!=NULL && RulePtr[q->rulenum]->pdecl==NULL ) - { - warnFL( eMsg1("rule %s accepts no parameter(s)", r->text), - FileStr[r->file], r->line ); - } - if ( r->parms==NULL && RulePtr[q->rulenum]->pdecl!=NULL ) - { - warnFL( eMsg1("rule %s requires parameter(s)", r->text), - FileStr[r->file], r->line ); - } - if ( r->assign!=NULL && RulePtr[q->rulenum]->ret==NULL ) - { - warnFL( eMsg1("rule %s yields no return value(s)", r->text), - FileStr[r->file], r->line ); - } - if ( r->assign==NULL && RulePtr[q->rulenum]->ret!=NULL ) - { - warnFL( eMsg1("rule %s returns a value(s)", r->text), - FileStr[r->file], r->line ); - } - if ( !r->linked ) - { - addFoLink( r->next, r->rname, RulePtr[q->rulenum] ); - r->linked = TRUE; - } - } - FoLink( r->next ); - return; - case nToken : - FoLink( ((TokNode *)p)->next ); - return; - case nAction : - FoLink( ((ActionNode *)p)->next ); - return; - default : - fatal_internal("invalid node type"); - } -} - -/* - * Add a reference to the end of a rule. - * - * 'r' points to the RuleBlk node in a rule. r->end points to the last node - * (EndRule jtype) in a rule. - * - * Initial: - * r->end --> o - * - * After: - * r->end --> o-->o--> Ptr to node following rule r in another rule - * | - * o--> Ptr to node following another reference to r. - * - * Note that the links are added to the head of the list so that r->end->p1 - * always points to the most recently added follow-link. At the end, it should - * point to the last reference found in the grammar (starting from the 1st rule). - */ -void -#ifdef __USE_PROTOS -addFoLink( Node *p, char *rname, Junction *r ) -#else -addFoLink( p, rname, r ) -Node *p; -char *rname; -Junction *r; -#endif -{ - Junction *j; - require(r!=NULL, "addFoLink: incorrect rule graph"); - require(r->end!=NULL, "addFoLink: incorrect rule graph"); - require(r->end->jtype==EndRule, "addFoLink: incorrect rule graph"); - require(p!=NULL, "addFoLink: NULL FOLLOW link"); - - j = newJunction(); - j->rname = rname; /* rname on follow links point to target rule */ - j->p1 = p; /* link to other rule */ - j->p2 = (Node *) r->end->p1;/* point to head of list */ - r->end->p1 = (Node *) j; /* reset head to point to new node */ -} - -void -#ifdef __USE_PROTOS -GenCrossRef( Junction *p ) -#else -GenCrossRef( p ) -Junction *p; -#endif -{ - set a; - Junction *j; - RuleEntry *q; - unsigned e; - require(p!=NULL, "GenCrossRef: why are you passing me a null grammar?"); - - printf("Cross Reference:\n\n"); - a = empty; - for (; p!=NULL; p = (Junction *)p->p2) - { - printf("Rule %20s referenced by {", p->rname); - /* make a set of rules for uniqueness */ - for (j = (Junction *)(p->end)->p1; j!=NULL; j = (Junction *)j->p2) - { - q = (RuleEntry *) hash_get(Rname, j->rname); - require(q!=NULL, "GenCrossRef: FoLinks are screwed up"); - set_orel(q->rulenum, &a); - } - for (; !set_nil(a); set_rm(e, a)) - { - e = set_int(a); - printf(" %s", RulePtr[e]->rname); - } - printf(" }\n"); - } - set_free( a ); -} - -/* - The single argument is a pointer to the start of an element of a - C++ style function prototypet list. Given a pointer to the start of - an formal we must locate the comma (or the end of the string) - and locate the datatype, formal name, and initial value expression. - - The function returns a pointer to the character following the comma - which terminates the formal declaration, or a pointer to the end of - the string if none was found. - - I thought we were parsing specialists, how come I'm doing this by - hand written code ? - - Examples of input: - - Foo f, - Foo f = Foo(1), - Foo f = Foo(1,2), - Foo f = &farray[1,2], - Foo f = ",", - Foo f = ',', - TFoo f = TFoo(1,2), - - A non-zero value for nesting indicates a problem matching '(' and ')', - '[' and ']', '<' and '>', '{' and '}', or improperly terminated string - or character literal. - -*/ - - -/* - * Don't care if it is a valid string literal or not, just find the end - * Start with pointer to leading "\"" - */ - -#ifdef __USE_PROTOS -char * skipStringLiteral(char *pCurrent) -#else -char * skipStringLiteral(pCurrent) -char *pCurrent; -#endif -{ - char *p = pCurrent; - if (*p == 0) return p; - require (*p == '\"', "skipStringLiteral") - p++; - for (p = p; *p != 0; p++) { - if (*p == '\\') { - p++; - if (*p == 0) break; - p++; - } - if (*p == '\"') { - p++; - break; - } - } - return p; -} - -/* - * Don't care if it is a valid character literal or not, just find the end - * Start with pointer to leading "'" - */ - -#ifdef __USE_PROTOS -char * skipCharLiteral(char *pStart) -#else -char * skipCharLiteral(pStart) - char *pStart; -#endif -{ - char *p = pStart; - if (*p == 0) return p; - require (*p == '\'', "skipCharLiteral") - p++; - for (p = p; *p != 0; p++) { - if (*p == '\\') { - p++; - if (*p == 0) break; - p++; - } - if (*p == '\'') { - p++; - break; - } - } - return p; -} - -#ifdef __USE_PROTOS -char * skipSpaces(char *pStart) -#else -char * skipSpaces(pStart) -char * pStart; -#endif -{ - char *p = pStart; - while (*p != 0 && isspace(*p)) p++; - return p; -} - -#ifdef __USE_PROTOS -char * skipToSeparatorOrEqualSign(char *pStart, int *pNest) -#else -char * skipToSeparatorOrEqualSign(pStart, pNest) -char *pStart; -int *pNest; -#endif -{ - char *p = pStart; - - int nest = 0; - - *pNest = (-1); - - while (*p != 0) { - switch (*p) { - - case '(' : - case '[' : - case '<' : - case '{' : - nest++; - p++; - break; - - case ')' : - case ']' : - case '>' : - case '}' : - nest--; - p++; - break; - - case '"' : - p = skipStringLiteral(p); - break; - - case '\'' : - p = skipCharLiteral(p); - break; - - case '\\': - p++; - if (*p == 0) goto EXIT; - p++; - break; - - case ',': - case '=': - if (nest == 0) goto EXIT; - p++; - break; - - default: - p++; - } - } -EXIT: - *pNest = nest; - return p; -} - -#ifdef __USE_PROTOS -char * skipToSeparator(char *pStart, int *pNest) -#else -char * skipToSeparator(pStart, pNest) -char *pStart; -int *pNest; -#endif -{ - char * p = pStart; - for ( ; ; ) { - p = skipToSeparatorOrEqualSign(p, pNest); - if (*pNest != 0) return p; - if (*p == ',') return p; - if (*p == 0) return p; - p++; - } -} - -/* skip to just past the "=" separating the declaration from the initialization value */ - -#ifdef __USE_PROTOS -char * getInitializer(char *pStart) -#else -char * getInitializer(pStart) -char * pStart; -#endif -{ - char *p; - char *pDataType; - char *pSymbol; - char *pEqualSign; - char *pValue; - char *pSeparator; - int nest = 0; - - require(pStart!=NULL, "getInitializer: invalid string"); - - p = endFormal(pStart, - &pDataType, - &pSymbol, - &pEqualSign, - &pValue, - &pSeparator, - &nest); - if (nest != 0) return NULL; - if (pEqualSign == NULL) return NULL; - if (pValue == NULL) return NULL; - return strBetween(pValue, NULL, pSeparator); -} - -/* - Examines the string from pStart to pEnd-1. - If the string has 0 length or is entirely white space - returns 1. Otherwise 0. -*/ - -#ifdef __USE_PROTOS -int isWhiteString(const char *pStart, const char *pEnd) -#else -int isWhiteString(pStart, pEnd) -const char *pStart; -const char *pEnd; -#endif -{ - const char *p; - for (p = pStart; p < pEnd; p++) { - if (! isspace(*p)) return 0; - } - return 1; -} - -/* - This replaces HasComma() which couldn't distinguish - - foo ["a,b"] - - from: - - foo[a,b] - -*/ - -#ifdef __USE_PROTOS -int hasMultipleOperands(char *pStart) -#else -int hasMultipleOperands(pStart) -char *pStart; -#endif -{ - char *p = pStart; - int nest = 0; - - p = skipSpaces(p); - if (*p == 0) return 0; - p = skipToSeparator(p, &nest); - if (nest == 0 && *p == ',') return 1; - return 0; -} - - -#define MAX_STR_BETWEEN_WORK_AREA 1000 - -static char strBetweenWorkArea[MAX_STR_BETWEEN_WORK_AREA]; - - -/* - strBetween(pStart, pNext, pStop) - - Creates a null terminated string by copying the text between two pointers - to a work area. The start of the string is pStart. The end of the string - is the character before pNext, or if pNext is null then the character before - pStop. Trailing spaces are not included in the copy operation. - - This is used when a string contains several parts. The pNext part may be - optional. The pStop will stop the scan when the optional part is not present - (is a null pointer). -*/ - -#ifdef __USE_PROTOS -char *strBetween(char *pStart, char *pNext, char *pStop) -#else -char *strBetween(pStart, pNext, pStop) -char *pStart; -char *pNext; -char *pStop; -#endif -{ - char *p; - char *q = strBetweenWorkArea; - const char *pEnd; - - pEnd = (pNext != NULL) ? pNext : pStop; - - require (pEnd != NULL, "pEnd == NULL"); - require (pEnd >= pStart, "pEnd < pStart"); - for (pEnd--; pEnd >= pStart; pEnd--) { /* MR31 */ - if (! isspace(*pEnd)) break; - } - for (p = pStart; - p <= pEnd && q < &strBetweenWorkArea[MAX_STR_BETWEEN_WORK_AREA-2]; - p++, q++) { - *q = *p; - } - *q = 0; - return strBetweenWorkArea; -} - -/* - function Returns pointer to character following separator at - value which to continue search for next formal. If at the - end of the string a pointer to the null byte at the - end of the string is returned. - - pStart Pointer to the starting position of the formal list - - This may be the middle of a longer string, for example - when looking for the end of formal #3 starting from - the middle of the complete formal list. - - ppDataType Returns a pointer to the start of the data type in the - formal. Example: pointer to "Foo". - - ppSymbol Returns a pointer to the start of the formal symbol. - Example: pointer to "f". - - ppEqualSign Returns a pointer to the equal sign separating the - formal symbol from the initial value. If there is - no "=" then this will be NULL. - - ppValue Returns a pointer to the initial value part of the - formal declaration. Example: pointer to "&farray[1,2]" - - ppSeparator Returns a pointer to the character which terminated the - scan. This should be a pointer to a comma or a null - byte which terminates the string. - - pNest Returns the nesting level when a separator was found. - This is non-zero for any kind of error. This is zero - for a successful parse of this portion of the formal - list. - -*/ - -#ifdef __USE_PROTOS -char * endFormal(char *pStart, - char **ppDataType, - char **ppSymbol, - char **ppEqualSign, - char **ppValue, - char **ppSeparator, - int *pNest) -#else -char * endFormal(pStart, - ppDataType, - ppSymbol, - ppEqualSign, - ppValue, - ppSeparator, - pNest) -char *pStart; -char **ppDataType; -char **ppSymbol; -char **ppEqualSign; -char **ppValue; -char **ppSeparator; -int *pNest; - -#endif -{ - char *p = pStart; - char *q; - - *ppDataType = NULL; - *ppSymbol = NULL; - *ppEqualSign = NULL; - *ppValue = NULL; - *ppSeparator = NULL; - - *pNest = 0; - - /* The first non-blank is the start of the datatype */ - - p = skipSpaces(p); - if (*p == 0) goto EXIT; - *ppDataType = p; - - /* We are not looking for the symbol, we are looking - for the separator that follows the symbol. Then - we'll back up. - - Search for the ',' or '=" or null terminator. - */ - - p = skipToSeparatorOrEqualSign(p, pNest); - - if (*pNest != 0) goto EXIT; - - /* - Work backwards to find start of symbol - Skip spaces between the end of symbol and separator - Assume that there are no spaces in the formal, but - there is a space preceding the formal - */ - - for (q = &p[-1]; q >= *ppDataType; q--) { - if (! isspace(*q)) break; - } - if (q < *ppDataType) goto EXIT; - - /* - MR26 Handle things like: IIR_Bool (IIR_Decl::*constraint)() - Backup until we hit the end of a symbol string, then find the - start of the symbol string. This wont' work for functions - with prototypes, but works for the most common cases. For - others, use typedef names. - */ - -/* MR26 */ for (q = q; q >= *ppDataType; q--) { -/* MR26 */ if (isalpha(*q) || isdigit(*q) || *q == '_' || *q == '$') break; -/* MR26 */ } -/* MR26 */ if (q < *ppDataType) goto EXIT; - - for (q = q; q >= *ppDataType; q--) { - if ( ! (isalpha(*q) || isdigit(*q) || *q == '_' || *q == '$')) break; - } - - *ppSymbol = &q[1]; - - if (*p == ',' || *p == 0) { - *ppSeparator = p; - goto EXIT; - } - - *ppEqualSign = p; - p = skipSpaces(++p); - *ppValue = p; - if (*p == 0) goto EXIT; - - - while (*p != 0 && *pNest == 0 && *p != ',') { - p = skipToSeparator(p, pNest); - } - if (*pNest == 0) *ppSeparator = p; - -EXIT: - if (*p == ',') p++; - return p; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mode.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mode.h deleted file mode 100644 index 592e811c7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mode.h +++ /dev/null @@ -1,12 +0,0 @@ -#define START 0 -#define STRINGS 1 -#define ACTION_STRINGS 2 -#define ACTION_CHARS 3 -#define ACTION_COMMENTS 4 -#define TOK_DEF_COMMENTS 5 -#define TOK_DEF_CPP_COMMENTS 6 -#define ACTION_CPP_COMMENTS 7 -#define CPP_COMMENTS 8 -#define COMMENTS 9 -#define ACTIONS 10 -#define PARSE_ENUM_FILE 11 diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mrhoist.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mrhoist.c deleted file mode 100644 index 2439f37a9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/mrhoist.c +++ /dev/null @@ -1,3030 +0,0 @@ -/* - * mrhoist.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33MR10 - * - */ - -#include - -#include "pcctscfg.h" - -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" -#include - -#ifdef __USE_PROTOS -void dumppred(Predicate *); -#else -void dumppred(); -#endif - -/* - Try to determine whether predicate "first" is true for - all cases where "second" is true. Comparison takes place - without regard to context. - Assumes that predicate symbols have been expanded. - Assumes that there are no NAND or NOR nodes - -*/ - -#ifdef __USE_PROTOS -int MR_secondPredicateUnreachable(Predicate *first,Predicate *second) -#else -int MR_secondPredicateUnreachable(first,second) - Predicate *first; - Predicate *second; -#endif -{ - Predicate *f; - Predicate *s; - - if (first == NULL) { - return 1; - } else if (second == NULL) { - return 0; - } else if (first->down == NULL && second->down == NULL) { - if (first->source == second->source && - first->inverted == second->inverted) { - return 1; /* look identical - will never reach alt2 */ - } else { - return 0; /* look different */ - }; - } else if (first->down == NULL && second->down != NULL) { - - if (second->expr == PRED_AND_LIST) { - - /* unreachable if first covers any child of second */ - - for (s=second->down; s != NULL; s=s->right) { - if (MR_secondPredicateUnreachable(first,s)) { - return 1; - }; - }; - return 0; - } else if (second->expr == PRED_OR_LIST) { - - /* unreachable if first covers every child of second */ - - for (s=second->down; s != NULL; s=s->right) { - if (!MR_secondPredicateUnreachable(first,s)) { - return 0; - }; - }; - return 1; - } else { - require (0,"Illegal pred->expr"); - return 0; /* MR20 Make compiler happy */ - }; - } else if (first->down != NULL && second->down == NULL) { - if (first->expr == PRED_AND_LIST) { - - /* unreachable if every child of first covers second */ - - for (f=first->down; f != NULL; f=f->right) { - if (!MR_secondPredicateUnreachable(f,second)) { - return 0; - }; - }; - return 1; - } else if (first->expr == PRED_OR_LIST) { - - /* unreachable if any child of first covers second */ - - for (f=first->down; f != NULL; f=f->right) { - if (MR_secondPredicateUnreachable(f,second)) { - return 1; - }; - }; - return 0; - } else { - require (0,"Illegal predicate->expr"); - return 0; /* MR20 Make compiler happy */ - }; - } else { - - if (first->expr == PRED_AND_LIST && second->expr == PRED_AND_LIST) { - - /* unreachable if each child of first covers at least one child of second */ - - for (f=first->down; f != NULL ; f=f->right) { - for (s=second->down; s != NULL ; s=s->right) { - if (MR_secondPredicateUnreachable(f,s)) goto A_next_f; - }; - return 0; -A_next_f: - continue; - }; - return 1; - - } else if (first->expr == PRED_AND_LIST && second->expr == PRED_OR_LIST) { - - /* unreachable if each child of first covers ALL of second's children */ - - for (f=first->down; f != NULL ; f=f->right) { - for (s=second->down; s != NULL ; s=s->right) { - if (!MR_secondPredicateUnreachable(f,s)) return 0; - }; - }; - return 1; - - } else if (first->expr == PRED_OR_LIST && second->expr == PRED_AND_LIST) { - - /* unreachable if any child of second is covered by any child of first */ - - for (f=first->down; f != NULL ; f=f->right) { - for (s=second->down; s != NULL ; s=s->right) { - if (MR_secondPredicateUnreachable(f,s)) return 1; - }; - }; - return 0; - - } else if (first->expr == PRED_OR_LIST && second->expr == PRED_OR_LIST) { - - /* unreachable if every child of second is covered by some child of first */ - - for (f=first->down; f != NULL ; f=f->right) { - for (s=second->down; s != NULL ; s=s->right) { - if (MR_secondPredicateUnreachable(f,s)) goto B_next_f; - }; - return 0; -B_next_f: - continue; - }; - return 1; - - } else { - require (0,"Illegal predicate->expr"); - return 0; /* MR20 Make compiler happy */ - }; - }; - return 0; /* MR20 MSVC 5.0 complains about missing return statement */ -} - -#ifdef __USE_PROTOS -void MR_xxxIndent(FILE *f,int depth) -#else -void MR_xxxIndent(f,depth) - FILE *f; - int depth; -#endif -{ - int i; - - for (i=0; irname,rrn->line,FileStr[rrn->file],rrn->text); - }; - lastOne=MR_ruleReferenced(rrn); - if (lastOne != NULL) { - for (j=0; jrname,lastOne->line,FileStr[lastOne->file]); - }; -} - -#ifdef __USE_PROTOS -void MR_dumpTreeF(FILE *f,int depth,Tree *tree,int across) -#else -void MR_dumpTreeF(f,depth,tree,across) - FILE *f; - Tree *tree; - int depth; - int across; -#endif -{ - int newAcross=across; - - if (tree == NULL ) return; - if (tree->down != NULL ) { - fprintf(output,"\n"); - MR_outputIndent(depth); - fprintf(output, "(root ="); - }; - if (tree->token == ALT ) { - fprintf(output," %-16s","Alt"); - } else if (tree->token==EpToken ) { - fprintf(output,"(%d)%13s",tree->v.rk," "); - } else { - fprintf(output," %-16s",TerminalString(tree->token)); - }; - if (tree->down != NULL) { - fprintf(output,"\n"); - MR_outputIndent(depth+1); - MR_dumpTreeF(f,depth+1,tree->down,1); - newAcross=0; - fprintf(output,"\n"); - MR_outputIndent(depth); - fprintf(output,")"); - }; - if (newAcross > 3) { - fprintf(output,"\n"); - MR_outputIndent(depth); - newAcross=0; - }; - MR_dumpTreeF(f,depth,tree->right,newAcross+1); -} - -#ifdef __USE_PROTOS -void MR_dumpTreeX(int depth,Tree *tree,int across) -#else -void MR_dumpTreeX(depth,tree,across) - Tree *tree; - int depth; - int across; -#endif -{ - MR_dumpTreeF(output,depth,tree,across); -} - -#ifdef __USE_PROTOS -void MR_dumpTokenSet(FILE *f,int depth,set s) -#else -void MR_dumpTokenSet(f,depth,s) - FILE *f; - int depth; - set s; -#endif -{ - int i; - int j; - - unsigned *pdq; - - if (set_nil(s)) { - fprintf(f,"\n"); - MR_xxxIndent(f,depth+1); - fprintf(f,"nil\n"); - return; - }; - - pdq=set_pdq(s); - require(pdq != NULL,"set_pdq failed"); - i=0; - for (i=0 ; ; i=i+4) { - fprintf(f,"\n"); - MR_xxxIndent(f,depth+1); - for (j=0; j < 4 ; j++) { - if (pdq[i+j] == nil) break; - fprintf(f," %-16s",TerminalString(pdq[i+j])); - }; - if (pdq[i+j] == nil) break; - }; - fprintf(f,"\n"); - free( (char *) pdq); -} - -#ifdef __USE_PROTOS -void MR_dumpPred1(int depth,Predicate *p,int withContext) -#else -void MR_dumpPred1(depth,p,withContext) - int depth; - Predicate *p; - int withContext; -#endif -{ - unsigned k; - - if (p == NULL) { - MR_outputIndent(depth); - fprintf(output,"The predicate is empty (or always true)\n\n"); - return; - }; - if (p->down != NULL) { - MR_outputIndent(depth); - if (p->inverted) { - - /* MR14a Left out print expression in fprintf - Reported by Manuel Kessler (mlkessle@cip.physik.uni-wuerzburg.de) - */ - - if (p->expr == PRED_AND_LIST) fprintf(output,"%s NAND (not AND) expr\n\n",p->expr); - if (p->expr == PRED_OR_LIST) fprintf(output,"%s NOR (not OR) expr\n\n",p->expr); - } else { - fprintf(output,"%s expr\n\n",p->expr); - }; - } else { - MR_outputIndent(depth); - fprintf(output,"pred %s <<%s>>?\n", - (p->inverted ? " *not*" : ""), - (p->expr == NULL ? "null expr" : p->expr)); - MR_outputIndent(depth+1); - fprintf(output," "); - fprintf(output," depth=k=%d",p->k); - if (p->source != NULL && p->source->guardpred) { - fprintf(output," (\"=>\" guard)"); - } - if (p->source != NULL && p->source->ampersandPred != NULL) { - fprintf(output," (\"&&\" guard)"); - }; - k=set_int(p->completionSet); - if (k != nil) { - fprintf(output," Incomplete Set at k=%d !",k); - }; - k=set_int(p->completionTree); - if (k != nil) { - fprintf(output," Incomplete Tree at k=%d !",k); - }; - if (p->source != NULL) { - fprintf(output," rule %s line %d %s", - p->source->rname,p->source->line,FileStr[p->source->file]); - }; - fprintf(output,"\n"); - if (withContext && - (HoistPredicateContext || - ! set_nil(p->scontext[1]) || - p->tcontext != NULL)) { - if (p->k == 1) { - MR_outputIndent(depth+1); - fprintf(output,"set context: "); - MR_dumpTokenSet(output,depth+1,p->scontext[1]); - } - if (p->k != 1) { - MR_outputIndent(depth+1); - fprintf(output,"tree context:"); - if (p->tcontext == NULL) { - fprintf(output," null"); - } else { - MR_dumpTreeX(depth+2,p->tcontext,0); - }; - fprintf(output,"\n"); - }; - }; - fprintf(output,"\n"); - }; - if (p->down != NULL) { - MR_dumpPred1(depth+1,p->down,withContext); - }; - if (p->right != NULL) { - MR_dumpPred1(depth,p->right,withContext); - }; -} - -#ifdef __USE_PROTOS -void MR_dumpPred(Predicate *p,int withContext) -#else -void MR_dumpPred(p,withContext) - Predicate *p; - int withContext; -#endif -{ - MR_dumpPred1(0,p,withContext); -} - -#ifdef __USE_PROTOS -Tree * MR_make_tree_from_set(set s) -#else -Tree * MR_make_tree_from_set(s) - set s; -#endif -{ - Tree *t=NULL; - Tree *node; - Tree **tp=&t; - int i; - - unsigned *pdq=set_pdq(s); - - if (pdq != NULL) { - for (i=0 ; pdq[i] != nil ; i++) { - node=tnode( (int) pdq[i]); - *tp=node; - tp=&(node->right); - }; - *tp=NULL; - free ( (char *) pdq); - }; - return t; -} - -#ifdef __USE_PROTOS -void MR_check_pred_too_long(Predicate *p,set completion) -#else -void MR_check_pred_too_long(p,completion) - Predicate *p; - set completion; -#endif -{ - if (p != NULL && - p->source != NULL && - ! p->source->predTooLong) { - if ( !set_nil(completion)) { - p->source->predTooLong=1; -warnFL("It is unusual (but ok) for a semantic predicate to test context past the end of its own rule", - FileStr[p->source->file],p->source->line); - }; - }; -} - -#ifdef __USE_PROTOS -int MR_predicate_context_completed(Predicate *p) -#else -int MR_predicate_context_completed(p) - Predicate *p; -#endif -{ - if (p == NULL) return 1; - if (p->expr != PRED_AND_LIST && - p->expr != PRED_OR_LIST) { - if ( ! set_nil(p->completionSet)) return 0; - if ( ! set_nil(p->completionTree)) return 0; - }; - return MR_predicate_context_completed(p->down) & - MR_predicate_context_completed(p->right); -} - -#ifdef __USE_PROTOS -Node * MR_advance(Node *n) -#else -Node * MR_advance(n) - Node *n; -#endif -{ - if (n == NULL) return NULL; - switch (n->ntype) { - case nJunction: return ((Junction *)n)->p1; - case nToken: return ((TokNode *)n)->next; - case nRuleRef: return ((RuleRefNode *)n)->next; - case nAction: return ((ActionNode *)n)->next; - default: return NULL; - }; - return NULL; /* MSVC 5.0 complains about missing return statement */ -} - -#ifdef __USE_PROTOS -Junction * MR_find_endRule(Node *n) -#else -Junction * MR_find_endRule(n) - Node *n; -#endif -{ - Node *next; - if (n == NULL) return NULL; - for (next=n; next != NULL; next=MR_advance(next)) { - if (next->ntype == nJunction && - ( (Junction *) next)->jtype == EndRule) { - break; - }; - }; - return (Junction *)next; -} - -/* - Intersection: a branch which is shorter is chosen - over one which is longer: (A B C) intersect (A B) yields (A B). - - AND: a branch which is longer is chosen over the one - which is shorter: (A B C) AND (A B) yields (A B C) - -*/ - -#ifdef __USE_PROTOS -Tree *MR_computeTreeIntersection(Tree *l,Tree *r) -#else -Tree *MR_computeTreeIntersection(l,r) - Tree *l; - Tree *r; -#endif -{ - Tree *result=NULL; - Tree **tail; - Tree *p; - Tree *q; - Tree *match; - - if (l == NULL || r == NULL) return NULL; - for (p=l; p != NULL; p=p->right) { - require(p->token != EpToken,"MR_computeTreeIntersection: p->EpToken unexpected\n"); - require (p->token != ALT,"MR_computeTreeIntersection: p->ALT unexpected\n"); - }; - for (q=r; q != NULL; q=q->right) { - require(q->token != EpToken,"MR_computeTreeIntersection: q->EpToken unexpected\n"); - require(q->token != ALT,"MR_computeTreeIntersection: q->ALT unexpected\n"); - }; - - result=tnode(ALT); - tail=&(result->down); - - for (p=l; p != NULL ; p=p->right) { - for (q=r; q != NULL ; q=q->right) { - if (p->token == q->token) { - match=tnode(p->token); - match->down=MR_computeTreeIntersection(p->down,q->down); - *tail=match; - tail=&(match->right); - }; - }; - }; - - *tail=NULL; - result=tshrink(result); - result=tflatten( result ); - result=tleft_factor( result ); - return result; -} - -/* the predicates which are ANDed together have a common - context: they must all have common roots. Thus the - AND operation is more like an OR operation because - branches which are longer are grafted onto shorter - branches of the AND tree. For instance combining - (A B C) with (A B C D) gives (A B C D). There - should never be a case of (A B C) and (A B D) because - they have the same context. - - Actually, this may not be true once one throws in - guard predicates which are defined by the user, not - the context. -*/ - -/* requires input trees to be in "canonical" format */ - -#ifdef __USE_PROTOS -Tree *MR_computeTreeAND(Tree *l,Tree *r) -#else -Tree *MR_computeTreeAND(l,r) - Tree *l; - Tree *r; -#endif -{ - Tree *result=NULL; - Tree **tail; - Tree *p; - Tree *q; - Tree *match; - - if (l == NULL) return tdup(r); - if (r == NULL) return tdup(l); - - for (p=l; p != NULL; p=p->right) { -/**** require(p->token != EpToken,"MR_computeTreeAND: p->EpToken unexpected\n"); ****/ - require (p->token != ALT,"MR_computeTreeAND: p->ALT unexpected\n"); - }; - for (q=r; q != NULL; q=q->right) { -/**** require(q->token != EpToken,"MR_computeTreeAND: q->EpToken unexpected\n"); ****/ - require(q->token != ALT,"MR_computeTreeAND: q->ALT unexpected\n"); - }; - - result=tnode(ALT); - tail=&(result->down); - - for (p=l; p != NULL ; p=p->right) { - for (q=r; q != NULL ; q=q->right) { - if (p->token == q->token) { - match=tnode(p->token); - match->down=MR_computeTreeAND(p->down,q->down); - *tail=match; - tail=&(match->right); - }; - }; - }; - - *tail=NULL; - result=tshrink(result); - result=tflatten( result ); - result=tleft_factor( result ); - return result; -} - -#ifdef __USE_PROTOS -void MR_union_plain_sets1(Predicate *p,set *theUnion) -#else -void MR_union_plain_sets1(p,theUnion) - Predicate *p; - set *theUnion; -#endif -{ - if (p == NULL) return; - MR_union_plain_sets1(p->down,theUnion); - MR_union_plain_sets1(p->right,theUnion); - set_orin(theUnion,p->plainSet); - return; -} - -#ifdef __USE_PROTOS -set MR_union_plain_sets(Predicate *p) -#else -set MR_union_plain_sets(p) - Predicate *p; -#endif -{ - set theUnion; - - theUnion=empty; - - MR_union_plain_sets1(p,&theUnion); - return theUnion; -} - -/* does NOT left factor: do not want to merge - (A B) with (A) to get (A B) - in fact the opposite: (A B) with (A) gives (A) -*/ - -#ifdef __USE_PROTOS -Tree *MR_compute_pred_tree_ctxXX(Predicate *p) -#else -Tree *MR_compute_pred_tree_ctxXX(p) - Predicate *p; -#endif -{ - Tree *result=NULL; - Predicate *q; - Tree *t; - - if (p == NULL) return NULL; - -/* this appears strange: why do we OR the context - of and AND predicate ? It is because of the way - that predicates are evaluated: if the context is - wrong then it's the same as if the predicate was - true. That means that even when one leg of an - AND has unmatched context, if the other leg has - matched context and is true then the predicate - succeeds. It's only when all the legs have unmatched - context that this one can skip evaluation of the - predicates. -*/ - if (p->expr == PRED_OR_LIST || - p->expr == PRED_AND_LIST) { - for (q=p->down; q != NULL ; q=q->right) { - t=MR_compute_pred_tree_ctxXX(q); - result=tappend(result,t); - t=NULL; - }; - - result=tshrink(result); - result=tflatten( result ); - -/* does NOT left factor: do not want to merge - (A B) with (A) to get (A B) - in fact the opposite: (A B) with (A) gives (A) -*/ - -/**** result=tleft_factor( result ); ****/ - return result; - }; - -#if 0 -** if (p->expr == PRED_AND_LIST) { -** -** Predicate *l; -** Predicate *r; -** Tree *l1; -** Tree *r1; -** Tree *prevl1; -** -** l=p->down; -** require (l->right != NULL,"MR_compute_pred_tree - AND has only one child"); -** -**/* l1 and r1 should already be in "canonical" format */ -** -** l1=MR_compute_pred_tree(l); -** for (r=l->right; r != NULL; r=r->right) { -** r1=MR_compute_pred_tree(r); -** prevl1=l1; -** l1=MR_computeTreeAND(l1,r1); -** Tfree(r1); -** Tfree(prevl1); -** }; -** -**/* result from computeTreeAND should be in "canonical" format */ -** -** result=l1; -** -**/* result of MR_computeTreeAND should be in "canonical" format */ -** -** return result; -** }; -#endif - - if (p->k == 1) { - result=MR_make_tree_from_set(p->scontext[1]); - } else { - result=tdup(p->tcontext); - result=MR_remove_epsilon_from_tree(result); - result=tshrink(result); - result=tflatten(result); - result=tleft_factor(result); - }; - return result; -} - -#ifdef __USE_PROTOS -void MR_pred_depth(Predicate *p,int *maxDepth) -#else -void MR_pred_depth(p,maxDepth) - Predicate *p; - int *maxDepth; -#endif -{ - if (p == NULL) return; - if (p->expr != PRED_OR_LIST && - p->expr != PRED_AND_LIST) { - if (p->k > *maxDepth) *maxDepth=p->k; - }; - MR_pred_depth(p->down,maxDepth); - MR_pred_depth(p->right,maxDepth); -} - -/* this computes the OR of all the contexts */ - -#ifdef __USE_PROTOS -set MR_compute_pred_set(Predicate *p) -#else -set MR_compute_pred_set(p) - Predicate *p; -#endif -{ - set result; - Predicate *q; - - result=empty; - - if (p == NULL) return empty; - - if (p->expr == PRED_OR_LIST || - p->expr == PRED_AND_LIST) { /* yes, I do mean PRED_AND_LIST ! */ - /* remember: r1: (A)? => <

>? r2; */ - /* r2: (B)? => <>? r3; */ - set t; - - t=empty; - result=empty; - - for (q=p->down; q != NULL; q=q->right) { - t=MR_compute_pred_set(q); - set_orin(&result,t); - set_free(t); - }; - return result; - } else if (p->k > 1) { - return empty; - } else { - return set_dup(p->scontext[1]); - }; -} - -#ifdef __USE_PROTOS -set MR_First(int ck,Junction *j,set *incomplete) -#else -set MR_First(ck,j,incomplete) - int ck; - Junction *j; - set *incomplete; -#endif -{ - Junction *p; - set tokensUsed; - - tokensUsed=empty; - - require(j->ntype==nJunction, "MR_First: non junction passed"); - - p = analysis_point((Junction *)j->p1); - - REACH(p,ck,incomplete,tokensUsed); - - return tokensUsed; -} - -#ifdef __USE_PROTOS -void MR_cleanup_pred_trees(Predicate *p) -#else -void MR_cleanup_pred_trees(p) - Predicate *p; -#endif -{ - Tree *t; - - if (p == NULL) return; - if (p->expr != PRED_OR_LIST && - p->expr != PRED_AND_LIST) { - t=p->tcontext; - t=tshrink(t); - t=tflatten(t); - t=tleft_factor(t); - p->tcontext=t; - }; - MR_cleanup_pred_trees(p->down); - MR_cleanup_pred_trees(p->right); -} - -/* does NOT return canonical tree */ - -#ifdef __USE_PROTOS -Tree * MR_remove_epsilon_from_tree(Tree *t) -#else -Tree * MR_remove_epsilon_from_tree(t) - Tree *t; -#endif -{ - if (t == NULL) return NULL; - - /* I think ALT can be ignored as a special case */ - - if (t->token != EpToken) { - t->down=MR_remove_epsilon_from_tree(t->down); - t->right=MR_remove_epsilon_from_tree(t->right); - return t; - } else { - Tree *u; - u=MR_remove_epsilon_from_tree(t->right); - t->right=NULL; - Tfree(t); - return u; - }; -} - -#ifdef __USE_PROTOS -void MR_complete_set(int predDepth,set *tokensUsed,set *incomplete) -#else -void MR_complete_set(predDepth,tokensUsed,incomplete) - int predDepth; - set *tokensUsed; - set *incomplete; -#endif -{ - int i; - RuleRefNode *ruleRef; - set rk2; - set b; - int k2; - Junction *save_MR_RuleBlkWithHalt; - - if (set_int(*incomplete) > (unsigned) predDepth) { - return; - }; - - require(MR_PredRuleRefStack.count == MR_RuleBlkWithHaltStack.count, - "RuleRefStack and RuleBlkWithHaltStack not same size"); - - require(MR_RuleBlkWithHalt == NULL || - (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == TRUE), - "RuleBlkWithHalt has no halt set"); - - save_MR_RuleBlkWithHalt=MR_RuleBlkWithHalt; - - if (MR_RuleBlkWithHalt != NULL) { - MR_RuleBlkWithHalt->end->halt=FALSE; - }; - - for (i=MR_PredRuleRefStack.count-1; i >= 0 ; i--) { - ruleRef=(RuleRefNode *)MR_PredRuleRefStack.data[i]; - if (ruleRef == NULL) continue; - - MR_RuleBlkWithHalt=(Junction *)MR_RuleBlkWithHaltStack.data[i]; - if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=TRUE; - - rk2=empty; - b=empty; - - while ( !set_nil(*incomplete) ) { - k2=set_int(*incomplete); - if (k2 > predDepth) break; /* <=== another exit from loop */ - set_rm(k2,*incomplete); - REACH(ruleRef->next,k2,&rk2,b); - set_orin(tokensUsed,b); - set_free(b); - }; - - if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=FALSE; - - set_orin(incomplete,rk2); /* remember what we couldn't do */ - set_free(rk2); - if (set_int(*incomplete) > (unsigned) predDepth) break; /* <=== another exit from loop */ - }; - - MR_RuleBlkWithHalt=save_MR_RuleBlkWithHalt; - if (MR_RuleBlkWithHalt != NULL) { - MR_RuleBlkWithHalt->end->halt=TRUE; - }; -} - -#ifdef __USE_PROTOS -void MR_complete_tree(int predDepth,Tree **t,set *incomplete) -#else -void MR_complete_tree(predDepth,t,incomplete) - int predDepth; - Tree **t; - set *incomplete; -#endif -{ - int i; - RuleRefNode *ruleRef; - set rk2; - Tree *u; - unsigned k2; - Junction *save_MR_RuleBlkWithHalt; - int saveConstrainSearch; - - if (set_int(*incomplete) > (unsigned) predDepth) { - return; - }; - - require(MR_PredRuleRefStack.count == MR_RuleBlkWithHaltStack.count, - "RuleRefStack and RuleBlkWithHaltStack not same size"); - - require(MR_RuleBlkWithHalt == NULL || - (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == TRUE), - "RuleBlkWithHalt has no halt set"); - - save_MR_RuleBlkWithHalt=MR_RuleBlkWithHalt; - saveConstrainSearch=ConstrainSearch; - ConstrainSearch=0; - - if (MR_RuleBlkWithHalt != NULL) { - MR_RuleBlkWithHalt->end->halt=FALSE; - }; - - for (i=MR_PredRuleRefStack.count-1; i >= 0 ; i--) { - ruleRef=(RuleRefNode *)MR_PredRuleRefStack.data[i]; - if (ruleRef == NULL) continue; - - MR_RuleBlkWithHalt=(Junction *)MR_RuleBlkWithHaltStack.data[i]; - - if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=TRUE; - - rk2=empty; - - while ( !set_nil(*incomplete) ) { - k2 = set_int(*incomplete); - if (k2 > (unsigned) predDepth) break; /* <=== another exit from loop */ - set_rm(k2,*incomplete); - u = NULL; - - TRAV(ruleRef->next,k2,&rk2,u); - - /* any subtrees missing k2 tokens, add u onto end */ - - *t=tlink(*t,u,k2); - Tfree(u); - } - - set_orin(incomplete,rk2); /* remember what we couldn't do */ - set_free(rk2); - - if (MR_RuleBlkWithHalt != NULL) MR_RuleBlkWithHalt->end->halt=FALSE; - - if (set_int(*incomplete) > (unsigned) predDepth) break; /* <=== another exit from loop */ - }; - - MR_RuleBlkWithHalt=save_MR_RuleBlkWithHalt; - - if (MR_RuleBlkWithHalt != NULL) { - MR_RuleBlkWithHalt->end->halt=TRUE; - }; - ConstrainSearch=saveConstrainSearch; -} - -#ifdef __USE_PROTOS -void MR_complete_predicates(int predDepth,Predicate *pred) -#else -void MR_complete_predicates(predDepth,pred) - int predDepth; - Predicate *pred; -#endif -{ - if (pred == NULL) return; - if (pred->expr != PRED_AND_LIST && - pred->expr != PRED_OR_LIST) { - MR_complete_set(predDepth,&(pred->scontext[1]),&(pred->completionSet)); - MR_complete_tree(predDepth,&(pred->tcontext),&(pred->completionTree)); - }; - MR_complete_predicates(predDepth,pred->down); - MR_complete_predicates(predDepth,pred->right); -} - -#ifdef __USE_PROTOS -Junction * MR_junctionWithoutP2(Junction *j) -#else -Junction * MR_junctionWithoutP2(j) - Junction *j; -#endif -{ - Junction *thisAlt; - -/* don't want to follow p2 to the next alternative of this rule */ -/* insert a generic node with null p2 if necessary */ -/* however FIRST requires a junction */ - - thisAlt=j; - if (thisAlt->p2 != NULL) { - if (thisAlt->p1->ntype == nJunction) { - thisAlt=(Junction *) thisAlt->p1; - } else { - thisAlt=newJunction(); - thisAlt->p1=j->p1; - thisAlt->rname=j->rname; - thisAlt->file=j->file; - thisAlt->line=j->line; - j->p1=(Node *)thisAlt; - }; - }; - return thisAlt; -} - -#ifdef __USE_PROTOS -int MR_tree_equ(Tree *big, Tree *small) { -#else -int MR_tree_equ(big,small) - Tree *big; - Tree *small; -{ -#endif - - Tree *b; - Tree *s; - int bcount=0; - int scount=0; - - if (small == NULL && big == NULL) return 1; - if (small == NULL) return 0; - if (big == NULL) return 0; - - if (small->token == ALT) { - require(small->right == NULL, - "MR_tree_equ: small: ALT node has siblings"); - return MR_tree_equ(big,small->down); - }; - if (big->token == ALT) { - require(big->right == NULL, - "MR_tree_equ: big: ALT node has siblings"); - return MR_tree_equ(big->down,small); - }; - for (s=small; s != NULL; s=s->right) { - scount++; - require(s->token != EpToken,"MR_tree_equ: s->EpToken unexpected\n"); - }; - for (b=big; b != NULL; b=b->right) { - bcount++; - require(b->token != EpToken,"MR_tree_equ: b->EpToken unexpected\n"); - }; - - if (bcount != scount) return 0; - - for (s=small; s != NULL; s=s->right) { - for (b=big; b!= NULL; b=b->right) { - if (s->token == b->token) { - if (MR_tree_equ(b->down,s->down)) goto next_s; - }; - }; - return 0; -next_s: - continue; - }; - return 1; -} - -/* this does not compare sources - only contexts ! */ - -#ifdef __USE_PROTOS -int MR_identicalContext(Predicate *p,Predicate *q) -#else -int MR_identicalContext(p,q) - Predicate *p; - Predicate *q; -#endif -{ - if (p->k != q->k) return 0; - require ( (p->tcontext == NULL) == (q->tcontext == NULL), - "tcontext inconsistent"); - if (p->k == 1) { - return set_equ(p->scontext[1],q->scontext[1]); - } else { - return MR_tree_equ(p->tcontext,q->tcontext); - }; -} - -#ifdef __USE_PROTOS -void MR_reportSetSuppression(int predDepth, - set predSet,set plainSet,Junction *jPred,Junction *jPlain,Predicate *p) -#else -void MR_reportSetSuppression(predDepth,predSet,plainSet,jPred,jPlain,p) - int predDepth; - set predSet; - set plainSet; - Junction *jPred; - Junction *jPlain; - Predicate *p; -#endif -{ - if (InfoP) { - fprintf(output,"\n#if 0\n\n"); - fprintf(output,"Hoisting of predicate suppressed by alternative without predicate.\n"); - fprintf(output,"The alt without the predicate includes all cases where the predicate is false.\n\n"); - fprintf(output," WITH predicate: line %d %s\n",jPred->line,FileStr[jPred->file]); - if (jPlain != NULL) { - fprintf(output," WITHOUT predicate: line %d %s\n",jPlain->line,FileStr[jPlain->file]); - } else { - fprintf(output," WITHOUT predicate: all alternatives without predicates (combined)\n"); - }; - if (predDepth == 1) { - fprintf(output,"\nThe context set for the predicate:\n"); - MR_dumpTokenSet(output,1,predSet); - }; - fprintf(output,"\nThe lookahead set for the alt WITHOUT the semantic predicate:\n"); - MR_dumpTokenSet(output,1,plainSet); - fprintf(output,"\nThe predicate:\n\n"); - MR_dumpPred1(1,p,1); - fprintf(output,"Chain of referenced rules:\n\n"); - MR_dumpPredRuleRefStack(output,4); - fprintf(output,"\n#endif\n"); - }; -} - -#ifdef __USE_PROTOS -void MR_reportSetRestriction(int predDepth,set predSet,set plainSet, - Junction *jPred,Junction *jPlain,Predicate *origPred,Predicate *newPred) -#else -void MR_reportSetRestriction(predDepth,predSet,plainSet,jPred,jPlain,origPred,newPred) - int predDepth; - set predSet; - set plainSet; - Junction *jPred; - Junction *jPlain; - Predicate *origPred; - Predicate *newPred; -#endif -{ - set intersect; - - intersect=empty; - - if (! InfoP) return; - fprintf(output,"\n#if 0\n\n"); - fprintf(output,"Restricting the context of a predicate because of overlap in the lookahead set\n"); - fprintf(output," between the alternative with the semantic predicate and one without\n"); - fprintf(output,"Without this restriction the alternative without the predicate could not\n"); - fprintf(output," be reached when input matched the context of the predicate and the predicate\n"); - fprintf(output," was false.\n\n"); - - fprintf(output," WITH predicate: line %d %s\n",jPred->line,FileStr[jPred->file]); - if (jPlain != NULL) { - fprintf(output," WITHOUT predicate: line %d %s\n",jPlain->line,FileStr[jPlain->file]); - } else { - fprintf(output," WITHOUT predicate: all alternatives without predicates (combined)\n"); - }; - if (predDepth == 1) { - fprintf(output,"\nThe original context set for the predicate:\n"); - MR_dumpTokenSet(output,1,predSet); - }; - fprintf(output,"\nThe lookahead set for the alt WITHOUT the semantic predicate:\n"); - MR_dumpTokenSet(output,1,plainSet); - if (predDepth == 1) { - fprintf(output,"\nThe intersection of the two sets\n"); - intersect=set_and(predSet,plainSet); - MR_dumpTokenSet(output,1,intersect); - set_free(intersect); - }; - fprintf(output,"\nThe original predicate:\n\n"); - MR_dumpPred1(1,origPred,1); - fprintf(output,"The new (modified) form of the predicate:\n\n"); - MR_dumpPred1(1,newPred,1); - fprintf(output,"#endif\n"); -} - -/* don't use Pass3 by itself unless you know that inverted is not important */ - -#ifdef __USE_PROTOS -Predicate * MR_removeRedundantPredPass3(Predicate *p) -#else -Predicate * MR_removeRedundantPredPass3(p) - Predicate *p; -#endif -{ - Predicate *q; - - if (p == NULL) return NULL; - p->right=MR_removeRedundantPredPass3(p->right); - p->down=MR_removeRedundantPredPass3(p->down); - if (p->redundant) { - q=p->right; - p->right=NULL; - predicate_free(p); - return q; - }; - if (p->expr == PRED_AND_LIST || - p->expr == PRED_OR_LIST) { - if (p->down == NULL) { - q=p->right; - p->right=NULL; - predicate_free(p); - return q; - }; - if (p->down != NULL && p->down->right == NULL) { - q=p->down; - q->right=p->right; - p->right=NULL; - p->down=NULL; - return q; - }; - }; - return p; -} - -#ifdef __USE_PROTOS -void MR_removeRedundantPredPass2(Predicate *p) -#else -void MR_removeRedundantPredPass2(p) - Predicate *p; -#endif -{ - Predicate *q; - - if (p == NULL) return; - - if (p->expr == PRED_AND_LIST) { - for (q=p->down ; q != NULL ; q=q->right) { - MR_removeRedundantPredPass2(q); - if (q->isConst) { - if (q->constValue == 0) { - p->isConst=1; - p->constValue=0; - return; - } else { - q->redundant=1; - }; - }; - }; - }; - - if (p->expr == PRED_OR_LIST) { - for (q=p->down ; q != NULL ; q=q->right) { - MR_removeRedundantPredPass2(q); - if (q->isConst) { - if (q->constValue == 0) { - q->redundant=1; - } else { - p->isConst=1; - p->constValue=1; - return; - }; - }; - }; - }; - - return; -} - -#if 0 - this totally ignores the implications of guarded predicates - in which the part after the guard could possibly cover a predicate. - that would be much harder: - - rule : (A)? => <

>? sub1; /* 1 */ - | (B)? => <>? sub2 /* 2 */ - sub1 : (A)? => <>? A B /* 3 */ - | B /* 4 - suppresses line 2 */ - ; -#endif - -#ifdef __USE_PROTOS -void MR_apply_restriction1(Predicate *pred,set *plainSet,int *changed) -#else -void MR_apply_restriction1(pred,plainSet,changed) - Predicate *pred; - set *plainSet; - int *changed; -#endif -{ - if (pred == NULL) return; - MR_apply_restriction1(pred->right,plainSet,changed); - if (pred->down != NULL) { - MR_apply_restriction1(pred->down,plainSet,changed); - } else { - set t; - if (pred->k == 1) { - t=set_dif(pred->scontext[1],*plainSet); - if (*changed == 0 && - !set_equ(t,pred->scontext[1])) { - *changed=1; - }; - if (set_nil(t)) { - pred->redundant=1; - }; - set_free(pred->scontext[1]); - pred->scontext[1]=t; - }; - }; -} - -#ifdef __USE_PROTOS -void MR_orin_plainSet(Predicate *p,set plainSet) -#else -void MR_orin_plainSet(p,plainSet) - Predicate *p; - set plainSet; -#endif -{ - if (p == NULL) return; - MR_orin_plainSet(p->down,plainSet); - MR_orin_plainSet(p->right,plainSet); - set_orin(&p->plainSet,plainSet); -} - -Predicate *PRED_SUPPRESS; - -#ifdef __USE_PROTOS -Predicate * MR_find_in_aSubBlk(Junction *alt) -#else -Predicate * MR_find_in_aSubBlk(alt) - Junction *alt; -#endif -{ - Predicate *root=NULL; - Predicate **tail=NULL; - - Junction *p; - - int nAlts=0; - Junction **jList; - Predicate **predList; - int *matchList; - set predSet; - int i; - int j; - int m; - int predDepth; - set incomplete; - set union_plainSet; - set setChange; - int changed; - Predicate *newPred; - set setDif; - Predicate *origPred; - int depth1=1; /* const int */ - set *plainContext; - set plainSet; - - predSet=empty; - incomplete=empty; - union_plainSet=empty; - setChange=empty; - setDif=empty; - plainSet=empty; - - if (PRED_SUPPRESS == NULL) { - PRED_SUPPRESS=new_pred(); - PRED_SUPPRESS->expr="Predicate Suppressed"; - }; - - /* this section just counts the number of "interesting" alternatives */ - /* in order to allocate arrays */ - - for (p=alt; p!=NULL; p=(Junction *)p->p2) { - /* ignore empty alts */ - if ( p->p1->ntype != nJunction || - ((Junction *)p->p1)->jtype != EndBlk ) { - nAlts++; - }; - }; - - /* if this is a (...)+ block then don't count the last alt because - it can't be taken until at least one time through the block. - In other words it isn't a real choice until the (...)+ is entered - at which point the hoisting issue is moot. - Maybe look at "ignore" instead ? - */ - - if (alt->jtype == aPlusBlk) { - nAlts--; - }; - - jList=(Junction **)calloc(nAlts,sizeof(Junction *)); - require(jList!=NULL,"cannot allocate MR_find_in_aSubBlk jList"); - - plainContext=(set *)calloc(nAlts,sizeof(set)); - require(plainContext!=NULL,"cannot allocate MR_find_in_aSubBlk plainContext"); - for (m=0; m < nAlts; m++) plainContext[m]=empty; - - predList=(Predicate **)calloc(nAlts,sizeof(Predicate *)); - require(predList!=NULL,"cannot allocate MR_find_in_aSubBlk predList"); - - matchList=(int *)calloc(nAlts,sizeof(int)); - require(matchList!=NULL,"cannot allocate MR_find_in_aSubBlk matchList"); - - /* this section just fills in the arrays previously allocated */ - /* the most interesting one is matchList[] */ - /* */ - /* bit 0 => this alt has a semantic pred which is "covered" */ - /* by an alt without a semantic pred. Don't hoist. */ - - for (i=0,p=alt; - p!=NULL && ip2) { - - /* ignore empty alts */ - - if ( p->p1->ntype != nJunction || - ((Junction *)p->p1)->jtype != EndBlk ) { - jList[i]=MR_junctionWithoutP2(p); - predList[i]=find_predicates(p->p1); /* should be jList ????? */ - if (predList[i] != NULL) { - MR_cleanup_pred_trees(predList[i]); /* flatten & left factor */ - plainContext[i]=MR_union_plain_sets(predList[i]); - } else { - MR_set_reuse(&plainSet); - MR_set_reuse(&incomplete); - plainSet=MR_First(depth1,jList[i],&incomplete); - MR_complete_set(depth1,&plainSet,&incomplete); - require(set_nil(incomplete),"couldn't complete k=1"); - plainContext[i]=plainSet; - plainSet=empty; - }; - set_orin(&union_plainSet,plainContext[i]); - }; - }; - - if (nAlts == 1) { - goto EXIT_SIMPLE; - }; - -/* - * Looking for cases where alt i has a semantic pred and alt j does not. - * Don't care about cases where lookahead for semantic predicates overlap - * because normal predicate hoisting does the correct thing automatically. - * Don't care about cases where lookahead for alts without semantic predicates - * overlap because normal prediction does the correct thing automatically. - * - * When we find such a case check for one of three subcases: - * - * 1. if lookahead for alt i is contained in the lookahead for any - * alt j then ignore semantic predicate of alt i - * 2. if lookahead for alt i is not contained in the lookahead for - * any alt j then add add predicate i to the OR list to be hoisted - * 3. if lookahead for alt i overlaps the lookahead for some alt j then - * add a dummy semantic predicate for alt j - * - * There is an implicit assumption that the context of all alternatives following - * the rule being processed here are identical (but may vary from hoist to - * hoist depending on the place where the rule was invoked that led to hoisting - * these predicates. In othere words in the fragment: - * - * ( <>? a1 a2 a3 | <>? b1 b2 b3 ) - * - * both a3 and b3 have the same follow sets because they are both at the end of - * alternatives in the same block. - */ - - for (i=0; i < nAlts; i++) { - if (jList[i] == NULL) continue; - if (predList[i] == NULL) continue; - - /* if the predicate depth turns out to be one token only */ - /* then it is can be easily represented as a set and */ - /* compared to the junction set create by MR_First() */ - - predDepth=0; - MR_pred_depth(predList[i],&predDepth); - require (predDepth >= 1,"MR_find_in_aSubBlk: pred depth < 1"); - require (predDepth <= CLL_k,"MR_find_in_aSubBlk: predDepth > CLL_k"); - - /* complete predicates to predDepth - If completed to depth=1 then the context would be incomplete. - The context would be truncated and the predicate simplify routine - would have incomplete information. It would lead to - either false matches of failure to find true matches. - */ - - MR_complete_predicates(predDepth,predList[i]); - - if (predList[i] != NULL) { - MR_cleanup_pred_trees(predList[i]); /* flatten & left factor */ - }; - - /* If the predicate depth is 1 then it is possible to suppress - a predicate completely using a single plain alt. Check for suppression - by a single plain alt first because it gives better messages. If that - fails try the union of all the plain alts. - */ - - if (predDepth == 1) { - - MR_set_reuse(&predSet); - predSet=MR_compute_pred_set(predList[i]); /* ignores k>1 predicates */ - - for (j=0; j < nAlts; j++) { - if (jList[j] == NULL) continue; - if (j == i) continue; - - MR_set_reuse(&setDif); - setDif=set_dif(predSet,plainContext[j]); - if (set_nil(setDif)) { - matchList[i] |= 1; - MR_reportSetSuppression(predDepth,predSet,plainContext[j],jList[i],jList[j],predList[i]); - predicate_free(predList[i]); - predList[i]=PRED_SUPPRESS; - goto next_i; - }; - - }; /* end loop on j */ - - changed=0; - - /* predicate_dup is only to give good error messages */ - /* remember to do a predicate_free() */ - - origPred=predicate_dup(predList[i]); - MR_apply_restriction1(predList[i],&union_plainSet,&changed); - if (changed) { - - /* don't use Pass3 by itself unless you know that inverted is not important */ - - newPred=MR_removeRedundantPredPass3(predList[i]); - newPred=MR_predSimplifyALL(newPred); - if (newPred == NULL) { - matchList[i] |= 1; - MR_reportSetSuppression(predDepth,predSet,union_plainSet,jList[i], - NULL,origPred); - predList[i]=PRED_SUPPRESS; - } else { - MR_reportSetRestriction(predDepth,predSet,union_plainSet,jList[i], - NULL,origPred,newPred); - predList[i]=newPred; - }; - }; - predicate_free(origPred); - origPred=NULL; - }; - - /* - If the predicate depth is > 1 then it can't be suppressed completely - because the code doesn't support inspection of such things. They're - much messier than k=1 sets. - */ - - if (predDepth > 1 ) { - - changed=0; - - /* predicate_dup is only to give good error messages */ - /* remember to do a predicate_free() */ - - origPred=predicate_dup(predList[i]); - MR_apply_restriction1(predList[i],&union_plainSet,&changed); - if (changed) { - newPred=MR_removeRedundantPredPass3(predList[i]); - newPred=MR_predSimplifyALL(newPred); - if (newPred == NULL) { - matchList[i] |= 1; - MR_reportSetSuppression(predDepth,predSet,union_plainSet,jList[i], - NULL,origPred); - predList[i]=PRED_SUPPRESS; - } else { - MR_reportSetRestriction(predDepth,predSet,union_plainSet,jList[i], - NULL,origPred,newPred); - predList[i]=newPred; - }; - }; - predicate_free(origPred); - origPred=NULL; - }; -next_i: - continue; - }; - -EXIT_SIMPLE: - - root = new_pred(); - root->expr=PRED_OR_LIST; - tail = &(root->down); - - for (i=0 ; i< nAlts ; i++) { - if (jList[i] == NULL) continue; - - if (predList[i] == NULL) { - continue; - } else if ( (matchList[i] & 1) != 0) { - if (predList[i] != PRED_SUPPRESS) { - predicate_free(predList[i]); - }; - continue; - }; - - /* make an OR list of predicates */ - - *tail=predList[i]; - tail=&(predList[i]->right); - }; - - /* if just one pred, remove OR root */ - - if (root->down == NULL) { - predicate_free(root); - root=NULL; - } else if (root->down->right == NULL) { - Predicate *p=root->down; - root->down=NULL; - predicate_free(root); - root=p; - } - - root=MR_predSimplifyALL(root); - - MR_orin_plainSet(root,union_plainSet); - - set_free(predSet); - set_free(union_plainSet); - set_free(incomplete); - set_free(setChange); - set_free(setDif); - - for (m=0; m < nAlts; m++) set_free(plainContext[m]); - - free ( (char *) jList); - free ( (char *) predList); - free ( (char *) matchList); - free ( (char *) plainContext); - - return root; -} - -#ifdef __USE_PROTOS -void MR_predContextPresent(Predicate *p,int *allHaveContext,int *noneHaveContext) -#else -void MR_predContextPresent(p,allHaveContext,noneHaveContext) - Predicate *p; - int *allHaveContext; - int *noneHaveContext; -#endif -{ - if (p == NULL) return; - MR_predContextPresent(p->right,allHaveContext,noneHaveContext); - if (p->expr != PRED_AND_LIST && - p->expr != PRED_OR_LIST) { - if (set_nil(p->scontext[1]) == 0 || - (p->tcontext != NULL)) { - *noneHaveContext=0; - } else { - *allHaveContext=0; - }; - }; - MR_predContextPresent(p->down,allHaveContext,noneHaveContext); -} - -#ifdef __USE_PROTOS -int MR_pointerStackPush(PointerStack *ps,void *dataPointer) -#else -int MR_pointerStackPush(ps,dataPointer) - PointerStack *ps; - void *dataPointer; -#endif -{ - void **newStack; - int newSize; - int i; - - if (ps->count == ps->size) { - newSize=20+ps->size*2; - newStack=(void **)calloc(newSize,sizeof(void *)); - require (newStack != NULL,"cannot allocate PointerStack"); - for (i=0; i < ps->size; i++) { - newStack[i]=ps->data[i]; - }; - if (ps->data != NULL) free( (char *) ps->data); - ps->data=newStack; - ps->size=newSize; - }; - ps->data[ps->count]=dataPointer; - ps->count++; - return ps->count-1; -} - -#ifdef __USE_PROTOS -void * MR_pointerStackPop(PointerStack *ps) -#else -void * MR_pointerStackPop(ps) - PointerStack *ps; -#endif -{ - void *dataPointer; - - require(ps->count > 0,"MR_pointerStackPop underflow"); - - dataPointer=ps->data[ps->count-1]; - ps->data[ps->count-1]=NULL; - (ps->count)--; - return dataPointer; -} - -#ifdef __USE_PROTOS -void * MR_pointerStackTop(PointerStack *ps) -#else -void * MR_pointerStackTop(ps) - PointerStack *ps; -#endif -{ - require(ps->count > 0,"MR_pointerStackTop underflow"); - return ps->data[ps->count-1]; -} - -#ifdef __USE_PROTOS -void MR_pointerStackReset(PointerStack *ps) -#else -void MR_pointerStackReset(ps) - PointerStack *ps; -#endif -{ - int i; - if (ps->data != NULL) { - for (i=0; i < ps->count ; i++) { - ps->data[i]=NULL; - }; - }; - ps->count=0; -} - -#ifdef __USE_PROTOS -Junction *MR_nameToRuleBlk(char *name) -#else -Junction *MR_nameToRuleBlk(name) - char *name; -#endif -{ - RuleEntry *q; - - require (RulePtr != NULL,"MR_nameToRule: RulePtr not initialized"); - - if (name == NULL) return NULL; - - q = (RuleEntry *) hash_get(Rname,name); - - if ( q == NULL ) { - return NULL; - } else { - return RulePtr[q->rulenum]; - }; -} - -#ifdef __USE_PROTOS -Junction * MR_ruleReferenced(RuleRefNode *rrn) -#else -Junction * MR_ruleReferenced(rrn) - RuleRefNode *rrn; -#endif -{ - return MR_nameToRuleBlk(rrn->text); -} - -#ifdef __USE_PROTOS -void MR_comparePredLeaves(Predicate *me,Predicate *myParent,Predicate *him,Predicate *hisParent) -#else -void MR_comparePredLeaves(me,myParent,him,hisParent) - Predicate *me; - Predicate *myParent; - Predicate *him; - Predicate *hisParent; -#endif -{ - if (me == NULL) return; - if (me == him) { - MR_comparePredLeaves(me->right,myParent,him,hisParent); - return; - } else if (me->expr == PRED_AND_LIST || - me->expr == PRED_OR_LIST) { - MR_comparePredLeaves(me->down,me,him,hisParent); - MR_comparePredLeaves(me->right,myParent,him,hisParent); - return; - } else { - if (me->source != NULL) { - - /* predicate->invert can be set only in the predEntry predicates */ - /* thus they are only visible after the predEntry predicates have been "unfolded" */ - - int sameSource=(me->source == him->source); - int sameInvert=1 & - (1 + me->inverted + him->inverted + me->source->inverted + him->source->inverted); - int samePredEntry=(me->source->predEntry != NULL - && him->source->predEntry != NULL - && me->source->predEntry == him->source->predEntry); - if (sameInvert && (sameSource || samePredEntry)) { - if (MR_identicalContext(me,him)) { - - /* identical predicates */ - - if (hisParent->expr == PRED_OR_LIST && - myParent->expr == PRED_OR_LIST) { - me->redundant=1; - } else if (hisParent->expr == PRED_AND_LIST && - myParent->expr == PRED_AND_LIST) { - me->redundant=1; - } else if ( (hisParent->expr == PRED_OR_LIST && - myParent->expr == PRED_AND_LIST) - || - (hisParent->expr == PRED_AND_LIST && - myParent->expr == PRED_OR_LIST) - ) { - myParent->redundant=1; - } else { - require (0,"MR_comparePredLeaves: not both PRED_LIST"); - }; - }; - }; /* end same source or same predEntrr with same invert sense */ - - /* same predEntry but opposite invert sense */ - - if (!sameInvert && (sameSource || samePredEntry)) { - if (MR_identicalContext(me,him)) { - if (hisParent->expr == PRED_OR_LIST && - myParent->expr == PRED_OR_LIST) { - myParent->isConst=1; - myParent->constValue=1; - } else if (hisParent->expr == PRED_AND_LIST && - myParent->expr == PRED_AND_LIST) { - myParent->isConst=1; - myParent->constValue=0; - } else if ( (hisParent->expr == PRED_OR_LIST && - myParent->expr == PRED_AND_LIST) - || - (hisParent->expr == PRED_AND_LIST && - myParent->expr == PRED_OR_LIST) - ) { - me->redundant=1; - } else { - require (0,"MR_comparePredLeaves: not both PRED_LIST"); - }; - }; - }; /* end same predEntry with opposite invert sense */ - }; - - MR_comparePredLeaves(me->right,myParent,him,hisParent); - return; - }; -} - -#ifdef __USE_PROTOS -void MR_removeRedundantPredPass1(Predicate *me,Predicate *myParent) -#else -void MR_removeRedundantPredPass1(me,myParent) - Predicate *me; - Predicate *myParent; -#endif -{ - if (me == NULL) return; - if (me->redundant) { - MR_removeRedundantPredPass1(me->right,myParent); - return; - }; - if (me->expr == PRED_AND_LIST || - me->expr == PRED_OR_LIST) { - MR_removeRedundantPredPass1(me->down,me); - MR_removeRedundantPredPass1(me->right,myParent); - } else { - require (me->source != NULL,"me->source == NULL"); - if (myParent != NULL) { - MR_comparePredLeaves(myParent->down,myParent,me,myParent); - }; - MR_removeRedundantPredPass1(me->right,myParent); - }; -} - -/* pretty much ignores things with the inverted bit set */ - -#ifdef __USE_PROTOS -Predicate *MR_predFlatten(Predicate *p) -#else -Predicate *MR_predFlatten(p) - Predicate *p; -#endif -{ - if (p == NULL) return NULL; - if (p->expr == PRED_OR_LIST - || p->expr == PRED_AND_LIST) { - - Predicate *child; - Predicate *gchild; - Predicate **tail; - Predicate *next; - char *PRED_XXX_LIST=p->expr; - - require (p->down != NULL,"MR_predFlatten AND/OR no child"); - - - p->down=MR_predFlatten(p->down); - p->right=MR_predFlatten(p->right); - child=p->down; - if (child->right == NULL) { - child->right=p->right; - p->right=NULL; - p->down=NULL; - if (p->inverted) child->inverted=!child->inverted; - predicate_free(p); - return child; - }; - - /* make a single list of all children and grandchildren */ - - tail=&(p->down); - for (child=p->down; child != NULL; child=next) { - if (child->expr != PRED_XXX_LIST - || child->inverted - || child->predEntry != NULL) { - *tail=child; - tail=&(child->right); - next=child->right; - } else { - for (gchild=child->down; - gchild != NULL; - gchild=gchild->right) { - *tail=gchild; - tail=&(gchild->right); - }; - next=child->right; - child->right=NULL; - child->down=NULL; - predicate_free(child); - }; - }; - *tail=NULL; - return p; - } else { - p->right=MR_predFlatten(p->right); - return p; - }; -} - -static char *alwaysFalseWarning=NULL; - -#ifdef __USE_PROTOS -Predicate *checkPredicateConflict(Predicate *p) -#else -Predicate *checkPredicateConflict(p) - Predicate *p; -#endif -{ - if (p->isConst) { - if (p->constValue == 1) { - predicate_free(p); - return NULL; - } else { - if (InfoP && !p->conflictReported) { - p->conflictReported=1; - fprintf(output,"\n#if 0\n\n"); - fprintf(output,"The following predicate expression will always be false:\n\n"); - MR_dumpPred1(1,p,1); - fprintf(output,"\n#endif\n"); - }; - - if (alwaysFalseWarning != CurRule) { - alwaysFalseWarning=CurRule; - if (InfoP) { - warnNoFL(eMsg1("one (or more) predicate expression hoisted into rule \"%s\" are always false \ -- see output file for more information",CurRule)); - } else { - warnNoFL(eMsg1("one (or more) predicate expressions hoisted into rule \"%s\" are always false \ -- use \"-info p\" for more information",CurRule)); - }; - }; - }; - }; - return p; -} - - -#ifdef __USE_PROTOS -int MR_countPredNodes(Predicate *p) -#else -int MR_countPredNodes(p) - Predicate *p; -#endif -{ - if (p == NULL) return 0; - return 1 + MR_countPredNodes(p->down) + MR_countPredNodes(p->right); -} - -#ifdef __USE_PROTOS -Predicate *MR_predSimplifyALLX(Predicate *p,int skipPass3) -#else -Predicate *MR_predSimplifyALLX(p,skipPass3) - Predicate *p; - int skipPass3; -#endif -{ - int countBefore; - int countAfter; - - countAfter=MR_countPredNodes(p); - - do { - if (p == NULL) return NULL; - if (p->right == NULL && p->down == NULL) return p; - countBefore=countAfter; - MR_simplifyInverted(p,0); - p=MR_predFlatten(p); - MR_removeRedundantPredPass1(p,NULL); - MR_removeRedundantPredPass2(p); - if (! skipPass3) { - p=checkPredicateConflict(p); - p=MR_removeRedundantPredPass3(p); - }; - countAfter=MR_countPredNodes(p); - } while (countBefore != countAfter); - - return p; -} - -#ifdef __USE_PROTOS -Predicate *MR_predSimplifyALL(Predicate *p) -#else -Predicate *MR_predSimplifyALL(p) - Predicate *p; -#endif -{ - return MR_predSimplifyALLX(p,0); -} - -#ifdef __USE_PROTOS -void MR_releaseResourcesUsedInRule(Node *n) -#else -void MR_releaseResourcesUsedInRule(n) - Node *n; -#endif -{ - Node *next; - Junction *j; - int i; - - if (n == NULL) return; - if (n->ntype == nJunction) { - j=(Junction *) n; - - if (j->predicate != NULL) { - predicate_free(j->predicate); - j->predicate=NULL; - }; - for (i=0; i< CLL_k; i++) { - set_free(j->fset[i]); - j->fset[i]=empty; - }; - if (j->ftree != NULL) { - Tfree(j->ftree); - j->ftree=NULL; - }; - if (j->jtype == EndRule) return; - if (j->jtype != RuleBlk && j->jtype != EndBlk) { - if (j->p2 != NULL && !j->ignore) { /* MR11 */ - MR_releaseResourcesUsedInRule(j->p2); - }; - }; - }; - next=MR_advance(n); - MR_releaseResourcesUsedInRule(next); -} - -#ifdef __USE_PROTOS -int MR_allPredLeaves(Predicate *p) -#else -int MR_allPredLeaves(p) - Predicate *p; -#endif -{ - Predicate *q; - - if (p == NULL) return 1; - - for (q=p; q != NULL; q=q->right) { - if (q->down != NULL) return 0; - }; - return 1; -} - -/* make sure it works for the last rule in a file */ - -#ifdef __USE_PROTOS -int MR_offsetFromRule(Node *n) -#else -int MR_offsetFromRule(n) - Node *n; -#endif -{ - Junction *j; - int offset=(-1); - - for (j=SynDiag; j != NULL; j=(Junction *)j->p2) { - - require (j->ntype == nJunction && j->jtype == RuleBlk,"Not a rule block"); - - if (n->file < j->file) { - return offset; - }; - if (n->file == j->file) { - if (n->line < j->line) { - return (offset < 0) ? 0 : offset; - } else { - offset=n->line - j->line; - if (offset == 0) return 0; - }; - }; - }; - return offset; -} - -#define ruleNameMax 50 - -static char ruleNameStatic1[ruleNameMax]; -static char ruleNameStatic2[ruleNameMax+10]; - -#ifdef __USE_PROTOS -char * MR_ruleNamePlusOffset(Node *n) -#else -char * MR_ruleNamePlusOffset(n) - Node *n; -#endif -{ - int offset=MR_offsetFromRule(n); - - strncpy(ruleNameStatic1,n->rname,ruleNameMax); - if (offset < 0) { - sprintf(ruleNameStatic2,"%s/?",ruleNameStatic1); - } else { - sprintf(ruleNameStatic2,"%s/%d",ruleNameStatic1,offset+1); - }; - return ruleNameStatic2; -} - -#ifdef __USE_PROTOS -int MR_max_height_of_tree(Tree *t) -#else -int MR_max_height_of_tree(t) - Tree *t; -#endif -{ - int h; - int height=0; - Tree *u; - - if (t == NULL) return 0; - - require (t->token != ALT && t->token != EpToken,"MR_max_height_of_tree ALT or EpToken"); - - for (u=t; u != NULL; u=u->right) { - h=MR_max_height_of_tree(u->down)+1; - if (h > height) height=h; - }; - return height; -} - -#ifdef __USE_PROTOS -int MR_all_leaves_same_height(Tree *t,int depth) -#else -int MR_all_leaves_same_height(t,depth) - Tree *t; - int depth; -#endif -{ - if (t == NULL) { - return (depth==0); - }; - - require (t->token != ALT && t->token != EpToken,"MR_all_leaves_same_height ALT or EpToken"); - - if (depth == 0) { - return 0; - } else { - if ( ! MR_all_leaves_same_height(t->down,depth-1)) { - return 0; - }; - if (t->right == NULL) { - return 1; - } else { - return MR_all_leaves_same_height(t->right,depth); - }; - }; -} - -#ifdef __USE_PROTOS -void MR_projectTreeOntoSet(Tree *tree,int ck,set *ckset) -#else -void MR_projectTreeOntoSet(tree,ck,ckset) - Tree *tree; - int ck; - set *ckset; -#endif -{ - if (tree == NULL) return; - - require(tree->token != EpToken,"MR_projectTreeOntoSet: EpToken unexpected\n"); - - MR_projectTreeOntoSet(tree->right,ck,ckset); - if (tree->token == ALT) { - MR_projectTreeOntoSet(tree->down,ck,ckset); - } else { - if (ck > 1) { - MR_projectTreeOntoSet(tree->down,ck-1,ckset); - } else { - set_orel(tree->token,ckset); - }; - }; -} - -#ifdef __USE_PROTOS -int MR_comparePredicates(Predicate *a,Predicate *b) -#else -int MR_comparePredicates(a,b) - Predicate *a; - Predicate *b; -#endif -{ - Predicate *p; - Predicate *q; - - if (a == b) return 1; - if (a == NULL || b == NULL ) return 0; - if (a->down == NULL && b->down == NULL) { - - /* predicate->invert can be set only in the predEntry predicates */ - /* thus they are only visible after the predEntry predicates have been "unfolded" */ - - int sameSource=(a->source == b->source); - int sameInvert= 1 & (1 +a->inverted + b->inverted + - a->source->inverted + b->source->inverted); - int samePredEntry=(a->source->predEntry != NULL - && b->source->predEntry != NULL - && a->source->predEntry == b->source->predEntry); - if (sameInvert && (sameSource || samePredEntry)) { - if (MR_identicalContext(a,b)) { - return 1; - }; - }; - return 0; - }; - if (a->down == NULL || b->down == NULL) return 0; - if (a->expr != b->expr) return 0; - - for (p=a->down; p != NULL; p=p->right) { - for (q=b->down; q != NULL; q=q->right) { - if (MR_comparePredicates(p,q)) goto NEXT_P; - }; - return 0; -NEXT_P: - continue; - }; - return 1; -} - -/* - * action->inverted can be set only when a predicate symbol appears in - * a rule: "rule : <>? X". It cannot be set under any - * other circumstances. In particular it cannot be set by - * "#pred NotA !A" or by "#pred Nota <>?". The first case - * creates a predEntry and the predicate expression of that predEntry - * has inverted set. In the second case, the code for handling "!" - * is only present in buildAction, which is not called by the #pred - * semantic routines, only when a <<...>>? is recognized as part of - * a rule definition. - * - * predicate->inverted can only be set by a predicate created by a #pred - * expression, such as "#pred NotA !A" or "#pred NotXY ! (X && Y) or - * "#pred XbarY !(X && Y)". In particular, it cannot be set by any - * predicate expression occurring under any other circumstances. - * The #pred predicate expresssions are stored with in predEntry->pred - * and do not normally appear anywhere else until the predicates are - * "unfolded" in order to recognize redundancies, conflicts, and - * tautologies. - * - * The unfold routine expands all references to #pred expressions. - * - * The simplifyInvert goes through and propagates the invert bit so that - * all OR and AND nodes are un-inverted. - * - * Note that !(A and B) => (!A or !B) - * !(A or B) => (!A and !B) - * - * MR_unfold() is called to expand predicate symbols by replacing predicates - * that reference predicate entries with the copies of the predicate entries. - * Each reference receives a duplicate of the original. This is necessary - * because the next phase involves simplification and removal of redundant - * predicate nodes. Anyway, the point I'm making is that predicate->invert - * should not be set in any predicate until it has been expanded. - * - * This is a recursive structure, but there is no need for "recursive expansion" - * by which I mean a predicate symbol refers to other predicate symbols which - * must also be expanded. - * - * Recursive expansion is *not* performed by this routine because it is not - * necessary. Expansion of references is performed by predPrimary when - * a new predicate symbol is created by referring to others in the pred expr. - */ - -#ifdef __USE_PROTOS -Predicate *MR_unfold(Predicate *pred) -#else -Predicate *MR_unfold(pred) - Predicate *pred; -#endif -{ - Predicate *result; - - if (pred == NULL) return NULL; - - pred->right=MR_unfold(pred->right); - - if (pred->down == NULL) { - if (pred->source->predEntry != NULL) { - if (pred->source->predEntry->pred == NULL) { - ; /* do nothing */ /* a reference to a literal #pred (perhaps with "!" */ - } else { - result=predicate_dup_without_context(pred->source->predEntry->pred); - if (pred->inverted) { - result->inverted=!result->inverted; - }; - if (pred->source->inverted) { - result->inverted=!result->inverted; - }; - result->right=pred->right; - pred->right=NULL; - predicate_free(pred); -/*** result=MR_unfold(result); *** not necessary */ /* recursive expansion */ - return result; - }; - } else { - ; /* do nothing */ /* an inline literal predicate */ - }; - } else { - pred->down=MR_unfold(pred->down); - }; - return pred; -} - -/* this should be called immediately after MR_unfold() and - at no other times -*/ - -#ifdef __USE_PROTOS -void MR_simplifyInverted(Predicate *pred,int inverted) -#else -void MR_simplifyInverted(pred,inverted) - Predicate *pred; - int inverted; -#endif -{ - int newInverted; - - if (pred == NULL) return; - - MR_simplifyInverted(pred->right,inverted); - - newInverted= 1 & (inverted + pred->inverted); - - if (pred->down == NULL) { - pred->inverted=newInverted; - } else { - if (newInverted != 0) { - if (pred->expr == PRED_AND_LIST) { - pred->expr=PRED_OR_LIST; - } else { - pred->expr=PRED_AND_LIST; - }; - }; - pred->inverted=0; - MR_simplifyInverted(pred->down,newInverted); - }; -} - -/* only remove it from AND and OR nodes, not leaves */ - -#ifdef __USE_PROTOS -void MR_clearPredEntry(Predicate *p) -#else -void MR_clearPredEntry(p) - Predicate *p; -#endif -{ - if (p == NULL) return; - MR_clearPredEntry(p->down); - MR_clearPredEntry(p->right); - if (p->down != NULL) p->predEntry=NULL; -} - - -#ifdef __USE_PROTOS -void MR_orphanRules(FILE *f) -#else -void MR_orphanRules(f) - FILE *f; -#endif -{ - set a; - Junction *p; - unsigned e; - RuleEntry *re; - - a=empty; - - if (! InfoO) return; - - for (p=SynDiag; p!=NULL; p = (Junction *)p->p2) { - if ( (Junction *) (p->end)->p1 == NULL) { - re=(RuleEntry *) hash_get(Rname,p->rname); - require (re != NULL,"RuleEntry == NULL"); - set_orel(re->rulenum, &a); - } - } - - if (set_deg(a) > 1) { - fprintf(f,"note: Start rules: {"); - for (; !set_nil(a); set_rm(e,a)) { - e=set_int(a); - fprintf(f," %s",RulePtr[e]->rname); - }; - fprintf(f," }\n"); - }; - set_free( a ); -} - -/* merge (X Y) and (X) to create (X) */ - -static int *mergeChain; -static Tree *mergeTree; - -#ifdef __USE_PROTOS -Tree *MR_merge_tree_contexts_client(Tree *t,int chain[]) -#else -Tree *MR_merge_tree_contexts_client(t,chain) - Tree *t; - int chain[]; -#endif -{ - if (t == NULL) return NULL; - if (chain[0] == 0) { - Tree *u=t->right; - t->right=NULL; - Tfree(t); - return MR_merge_tree_contexts_client(u,&chain[0]); - } - if (chain[0] == t->token) { - t->down=MR_merge_tree_contexts_client(t->down,&chain[1]); - }; - t->right=MR_merge_tree_contexts_client(t->right,&chain[0]); - return t; -} - -#ifdef __USE_PROTOS -void MR_iterateOverTreeContexts(Tree *t,int chain[]) -#else -void MR_iterateOverTreeContexts(t,chain) - Tree *t; - int chain[]; -#endif -{ - if (t == NULL) return; - chain[0]=t->token; - if (t->down != NULL) { - MR_iterateOverTreeContexts(t->down,&chain[1]); - } else { - MR_merge_tree_contexts_client(mergeTree,mergeChain); - }; - MR_iterateOverTreeContexts(t->right,&chain[0]); - chain[0]=0; -} - -#ifdef __USE_PROTOS -Tree *MR_merge_tree_contexts(Tree *t) -#else -Tree *MR_merge_tree_contexts(t) - Tree *t; -#endif -{ - int h=MR_max_height_of_tree(t); - - mergeTree=t; - mergeChain=(int *) calloc(h+1,sizeof(int)); - require (mergeChain != NULL,"MR_merge_tree_contexts: can't alloc chain"); - MR_iterateOverTreeContexts(t,mergeChain); - t=tshrink(t); - t=tflatten(t); - t=tleft_factor(t); - free ( (char *) mergeChain); - mergeChain=NULL; - return t; -} - -#ifdef __USE_PROTOS -Tree *MR_compute_pred_tree_context(Predicate *p) -#else -Tree *MR_compute_pred_tree_context(p) - Predicate *p; -#endif -{ - Tree *t; - - t=MR_compute_pred_tree_ctxXX(p); - MR_merge_tree_contexts(t); - return t; -} - -#ifdef __USE_PROTOS -void MR_guardPred_plainSet(ActionNode *anode,Predicate *pred) -#else -void MR_guardPred_plainSet(anode,pred) - ActionNode *anode; - Predicate *pred; -#endif -{ - Junction *j; - Predicate *workPred; - set maskSet; - - maskSet=empty; - - if (!MRhoisting) return; - - /* it doesn't really matter whether the predicate has - depth k=1 or k>1 because we're not really looking - at the predicate itself, just the stuff "behind" - the predicate. - */ - - /* shouldn't have to worry about REACHing off the end - of the rule containing the predicate because the - Rule->end->halt should have been set already by the - the code which handles RuleRef nodes. - - We don't want to REACH off the end of the rule because - this would give the "global" follow context rather than - the "local" context. - - r1a : (A)? => <

>? r2 (A|B) - r1b : (A)? => <

>? r2 (A|C) - r2 : (); - - For r1a we want follow of predicate = {A B} - we want plainSet = {B} - For r1b we want follow of predicate = {A C} - we want plainSet = {C} - */ - - require (anode->next->ntype == nJunction,"MR_guardpred_plainSet not Junction"); - j=(Junction *)(anode->next); - - workPred=predicate_dup_without_context(pred); - workPred->k=1; - workPred->scontext[1]=MR_First(1,j, &(workPred->completionSet) ); - MR_complete_predicates(1,workPred); - if (pred->k == 1) { - maskSet=pred->scontext[1]; - } else { - MR_projectTreeOntoSet(pred->tcontext,1,&maskSet); - } - pred->plainSet=set_dif(workPred->scontext[1],maskSet); - predicate_free(workPred); -} - -/*******************************************************************************/ - -static Tree * suppressTree; -static int * suppressChain; /* element 0 not used */ -static set * suppressSets; -static Node * suppressNode; -static int suppressChainLength; -int MR_SuppressSearch=0; -static int suppressSucceeded; -static Predicate * suppressPredicate; - -#ifdef __USE_PROTOS -int MR_isChain(Tree *t) -#else -int MR_isChain(t) - Tree *t; -#endif -{ - Tree *u; - - for (u=t; u != NULL; u=u->down) { - if (u->right != NULL) return 0; - } - return 1; -} - -#ifdef __USE_PROTOS -int MR_suppressK_client(Tree *tree,int tokensInChain[]) -#else -int MR_suppressK_client(tree,tokensInChain) - Tree *tree; - int tokensInChain[]; -#endif -{ - int i; - set *save_fset; - int save_ConstrainSearch; - set incomplete; - Tree *t; - - suppressSucceeded=0; /* volatile */ - - if (suppressSets == NULL) { - suppressSets=(set *) calloc (CLL_k+1,sizeof(set)); - require (suppressSets != NULL,"MR_suppressK_client: suppressSets alloc"); - }; - - for (suppressChainLength=1; - tokensInChain[suppressChainLength+1] != 0; - suppressChainLength++) {}; - - require (suppressChainLength != 0,"MR_suppressK_client: chain empty"); - - for (i=1 ; i <= suppressChainLength ; i++) { - set_clr(suppressSets[i]); - set_orel( (unsigned) tokensInChain[i], - &suppressSets[i]); - }; - - save_fset=fset; - save_ConstrainSearch=ConstrainSearch; - - fset=suppressSets; - - MR_SuppressSearch=1; - MR_AmbSourceSearch=1; - MR_MaintainBackTrace=1; - ConstrainSearch=1; - - maxk = suppressChainLength; - - incomplete=empty; - t=NULL; - -/*** constrain = &(fset[1]); ***/ - - MR_setConstrainPointer(&(fset[1])); /* MR18 */ - - MR_pointerStackReset(&MR_BackTraceStack); - - TRAV(suppressNode,maxk,&incomplete,t); - - Tfree(t); - - require (set_nil(incomplete),"MR_suppressK_client TRAV incomplete"); - require (MR_BackTraceStack.count == 0, - "MR_suppressK_client: MR_BackTraceStack.count != 0"); - set_free(incomplete); - - ConstrainSearch=save_ConstrainSearch; - fset=save_fset; - - MR_AmbSourceSearch=0; - MR_MaintainBackTrace=0; - MR_SuppressSearch=0; - return suppressSucceeded; -} - -#ifdef __USE_PROTOS -Tree * MR_iterateOverTreeSuppressK(Tree *t,int chain[]) -#else -Tree * MR_iterateOverTreeSuppressK(t,chain) - Tree *t; - int chain[]; -#endif -{ - if (t == NULL) return NULL; - t->right=MR_iterateOverTreeSuppressK(t->right,&chain[0]); - chain[0]=t->token; - if (t->down != NULL) { - t->down=MR_iterateOverTreeSuppressK(t->down,&chain[1]); - if (t->down == NULL) { - Tree *u=t->right; - t->right=NULL; - Tfree(t); - chain[0]=0; - return u; - }; - } else { - MR_suppressK_client(suppressTree,suppressChain); - if (suppressSucceeded) { - Tree *u=t->right; - t->right=NULL; - Tfree(t); - chain[0]=0; - return u; - }; - }; - chain[0]=0; - return t; -} - -/* @@@ */ - -#ifdef __USE_PROTOS -Predicate * MR_suppressK(Node *j,Predicate *p) -#else -Predicate * MR_suppressK(j,p) - Node *j; - Predicate *p; -#endif -{ - Predicate *result; - int guardPred=0; - int ampersandPred=0; - Node *nodePrime; - - if (! MRhoistingk) { - return p; - } - - if (! MRhoisting) return p; - if (CLL_k == 1) return p; - - if (suppressChain == NULL) { - suppressChain=(int *) calloc(CLL_k+2,sizeof(int)); - require (suppressChain != NULL,"MR_suppressK: can't allocate chain"); - } - - if (p == NULL) return NULL; - - if (j->ntype == nJunction) { - nodePrime=(Node *) MR_junctionWithoutP2( (Junction *) j); - } else { - nodePrime=j; - }; - - p->down=MR_suppressK(j,p->down); - p->right=MR_suppressK(j,p->right); - if (p->down != NULL) { - result=p; - goto EXIT; - }; - if (p->k == 1) { - result=p; - goto EXIT; - }; - - if (p->source != NULL) { - if (p->source->guardpred != NULL) guardPred=1; - if (p->source->ampersandPred != NULL) ampersandPred=1; - } - - suppressPredicate=p; - suppressNode=nodePrime; /* was j*/ - - suppressTree=p->tcontext; - - if (guardPred || ampersandPred) { - p->tcontext=MR_iterateOverTreeSuppressK(suppressTree,&suppressChain[1]); - if (p->tcontext == NULL) { - predicate_free(p); - result=NULL; - goto EXIT; - }; - } else { - if (MR_isChain(p->tcontext)) { - p->tcontext=MR_iterateOverTreeSuppressK(suppressTree,&suppressChain[1]); - if (p->tcontext == NULL) { - predicate_free(p); - result=NULL; - goto EXIT; - }; - } - } - result=p; -EXIT: - return result; -} - -#ifdef __USE_PROTOS -void MR_suppressSearchReport(void) -#else -void MR_suppressSearchReport() -#endif -{ - int i; - Node *p; - TokNode *tn; - int depth; - set setAnd; - - /* number of tokens in back trace stack matches length of chain */ - - depth=0; - for (i=0; i < MR_BackTraceStack.count ; i++) { - p=(Node *) MR_BackTraceStack.data[i]; - if (p->ntype == nToken) depth++; - }; - - require (depth == suppressChainLength,"depth > suppressChainLength"); - - /* token codes match chain */ - - depth=0; - for (i=0; i < MR_BackTraceStack.count ; i++) { - p=(Node *) MR_BackTraceStack.data[i]; - if (p->ntype != nToken) continue; - tn=(TokNode *) p; - depth++; - if (set_nil(tn->tset)) { - require(set_el( (unsigned) tn->token,fset[depth]), - "MR_suppressSearchReport: no match to #token in chain"); - } else { - setAnd=set_and(fset[depth],tn->tset); - require(!set_nil(setAnd), - "MR_suppressSearchReport: no match to #token set in chain"); - set_free(setAnd); - }; - }; - - /* have a match - now remove it from the predicate */ - - suppressSucceeded=1; - - if (suppressSucceeded) { - fprintf(output,"\n"); - fprintf(output,"#if 0\n"); - fprintf(output,"\n"); - fprintf(output,"Part (or all) of predicate with depth > 1 suppressed by "); - fprintf(output,"alternative without predicate\n\n"); - MR_dumpPred(suppressPredicate,1); - fprintf(output,"The token sequence which is suppressed:"); - fprintf(output," ("); - for (i=1; i <= suppressChainLength; i++) { - fprintf(output," %s",TerminalString(suppressChain[i])); - }; - fprintf(output," )\n"); - fprintf(output,"The sequence of references which generate that sequence of tokens:\n\n"); - - MR_backTraceDumpItemReset(); - - for (i=0; i < MR_BackTraceStack.count ; i++) { - MR_backTraceDumpItem(output,0,(Node *) MR_BackTraceStack.data[i]); - }; - fprintf(output,"\n"); - fprintf(output,"#endif\n"); - } -} - -#ifdef __USE_PROTOS -void MR_markCompromisedRule(Node *n) -#else -void MR_markCompromisedRule(n) - Node *n; -#endif -{ - RuleEntry *q; - Node *mark=NULL; - Junction *j; - - if (n->ntype == nRuleRef) { - mark=(Node *) MR_ruleReferenced( (RuleRefNode *) n); - } else if (n->ntype == nToken) { - mark=n; - } else if (n->ntype == nJunction) { - j=(Junction *)n; - switch (j->jtype) { - case aOptBlk: - case aLoopBlk: - case RuleBlk: - case EndRule: - case aPlusBlk: - case aLoopBegin: - mark=n; - break; - default: - break; - }; - } - - if (mark == NULL) return; - - require (RulePtr != NULL,"RulePtr not initialized"); - - q = (RuleEntry *) hash_get(Rname,mark->rname); - require (q != NULL,"RuleEntry not found"); - set_orel(q->rulenum,&MR_CompromisedRules); -} - -#ifdef __USE_PROTOS -void MR_alphaBetaTraceReport(void) -#else -void MR_alphaBetaTraceReport() -#endif -{ - int i; - - if (! AlphaBetaTrace) return; - - MR_AlphaBetaMessageCount++; - - fprintf(output,"\n"); - fprintf(output,"#if 0\n"); - fprintf(output,"\n"); - fprintf(output,"Trace of references leading to attempt to compute the follow set of\n"); - fprintf(output,"alpha in an \"(alpha)? beta\" block. It is not possible for antlr to\n"); - fprintf(output,"compute this follow set because it is not known what part of beta has\n"); - fprintf(output,"already been matched by alpha and what part remains to be matched.\n"); - fprintf(output,"\n"); - fprintf(output,"Rules which make use of the incorrect follow set will also be incorrect\n"); - fprintf(output,"\n"); - - MR_backTraceDumpItemReset(); - - for (i=0; i < MR_BackTraceStack.count ; i++) { - MR_backTraceDumpItem(output,0,(Node *) MR_BackTraceStack.data[i]); - if (i < MR_BackTraceStack.count-1) { - MR_markCompromisedRule( (Node *) MR_BackTraceStack.data[i]); - }; - }; - fprintf(output,"\n"); - fprintf(output,"#endif\n"); -} - -#ifdef __USE_PROTOS -void MR_dumpRuleSet(set s) -#else -void MR_dumpRuleSet(s) - set s; -#endif -{ - unsigned *cursor; - unsigned *origin=set_pdq(s); - - require(origin != NULL,"set_pdq failed"); - - if (RulePtr == NULL) { - fprintf(stderr,"RulePtr[] not yet initialized"); - } else { - for (cursor=origin; *cursor != nil ; cursor++) { -/**** if (cursor != origin) fprintf(stderr,","); ****/ - fprintf(stderr," %s",RulePtr[*cursor]->rname); - fprintf(stderr,"\n"); - }; - free( (char *) origin); - }; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/parser.dlg b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/parser.dlg deleted file mode 100644 index 804c6d018..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/parser.dlg +++ /dev/null @@ -1,1387 +0,0 @@ -<< -/* parser.dlg -- DLG Description of scanner - * - * Generated from: antlr.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include "pcctscfg.h" -#include "set.h" -#include -#include "syn.h" -#include "hash.h" -#include "generic.h" -#define zzcr_attr(attr,tok,t) -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -LOOKAHEAD - -void -#ifdef __USE_PROTOS -zzerraction() -#else -zzerraction() -#endif -{ - (*zzerr)("invalid token"); - zzadvance(); - zzskip(); -} ->> - -<<%%lexaction - -/* maintained, but not used for now */ -set AST_nodes_refd_in_actions = set_init; -int inAlt = 0; -set attribsRefdFromAction = set_init; /* MR20 */ -int UsedOldStyleAttrib = 0; -int UsedNewStyleLabel = 0; -#ifdef __USE_PROTOS -char *inline_set(char *); -#else -char *inline_set(); -#endif - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ -/* MR1 in DLG action */ - -int tokenActionActive=0; /* MR1 */ - - ->> - -<<%%lexaction - - -static char * -#ifdef __USE_PROTOS -getFileNameFromTheLineInfo(char *toStr, char *fromStr) -#else -getFileNameFromTheLineInfo(toStr, fromStr) -char *toStr, *fromStr; -#endif -{ - int i, j, k; - - if (!fromStr || !toStr) return toStr; - - /* find the first " */ - - for (i=0; - (i> - -<<%%lexaction - -#ifdef __USE_PROTOS -void mark_label_used_in_sem_pred(LabelEntry *le) /* MR10 */ -#else -void mark_label_used_in_sem_pred(le) /* MR10 */ -LabelEntry *le; -#endif -{ - TokNode *tn; - require (le->elem->ntype == nToken,"mark_label_used... ntype != nToken"); - tn=(TokNode *)le->elem; - require (tn->label != 0,"mark_label_used... TokNode has no label"); - tn->label_used_in_semantic_pred=1; -} ->> - - -%%START - -@ - << - NLA = Eof; - /* L o o k F o r A n o t h e r F i l e */ - { - FILE *new_input; - new_input = NextFile(); - if ( new_input == NULL ) { NLA=Eof; return; } - fclose( input ); - input = new_input; - zzrdstream( input ); - zzskip(); /* Skip the Eof (@) char i.e continue */ - } - >> - -[\t\ ]+ - << - NLA = 76; - zzskip(); - >> - -\n|\r|\r\n - << - NLA = 77; - zzline++; zzskip(); - >> - -\[ - << - NLA = 78; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint(']'); - >> - -\<\< - << - NLA = 79; - action_file=CurFile; action_line=zzline; - zzmode(ACTIONS); zzmore(); - list_free(&CurActionLabels,0); /* MR10 */ - numericActionLabel=0; /* MR10 */ - istackreset(); - pushint('>'); - >> - -\" - << - NLA = 80; - zzmode(STRINGS); zzmore(); - >> - -/\* - << - NLA = 81; - zzmode(COMMENTS); zzskip(); - >> - -\*/ - << - NLA = 82; - warn("Missing /*; found dangling */"); zzskip(); - >> - -// - << - NLA = 83; - zzmode(CPP_COMMENTS); zzskip(); - >> - -#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n) - << - NLA = 84; - - zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore(); - getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr); - >> - -#line ~[\n\r]* (\n|\r|\r\n) - << - NLA = 85; - - zzline++; zzmore(); - >> - -\>\> - << - NLA = 86; - warn("Missing <<; found dangling \>\>"); zzskip(); - >> - -. - << - NLA = WildCard; - >> - -\@ - << - NLA = 88; - FoundException = 1; /* MR6 */ - FoundAtOperator = 1; - >> - -{\\}#pragma - << - NLA = Pragma; - >> - -{\\}#FirstSetSymbol - << - NLA = FirstSetSymbol; - >> - -{\\}#header - << - NLA = 94; - >> - -{\\}#first - << - NLA = 95; - >> - -{\\}#parser - << - NLA = 96; - >> - -{\\}#tokdefs - << - NLA = 97; - >> - -\} - << - NLA = 98; - >> - -class - << - NLA = 99; - >> - -\{ - << - NLA = 102; - >> - -! - << - NLA = 103; - >> - -\< - << - NLA = 104; - >> - -\> - << - NLA = 105; - >> - -: - << - NLA = 106; - >> - -; - << - NLA = 107; - >> - -{\\}#lexaction - << - NLA = 108; - >> - -{\\}#lexmember - << - NLA = 109; - >> - -{\\}#lexprefix - << - NLA = 110; - >> - -{\\}#pred - << - NLA = 111; - >> - -\|\| - << - NLA = 112; - >> - -&& - << - NLA = 113; - >> - -\( - << - NLA = 114; - >> - -\) - << - NLA = 115; - >> - -{\\}#lexclass - << - NLA = 116; - >> - -{\\}#errclass - << - NLA = 117; - >> - -{\\}#tokclass - << - NLA = 118; - >> - -.. - << - NLA = 119; - >> - -{\\}#token - << - NLA = 120; - >> - -= - << - NLA = 121; - >> - -[0-9]+ - << - NLA = 122; - >> - -\| - << - NLA = 123; - >> - -\~ - << - NLA = 124; - >> - -^ - << - NLA = 125; - >> - -approx - << - NLA = 126; - >> - -LL\(1\) - << - NLA = 127; - >> - -LL\(2\) - << - NLA = 128; - >> - -\* - << - NLA = 129; - >> - -\+ - << - NLA = 130; - >> - -? - << - NLA = 131; - >> - -=> - << - NLA = 132; - >> - -exception - << - NLA = 133; - >> - -default - << - NLA = 134; - >> - -catch - << - NLA = 135; - >> - -[a-z] [A-Za-z0-9_]* - << - NLA = NonTerminal; - - while ( zzchar==' ' || zzchar=='\t' ) { - zzadvance(); - } - if ( zzchar == ':' && inAlt ) NLA = LABEL; - >> - -[A-Z] [A-Za-z0-9_]* - << - NLA = TokenTerm; - - while ( zzchar==' ' || zzchar=='\t' ) { - zzadvance(); - } - if ( zzchar == ':' && inAlt ) NLA = LABEL; - >> - -{\\}#[A-Za-z0-9_]* - << - NLA = 136; - warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip(); - >> - - -%%STRINGS - -@ - << - NLA = Eof; - >> - -\" - << - NLA = QuotedTerm; - zzmode(START); - >> - -\n|\r|\r\n - << - NLA = 3; - - zzline++; - warn("eoln found in string"); - zzskip(); - >> - -\\(\n|\r|\r\n) - << - NLA = 4; - zzline++; zzmore(); - >> - -\\~[] - << - NLA = 5; - zzmore(); - >> - -~[\n\r\"\\]+ - << - NLA = 6; - zzmore(); - >> - - -%%ACTION_STRINGS - -@ - << - NLA = Eof; - >> - -\" - << - NLA = 7; - zzmode(ACTIONS); zzmore(); - >> - -\n|\r|\r\n - << - NLA = 8; - - zzline++; - warn("eoln found in string (in user action)"); - zzskip(); - >> - -\\(\n|\r|\r\n) - << - NLA = 9; - zzline++; zzmore(); - >> - -\\~[] - << - NLA = 10; - zzmore(); - >> - -~[\n\r\"\\]+ - << - NLA = 11; - zzmore(); - >> - - -%%ACTION_CHARS - -@ - << - NLA = Eof; - >> - -' - << - NLA = 12; - zzmode(ACTIONS); zzmore(); - >> - -\n|\r|\r\n - << - NLA = 13; - - zzline++; - warn("eoln found in char literal (in user action)"); - zzskip(); - >> - -\\~[] - << - NLA = 14; - zzmore(); - >> - -~[\n\r'\\]+ - << - NLA = 15; - zzmore(); - >> - - -%%ACTION_COMMENTS - -@ - << - NLA = Eof; - >> - -\*/ - << - NLA = 16; - zzmode(ACTIONS); zzmore(); - >> - -\* - << - NLA = 17; - zzmore(); - >> - -\n|\r|\r\n - << - NLA = 18; - zzline++; zzmore(); DAWDLE; - >> - -~[\n\r\*]+ - << - NLA = 19; - zzmore(); - >> - - -%%TOK_DEF_COMMENTS - -@ - << - NLA = Eof; - >> - -\*/ - << - NLA = 20; - zzmode(PARSE_ENUM_FILE); - zzmore(); - >> - -\* - << - NLA = 21; - zzmore(); - >> - -\n|\r|\r\n - << - NLA = 22; - zzline++; zzmore(); DAWDLE; - >> - -~[\n\r\*]+ - << - NLA = 23; - zzmore(); - >> - - -%%TOK_DEF_CPP_COMMENTS - -@ - << - NLA = Eof; - >> - -\n|\r|\r\n - << - NLA = 24; - zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE; - >> - -~[\n\r]+ - << - NLA = 25; - zzskip(); - >> - - -%%ACTION_CPP_COMMENTS - -@ - << - NLA = Eof; - >> - -\n|\r|\r\n - << - NLA = 26; - zzline++; zzmode(ACTIONS); zzmore(); DAWDLE; - >> - -~[\n\r]+ - << - NLA = 27; - zzmore(); - >> - - -%%CPP_COMMENTS - -@ - << - NLA = Eof; - >> - -\n|\r|\r\n - << - NLA = 28; - zzline++; zzmode(START); zzskip(); DAWDLE; - >> - -~[\n\r]+ - << - NLA = 29; - zzskip(); - >> - - -%%COMMENTS - -@ - << - NLA = Eof; - >> - -\*/ - << - NLA = 30; - zzmode(START); zzskip(); - >> - -\* - << - NLA = 31; - zzskip(); - >> - -\n|\r|\r\n - << - NLA = 32; - zzline++; zzskip(); DAWDLE; - >> - -~[\n\r\*]+ - << - NLA = 33; - zzskip(); - >> - - -%%ACTIONS - -@ - << - NLA = Eof; - >> - -\>\> - << - NLA = Action; - /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = ' '; - zzbegexpr[1] = ' '; - if ( zzbufovf ) { - err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); - } - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ - /* MR1 in DLG action */ - /* MR1 Doesn't matter what kind of action it is - reset*/ - - tokenActionActive=0; /* MR1 */ - >> - -\>\>? - << - NLA = Pred; - /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = '\0'; - if ( zzbufovf ) { - err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE)); - }; -#ifdef __cplusplus__ - /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -#ifdef __STDC__ - /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -#ifdef __USE_PROTOS - /* MRxx */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else - /* MR10 */ list_apply(CurActionLabels,mark_label_used_in_sem_pred); -#endif -#endif -#endif - >> - -\] - << - NLA = PassAction; - if ( topint() == ']' ) { - popint(); - if ( istackempty() ) /* terminate action */ - { - zzmode(START); - NLATEXT[0] = ' '; - zzbegexpr[0] = ' '; - if ( zzbufovf ) { - err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - else { - /* terminate $[..] and #[..] */ - if ( GenCC ) zzreplstr("))"); - else zzreplstr(")"); - zzmore(); - } - } - else if ( topint() == '|' ) { /* end of simple [...] */ - popint(); - zzmore(); - } - else zzmore(); - >> - -consumeUntil\( [\ \t]* \{~[\}]+\} [\ \t]* \) - << - NLA = 37; - - zzmore(); - zzreplstr(inline_set(zzbegexpr+ - strlen("consumeUntil("))); - >> - -consumeUntil\( ~[\)]+ \) - << - NLA = 38; - zzmore(); - >> - -\n|\r|\r\n - << - NLA = 39; - zzline++; zzmore(); DAWDLE; - >> - -\> - << - NLA = 40; - zzmore(); - >> - -$ - << - NLA = 41; - zzmore(); - >> - -$$ - << - NLA = 42; - if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();} - else err("$$ use invalid in C++ mode"); - >> - -$\[\] - << - NLA = 43; - if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();} - else err("$[] use invalid in C++ mode"); - >> - -$\[ - << - NLA = 44; - - pushint(']'); - if ( !GenCC ) zzreplstr("zzconstr_attr("); - else err("$[..] use invalid in C++ mode"); - zzmore(); - >> - -$[0-9]+ - << - NLA = 45; - { - static char buf[100]; - numericActionLabel=1; /* MR10 */ - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("$i attrib ref too big"); - set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)", - BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s", - BlkLevel-1,zzbegexpr+1); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - >> - -$[0-9]+. - << - NLA = 46; - { - static char buf[100]; - numericActionLabel=1; /* MR10 */ - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("$i.field attrib ref too big"); - zzbegexpr[strlen(zzbegexpr)-1] = ' '; - set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).", - BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s.", - BlkLevel-1,zzbegexpr+1); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - >> - -$[0-9]+.[0-9]+ - << - NLA = 47; - { - static char buf[100]; - static char i[20], j[20]; - char *p,*q; - numericActionLabel=1; /* MR10 */ - if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big"); - for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) { - if ( q == &i[20] ) - fatalFL("i of $i.j attrib ref too big", - FileStr[CurFile], zzline ); - *q++ = *p; - } - *q = '\0'; - for (p++, q= &j[0]; *p!='\0'; p++) { - if ( q == &j[20] ) - fatalFL("j of $i.j attrib ref too big", - FileStr[CurFile], zzline ); - *q++ = *p; - } - *q = '\0'; - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j); - else sprintf(buf,"_t%s%s",i,j); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - >> - -$[_a-zA-Z][_a-zA-Z0-9]* - << - NLA = 48; - { static char buf[300]; LabelEntry *el; - zzbegexpr[0] = ' '; - if ( CurRule != NULL && - strcmp(CurRule, &zzbegexpr[1])==0 ) { - if ( !GenCC ) zzreplstr("zzaRet"); - } - else if ( CurRetDef != NULL && - strmember(CurRetDef, &zzbegexpr[1])) { - if ( hasMultipleOperands( CurRetDef ) ) { - require (strlen(zzbegexpr)<=(size_t)285, - "$retval attrib ref too big"); - sprintf(buf,"_retv.%s",&zzbegexpr[1]); - zzreplstr(buf); - } - else zzreplstr("_retv"); - } - else if ( CurParmDef != NULL && - strmember(CurParmDef, &zzbegexpr[1])) { - ; - } - else if ( Elabel==NULL ) { - { err("$-variables in actions outside of rules are not allowed"); } - } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) { - /* MR10 */ - /* MR10 */ /* element labels might exist without an elem when */ - /* MR10 */ /* it is a forward reference (to a rule) */ - /* MR10 */ - /* MR10 */ if ( GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) ) - /* MR10 */ { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); } - /* MR10 */ - /* MR10 */ if ( !GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) && GenAST) { - /* MR10 */ err("You can no longer use attributes returned by rules when also using ASTs"); - /* MR10 */ err(" Use upward inheritance (\"rule >[Attrib a] : ... <<$a=...\>\>\")"); - /* MR10 */ }; - /* MR10 */ - /* MR10 */ /* keep track of <<... $label ...>> for semantic predicates in guess mode */ - /* MR10 */ /* element labels contain pointer to the owners node */ - /* MR10 */ - /* MR10 */ if (el->elem != NULL && el->elem->ntype == nToken) { - /* MR10 */ list_add(&CurActionLabels,el); - /* MR10 */ }; -} -else -warn(eMsg1("$%s not parameter, return value, (defined) element label",&zzbegexpr[1])); -} -zzmore(); - >> - -#0 - << - NLA = 49; - zzreplstr("(*_root)"); zzmore(); chkGTFlag(); - >> - -#\[\] - << - NLA = 50; - if ( GenCC ) { - if (NewAST) zzreplstr("(newAST)"); - else zzreplstr("(new AST)");} - else {zzreplstr("zzastnew()");} zzmore(); - chkGTFlag(); - >> - -#\(\) - << - NLA = 51; - zzreplstr("NULL"); zzmore(); chkGTFlag(); - >> - -#[0-9]+ - << - NLA = 52; - { - static char buf[100]; - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("#i AST ref too big"); - if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"zzastArg(%s)",zzbegexpr+1); - zzreplstr(buf); - zzmore(); - set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions); - chkGTFlag(); - } - >> - -#line[\ \t]* [0-9]+ {[\ \t]* \"~[\"]+\" ([\ \t]* [0-9]*)* } (\n|\r|\r\n) - << - NLA = 53; - - zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore(); - getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr); - >> - -#line ~[\n\r]* (\n|\r|\r\n) - << - NLA = 54; - - zzline++; zzmore(); - >> - -#[_a-zA-Z][_a-zA-Z0-9]* - << - NLA = 55; - - if ( !(strcmp(zzbegexpr, "#ifdef")==0 || - strcmp(zzbegexpr, "#if")==0 || - strcmp(zzbegexpr, "#else")==0 || - strcmp(zzbegexpr, "#endif")==0 || - strcmp(zzbegexpr, "#ifndef")==0 || - strcmp(zzbegexpr, "#define")==0 || - strcmp(zzbegexpr, "#pragma")==0 || - strcmp(zzbegexpr, "#undef")==0 || - strcmp(zzbegexpr, "#import")==0 || - strcmp(zzbegexpr, "#line")==0 || - strcmp(zzbegexpr, "#include")==0 || - strcmp(zzbegexpr, "#error")==0) ) - { - static char buf[100]; - sprintf(buf, "%s_ast", zzbegexpr+1); - /* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1)); - zzreplstr(buf); - chkGTFlag(); - } - zzmore(); - >> - -#\[ - << - NLA = 56; - - pushint(']'); - if ( GenCC ) { - if (NewAST) zzreplstr("(newAST("); - else zzreplstr("(new AST("); } - else zzreplstr("zzmk_ast(zzastnew(),"); - zzmore(); - chkGTFlag(); - >> - -#\( - << - NLA = 57; - - pushint('}'); - if ( GenCC ) { - if (tmakeInParser) { - zzreplstr("tmake("); - } - else { - zzreplstr("ASTBase::tmake("); - } - } - else { - zzreplstr("zztmake("); - } - zzmore(); - chkGTFlag(); - >> - -# - << - NLA = 58; - zzmore(); - >> - -\) - << - NLA = 59; - - if ( istackempty() ) - zzmore(); - else if ( topint()==')' ) { - popint(); - } - else if ( topint()=='}' ) { - popint(); - /* terminate #(..) */ - zzreplstr(", NULL)"); - } - zzmore(); - >> - -\[ - << - NLA = 60; - - pushint('|'); /* look for '|' to terminate simple [...] */ - zzmore(); - >> - -\( - << - NLA = 61; - - pushint(')'); - zzmore(); - >> - -\\\] - << - NLA = 62; - zzreplstr("]"); zzmore(); - >> - -\\\) - << - NLA = 63; - zzreplstr(")"); zzmore(); - >> - -\\> - << - NLA = 64; - if (! tokenActionActive) zzreplstr(">"); /* MR1 */ - zzmore(); /* MR1 */ - >> - -' - << - NLA = 65; - zzmode(ACTION_CHARS); zzmore(); - >> - -\" - << - NLA = 66; - zzmode(ACTION_STRINGS); zzmore(); - >> - -\\$ - << - NLA = 67; - zzreplstr("$"); zzmore(); - >> - -\\# - << - NLA = 68; - zzreplstr("#"); zzmore(); - >> - -\\(\n|\r|\r\n) - << - NLA = 69; - zzline++; zzmore(); - >> - -\\~[\]\)>$#] - << - NLA = 70; - zzmore(); - >> - -/ - << - NLA = 71; - zzmore(); - >> - -/\* - << - NLA = 72; - zzmode(ACTION_COMMENTS); zzmore(); - >> - -\*/ - << - NLA = 73; - warn("Missing /*; found dangling */ in action"); zzmore(); - >> - -// - << - NLA = 74; - zzmode(ACTION_CPP_COMMENTS); zzmore(); - >> - -~[\n\r\)\(\\$#\>\]\[\"'/]+ - << - NLA = 75; - zzmore(); - >> - - -%%PARSE_ENUM_FILE - -@ - << - NLA = Eof; - ; - >> - -[\t\ ]+ - << - NLA = 137; - zzskip(); - >> - -\n|\r|\r\n - << - NLA = 138; - zzline++; zzskip(); - >> - -// - << - NLA = 139; - zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); - >> - -/\* - << - NLA = 140; - zzmode(TOK_DEF_COMMENTS); zzskip(); - >> - -#ifdef - << - NLA = 141; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#if - << - NLA = 142; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#ifndef - << - NLA = 143; - ; - >> - -#else - << - NLA = 144; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#endif - << - NLA = 145; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#undef - << - NLA = 146; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#import - << - NLA = 147; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#define - << - NLA = 149; - >> - -enum - << - NLA = 151; - >> - -\{ - << - NLA = 152; - >> - -= - << - NLA = 153; - >> - -, - << - NLA = 154; - >> - -\} - << - NLA = 155; - >> - -; - << - NLA = 156; - >> - -[0-9]+ - << - NLA = INT; - >> - -[a-zA-Z_][_a-zA-Z0-9]* - << - NLA = ID; - >> - -%% diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/pred.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/pred.c deleted file mode 100644 index 66c64340d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/pred.c +++ /dev/null @@ -1,821 +0,0 @@ -/* - * pred.c -- source for predicate detection, manipulation - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "pcctscfg.h" -#include "set.h" -#include "syn.h" -#include "hash.h" -#include "generic.h" -#include "dlgdef.h" -#include - -#ifdef __USE_PROTOS -static void complete_context_sets(RuleRefNode *, Predicate *); -static void complete_context_trees(RuleRefNode *, Predicate *); -#else -static void complete_context_sets(); -static void complete_context_trees(); -#endif - -char *PRED_AND_LIST = "AND"; -char *PRED_OR_LIST = "OR"; - -/* - * In C mode, return the largest constant integer found as the - * sole argument to LATEXT(i). - * - * In C++ mode, return the largest constant integer found as the - * sole argument to LT(i) given that the char before is nonalpha. - */ - -int -#ifdef __USE_PROTOS -predicateLookaheadDepth(ActionNode *a) -#else -predicateLookaheadDepth(a) -ActionNode *a; -#endif -{ - int max_k=0; - - if (a->predEntry != NULL) { - MR_pred_depth(a->predEntry->pred,&max_k); - goto PREDENTRY_EXIT; - } - - if ( GenCC ) - { - /* scan for LT(i) */ - int k = 0; - char *p = a->action; - while ( p!=NULL ) - { - p = strstr(p, "LT("); - if ( p!=NULL ) - { - if ( p>=a->action && !isalpha(*(p-1)) ) - { - k = atoi(p+strlen("LT(")); - if ( k>max_k ) max_k=k; - } - p += strlen("LT("); - } - } - } - else { - /* scan for LATEXT(i) */ - int k = 0; - char *p = a->action; - while ( p!=NULL ) - { - p = strstr(p, "LATEXT("); - if ( p!=NULL ) - { - p += strlen("LATEXT("); - k = atoi(p); - if ( k>max_k ) max_k=k; - } - } - } - - if (max_k==0) { - max_k = 1; /* MR33 Badly designed if didn't set max_k when CLL_k = 1 */ - if (CLL_k > 1) /* MR27 Don't warn if max(k,ck) == 1 */ - { - if ( !a->frmwarned ) - { - a->frmwarned = 1; - warnFL(eMsg1("predicate: %s missing, bad, or with i=0; assuming i=1", - GenCC?"LT(i)":"LATEXT(i)"), - FileStr[a->file], a->line); - } - } - } - -/* MR10 */ if ( max_k > CLL_k) { -/* MR10 */ if ( !a->frmwarned ) -/* MR10 */ { -/* MR10 */ a->frmwarned = 1; -/* MR11 */ errFL(eMsgd2("predicate refers to lookahead token %d. Semantic lookahead is limited to max(k,ck)==%d", -/* MR10 */ max_k,CLL_k), -/* MR10 */ FileStr[a->file],a->line); -/* MR10 */ if (max_k >= OutputLL_k) { -/* MR10 */ if (!GenCC) { -/* MR10 */ errFL(eMsgd(" the lookahead buffer size in C mode is %d token(s) (including the one just recognized)", -/* MR10 */ OutputLL_k), -/* MR10 */ FileStr[a->file],a->line); -/* MR10 */ }; -/* MR10 */ }; -/* MR10 */ }; -/* MR10 */ max_k= CLL_k; -/* MR10 */ }; - -PREDENTRY_EXIT: - return max_k; -} - -/* Find all predicates in a block of alternatives. DO NOT find predicates - * behind the block because that predicate could depend on things set in - * one of the nonoptional blocks - */ - -Predicate * -#ifdef __USE_PROTOS -find_in_aSubBlk( Junction *alt ) -#else -find_in_aSubBlk( alt ) -Junction *alt; -#endif -{ - Predicate *a, *head=NULL, *tail=NULL, *root=NULL; - Junction *p = alt; - - if (MRhoisting) { - return MR_find_in_aSubBlk(alt); - }; - for (; p!=NULL; p=(Junction *)p->p2) - { - /* ignore empty alts */ - if ( p->p1->ntype != nJunction || - ((Junction *)p->p1)->jtype != EndBlk ) - { - a = find_predicates(p->p1); /* get preds for this alt */ - if ( a==NULL ) continue; - - /* make an OR list of predicates */ - if ( head==NULL ) - { - root = new_pred(); - root->expr = PRED_OR_LIST; - head = tail = a; - root->down = head; - } - else { - tail->right = a; - a->left = tail; - a->up = tail->up; - tail = a; - } - } - } - - /* if just one pred, remove OR root */ - if ( root!=NULL && root->down->right == NULL ) - { - Predicate *d = root->down; - free( (char *) root); - return d; - } - - return root; -} - -Predicate * -#ifdef __USE_PROTOS -find_in_aOptBlk( Junction *alt ) -#else -find_in_aOptBlk( alt ) -Junction *alt; -#endif -{ - return find_in_aSubBlk( alt ); -} - -Predicate * -#ifdef __USE_PROTOS -find_in_aLoopBegin( Junction *alt ) -#else -find_in_aLoopBegin( alt ) -Junction *alt; -#endif -{ - return find_in_aSubBlk( (Junction *) alt->p1 ); /* get preds in alts */ -} - -Predicate * -#ifdef __USE_PROTOS -find_in_aPlusBlk( Junction *alt ) -#else -find_in_aPlusBlk( alt ) -Junction *alt; -#endif -{ - require(alt!=NULL&&alt->p2!=NULL, "invalid aPlusBlk"); - return find_in_aSubBlk( alt ); -} - -/* Look for a predicate; - * - * Do not pass anything but Junction nodes; no Actions, Tokens, RuleRefs. - * This means that a "hoisting distance" of zero is the only distance - * allowable. Init actions are ignored. - * - * WARNING: - * Assumes no (..)? block after predicate for the moment. - * Does not check to see if pred is in production that can generate - * a sequence contained in the set of ambiguous tuples. - * - * Return the predicate found if any. - */ - - -Predicate * -#ifdef __USE_PROTOS -find_predicates( Node *alt ) -#else -find_predicates( alt ) -Node *alt; -#endif -{ -#ifdef DBG_PRED - Junction *j; - RuleRefNode *r; - TokNode *t; -#endif - Predicate *pred; - - if ( alt==NULL ) return NULL; - -#ifdef DBG_PRED - switch ( alt->ntype ) - { - case nJunction : - j = (Junction *) alt; - fprintf(stderr, "Junction(in %s)", j->rname); - switch ( j->jtype ) - { - case aSubBlk : - fprintf(stderr,"aSubBlk\n"); - break; - case aOptBlk : - fprintf(stderr,"aOptBlk\n"); - break; - case aLoopBegin : - fprintf(stderr,"aLoopBeginBlk\n"); - break; - case aLoopBlk : - fprintf(stderr,"aLoopBlk\n"); - break; - case aPlusBlk : - fprintf(stderr,"aPlusBlk\n"); - break; - case EndBlk : - fprintf(stderr,"EndBlk\n"); - break; - case RuleBlk : - fprintf(stderr,"RuleBlk\n"); - break; - case Generic : - fprintf(stderr,"Generic\n"); - break; - case EndRule : - fprintf(stderr,"EndRule\n"); - break; - } - break; - case nRuleRef : - r = (RuleRefNode *) alt; - fprintf(stderr, "RuleRef(in %s)\n", r->rname); - break; - case nToken : - t = (TokNode *) alt; - fprintf(stderr, "TokenNode(in %s)%s\n", t->rname, TokenString(t->token)); - break; - case nAction : - fprintf(stderr, "Action\n"); - break; - } -#endif - - switch ( alt->ntype ) - { - case nJunction : - { - Predicate *a, *b; - Junction *p = (Junction *) alt; - - /* lock nodes */ - if ( p->jtype==aLoopBlk || p->jtype==RuleBlk || - p->jtype==aPlusBlk || p->jtype==EndRule ) - { - require(p->pred_lock!=NULL, "rJunc: lock array is NULL"); - if ( p->pred_lock[1] ) - { - return NULL; - } - p->pred_lock[1] = TRUE; - } - - switch ( p->jtype ) - { - case aSubBlk : - a = find_in_aSubBlk(p); - return a; /* nothing is visible past this guy */ - case aOptBlk : - a = find_in_aOptBlk(p); - return a; - case aLoopBegin : - a = find_in_aLoopBegin(p); - return a; - case aLoopBlk : - a = find_in_aSubBlk(p); - p->pred_lock[1] = FALSE; - return a; - case aPlusBlk : - a = find_in_aPlusBlk(p); - p->pred_lock[1] = FALSE; - return a; /* nothing is visible past this guy */ - case RuleBlk : - a = find_predicates(p->p1); - p->pred_lock[1] = FALSE; - return a; - case Generic : - a = find_predicates(p->p1); - b = find_predicates(p->p2); - if ( p->pred_lock!=NULL ) p->pred_lock[1] = FALSE; - if ( a==NULL ) return b; - if ( b==NULL ) return a; - /* otherwise OR the two preds together */ - { - fatal_internal("hit unknown situation during predicate hoisting"); - } - case EndBlk : - case EndRule : /* Find no predicates after a rule ref */ - return NULL; - default: - fatal_internal("this cannot be printed\n"); - break; - } - } - case nAction : - { - ActionNode *p = (ActionNode *) alt; - if ( p->noHoist) return NULL; /* MR12c */ - if ( p->init_action ) return find_predicates(p->next); - if ( p->is_predicate ) - { - Tree *t=NULL; -#ifdef DBG_PRED - fprintf(stderr, "predicate: <<%s>>?\n", p->action); -#endif - if ( p->guardpred!=NULL ) - { - pred = predicate_dup(p->guardpred); - MR_guardPred_plainSet(p,pred); /* MR12c */ - } - else - { - pred = new_pred(); - pred->k = predicateLookaheadDepth(p); - pred->source = p; - pred->expr = p->action; - if ( HoistPredicateContext && pred->k > 1 ) - { - /* MR30 No need to use first_item_is_guess_block_extra - since we know this is an action, not a (...)* or - (...)+ block. - */ - - if ( first_item_is_guess_block((Junction *)p->next) ) - { - warnFL("cannot compute context of predicate in front of (..)? block", - FileStr[p->file], p->line); - } - else - { - ConstrainSearch = 0; -/* MR11 */ if (p->ampersandPred != NULL) { -/* MR11 */ TRAV(p, -/* MR11 */ pred->k, -/* MR11 */ &(pred->completionTree), t); -/* MR11 */ } else { - TRAV(p->next, - pred->k, - &(pred->completionTree), t); - }; - pred->tcontext = t; - MR_check_pred_too_long(pred,pred->completionTree); -#ifdef DBG_PRED - fprintf(stderr, "LL(%d) context:", pred->k); - preorder(t); - fprintf(stderr, "\n"); -#endif - } - } - else if ( HoistPredicateContext && pred->k == 1 ) - { - pred->scontext[1] = empty; - /* MR30 No need to use first_item_is_guess_block_extra - since we know this is an action. - */ - if ( first_item_is_guess_block((Junction *)p->next) ) - { - warnFL("cannot compute context of predicate in front of (..)? block", - FileStr[p->file], p->line); - } - else - { - REACH((Junction *)p->next, - 1, - &(pred->completionSet), - pred->scontext[1]); - MR_check_pred_too_long(pred,pred->completionSet); -#ifdef DBG_PRED - fprintf(stderr, "LL(1) context:"); - s_fprT(stderr, pred->scontext[1]); - fprintf(stderr, "\n"); -#endif - } - } - } - { - Predicate *d = find_predicates(p->next); - Predicate *root; - -/* Warning: Doesn't seem like the up pointers will all be set correctly; - * TJP: that's ok, we're not using them now. - */ - if ( d!=NULL ) - { - root = new_pred(); - root->expr = PRED_AND_LIST; - root->down = pred; - pred->right = d; - pred->up = root; - d->left = pred; - d->up = pred->up; - return root; - } - } - return pred; - } - return NULL; - } - case nRuleRef : - { - Predicate *a; - RuleRefNode *p = (RuleRefNode *) alt; - Junction *r; - Junction *save_MR_RuleBlkWithHalt; - - RuleEntry *q = (RuleEntry *) hash_get(Rname, p->text); - if ( q == NULL ) - { - warnFL( eMsg1("rule %s not defined",p->text), FileStr[p->file], p->line ); - return NULL; - } - r = RulePtr[q->rulenum]; - if ( r->pred_lock[1] ) - { - /* infinite left-recursion; ignore 'cause LL sup 1 (k) analysis - * must have seen it earlier. - */ - return NULL; - } - - /* MR10 There should only be one halt set at a time. */ - /* MR10 Life would have been easier with a global variable */ - /* MR10 (at least for this particular need) */ - /* MR10 Unset the old one and set the new one, later undo. */ - - require(r->end->halt == FALSE,"should only have one halt at a time"); - -/* MR10 */ require(MR_RuleBlkWithHalt == NULL || -/* MR10 */ (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == TRUE), -/* MR10 */ "RuleBlkWithHalt->end not RuleBlk or does not have halt set"); -/* MR10 */ if (MR_RuleBlkWithHalt != NULL) { -/* MR10 */ MR_RuleBlkWithHalt->end->halt=FALSE; -/* MR10 */ }; - -/*** fprintf(stderr,"\nSetting halt on junction #%d\n",r->end->seq); ***/ - - require(r->end->halt == FALSE,"rule->end->halt already set"); - - save_MR_RuleBlkWithHalt=MR_RuleBlkWithHalt; - -/* MR10 */ MR_pointerStackPush(&MR_RuleBlkWithHaltStack,MR_RuleBlkWithHalt); -/* MR10 */ MR_pointerStackPush(&MR_PredRuleRefStack,p); - - r->end->halt = TRUE; -/* MR10 */ MR_RuleBlkWithHalt=r; - - a = find_predicates((Node *)r); - - require(r->end->halt == TRUE,"rule->end->halt not set"); - r->end->halt = FALSE; - -/* MR10 */ MR_pointerStackPop(&MR_PredRuleRefStack); -/* MR10 */ MR_RuleBlkWithHalt=(Junction *) MR_pointerStackPop(&MR_RuleBlkWithHaltStack); - - require (MR_RuleBlkWithHalt==save_MR_RuleBlkWithHalt, - "RuleBlkWithHaltStack not consistent"); - -/* MR10 */ require(MR_RuleBlkWithHalt == NULL || -/* MR10 */ (MR_RuleBlkWithHalt->jtype == RuleBlk && MR_RuleBlkWithHalt->end->halt == FALSE), -/* MR10 */ "RuleBlkWithHalt->end not RuleBlk or has no halt set"); -/* MR10 */ if (MR_RuleBlkWithHalt != NULL) { -/* MR10 */ MR_RuleBlkWithHalt->end->halt=TRUE; -/* MR10 */ }; - -/*** fprintf(stderr,"\nRestoring halt on junction #%d\n",r->end->seq); ***/ - - if ( a==NULL ) return NULL; - - /* attempt to compute the "local" FOLLOW just like in normal lookahead - * computation if needed - */ - - complete_context_sets(p,a); - complete_context_trees(p,a); - -/* MR10 */ MR_cleanup_pred_trees(a); - - return a; - } - case nToken : - break; - } - - return NULL; -} - -#ifdef __USE_PROTOS -Predicate *MR_find_predicates_and_supp(Node *alt) -#else -Predicate *MR_find_predicates_and_supp(alt) - Node *alt; -#endif -{ - Predicate *p; - - p=find_predicates(alt); - p=MR_suppressK(alt,p); - return p; -} - -Predicate * -#ifdef __USE_PROTOS -new_pred( void ) -#else -new_pred( ) -#endif -{ - Predicate *p = (Predicate *) calloc(1,sizeof(Predicate)); /* MR10 */ - require(p!=NULL, "new_pred: cannot alloc predicate"); - p->scontext[0]=empty; - p->scontext[1]=empty; - p->completionTree=empty; - p->completionSet=empty; - p->plainSet=empty; - return p; -} - -static void -#ifdef __USE_PROTOS -complete_context_sets( RuleRefNode *p, Predicate *a ) -#else -complete_context_sets( p, a ) -RuleRefNode *p; -Predicate *a; -#endif -{ - set rk2, b; - int k2; - -#ifdef DBG_PRED - fprintf(stderr, "enter complete_context_sets\n"); -#endif - for (; a!=NULL; a=a->right) - { - if ( a->expr == PRED_AND_LIST || a->expr == PRED_OR_LIST ) - { - complete_context_sets(p,a->down); - continue; - } - rk2 = b = empty; - while ( !set_nil(a->completionSet) ) - { - k2 = set_int(a->completionSet); - set_rm(k2, a->completionSet); - - REACH(p->next, k2, &rk2, b); - set_orin(&(a->scontext[1]), b); - set_free(b); - } - - set_orin(&(a->completionSet), rk2);/* remember what we couldn't do */ - set_free(rk2); -#ifdef DBG_PRED - fprintf(stderr, "LL(1) context for %s(addr 0x%x) after ruleref:", a->expr, a); - s_fprT(stderr, a->scontext[1]); - fprintf(stderr, "\n"); -#endif -/* complete_context_sets(p, a->down);*/ - } -#ifdef DBG_PRED - fprintf(stderr, "exit complete_context_sets\n"); -#endif -} - -static void -#ifdef __USE_PROTOS -complete_context_trees( RuleRefNode *p, Predicate *a ) -#else -complete_context_trees( p, a ) -RuleRefNode *p; -Predicate *a; -#endif -{ - set rk2; - int k2; - Tree *u; - -#ifdef DBG_PRED - fprintf(stderr, "enter complete_context_trees\n"); -#endif - for (; a!=NULL; a=a->right) - { - if ( a->expr == PRED_AND_LIST || a->expr == PRED_OR_LIST ) - { - complete_context_trees(p, a->down); - continue; - } - rk2 = empty; - - /* any k left to do? if so, link onto tree */ - while ( !set_nil(a->completionTree) ) - { - k2 = set_int(a->completionTree); - set_rm(k2, a->completionTree); - u = NULL; - - TRAV(p->next, k2, &rk2, u); - - /* any subtrees missing k2 tokens, add u onto end */ - a->tcontext = tlink(a->tcontext, u, k2); - Tfree(u); /* MR10 */ - } - set_orin(&(a->completionTree), rk2);/* remember what we couldn't do */ - set_free(rk2); -#ifdef DBG_PRED - fprintf(stderr, "LL(i<%d) context after ruleref:", LL_k); - preorder(a->tcontext); - fprintf(stderr, "\n"); -#endif -/* complete_context_trees(p, a->down);*/ - } -#ifdef DBG_PRED - fprintf(stderr, "exit complete_context_trees\n"); -#endif -} - -/* Walk a list of predicates and return the set of all tokens in scontext[1]'s */ -set -#ifdef __USE_PROTOS -covered_set( Predicate *p ) -#else -covered_set( p ) -Predicate *p; -#endif -{ - set a; - - a = empty; - for (; p!=NULL; p=p->right) - { - if ( p->expr == PRED_AND_LIST || p->expr == PRED_OR_LIST ) - { - set_orin(&a, covered_set(p->down)); - continue; - } - set_orin(&a, p->scontext[1]); - set_orin(&a, covered_set(p->down)); - } - return a; -} - -/* MR10 predicate_free() - MR10 Don't free the leaf nodes since they are part of the action node -*/ - -#ifdef __USE_PROTOS -void predicate_free(Predicate *p) -#else -void predicate_free(p) - Predicate *p; -#endif -{ - if (p == NULL) return; - predicate_free(p->right); - predicate_free(p->down); - if (p->cloned || - p->source == NULL || - p->source->guardpred == NULL || - p->expr == PRED_AND_LIST || - p->expr == PRED_OR_LIST) { - set_free(p->scontext[1]); - set_free(p->completionSet); - set_free(p->completionTree); - set_free(p->plainSet); - Tfree(p->tcontext); - free( (char *) p); - } else { - p->right=NULL; - p->down=NULL; /* MR13 *** debug */ - }; -} - -/* MR10 predicate_dup() */ - -#ifdef __USE_PROTOS -Predicate * predicate_dup_xxx(Predicate *p,int contextToo) -#else -Predicate * predicate_dup_xxx(p,contextToo) - Predicate *p; - int contextToo; -#endif -{ - Predicate *q; - - if (p == NULL) return NULL; - q=new_pred(); - q->down=predicate_dup(p->down); - q->right=predicate_dup(p->right); - - /* - don't replicate expr - it is read-only - and address comparison is used to look - for identical predicates. - */ - - q->expr=p->expr; - q->k=p->k; - q->source=p->source; - q->cloned=1; - q->ampersandStyle=p->ampersandStyle; - q->inverted=p->inverted; - q->predEntry=p->predEntry; - q->plainSet=set_dup(p->plainSet); - - if (contextToo) { - q->tcontext=tdup(p->tcontext); - q->scontext[0]=set_dup(p->scontext[0]); - q->scontext[1]=set_dup(p->scontext[1]); - q->completionTree=set_dup(p->completionTree); - q->completionSet=set_dup(p->completionSet); - }; - - /* don't need to dup "redundant" */ - - return q; - -} - -#ifdef __USE_PROTOS -Predicate * predicate_dup_without_context(Predicate *p) -#else -Predicate * predicate_dup_without_context(p) - Predicate *p; -#endif -{ - return predicate_dup_xxx(p,0); -} - -#ifdef __USE_PROTOS -Predicate * predicate_dup(Predicate *p) -#else -Predicate * predicate_dup(p) - Predicate *p; -#endif -{ - return predicate_dup_xxx(p,1); -} - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/proto.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/proto.h deleted file mode 100644 index 930b2decb..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/proto.h +++ /dev/null @@ -1,852 +0,0 @@ -/* - * proto.h -- function prototypes - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - - /* V a r i a b l e s */ - -extern int tp; -extern Junction *SynDiag; -extern char Version[]; -extern char VersionDef[]; -#ifdef __cplusplus -extern void (*fpPrint[])(...); -#else -extern void (*fpPrint[])(); -#endif -#ifdef __cplusplus -extern struct _set (*fpReach[])(...); -#else -extern struct _set (*fpReach[])(); -#endif -#ifdef __cplusplus -extern struct _tree *(*fpTraverse[])(...); -#else -extern struct _tree *(*fpTraverse[])(); -#endif -#ifdef __cplusplus -extern void (**fpTrans)(...); -#else -extern void (**fpTrans)(); -#endif -#ifdef __cplusplus -extern void (**fpJTrans)(...); -#else -extern void (**fpJTrans)(); -#endif -#ifdef __cplusplus -extern void (*C_Trans[NumNodeTypes+1])(...); -#else -extern void (*C_Trans[])(); -#endif -#ifdef __cplusplus -extern void (*C_JTrans[NumJuncTypes+1])(...); -#else -extern void (*C_JTrans[])(); -#endif -extern int BlkLevel; -extern int CurFile; -extern char *CurPredName; -extern char *CurRule; -extern int CurRuleDebug; /* MR13 */ -extern Junction *CurRuleBlk; -extern RuleEntry *CurRuleNode; -extern ListNode *CurElementLabels; -extern ListNode *CurAstLabelsInActions; /* MR27 */ -extern ListNode *ContextGuardPredicateList; /* MR13 */ -extern ListNode *CurActionLabels; -extern int numericActionLabel; /* MR10 << ... $1 ... >> or << ... $1 ... >>? */ -extern ListNode *NumericPredLabels; /* MR10 << ... $1 ... >>? ONLY */ -extern char *FileStr[]; -extern int NumFiles; -extern int EpToken; -extern int WildCardToken; -extern Entry **Tname, - **Texpr, - **Rname, - **Fcache, - **Tcache, - **Elabel, - **Sname, - **Pname; /* MR11 */ -extern ListNode *ExprOrder; -extern ListNode **Cycles; -extern int TokenNum; -extern int LastTokenCounted; -extern ListNode *BeforeActions, *AfterActions, *LexActions; - -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via #lexmember <<....>> & #lexprefix <<...>> */ -/* MR1 */ - -extern ListNode *LexMemberActions; /* MR1 */ -extern ListNode *LexPrefixActions; /* MR1 */ - -extern set *fset; /* for constrained search */ /* MR11 */ -extern int maxk; /* for constrained search */ /* MR11 */ -extern int Save_argc; /* MR10 */ -extern char **Save_argv; /* MR10 */ -extern ListNode *eclasses, *tclasses; -extern char *HdrAction; -extern char *FirstAction; /* MR11 */ -extern FILE *ErrFile; -extern char *RemapFileName; -extern char *ErrFileName; -extern char *DlgFileName; -extern char *DefFileName; -extern char *ModeFileName; -extern char *StdMsgName; -extern int NumRules; -extern Junction **RulePtr; -extern int LL_k; -extern int CLL_k; -extern char *decodeJType[]; -extern int PrintOut; -extern int PrintAnnotate; -extern int CodeGen; -extern int LexGen; -extern int esetnum; -extern int setnum; -extern int wordnum; -extern int GenAST; -extern int GenANSI; -extern int **FoStack; -extern int **FoTOS; -extern int GenExprSetsOpt; -extern FILE *DefFile; -extern int CannotContinue; -extern int GenCR; -extern int GenLineInfo; -extern int GenLineInfoMS; -extern int action_file, action_line; -extern int TraceGen; -extern int CurAmbigAlt1, CurAmbigAlt2, CurAmbigline, CurAmbigfile; -extern char *CurAmbigbtype; -extern int elevel; -extern int GenEClasseForRules; -extern FILE *input, *output; -extern char **TokenStr, **ExprStr; -extern int CurrentLexClass, NumLexClasses; -extern LClass lclass[]; -extern char LexStartSymbol[]; -extern char *CurRetDef; -extern char *CurParmDef; -extern int OutputLL_k; -extern int TreeResourceLimit; -extern int DemandLookahead; -extern char *RulePrefix; -extern int GenStdPccts; -extern char *stdpccts; -extern int ParseWithPredicates; -extern int ConstrainSearch; -extern int PURIFY; /* MR23 */ - -extern set MR_CompromisedRules; /* MR14 */ -extern int MR_AmbSourceSearch; /* MR11 */ -extern int MR_SuppressSearch; /* MR13 */ -extern int MR_AmbSourceSearchGroup; /* MR11 */ -extern int MR_AmbSourceSearchChoice; /* MR11 */ -extern int MR_AmbSourceSearchLimit; /* MR11 */ -extern int MR_usingPredNames; /* MR11 */ -extern int MR_ErrorSetComputationActive; /* MR14 */ -extern char *MR_AmbAidRule; /* MR11 */ -extern int MR_AmbAidLine; /* MR11 */ -extern int MR_AmbAidMultiple; /* MR11 */ -extern int MR_AmbAidDepth; /* MR11 */ -extern int MR_skipped_e3_report; /* MR11 */ -extern int MR_matched_AmbAidRule; /* MR11 */ -extern int MR_Inhibit_Tokens_h_Gen; /* MR13 */ -extern int NewAST; /* MR13 */ -extern int tmakeInParser; /* MR23 */ -extern int AlphaBetaTrace; /* MR14 */ -extern int MR_BlkErr; /* MR21 */ -extern int MR_AlphaBetaWarning; /* MR14 */ -extern int MR_AlphaBetaMessageCount; /* MR14 */ -extern int MR_MaintainBackTrace; /* MR14 */ -extern int MR_BadExprSets; /* MR13 */ -extern int FoundGuessBlk; -extern int FoundException; -extern int FoundAtOperator; /* MR6 */ -extern int FoundExceptionGroup; /* MR6 */ -extern int WarningLevel; -extern int UseStdout; /* MR6 */ -extern int TabWidth; /* MR6 */ -extern int pLevel; -extern int pAlt1; -extern int pAlt2; -extern int AImode; -extern int HoistPredicateContext; -extern int MRhoisting; /* MR9 */ -extern int MRhoistingk; /* MR13 */ -extern int MR_debugGenRule; /* MR11 */ -extern int GenCC; -extern char *ParserName; -extern char *StandardSymbols[]; -extern char *ASTSymbols[]; -extern set reserved_positions; -extern set all_tokens; -extern set imag_tokens; -extern set tokclasses; -extern ListNode *ForcedTokens; -extern int *TokenInd; -extern FILE *Parser_h, *Parser_c; -extern char CurrentClassName[]; -extern int no_classes_found; -extern char Parser_h_Name[]; -extern char Parser_c_Name[]; -extern char MRinfoFile_Name[]; /* MR10 */ -extern FILE *MRinfoFile; /* MR10 */ -extern int MRinfo; /* MR10 */ -extern int MRinfoSeq; /* MR10 */ -extern int InfoP; /* MR10 */ -extern int InfoT; /* MR10 */ -extern int InfoF; /* MR10 */ -extern int InfoM; /* MR10 */ -extern int InfoO; /* MR12 */ -extern int PotentialSuppression; /* MR10 */ -extern int PotentialDummy; /* MR10 */ -extern int TnodesInUse; /* MR10 */ -extern int TnodesPeak; /* MR10 */ -extern int TnodesReportThreshold; /* MR11 */ -extern int TnodesAllocated; /* MR10 */ -extern char *ClassDeclStuff; /* MR10 */ -extern char *BaseClassName; /* MR22 */ -extern ListNode *class_before_actions, *class_after_actions; -extern char *UserTokenDefsFile; -extern int UserDefdTokens; -extern ListNode *MetaTokenNodes; -extern char *OutputDirectory; -extern int DontCopyTokens; -extern int LTinTokenAction; /* MR23 */ -extern set AST_nodes_refd_in_actions; -extern ListNode *CurExGroups; -extern int CurBlockID; -extern int CurAltNum; -extern Junction *CurAltStart; -extern Junction *OuterAltStart; /* chain exception groups MR7 */ -extern ExceptionGroup *DefaultExGroup; -extern int NumSignals; -extern int ContextGuardTRAV; -extern Junction *MR_RuleBlkWithHalt; /* MR10 */ -extern PointerStack MR_BackTraceStack; /* MR10 */ -extern PointerStack MR_PredRuleRefStack; /* MR10 */ -extern PointerStack MR_RuleBlkWithHaltStack; /* MR10 */ - -/* */ -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ -/* MR1 in DLG action */ -/* */ -extern int tokenActionActive; /* MR1 */ - -extern char *PRED_OR_LIST; /* MR10 */ -extern char *PRED_AND_LIST; /* MR10 */ - -#ifdef __VMS -#define STRICMP strcasecmp /* MR21 */ -#else -#define STRICMP stricmp /* MR21 */ -#endif - -/* MR26 */ -#ifdef PCCTS_USE_STDARG -extern Tree *tmake(Tree *root, ...); -#else -extern Tree *tmake(); -#endif - -#ifdef __USE_PROTOS -extern int STRICMP(const char*, const char*); -extern void istackreset(void); -extern int istacksize(void); -extern void pushint(int); -extern int popint( void ); -extern int istackempty( void ); -extern int topint( void ); -extern void NewSetWd( void ); -extern void DumpSetWd( void ); -extern void DumpSetWdForC( void ); -extern void DumpSetWdForCC( void ); -extern void NewSet( void ); -extern void FillSet( set ); -extern void ComputeErrorSets( void ); -extern void ComputeTokSets( void ); -extern void SubstErrorClass( set * ); -extern int DefErrSet( set *, int, char * ); -extern int DefErrSetForC( set *, int, char * ); -extern int DefErrSetForCC( set *, int, char * ); -extern int DefErrSet1(int, set *, int, char *); /* MR21 */ -extern int DefErrSetForC1(int, set *, int, char *, const char* ); /* MR21 */ -extern int DefErrSetForCC1(int, set *, int, char *, const char* ); /* MR21 */ -extern int DefErrSetWithSuffix(int, set *, int, char *, const char *); /* MR21 */ -extern void GenErrHdr( void ); -extern void dumpExpr( FILE *, char * ); -extern void addParm( Node *, char * ); -extern Graph buildAction( char *, int, int, int ); -extern Graph buildToken( char * ); -extern Graph buildWildCard( char * ); -extern Graph buildRuleRef( char * ); -extern Graph Or( Graph, Graph ); -extern Graph Cat( Graph, Graph ); -extern Graph makeOpt( Graph, int, char *); -extern Graph makeBlk( Graph, int, char *); -extern Graph makeLoop( Graph, int, char *); -extern Graph makePlus( Graph, int, char *); -extern Graph emptyAlt( void ); -extern Graph emptyAlt3( void ); -extern TokNode * newTokNode( void ); -extern RuleRefNode * newRNode( void ); -extern Junction * newJunction( void ); -extern ActionNode * newActionNode( void ); -extern char * makelocks( void ); -extern void preorder( Tree * ); -extern Tree * tnode( int ); -extern void _Tfree( Tree * ); -extern Tree * tdup( Tree * ); -extern int is_single_tuple( Tree * ); -extern Tree * tappend( Tree *, Tree * ); -extern void Tfree( Tree * ); -extern Tree * tlink( Tree *, Tree *, int ); -extern Tree * tshrink( Tree * ); -extern Tree * tflatten( Tree * ); -extern Tree * tJunc( Junction *, int, set * ); -extern Tree * tRuleRef( RuleRefNode *, int, set * ); -extern Tree * tToken( TokNode *, int, set * ); -extern Tree * tAction( ActionNode *, int, set * ); -extern int tmember( Tree *, Tree * ); -extern int tmember_constrained( Tree *, Tree * ); -extern Tree * tleft_factor( Tree * ); -extern Tree * trm_perm( Tree *, Tree * ); -extern void tcvt( set *, Tree * ); -extern Tree * permute( int, int ); -extern Tree * VerifyAmbig( Junction *, Junction *, unsigned **, set *, Tree **, Tree **, int * ); -extern set rJunc( Junction *, int, set * ); -extern set rRuleRef( RuleRefNode *, int, set * ); -extern set rToken( TokNode *, int, set * ); -extern set rAction( ActionNode *, int, set * ); -extern void HandleAmbiguity( Junction *, Junction *, Junction *, int ); -extern set First( Junction *, int, int, int * ); -extern void freeBlkFsets( Junction * ); -extern void genAction( ActionNode * ); -extern void genRuleRef( RuleRefNode * ); -extern void genToken( TokNode * ); -extern void genOptBlk( Junction * ); -extern void genLoopBlk( Junction *, Junction *, Junction *, int ); -extern void genLoopBegin( Junction * ); -extern void genPlusBlk( Junction * ); -extern void genSubBlk( Junction * ); -extern void genRule( Junction * ); -extern void genJunction( Junction * ); -extern void genEndBlk( Junction * ); -extern void genEndRule( Junction * ); -extern void genHdr( int ); -extern void genHdr1( int ); -extern void dumpAction( char *, FILE *, int, int, int, int ); -extern void dumpActionPlus(ActionNode*, char *, FILE *, int, int, int, int ); /* MR21 */ -extern Entry ** newHashTable( void ); -extern Entry * hash_add( Entry **, char *, Entry * ); -extern Entry * hash_get( Entry **, char * ); -extern void hashStat( Entry ** ); -extern char * mystrdup( char * ); -extern void genLexDescr( void ); -extern void dumpLexClasses( FILE * ); -extern void genDefFile( void ); -extern void DumpListOfParmNames( char *, FILE *, int ); /* MR5 janm 26-May-97 */ -extern int DumpNextNameInDef( char **, FILE * ); -extern void DumpOldStyleParms( char *, FILE * ); -extern void DumpType( char *, FILE * ); -extern int strmember( char *, char * ); -/* extern int HasComma( char * ); MR23 Replaced by hasMultipleOperands() */ -extern void DumpRetValStruct( FILE *, char *, int ); -extern char * StripQuotes( char * ); -extern int main( int, char *[] ); -extern void readDescr( void ); -extern FILE * NextFile( void ); -extern char * outnameX( char *, char *); -extern char * outname( char * ); -extern void fatalFL( char *, char *, int ); -extern void fatal_intern( char *, char *, int ); -extern void cleanUp( void ); -extern char * eMsg3( char *, char *, char *, char * ); -extern char * eMsgd( char *, int ); -extern char * eMsgd2( char *, int, int ); -extern void s_fprT( FILE *, set ); -extern char * TerminalString( int ); -extern void lexclass( char * ); -extern void lexmode( int ); -extern int LexClassIndex( char * ); -extern int hasAction( char * ); -extern void setHasAction( char *, char * ); -extern int addTname( char * ); -extern int addTexpr( char * ); -extern int Tnum( char * ); -extern void Tklink( char *, char * ); -extern Entry * newEntry( char *, int ); -extern void list_add( ListNode **, void * ); -extern void list_free( ListNode **, int freeData ); /* MR10 */ -extern void list_apply( ListNode *, void (*)(void *) ); -extern int list_search_cstring (ListNode *, char *); /* MR27 */ -extern char * Fkey( char *, int, int ); -extern void FoPush( char *, int ); -extern void FoPop( int ); -extern void RegisterCycle( char *, int ); -extern void ResolveFoCycles( int ); -extern void pJunc( Junction * ); -extern void pRuleRef( RuleRefNode * ); -extern void pToken( TokNode * ); -extern void pAction( ActionNode * ); -extern void FoLink( Node * ); -extern void addFoLink( Node *, char *, Junction * ); -extern void GenCrossRef( Junction * ); -extern void defErr( char *, long, long, long, long, long, long ); -extern void genStdPCCTSIncludeFile(FILE *,char *); /* MR10 */ -extern char * pcctsBaseName(char *); /* MR32 */ -extern Predicate *find_predicates(Node *); /* MR10 */ -extern Predicate *MR_find_predicates_and_supp(Node *); /* MR13 */ -extern int predicateLookaheadDepth(ActionNode *); /* MR10 */ -extern void predicate_free(Predicate *); /* MR10 */ -extern Predicate * predicate_dup(Predicate *); /* MR10 */ -extern Predicate * predicate_dup_without_context(Predicate *); /* MR11 */ -extern void GenRulePrototypes(FILE *, Junction *); -extern Junction *first_item_is_guess_block(Junction *); -extern Junction *first_item_is_guess_block_extra(Junction * q); /* MR30 */ -extern Junction *analysis_point(Junction *); -extern Tree *make_tree_from_sets(set *, set *); -extern Tree *tdup_chain(Tree *); -extern Tree *tdif(Tree *, Predicate *, set *, set *); -extern set covered_set(Predicate *); -extern void AmbiguityDialog(Junction *, int, Junction *, Junction *, int *, int *); -extern void dumpAmbigMsg(set *, FILE *, int); -extern void GenRuleFuncRedefs(FILE *, Junction *); -extern void GenPredefinedSymbolRedefs(FILE *); -extern void GenASTSymbolRedefs(FILE *); -extern void GenRemapFile(void); -extern void GenSetRedefs(FILE *); -extern ForcedToken *newForcedToken(char *, int); -extern void RemapForcedTokens(void); -extern char *TokenOrExpr(int); -extern void setUpperRange(TokNode *, char *); -extern void GenParser_c_Hdr(void); -extern void GenParser_h_Hdr(void); -extern void GenRuleMemberDeclarationsForCC(FILE *, Junction *); -extern int addForcedTname( char *, int ); -extern char *OutMetaName(char *); -extern void OutFirstSetSymbol(Junction *q, char *); /* MR21 */ -extern void warnNoFL(char *err); -extern void warnFL(char *err,char *f,int l); -extern void warn(char *err); -extern void warnNoCR( char *err ); -extern void errNoFL(char *err); -extern void errFL(char *err,char *f,int l); -extern void err(char *err); -extern void errNoCR( char *err ); -extern void genPredTree( Predicate *p, Node *j, int ,int); -extern UserAction *newUserAction(char *); -extern char *gate_symbol(char *name); -extern char *makeAltID(int blockid, int altnum); -extern void DumpRemainingTokSets(void); -extern void DumpANSIFunctionArgDef(FILE *f, Junction *q, int bInit); /* MR23 */ -extern void DumpFormals(FILE *, char *, int bInit); /* MR23 */ -extern char* hideDefaultArgs(const char* pdecl); /* MR22 VHS */ -extern Predicate *computePredFromContextGuard(Graph,int *msgDone); /* MR21 */ -extern void recomputeContextGuard(Predicate *); /* MR13 */ -extern Predicate *new_pred(void); -extern void chkGTFlag(void); -extern void leAdd(LabelEntry *); /* MR7 */ -extern void leFixup(void); /* MR7 */ -extern void egAdd(ExceptionGroup *); /* MR7 */ -extern void egFixup(void); /* MR7 */ -extern void altAdd(Junction *); /* MR7 */ -extern void altFixup(void); /* MR7 */ -extern Predicate * MR_find_in_aSubBlk(Junction *alt); /* MR10 */ -extern Predicate * MR_predFlatten(Predicate *p); /* MR10 */ -extern Predicate * MR_predSimplifyALL(Predicate *p); /* MR10 */ -extern Predicate * MR_predSimplifyALLX(Predicate *p,int skipPass3); /* MR10 */ -extern int MR_allPredLeaves(Predicate *p); /* MR10 */ -extern void MR_cleanup_pred_trees(Predicate *p); /* MR10 */ -extern int MR_predicate_context_completed(Predicate *p); /* MR10 */ -extern void MR_check_pred_too_long(Predicate *p,set completion); /* MR10 */ -extern Tree * MR_remove_epsilon_from_tree(Tree *t); /* MR10 */ -extern Tree * MR_computeTreeAND(Tree *l,Tree *r); /* MR10 */ -extern int MR_tree_equ(Tree *big, Tree *small); /* MR10 */ -extern set MR_First(int ck,Junction *j,set *incomplete); /* MR10 */ -extern set MR_compute_pred_set(Predicate *p); /* MR10 */ -extern Tree * MR_compute_pred_tree_context(Predicate *p); /* MR10 */ -extern int MR_pointerStackPush(PointerStack *,void *); /* MR10 */ -extern void * MR_pointerStackPop(PointerStack *); /* MR10 */ -extern void * MR_pointerStackTop(PointerStack *); /* MR10 */ -extern void MR_pointerStackReset(PointerStack *); /* MR10 */ -extern void MR_backTraceReport(void); /* MR10 */ -extern void MR_alphaBetaTraceReport(void); /* MR14 */ -extern void MR_dumpRuleSet(set); /* MR14 */ -extern void MR_predContextPresent(Predicate *p,int *,int *); /* MR10 */ -extern void MR_dumpPred(Predicate *p,int withContext); /* MR10 */ -extern void MR_dumpPred1(int,Predicate *p,int withContext); /* MR10 */ -extern void MR_xxxIndent(FILE *f,int depth); /* MR11 */ -extern void MR_outputIndent(int depth); /* MR11 */ -extern void MR_stderrIndent(int depth); /* MR11 */ -extern Junction * MR_ruleReferenced(RuleRefNode *rrn); /* MR10 */ -extern Junction * MR_nameToRuleBlk(char *); /* MR10 */ -extern void MR_releaseResourcesUsedInRule(Node *); /* MR10 */ -extern void MR_dumpTreeX(int depth,Tree *t,int across); /* MR10 */ -extern void MR_dumpTreeF(FILE *f,int depth,Tree *t,int across); /* MR10 */ -extern void DumpFcache(void); /* MR10 */ -extern void MR_dumpTokenSet(FILE *f,int depth,set s); /* MR10 */ -extern void MR_traceAmbSource(set *,Junction *,Junction *); /* MR11 */ -extern void MR_traceAmbSourceK(Tree *,Junction *a1,Junction *a2); /* MR11 */ -extern void MR_traceAmbSourceKclient(void); /* MR20 */ -extern Node *MR_advance(Node *); /* MR11 */ -extern int MR_offsetFromRule(Node *); /* MR11 */ -extern char *MR_ruleNamePlusOffset(Node *); /* MR11 */ -extern int MR_max_height_of_tree(Tree *); /* MR11 */ -extern int MR_all_leaves_same_height(Tree *,int); /* MR11 */ -extern void MR_projectTreeOntoSet(Tree *t,int k,set *); /* MR11 */ -extern Tree *MR_make_tree_from_set(set); /* MR11 */ -extern Predicate *MR_removeRedundantPredPass3(Predicate *); /* MR11 */ -extern void MR_pred_depth(Predicate *,int *); /* MR11 */ -extern int MR_comparePredicates(Predicate *,Predicate *); /* MR11 */ -extern Predicate * MR_unfold(Predicate *); /* MR11 */ -extern void MR_simplifyInverted(Predicate *,int); /* MR11 */ -extern int MR_secondPredicateUnreachable /* MR11 */ - (Predicate *first,Predicate *second); /* MR11 */ -extern void MR_clearPredEntry(Predicate *); /* MR11 */ -extern void MR_orphanRules(FILE *); /* MR12 */ -extern void MR_merge_contexts(Tree *); /* MR12 */ -extern int ci_strequ(char *,char *); /* MR12 */ -extern void MR_guardPred_plainSet(ActionNode *anode,Predicate *); /* MR12c */ -extern void MR_suppressSearchReport(void); /* MR12c */ -extern Predicate * MR_suppressK(Node *,Predicate *); /* MR13 */ -extern void MR_backTraceDumpItem(FILE *,int skip,Node *n); /* MR13 */ -extern void MR_backTraceDumpItemReset(void); /* MR13 */ -extern Junction * MR_junctionWithoutP2(Junction *); /* MR13 */ -extern void MR_setConstrainPointer(set *); /* MR18 */ -extern void BlockPreambleOption(Junction *q, char * pSymbol); /* MR23 */ -extern char* getInitializer(char *); /* MR23 */ -extern char *endFormal(char *pStart, /* MR23 */ - char **ppDataType, /* MR23 */ - char **ppSymbol, /* MR23 */ - char **ppEqualSign, /* MR23 */ - char **ppValue, /* MR23 */ - char **ppSeparator, /* MR23 */ - int *pNext); /* MR23 */ -extern char *strBetween(char *pStart, /* MR23 */ - char *pNext, /* MR23 */ - char *pStop); /* MR23 */ -extern int hasMultipleOperands(char *); /* MR23 */ -extern void DumpInitializers(FILE*, RuleEntry*, char*); /* MR23 */ -extern int isTermEntryTokClass(TermEntry *); /* MR23 */ -extern int isEmptyAlt(Node *, Node *); /* MR23 */ -#else -extern int STRICMP(); -extern void istackreset(); -extern int istacksize(); -extern void pushint(); -extern int popint(); -extern int istackempty(); -extern int topint(); -extern void NewSetWd(); -extern void DumpSetWd(); -extern void DumpSetWdForC(); -extern void DumpSetWdForCC(); -extern void NewSet(); -extern void FillSet(); -extern void ComputeErrorSets(); -extern void ComputeTokSets(); -extern void SubstErrorClass(); -extern int DefErrSet(); -extern int DefErrSetForC(); -extern int DefErrSetForCC(); -extern int DefErrSet1(); -extern int DefErrSetForC1(); -extern int DefErrSetForCC1(); -extern int DefErrSetWithSuffix(); /* MR21 */ -extern void GenErrHdr(); -extern void dumpExpr(); -extern void addParm(); -extern Graph buildAction(); -extern Graph buildToken(); -extern Graph buildWildCard(); -extern Graph buildRuleRef(); -extern Graph Or(); -extern Graph Cat(); -extern Graph makeOpt(); -extern Graph makeBlk(); -extern Graph makeLoop(); -extern Graph makePlus(); -extern Graph emptyAlt(); -extern Graph emptyAlt3(); -extern TokNode * newTokNode(); -extern RuleRefNode * newRNode(); -extern Junction * newJunction(); -extern ActionNode * newActionNode(); -extern char * makelocks(); -extern void preorder(); -extern Tree * tnode(); -extern void _Tfree(); -extern Tree * tdup(); -extern int is_single_tuple(); -extern Tree * tappend(); -extern void Tfree(); -extern Tree * tlink(); -extern Tree * tshrink(); -extern Tree * tflatten(); -extern Tree * tJunc(); -extern Tree * tRuleRef(); -extern Tree * tToken(); -extern Tree * tAction(); -extern int tmember(); -extern int tmember_constrained(); -extern Tree * tleft_factor(); -extern Tree * trm_perm(); -extern void tcvt(); -extern Tree * permute(); -extern Tree * VerifyAmbig(); -extern set rJunc(); -extern set rRuleRef(); -extern set rToken(); -extern set rAction(); -extern void HandleAmbiguity(); -extern set First(); -extern void freeBlkFsets(); -extern void genAction(); -extern void genRuleRef(); -extern void genToken(); -extern void genOptBlk(); -extern void genLoopBlk(); -extern void genLoopBegin(); -extern void genPlusBlk(); -extern void genSubBlk(); -extern void genRule(); -extern void genJunction(); -extern void genEndBlk(); -extern void genEndRule(); -extern void genHdr(); -extern void genHdr1(); -extern void dumpAction(); -extern void dumpActionPlus(); /* MR21 */ -extern Entry ** newHashTable(); -extern Entry * hash_add(); -extern Entry * hash_get(); -extern void hashStat(); -extern char * mystrdup(); -extern void genLexDescr(); -extern void dumpLexClasses(); -extern void genDefFile(); -extern void DumpListOfParmNames(); /* MR5 janm 26-May-97 */ -extern int DumpNextNameInDef(); -extern void DumpOldStyleParms(); -extern void DumpType(); -extern int strmember(); -/* extern int HasComma(); MR23 Replaced by hasMultipleOperands() */ -extern void DumpRetValStruct(); -extern char * StripQuotes(); -extern int main(); -extern void readDescr(); -extern FILE * NextFile(); -extern char * outnameX(); -extern char * outname(); -extern void fatalFL(); -extern void fatal_intern(); -extern void cleanUp(); -extern char * eMsg3(); -extern char * eMsgd(); -extern char * eMsgd2(); -extern void s_fprT(); -extern char * TerminalString(); -extern void lexclass(); -extern void lexmode(); -extern int LexClassIndex(); -extern int hasAction(); -extern void setHasAction(); -extern int addTname(); -extern int addTexpr(); -extern int Tnum(); -extern void Tklink(); -extern Entry * newEntry(); -extern void list_add(); -extern void list_free(); /* MR10 */ -extern void list_apply(); -extern int list_search_cstring (); /* MR27 */ -extern char * Fkey(); -extern void FoPush(); -extern void FoPop(); -extern void RegisterCycle(); -extern void ResolveFoCycles(); -extern void pJunc(); -extern void pRuleRef(); -extern void pToken(); -extern void pAction(); -extern void FoLink(); -extern void addFoLink(); -extern void GenCrossRef(); -extern void defErr(); -extern void genStdPCCTSIncludeFile(); -extern char * pcctsBaseName(); /* MR32 */ -extern Predicate *find_predicates(); -extern Predicate *MR_find_predicates_and_supp(); /* MR13 */ -extern int predicateLookaheadDepth(); /* MR10 */ -extern void predicate_free(); /* MR10 */ -extern Predicate * predicate_dup(); /* MR10 */ -extern Predicate * predicate_dup_without_context(); /* MR11 */ -extern void GenRulePrototypes(); -extern Junction *first_item_is_guess_block(); -extern Junction *first_item_is_guess_block_extra(); /* MR30 */ -extern Junction *analysis_point(); -extern Tree *make_tree_from_sets(); -extern Tree *tdup_chain(); -extern Tree *tdif(); -extern set covered_set(); -extern void AmbiguityDialog(); -extern void dumpAmbigMsg(); -extern void GenRuleFuncRedefs(); -extern void GenPredefinedSymbolRedefs(); -extern void GenASTSymbolRedefs(); -extern void GenRemapFile(); -extern void GenSetRedefs(); -extern ForcedToken *newForcedToken(); -extern void RemapForcedTokens(); -extern char *TokenOrExpr(); -extern void setUpperRange(); -extern void GenParser_c_Hdr(); -extern void GenParser_h_Hdr(); -extern void GenRuleMemberDeclarationsForCC(); -extern int addForcedTname(); -extern char *OutMetaName(); -extern void OutFirstSetSymbol(); /* MR21 */ -extern void warnNoFL(); -extern void warnFL(); -extern void warn(); -extern void warnNoCR(); -extern void errNoFL(); -extern void errFL(); -extern void err(); -extern void errNoCR(); -extern void genPredTree(); -extern UserAction *newUserAction(); -extern char *gate_symbol(); -extern char *makeAltID(); -extern void DumpRemainingTokSets(); -extern void DumpANSIFunctionArgDef(); -extern void DumpFormals(); /* MR23 */ -extern char* hideDefaultArgs(); /* MR22 VHS */ -extern Predicate *computePredFromContextGuard(); -extern void recomputeContextGuard(); /* MR13 */ -extern Predicate *new_pred(); -extern void chkGTFlag(); -extern void leAdd(); /* MR7 */ -extern void leFixup(); /* MR7 */ -extern void egAdd(); /* MR7 */ -extern void egFixup(); /* MR7 */ -extern void altAdd(); /* MR7 */ -extern void altFixup(); /* MR7 */ -extern Predicate * MR_find_in_aSubBlk(); /* MR10 */ -extern Predicate * MR_predFlatten(); /* MR10 */ -extern Predicate * MR_predSimplifyALL(); /* MR10 */ -extern Predicate * MR_predSimplifyALLX(); /* MR10 */ -extern void MR_cleanup_pred_trees(); /* MR10 */ -extern int MR_allPredLeaves(); /* MR10 */ -extern int MR_predicate_context_completed(); /* MR10 */ -extern void MR_check_pred_too_long(); /* MR10 */ -extern Tree * MR_remove_epsilon_from_tree(); /* MR10 */ -extern Tree * MR_computeTreeAND(); /* MR10 */ -extern int MR_tree_equ(); /* MR10 */ -extern set MR_First(); /* MR10 */ -extern set MR_compute_pred_set(); /* MR10 */ -extern Tree * MR_compute_pred_tree_context(); /* MR10 */ -extern int MR_pointerStackPush(); /* MR10 */ -extern void * MR_pointerStackPop(); /* MR10 */ -extern void * MR_pointerStackTop(); /* MR10 */ -extern void MR_pointerStackReset(); /* MR10 */ -extern void MR_backTraceReport(); /* MR10 */ -extern void MR_alphaBetaTraceReport(); /* MR14 */ -extern void MR_dumpRuleSet(); /* MR14 */ -extern void MR_predContextPresent(); /* MR10 */ -extern void MR_dumpPred(); /* MR10 */ -extern void MR_dumpPred1(); /* MR10 */ -extern void MR_xxxIndent(); /* MR11 */ -extern void MR_stderrIndent(); /* MR11 */ -extern void MR_outputIndent(); /* MR11 */ -extern Junction * MR_ruleReferenced(); /* MR10 */ -extern void MR_releaseResourcesUsedInRule(); /* MR10 */ -extern void MR_dumpTreeX(); /* MR10 */ -extern void MR_dumpTreeF(); /* MR10 */ -extern void DumpFcache(); /* MR10 */ -extern void MR_dumpTokenSet(); /* MR10 */ -extern void MR_traceAmbSource(); /* MR11 */ -extern Node *MR_advance(); /* MR11 */ -extern int MR_offsetFromRule(); /* MR11 */ -extern char *MR_ruleNamePlusOffset(); /* MR11 */ -extern void MR_traceAmbSourceK(); /* MR11 */ -extern void MR_traceAmbSourceKclient(); /* [i_a] added */ -extern int MR_max_height_of_tree(); /* MR11 */ -extern int MR_all_leaves_same_height(); /* MR11 */ -extern void MR_projectTreeOntoSet(); /* MR11 */ -extern Tree *MR_make_tree_from_set(); /* MR11 */ -extern Predicate *MR_removeRedundantPredPass3(); /* MR11 */ -extern void MR_pred_depth(); /* MR11 */ -extern int MR_comparePredicates(); /* MR11 */ -extern Predicate * MR_unfold(); /* MR11 */ -extern void MR_simplifyInverted(); /* MR11 */ -extern int MR_secondPredicateUnreachable(); /* MR11 */ -extern Junction * MR_nameToRuleBlk(); /* MR10 */ -extern void MR_clearPredEntry(); /* MR11 */ -extern void MR_orphanRules(); /* MR12 */ -extern void MR_merge_contexts(); /* MR12 */ -extern int ci_strequ(); /* MR12 */ -extern void MR_guardPred_plainSet(); /* MR12c */ -extern void MR_suppressSearchReport(); /* MR12c */ -extern Predicate * MR_suppressK(); /* MR13 */ -extern void MR_backTraceDumpItem(); /* MR13 */ -extern void MR_backTraceDumpItemReset(); /* MR13 */ -extern Junction * MR_junctionWithoutP2(); /* MR13 */ -extern void MR_setConstrainPointer(); /* MR18 */ -extern void BlockPreambleOption(); /* MR23 */ -extern char* getInitializer(); /* MR23 */ -extern int hasMultipleOperands(); /* MR23 */ -extern char *endFormal(); /* MR23 */ -extern char *strBetween(); /* MR23 */ -extern void DumpInitializers(); /* MR23 */ -extern int isTermEntryTokClass(); /* MR23 */ -extern int isEmptyAlt(); - -#endif - -#ifdef __USE_PROTOS -#include -#endif - -/* MR20 G. Hobbelt Create proper externs for dlg variables */ - -extern set attribsRefdFromAction; -extern int inAlt; -extern int UsedOldStyleAttrib; -extern int UsedNewStyleLabel; - -#define MAX_BLK_LEVEL 100 /* MR23 */ -extern int CurBlockID_array[MAX_BLK_LEVEL]; /* MR23 */ -extern int CurAltNum_array[MAX_BLK_LEVEL]; /* MR23 */ diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/scan.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/scan.c deleted file mode 100644 index e0030dee1..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/scan.c +++ /dev/null @@ -1,5735 +0,0 @@ - -/* parser.dlg -- DLG Description of scanner - * - * Generated from: antlr.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include "pcctscfg.h" -#include "set.h" -#include -#include "syn.h" -#include "hash.h" -#include "generic.h" -#define zzcr_attr(attr,tok,t) -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -LOOKAHEAD - -void -#ifdef __USE_PROTOS -zzerraction() -#else -zzerraction() -#endif -{ - (*zzerr)("invalid token"); - zzadvance(); - zzskip(); -} -/* - * D L G tables - * - * Generated from: parser.dlg - * - * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz - * Purdue University Electrical Engineering - * DLG Version 1.33MR33 - */ - -#include "mode.h" - - - - -/* maintained, but not used for now */ -set AST_nodes_refd_in_actions = set_init; -int inAlt = 0; -set attribsRefdFromAction = set_init; /* MR20 */ -int UsedOldStyleAttrib = 0; -int UsedNewStyleLabel = 0; -#ifdef __USE_PROTOS -char *inline_set(char *); -#else -char *inline_set(); -#endif - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ -/* MR1 in DLG action */ - -int tokenActionActive=0; /* MR1 */ - - - - - -static char * -#ifdef __USE_PROTOS -getFileNameFromTheLineInfo(char *toStr, char *fromStr) -#else -getFileNameFromTheLineInfo(toStr, fromStr) -char *toStr, *fromStr; -#endif -{ - int i, j, k; - - if (!fromStr || !toStr) return toStr; - - /* find the first " */ - - for (i=0; - (ielem->ntype == nToken,"mark_label_used... ntype != nToken"); - tn=(TokNode *)le->elem; - require (tn->label != 0,"mark_label_used... TokNode has no label"); - tn->label_used_in_semantic_pred=1; -} - -static void act1() -{ - NLA = Eof; - /* L o o k F o r A n o t h e r F i l e */ - { - FILE *new_input; - new_input = NextFile(); - if ( new_input == NULL ) { NLA=Eof; return; } - fclose( input ); - input = new_input; - zzrdstream( input ); - zzskip(); /* Skip the Eof (@) char i.e continue */ - } - } - - -static void act2() -{ - NLA = 76; - zzskip(); - } - - -static void act3() -{ - NLA = 77; - zzline++; zzskip(); - } - - -static void act4() -{ - NLA = 78; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint(']'); - } - - -static void act5() -{ - NLA = 79; - action_file=CurFile; action_line=zzline; - zzmode(ACTIONS); zzmore(); - list_free(&CurActionLabels,0); /* MR10 */ - numericActionLabel=0; /* MR10 */ - istackreset(); - pushint('>'); - } - - -static void act6() -{ - NLA = 80; - zzmode(STRINGS); zzmore(); - } - - -static void act7() -{ - NLA = 81; - zzmode(COMMENTS); zzskip(); - } - - -static void act8() -{ - NLA = 82; - warn("Missing /*; found dangling */"); zzskip(); - } - - -static void act9() -{ - NLA = 83; - zzmode(CPP_COMMENTS); zzskip(); - } - - -static void act10() -{ - NLA = 84; - - zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore(); - getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr); - } - - -static void act11() -{ - NLA = 85; - - zzline++; zzmore(); - } - - -static void act12() -{ - NLA = 86; - warn("Missing <<; found dangling >>"); zzskip(); - } - - -static void act13() -{ - NLA = WildCard; - } - - -static void act14() -{ - NLA = 88; - FoundException = 1; /* MR6 */ - FoundAtOperator = 1; - } - - -static void act15() -{ - NLA = Pragma; - } - - -static void act16() -{ - NLA = FirstSetSymbol; - } - - -static void act17() -{ - NLA = 94; - } - - -static void act18() -{ - NLA = 95; - } - - -static void act19() -{ - NLA = 96; - } - - -static void act20() -{ - NLA = 97; - } - - -static void act21() -{ - NLA = 98; - } - - -static void act22() -{ - NLA = 99; - } - - -static void act23() -{ - NLA = 102; - } - - -static void act24() -{ - NLA = 103; - } - - -static void act25() -{ - NLA = 104; - } - - -static void act26() -{ - NLA = 105; - } - - -static void act27() -{ - NLA = 106; - } - - -static void act28() -{ - NLA = 107; - } - - -static void act29() -{ - NLA = 108; - } - - -static void act30() -{ - NLA = 109; - } - - -static void act31() -{ - NLA = 110; - } - - -static void act32() -{ - NLA = 111; - } - - -static void act33() -{ - NLA = 112; - } - - -static void act34() -{ - NLA = 113; - } - - -static void act35() -{ - NLA = 114; - } - - -static void act36() -{ - NLA = 115; - } - - -static void act37() -{ - NLA = 116; - } - - -static void act38() -{ - NLA = 117; - } - - -static void act39() -{ - NLA = 118; - } - - -static void act40() -{ - NLA = 119; - } - - -static void act41() -{ - NLA = 120; - } - - -static void act42() -{ - NLA = 121; - } - - -static void act43() -{ - NLA = 122; - } - - -static void act44() -{ - NLA = 123; - } - - -static void act45() -{ - NLA = 124; - } - - -static void act46() -{ - NLA = 125; - } - - -static void act47() -{ - NLA = 126; - } - - -static void act48() -{ - NLA = 127; - } - - -static void act49() -{ - NLA = 128; - } - - -static void act50() -{ - NLA = 129; - } - - -static void act51() -{ - NLA = 130; - } - - -static void act52() -{ - NLA = 131; - } - - -static void act53() -{ - NLA = 132; - } - - -static void act54() -{ - NLA = 133; - } - - -static void act55() -{ - NLA = 134; - } - - -static void act56() -{ - NLA = 135; - } - - -static void act57() -{ - NLA = NonTerminal; - - while ( zzchar==' ' || zzchar=='\t' ) { - zzadvance(); - } - if ( zzchar == ':' && inAlt ) NLA = LABEL; - } - - -static void act58() -{ - NLA = TokenTerm; - - while ( zzchar==' ' || zzchar=='\t' ) { - zzadvance(); - } - if ( zzchar == ':' && inAlt ) NLA = LABEL; - } - - -static void act59() -{ - NLA = 136; - warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip(); - } - -static unsigned char shift0[257] = { - 0, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 1, 2, 58, 58, 3, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 1, 40, 6, 9, 58, 58, 45, - 58, 46, 47, 8, 52, 58, 58, 18, 7, 16, - 14, 15, 16, 16, 16, 16, 16, 16, 16, 41, - 42, 5, 48, 17, 53, 19, 56, 56, 56, 56, - 56, 26, 56, 56, 56, 56, 56, 51, 56, 56, - 56, 56, 56, 56, 29, 56, 56, 56, 56, 56, - 56, 56, 4, 20, 58, 50, 57, 58, 23, 31, - 38, 34, 13, 35, 24, 33, 11, 55, 36, 10, - 25, 12, 32, 21, 55, 22, 27, 28, 54, 55, - 55, 43, 30, 55, 39, 44, 37, 49, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58 -}; - - -static void act60() -{ - NLA = Eof; - } - - -static void act61() -{ - NLA = QuotedTerm; - zzmode(START); - } - - -static void act62() -{ - NLA = 3; - - zzline++; - warn("eoln found in string"); - zzskip(); - } - - -static void act63() -{ - NLA = 4; - zzline++; zzmore(); - } - - -static void act64() -{ - NLA = 5; - zzmore(); - } - - -static void act65() -{ - NLA = 6; - zzmore(); - } - -static unsigned char shift1[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 2, 5, 5, 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act66() -{ - NLA = Eof; - } - - -static void act67() -{ - NLA = 7; - zzmode(ACTIONS); zzmore(); - } - - -static void act68() -{ - NLA = 8; - - zzline++; - warn("eoln found in string (in user action)"); - zzskip(); - } - - -static void act69() -{ - NLA = 9; - zzline++; zzmore(); - } - - -static void act70() -{ - NLA = 10; - zzmore(); - } - - -static void act71() -{ - NLA = 11; - zzmore(); - } - -static unsigned char shift2[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 2, 5, 5, 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act72() -{ - NLA = Eof; - } - - -static void act73() -{ - NLA = 12; - zzmode(ACTIONS); zzmore(); - } - - -static void act74() -{ - NLA = 13; - - zzline++; - warn("eoln found in char literal (in user action)"); - zzskip(); - } - - -static void act75() -{ - NLA = 14; - zzmore(); - } - - -static void act76() -{ - NLA = 15; - zzmore(); - } - -static unsigned char shift3[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 2, 5, 5, 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act77() -{ - NLA = Eof; - } - - -static void act78() -{ - NLA = 16; - zzmode(ACTIONS); zzmore(); - } - - -static void act79() -{ - NLA = 17; - zzmore(); - } - - -static void act80() -{ - NLA = 18; - zzline++; zzmore(); DAWDLE; - } - - -static void act81() -{ - NLA = 19; - zzmore(); - } - -static unsigned char shift4[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 3, 5, 5, 4, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 1, 5, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act82() -{ - NLA = Eof; - } - - -static void act83() -{ - NLA = 20; - zzmode(PARSE_ENUM_FILE); - zzmore(); - } - - -static void act84() -{ - NLA = 21; - zzmore(); - } - - -static void act85() -{ - NLA = 22; - zzline++; zzmore(); DAWDLE; - } - - -static void act86() -{ - NLA = 23; - zzmore(); - } - -static unsigned char shift5[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 3, 5, 5, 4, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 1, 5, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act87() -{ - NLA = Eof; - } - - -static void act88() -{ - NLA = 24; - zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE; - } - - -static void act89() -{ - NLA = 25; - zzskip(); - } - -static unsigned char shift6[257] = { - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - - -static void act90() -{ - NLA = Eof; - } - - -static void act91() -{ - NLA = 26; - zzline++; zzmode(ACTIONS); zzmore(); DAWDLE; - } - - -static void act92() -{ - NLA = 27; - zzmore(); - } - -static unsigned char shift7[257] = { - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - - -static void act93() -{ - NLA = Eof; - } - - -static void act94() -{ - NLA = 28; - zzline++; zzmode(START); zzskip(); DAWDLE; - } - - -static void act95() -{ - NLA = 29; - zzskip(); - } - -static unsigned char shift8[257] = { - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - - -static void act96() -{ - NLA = Eof; - } - - -static void act97() -{ - NLA = 30; - zzmode(START); zzskip(); - } - - -static void act98() -{ - NLA = 31; - zzskip(); - } - - -static void act99() -{ - NLA = 32; - zzline++; zzskip(); DAWDLE; - } - - -static void act100() -{ - NLA = 33; - zzskip(); - } - -static unsigned char shift9[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 3, 5, 5, 4, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 1, 5, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act101() -{ - NLA = Eof; - } - - -static void act102() -{ - NLA = Action; - /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = ' '; - zzbegexpr[1] = ' '; - if ( zzbufovf ) { - err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); - } - -/* MR1 10-Apr-97 MR1 Previously unable to put right shift operator */ - /* MR1 in DLG action */ - /* MR1 Doesn't matter what kind of action it is - reset*/ - - tokenActionActive=0; /* MR1 */ - } - - -static void act103() -{ - NLA = Pred; - /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = '\0'; - if ( zzbufovf ) { - err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE)); - }; -#ifdef __cplusplus__ - /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -#ifdef __STDC__ - /* MR10 */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else -#ifdef __USE_PROTOS - /* MRxx */ list_apply(CurActionLabels, (void (*)(void *))mark_label_used_in_sem_pred); -#else - /* MR10 */ list_apply(CurActionLabels,mark_label_used_in_sem_pred); -#endif -#endif -#endif - } - - -static void act104() -{ - NLA = PassAction; - if ( topint() == ']' ) { - popint(); - if ( istackempty() ) /* terminate action */ - { - zzmode(START); - NLATEXT[0] = ' '; - zzbegexpr[0] = ' '; - if ( zzbufovf ) { - err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - else { - /* terminate $[..] and #[..] */ - if ( GenCC ) zzreplstr("))"); - else zzreplstr(")"); - zzmore(); - } - } - else if ( topint() == '|' ) { /* end of simple [...] */ - popint(); - zzmore(); - } - else zzmore(); - } - - -static void act105() -{ - NLA = 37; - - zzmore(); - zzreplstr(inline_set(zzbegexpr+ - strlen("consumeUntil("))); - } - - -static void act106() -{ - NLA = 38; - zzmore(); - } - - -static void act107() -{ - NLA = 39; - zzline++; zzmore(); DAWDLE; - } - - -static void act108() -{ - NLA = 40; - zzmore(); - } - - -static void act109() -{ - NLA = 41; - zzmore(); - } - - -static void act110() -{ - NLA = 42; - if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();} - else err("$$ use invalid in C++ mode"); - } - - -static void act111() -{ - NLA = 43; - if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();} - else err("$[] use invalid in C++ mode"); - } - - -static void act112() -{ - NLA = 44; - - pushint(']'); - if ( !GenCC ) zzreplstr("zzconstr_attr("); - else err("$[..] use invalid in C++ mode"); - zzmore(); - } - - -static void act113() -{ - NLA = 45; - { - static char buf[100]; - numericActionLabel=1; /* MR10 */ - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("$i attrib ref too big"); - set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)", - BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s", - BlkLevel-1,zzbegexpr+1); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - } - - -static void act114() -{ - NLA = 46; - { - static char buf[100]; - numericActionLabel=1; /* MR10 */ - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("$i.field attrib ref too big"); - zzbegexpr[strlen(zzbegexpr)-1] = ' '; - set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).", - BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"_t%d%s.", - BlkLevel-1,zzbegexpr+1); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - } - - -static void act115() -{ - NLA = 47; - { - static char buf[100]; - static char i[20], j[20]; - char *p,*q; - numericActionLabel=1; /* MR10 */ - if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big"); - for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) { - if ( q == &i[20] ) - fatalFL("i of $i.j attrib ref too big", - FileStr[CurFile], zzline ); - *q++ = *p; - } - *q = '\0'; - for (p++, q= &j[0]; *p!='\0'; p++) { - if ( q == &j[20] ) - fatalFL("j of $i.j attrib ref too big", - FileStr[CurFile], zzline ); - *q++ = *p; - } - *q = '\0'; - if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j); - else sprintf(buf,"_t%s%s",i,j); - zzreplstr(buf); - zzmore(); - UsedOldStyleAttrib = 1; - if ( UsedNewStyleLabel ) - err("cannot mix old-style $i with new-style labels"); - } - } - - -static void act116() -{ - NLA = 48; - { static char buf[300]; LabelEntry *el; - zzbegexpr[0] = ' '; - if ( CurRule != NULL && - strcmp(CurRule, &zzbegexpr[1])==0 ) { - if ( !GenCC ) zzreplstr("zzaRet"); - } - else if ( CurRetDef != NULL && - strmember(CurRetDef, &zzbegexpr[1])) { - if ( hasMultipleOperands( CurRetDef ) ) { - require (strlen(zzbegexpr)<=(size_t)285, - "$retval attrib ref too big"); - sprintf(buf,"_retv.%s",&zzbegexpr[1]); - zzreplstr(buf); - } - else zzreplstr("_retv"); - } - else if ( CurParmDef != NULL && - strmember(CurParmDef, &zzbegexpr[1])) { - ; - } - else if ( Elabel==NULL ) { - { err("$-variables in actions outside of rules are not allowed"); } - } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) { - /* MR10 */ - /* MR10 */ /* element labels might exist without an elem when */ - /* MR10 */ /* it is a forward reference (to a rule) */ - /* MR10 */ - /* MR10 */ if ( GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) ) - /* MR10 */ { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); } - /* MR10 */ - /* MR10 */ if ( !GenCC && (el->elem == NULL || el->elem->ntype==nRuleRef) && GenAST) { - /* MR10 */ err("You can no longer use attributes returned by rules when also using ASTs"); - /* MR10 */ err(" Use upward inheritance (\"rule >[Attrib a] : ... <<$a=...>>\")"); - /* MR10 */ }; - /* MR10 */ - /* MR10 */ /* keep track of <<... $label ...>> for semantic predicates in guess mode */ - /* MR10 */ /* element labels contain pointer to the owners node */ - /* MR10 */ - /* MR10 */ if (el->elem != NULL && el->elem->ntype == nToken) { - /* MR10 */ list_add(&CurActionLabels,el); - /* MR10 */ }; -} -else -warn(eMsg1("$%s not parameter, return value, (defined) element label",&zzbegexpr[1])); -} -zzmore(); - } - - -static void act117() -{ - NLA = 49; - zzreplstr("(*_root)"); zzmore(); chkGTFlag(); - } - - -static void act118() -{ - NLA = 50; - if ( GenCC ) { - if (NewAST) zzreplstr("(newAST)"); - else zzreplstr("(new AST)");} - else {zzreplstr("zzastnew()");} zzmore(); - chkGTFlag(); - } - - -static void act119() -{ - NLA = 51; - zzreplstr("NULL"); zzmore(); chkGTFlag(); - } - - -static void act120() -{ - NLA = 52; - { - static char buf[100]; - if ( strlen(zzbegexpr)>(size_t)85 ) - fatal("#i AST ref too big"); - if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1); - else sprintf(buf,"zzastArg(%s)",zzbegexpr+1); - zzreplstr(buf); - zzmore(); - set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions); - chkGTFlag(); - } - } - - -static void act121() -{ - NLA = 53; - - zzline = atoi(zzbegexpr+5) - 1; zzline++; zzmore(); - getFileNameFromTheLineInfo(FileStr[CurFile], zzbegexpr); - } - - -static void act122() -{ - NLA = 54; - - zzline++; zzmore(); - } - - -static void act123() -{ - NLA = 55; - - if ( !(strcmp(zzbegexpr, "#ifdef")==0 || - strcmp(zzbegexpr, "#if")==0 || - strcmp(zzbegexpr, "#else")==0 || - strcmp(zzbegexpr, "#endif")==0 || - strcmp(zzbegexpr, "#ifndef")==0 || - strcmp(zzbegexpr, "#define")==0 || - strcmp(zzbegexpr, "#pragma")==0 || - strcmp(zzbegexpr, "#undef")==0 || - strcmp(zzbegexpr, "#import")==0 || - strcmp(zzbegexpr, "#line")==0 || - strcmp(zzbegexpr, "#include")==0 || - strcmp(zzbegexpr, "#error")==0) ) - { - static char buf[100]; - sprintf(buf, "%s_ast", zzbegexpr+1); - /* MR27 */ list_add(&CurAstLabelsInActions, mystrdup(zzbegexpr+1)); - zzreplstr(buf); - chkGTFlag(); - } - zzmore(); - } - - -static void act124() -{ - NLA = 56; - - pushint(']'); - if ( GenCC ) { - if (NewAST) zzreplstr("(newAST("); - else zzreplstr("(new AST("); } - else zzreplstr("zzmk_ast(zzastnew(),"); - zzmore(); - chkGTFlag(); - } - - -static void act125() -{ - NLA = 57; - - pushint('}'); - if ( GenCC ) { - if (tmakeInParser) { - zzreplstr("tmake("); - } - else { - zzreplstr("ASTBase::tmake("); - } - } - else { - zzreplstr("zztmake("); - } - zzmore(); - chkGTFlag(); - } - - -static void act126() -{ - NLA = 58; - zzmore(); - } - - -static void act127() -{ - NLA = 59; - - if ( istackempty() ) - zzmore(); - else if ( topint()==')' ) { - popint(); - } - else if ( topint()=='}' ) { - popint(); - /* terminate #(..) */ - zzreplstr(", NULL)"); - } - zzmore(); - } - - -static void act128() -{ - NLA = 60; - - pushint('|'); /* look for '|' to terminate simple [...] */ - zzmore(); - } - - -static void act129() -{ - NLA = 61; - - pushint(')'); - zzmore(); - } - - -static void act130() -{ - NLA = 62; - zzreplstr("]"); zzmore(); - } - - -static void act131() -{ - NLA = 63; - zzreplstr(")"); zzmore(); - } - - -static void act132() -{ - NLA = 64; - if (! tokenActionActive) zzreplstr(">"); /* MR1 */ - zzmore(); /* MR1 */ - } - - -static void act133() -{ - NLA = 65; - zzmode(ACTION_CHARS); zzmore(); - } - - -static void act134() -{ - NLA = 66; - zzmode(ACTION_STRINGS); zzmore(); - } - - -static void act135() -{ - NLA = 67; - zzreplstr("$"); zzmore(); - } - - -static void act136() -{ - NLA = 68; - zzreplstr("#"); zzmore(); - } - - -static void act137() -{ - NLA = 69; - zzline++; zzmore(); - } - - -static void act138() -{ - NLA = 70; - zzmore(); - } - - -static void act139() -{ - NLA = 71; - zzmore(); - } - - -static void act140() -{ - NLA = 72; - zzmode(ACTION_COMMENTS); zzmore(); - } - - -static void act141() -{ - NLA = 73; - warn("Missing /*; found dangling */ in action"); zzmore(); - } - - -static void act142() -{ - NLA = 74; - zzmode(ACTION_CPP_COMMENTS); zzmore(); - } - - -static void act143() -{ - NLA = 75; - zzmore(); - } - -static unsigned char shift10[257] = { - 0, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 16, 19, 33, 33, 20, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 16, 33, 28, 27, 21, 33, 33, - 30, 15, 18, 32, 33, 33, 33, 25, 31, 23, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 33, - 33, 33, 33, 1, 2, 33, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 11, 26, 26, 26, - 26, 26, 22, 29, 3, 33, 26, 33, 26, 26, - 4, 26, 10, 26, 26, 26, 13, 26, 26, 14, - 9, 6, 5, 26, 26, 26, 7, 12, 8, 26, - 26, 26, 26, 26, 17, 33, 34, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33 -}; - - -static void act144() -{ - NLA = Eof; - ; - } - - -static void act145() -{ - NLA = 137; - zzskip(); - } - - -static void act146() -{ - NLA = 138; - zzline++; zzskip(); - } - - -static void act147() -{ - NLA = 139; - zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); - } - - -static void act148() -{ - NLA = 140; - zzmode(TOK_DEF_COMMENTS); zzskip(); - } - - -static void act149() -{ - NLA = 141; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act150() -{ - NLA = 142; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act151() -{ - NLA = 143; - ; - } - - -static void act152() -{ - NLA = 144; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act153() -{ - NLA = 145; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act154() -{ - NLA = 146; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act155() -{ - NLA = 147; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act156() -{ - NLA = 149; - } - - -static void act157() -{ - NLA = 151; - } - - -static void act158() -{ - NLA = 152; - } - - -static void act159() -{ - NLA = 153; - } - - -static void act160() -{ - NLA = 154; - } - - -static void act161() -{ - NLA = 155; - } - - -static void act162() -{ - NLA = 156; - } - - -static void act163() -{ - NLA = INT; - } - - -static void act164() -{ - NLA = ID; - } - -static unsigned char shift11[257] = { - 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 1, 2, 27, 27, 3, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 1, 27, 27, 6, 27, 27, 27, - 27, 27, 27, 5, 27, 22, 27, 27, 4, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, - 24, 27, 21, 27, 27, 27, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 27, 27, 27, 27, 26, 27, 26, 26, - 26, 9, 10, 8, 26, 26, 7, 26, 26, 12, - 15, 11, 17, 16, 26, 18, 13, 19, 14, 26, - 26, 26, 26, 26, 20, 27, 23, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27 -}; - -#define DfaStates 436 -typedef unsigned short DfaState; - -static DfaState st0[60] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 11, 11, 12, 13, 13, 13, 14, 15, 16, - 17, 11, 11, 18, 11, 11, 19, 11, 11, 19, - 11, 11, 11, 11, 20, 11, 11, 21, 22, 23, - 24, 25, 26, 11, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 11, 11, 19, 436, 436, 436 -}; - -static DfaState st1[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st2[60] = { - 436, 2, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st3[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st4[60] = { - 436, 436, 37, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st5[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st6[60] = { - 436, 436, 436, 436, 436, 38, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st7[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st8[60] = { - 436, 436, 436, 436, 436, 436, 436, 39, 40, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st9[60] = { - 436, 436, 436, 436, 436, 436, 436, 41, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st10[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 42, 43, 43, 44, 43, 43, 43, 436, 436, 436, - 436, 45, 43, 43, 43, 43, 46, 43, 47, 43, - 43, 43, 43, 48, 43, 49, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st11[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st12[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 51, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st13[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 13, 13, 13, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st14[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 52, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st15[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 53, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st16[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st17[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 54, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st18[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 55, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st19[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 56, 56, 56, 56, 56, 56, 56, 436, 436, 436, - 436, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 436, 56, 436, - 436, 436, 436, 56, 436, 436, 436, 436, 436, 436, - 436, 56, 436, 436, 56, 56, 56, 56, 436, 436 -}; - -static DfaState st20[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 57, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st21[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st22[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 58, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 59, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st23[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st24[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st25[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st26[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st27[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 60, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st28[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 61, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st29[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st30[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st31[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 62, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st32[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st33[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st34[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 56, 56, 56, 56, 56, 56, 56, 436, 436, 436, - 436, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 436, 56, 436, - 436, 436, 436, 56, 436, 436, 436, 436, 436, 436, - 436, 63, 436, 436, 56, 56, 56, 56, 436, 436 -}; - -static DfaState st35[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st36[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st37[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st38[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st39[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st40[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st41[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st42[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 64, 43, 65, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st43[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st44[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 66, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st45[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 67, 68, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st46[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 69, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st47[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 70, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st48[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 71, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st49[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 72, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st50[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st51[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 73, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st52[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st53[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st54[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 74, 43, 43, 44, 43, 43, 43, 436, 436, 436, - 436, 45, 43, 43, 43, 43, 46, 43, 47, 43, - 43, 43, 43, 48, 43, 49, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st55[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 75, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st56[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 56, 56, 56, 56, 56, 56, 56, 436, 436, 436, - 436, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 436, 56, 436, - 436, 436, 436, 56, 436, 436, 436, 436, 436, 436, - 436, 56, 436, 436, 56, 56, 56, 56, 436, 436 -}; - -static DfaState st57[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 76, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st58[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 77, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st59[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 78, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st60[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st61[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st62[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st63[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 56, 56, 56, 56, 56, 56, 56, 436, 436, 436, - 436, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 436, 56, 436, - 436, 436, 436, 56, 436, 436, 79, 436, 436, 436, - 436, 56, 436, 436, 56, 56, 56, 56, 436, 436 -}; - -static DfaState st64[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 80, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st65[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 81, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st66[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 82, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st67[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 83, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 84, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st68[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 85, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st69[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 86, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st70[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 87, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st71[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 88, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st72[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 89, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st73[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 90, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st74[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 65, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st75[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 91, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st76[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 92, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st77[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 93, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st78[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 94, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st79[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 95, 96, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st80[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 97, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st81[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 98, 43, 99, 43, 100, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 101, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st82[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 102, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st83[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 103, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st84[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 104, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st85[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 105, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st86[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 106, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st87[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 107, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 108, 43, 43, 436, 109, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st88[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 110, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st89[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 111, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st90[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 112, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st91[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 113, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st92[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 114, 50, 50, 50, 436, 436 -}; - -static DfaState st93[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 115, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st94[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 116, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st95[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 117, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st96[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 118, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st97[60] = { - 436, 119, 120, 121, 122, 122, 122, 122, 122, 122, - 123, 123, 123, 123, 124, 124, 124, 122, 122, 122, - 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 122, 123, 122, - 122, 122, 122, 123, 122, 122, 122, 122, 122, 122, - 122, 123, 122, 122, 123, 123, 123, 123, 122, 436 -}; - -static DfaState st98[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 125, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st99[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 126, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st100[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 127, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st101[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 128, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st102[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 129, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st103[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st104[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 130, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st105[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 131, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st106[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 132, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st107[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 133, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st108[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 134, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st109[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 135, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st110[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 136, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st111[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 137, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st112[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 138, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st113[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 139, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st114[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 140, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st115[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st116[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st117[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st118[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st119[60] = { - 436, 119, 120, 121, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 141, 141, 141, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st120[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st121[60] = { - 436, 436, 142, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st122[60] = { - 436, 122, 120, 121, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st123[60] = { - 436, 122, 120, 121, 122, 122, 122, 122, 122, 122, - 123, 123, 123, 123, 123, 123, 123, 122, 122, 122, - 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 122, 123, 122, - 122, 122, 122, 123, 122, 122, 122, 122, 122, 122, - 122, 123, 122, 122, 123, 123, 123, 123, 122, 436 -}; - -static DfaState st124[60] = { - 436, 143, 144, 145, 122, 122, 146, 122, 122, 122, - 123, 123, 123, 123, 124, 124, 124, 122, 122, 122, - 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 122, 123, 122, - 122, 122, 122, 123, 122, 122, 122, 122, 122, 122, - 122, 123, 122, 122, 123, 123, 123, 123, 122, 436 -}; - -static DfaState st125[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 147, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st126[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 148, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st127[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 149, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st128[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 150, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st129[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 151, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st130[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 152, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st131[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 153, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st132[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 154, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st133[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st134[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 155, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st135[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 156, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st136[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 157, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st137[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st138[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 158, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st139[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st140[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 159, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st141[60] = { - 436, 143, 144, 145, 122, 122, 146, 122, 122, 122, - 122, 122, 122, 122, 141, 141, 141, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st142[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st143[60] = { - 436, 143, 120, 121, 122, 122, 146, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st144[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st145[60] = { - 436, 436, 160, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st146[60] = { - 436, 161, 162, 163, 161, 161, 122, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 436 -}; - -static DfaState st147[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 164, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st148[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 165, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st149[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 166, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st150[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 167, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st151[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 168, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st152[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st153[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st154[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 169, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st155[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 170, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st156[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 171, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st157[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st158[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 172, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st159[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st160[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st161[60] = { - 436, 161, 162, 163, 161, 161, 173, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 436 -}; - -static DfaState st162[60] = { - 436, 174, 174, 174, 174, 174, 175, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 436 -}; - -static DfaState st163[60] = { - 436, 174, 176, 174, 174, 174, 175, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 436 -}; - -static DfaState st164[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 177, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st165[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 178, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st166[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 179, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st167[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 180, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st168[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 181, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st169[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 182, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st170[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st171[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 183, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st172[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 184, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st173[60] = { - 436, 185, 144, 145, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 186, 186, 186, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st174[60] = { - 436, 174, 174, 174, 174, 174, 175, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 436 -}; - -static DfaState st175[60] = { - 436, 187, 188, 189, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 190, 190, 190, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st176[60] = { - 436, 174, 174, 174, 174, 174, 175, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 436 -}; - -static DfaState st177[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 191, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st178[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 192, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st179[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 193, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st180[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st181[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st182[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 194, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st183[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st184[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 50, 50, 50, 50, 50, 50, 50, 436, 436, 436, - 436, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 436, 50, 436, - 436, 436, 436, 50, 436, 436, 436, 436, 436, 436, - 436, 50, 436, 436, 50, 50, 50, 50, 436, 436 -}; - -static DfaState st185[60] = { - 436, 185, 144, 145, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 186, 186, 186, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st186[60] = { - 436, 185, 144, 145, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 186, 186, 186, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 436 -}; - -static DfaState st187[60] = { - 436, 187, 188, 189, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 190, 190, 190, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st188[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st189[60] = { - 436, 436, 195, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st190[60] = { - 436, 187, 188, 189, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 190, 190, 190, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st191[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st192[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st193[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st194[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 196, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st195[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st196[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 197, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st197[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 198, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st198[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 199, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st199[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 200, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st200[60] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 43, 43, 43, 43, 43, 43, 43, 436, 436, 436, - 436, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 436, 43, 436, - 436, 436, 436, 43, 436, 436, 436, 436, 436, 436, - 436, 43, 436, 436, 43, 43, 43, 43, 436, 436 -}; - -static DfaState st201[7] = { - 202, 203, 204, 205, 206, 207, 436 -}; - -static DfaState st202[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st203[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st204[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st205[7] = { - 436, 436, 208, 436, 436, 436, 436 -}; - -static DfaState st206[7] = { - 436, 209, 210, 211, 209, 209, 436 -}; - -static DfaState st207[7] = { - 436, 436, 436, 436, 436, 207, 436 -}; - -static DfaState st208[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st209[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st210[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st211[7] = { - 436, 436, 212, 436, 436, 436, 436 -}; - -static DfaState st212[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st213[7] = { - 214, 215, 216, 217, 218, 219, 436 -}; - -static DfaState st214[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st215[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st216[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st217[7] = { - 436, 436, 220, 436, 436, 436, 436 -}; - -static DfaState st218[7] = { - 436, 221, 222, 223, 221, 221, 436 -}; - -static DfaState st219[7] = { - 436, 436, 436, 436, 436, 219, 436 -}; - -static DfaState st220[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st221[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st222[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st223[7] = { - 436, 436, 224, 436, 436, 436, 436 -}; - -static DfaState st224[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st225[7] = { - 226, 227, 228, 229, 230, 231, 436 -}; - -static DfaState st226[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st227[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st228[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st229[7] = { - 436, 436, 232, 436, 436, 436, 436 -}; - -static DfaState st230[7] = { - 436, 233, 233, 233, 233, 233, 436 -}; - -static DfaState st231[7] = { - 436, 436, 436, 436, 436, 231, 436 -}; - -static DfaState st232[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st233[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st234[7] = { - 235, 236, 237, 238, 239, 237, 436 -}; - -static DfaState st235[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st236[7] = { - 436, 436, 240, 436, 436, 436, 436 -}; - -static DfaState st237[7] = { - 436, 436, 237, 436, 436, 237, 436 -}; - -static DfaState st238[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st239[7] = { - 436, 436, 436, 241, 436, 436, 436 -}; - -static DfaState st240[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st241[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st242[7] = { - 243, 244, 245, 246, 247, 245, 436 -}; - -static DfaState st243[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st244[7] = { - 436, 436, 248, 436, 436, 436, 436 -}; - -static DfaState st245[7] = { - 436, 436, 245, 436, 436, 245, 436 -}; - -static DfaState st246[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st247[7] = { - 436, 436, 436, 249, 436, 436, 436 -}; - -static DfaState st248[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st249[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st250[5] = { - 251, 252, 253, 254, 436 -}; - -static DfaState st251[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st252[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st253[5] = { - 436, 255, 436, 436, 436 -}; - -static DfaState st254[5] = { - 436, 436, 436, 254, 436 -}; - -static DfaState st255[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st256[5] = { - 257, 258, 259, 260, 436 -}; - -static DfaState st257[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st258[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st259[5] = { - 436, 261, 436, 436, 436 -}; - -static DfaState st260[5] = { - 436, 436, 436, 260, 436 -}; - -static DfaState st261[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st262[5] = { - 263, 264, 265, 266, 436 -}; - -static DfaState st263[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st264[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st265[5] = { - 436, 267, 436, 436, 436 -}; - -static DfaState st266[5] = { - 436, 436, 436, 266, 436 -}; - -static DfaState st267[5] = { - 436, 436, 436, 436, 436 -}; - -static DfaState st268[7] = { - 269, 270, 271, 272, 273, 271, 436 -}; - -static DfaState st269[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st270[7] = { - 436, 436, 274, 436, 436, 436, 436 -}; - -static DfaState st271[7] = { - 436, 436, 271, 436, 436, 271, 436 -}; - -static DfaState st272[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st273[7] = { - 436, 436, 436, 275, 436, 436, 436 -}; - -static DfaState st274[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st275[7] = { - 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st276[36] = { - 277, 278, 279, 280, 281, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 282, 279, 279, 283, 284, - 285, 286, 287, 279, 279, 279, 279, 288, 289, 290, - 291, 292, 293, 279, 279, 436 -}; - -static DfaState st277[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st278[36] = { - 436, 294, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st279[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st280[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st281[36] = { - 436, 436, 279, 436, 279, 295, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st282[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st283[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st284[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st285[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 296, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st286[36] = { - 436, 436, 436, 436, 297, 297, 297, 297, 297, 297, - 297, 297, 297, 297, 297, 436, 436, 436, 436, 436, - 436, 298, 299, 300, 300, 436, 297, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st287[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st288[36] = { - 436, 436, 436, 436, 301, 301, 301, 301, 301, 301, - 301, 301, 301, 301, 302, 303, 436, 436, 436, 436, - 436, 436, 304, 305, 306, 436, 301, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st289[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st290[36] = { - 436, 307, 308, 309, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, 310, 311, - 312, 313, 308, 308, 308, 308, 308, 314, 308, 308, - 308, 308, 308, 308, 308, 436 -}; - -static DfaState st291[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st292[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 315, 316, 436, 436, 436 -}; - -static DfaState st293[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 317, 279, 279, 279, 436 -}; - -static DfaState st294[36] = { - 436, 436, 318, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st295[36] = { - 436, 436, 279, 436, 279, 279, 319, 279, 279, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st296[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st297[36] = { - 436, 436, 436, 436, 320, 320, 320, 320, 320, 320, - 320, 320, 320, 320, 320, 436, 436, 436, 436, 436, - 436, 436, 436, 320, 320, 436, 320, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st298[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st299[36] = { - 436, 436, 436, 321, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st300[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 300, 300, 322, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st301[36] = { - 436, 436, 436, 436, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 436, 436, 436, 436, 436, - 436, 436, 436, 323, 323, 436, 323, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st302[36] = { - 436, 436, 436, 436, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 324, 323, 436, 436, 436, 436, 436, - 436, 436, 436, 323, 323, 436, 323, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st303[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 325, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st304[36] = { - 436, 436, 436, 326, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st305[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 306, 306, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st306[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 306, 306, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st307[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st308[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st309[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st310[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st311[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st312[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 327, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st313[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st314[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st315[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st316[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st317[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st318[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st319[36] = { - 436, 436, 279, 436, 279, 279, 279, 328, 279, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st320[36] = { - 436, 436, 436, 436, 320, 320, 320, 320, 320, 320, - 320, 320, 320, 320, 320, 436, 436, 436, 436, 436, - 436, 436, 436, 320, 320, 436, 320, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st321[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st322[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 329, 329, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st323[36] = { - 436, 436, 436, 436, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 436, 436, 436, 436, 436, - 436, 436, 436, 323, 323, 436, 323, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st324[36] = { - 436, 436, 436, 436, 323, 323, 330, 323, 323, 323, - 323, 323, 323, 323, 323, 436, 436, 436, 436, 436, - 436, 436, 436, 323, 323, 436, 323, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st325[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st326[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st327[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st328[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 331, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st329[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 329, 329, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st330[36] = { - 436, 436, 436, 436, 323, 323, 323, 323, 323, 323, - 332, 323, 323, 323, 323, 436, 436, 436, 436, 436, - 436, 436, 436, 323, 323, 436, 323, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st331[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 333, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st332[36] = { - 436, 334, 334, 334, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 335, 334, 336, 334, 334, 337, - 338, 334, 334, 339, 339, 334, 335, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st333[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 340, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st334[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 334, 334, 334, 337, - 338, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st335[36] = { - 436, 334, 334, 334, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 335, 334, 334, 334, 334, 337, - 338, 334, 334, 335, 335, 334, 335, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st336[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 336, 334, 334, 337, - 338, 334, 334, 341, 341, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st337[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st338[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 342, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st339[36] = { - 436, 334, 334, 334, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 335, 334, 343, 334, 334, 344, - 345, 334, 334, 339, 339, 334, 335, 334, 346, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st340[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 347, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st341[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 343, 334, 334, 344, - 345, 334, 334, 341, 341, 334, 334, 334, 346, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st342[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st343[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 343, 334, 334, 337, - 338, 334, 334, 334, 334, 334, 334, 334, 346, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st344[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st345[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 348, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st346[36] = { - 436, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 350, - 351, 349, 349, 349, 349, 349, 349, 349, 334, 349, - 349, 349, 349, 349, 349, 436 -}; - -static DfaState st347[36] = { - 436, 436, 279, 436, 279, 279, 352, 279, 279, 279, - 279, 279, 279, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st348[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st349[36] = { - 436, 349, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 349, 349, 349, 349, 349, 349, 349, 349, 350, - 351, 349, 349, 349, 349, 349, 349, 349, 353, 349, - 349, 349, 349, 349, 349, 436 -}; - -static DfaState st350[36] = { - 436, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 355, 354, - 354, 354, 354, 354, 354, 436 -}; - -static DfaState st351[36] = { - 436, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 356, - 354, 354, 354, 354, 354, 354, 354, 354, 355, 354, - 354, 354, 354, 354, 354, 436 -}; - -static DfaState st352[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 279, 357, 279, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st353[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 358, 334, 334, 344, - 345, 334, 334, 359, 359, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st354[36] = { - 436, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 355, 354, - 354, 354, 354, 354, 354, 436 -}; - -static DfaState st355[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 360, 436, 436, 361, - 362, 436, 436, 363, 363, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st356[36] = { - 436, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 355, 354, - 354, 354, 354, 354, 354, 436 -}; - -static DfaState st357[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 364, 279, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st358[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 358, 334, 334, 344, - 345, 334, 334, 359, 359, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st359[36] = { - 436, 334, 334, 334, 334, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 334, 358, 334, 334, 344, - 345, 334, 334, 359, 359, 334, 334, 334, 334, 334, - 334, 334, 334, 334, 334, 436 -}; - -static DfaState st360[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 360, 436, 436, 361, - 362, 436, 436, 363, 363, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st361[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st362[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 365, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st363[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 360, 436, 436, 361, - 362, 436, 436, 363, 363, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st364[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 366, 436, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st365[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st366[36] = { - 436, 436, 279, 436, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 367, 279, 279, 436, 436, - 436, 436, 436, 279, 279, 279, 279, 436, 436, 436, - 436, 436, 279, 279, 279, 436 -}; - -static DfaState st367[36] = { - 436, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 368, 369, 370, 436, 368, - 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 436 -}; - -static DfaState st368[36] = { - 436, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 368, 368, 368, 371, 368, - 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 436 -}; - -static DfaState st369[36] = { - 436, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 368, 369, 370, 371, 368, - 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 436 -}; - -static DfaState st370[36] = { - 436, 372, 372, 372, 372, 372, 372, 372, 372, 372, - 372, 372, 372, 372, 372, 372, 372, 372, 373, 372, - 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, - 372, 372, 372, 372, 368, 436 -}; - -static DfaState st371[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st372[36] = { - 436, 372, 372, 372, 372, 372, 372, 372, 372, 372, - 372, 372, 372, 372, 372, 372, 372, 372, 373, 372, - 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, - 372, 372, 372, 372, 374, 436 -}; - -static DfaState st373[36] = { - 436, 375, 375, 375, 375, 375, 375, 375, 375, 375, - 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, - 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, - 375, 375, 375, 375, 376, 436 -}; - -static DfaState st374[36] = { - 436, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 368, 377, 368, 378, 368, - 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 436 -}; - -static DfaState st375[36] = { - 436, 375, 375, 375, 375, 375, 375, 375, 375, 375, - 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, - 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, - 375, 375, 375, 375, 376, 436 -}; - -static DfaState st376[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 379, 436, 380, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st377[36] = { - 436, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 368, 377, 368, 378, 368, - 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 368, 436 -}; - -static DfaState st378[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st379[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 379, 436, 380, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st380[36] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436 -}; - -static DfaState st381[28] = { - 382, 383, 384, 385, 386, 436, 387, 388, 388, 388, - 389, 388, 388, 388, 388, 388, 388, 388, 388, 388, - 390, 391, 392, 393, 394, 395, 388, 436 -}; - -static DfaState st382[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st383[28] = { - 436, 383, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st384[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st385[28] = { - 436, 436, 396, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st386[28] = { - 436, 436, 436, 436, 397, 398, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st387[28] = { - 436, 436, 436, 436, 436, 436, 436, 399, 436, 400, - 401, 436, 436, 436, 402, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st388[28] = { - 436, 436, 436, 436, 436, 436, 436, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, - 436, 436, 436, 436, 436, 403, 403, 436 -}; - -static DfaState st389[28] = { - 436, 436, 436, 436, 436, 436, 436, 403, 403, 403, - 403, 404, 403, 403, 403, 403, 403, 403, 403, 403, - 436, 436, 436, 436, 436, 403, 403, 436 -}; - -static DfaState st390[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st391[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st392[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st393[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st394[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st395[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 395, 436, 436 -}; - -static DfaState st396[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st397[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st398[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st399[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 405, 436, - 436, 436, 436, 436, 436, 406, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st400[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 407, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st401[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 408, 409, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st402[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 410, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st403[28] = { - 436, 436, 436, 436, 436, 436, 436, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, - 436, 436, 436, 436, 436, 403, 403, 436 -}; - -static DfaState st404[28] = { - 436, 436, 436, 436, 436, 436, 436, 403, 403, 403, - 403, 403, 403, 403, 411, 403, 403, 403, 403, 403, - 436, 436, 436, 436, 436, 403, 403, 436 -}; - -static DfaState st405[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 412, - 436, 413, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st406[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 414, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st407[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 415, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st408[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 416, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st409[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 417, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st410[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 418, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st411[28] = { - 436, 436, 436, 436, 436, 436, 436, 403, 403, 403, - 403, 403, 403, 403, 403, 419, 403, 403, 403, 403, - 436, 436, 436, 436, 436, 403, 403, 436 -}; - -static DfaState st412[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 420, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st413[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 421, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st414[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 422, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st415[28] = { - 436, 436, 436, 436, 436, 436, 436, 423, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st416[28] = { - 436, 436, 436, 436, 436, 436, 436, 424, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st417[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 425, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st418[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 426, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st419[28] = { - 436, 436, 436, 436, 436, 436, 436, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, - 436, 436, 436, 436, 436, 403, 403, 436 -}; - -static DfaState st420[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 427, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st421[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 428, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st422[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 429, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st423[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 430, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st424[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 431, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st425[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st426[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 432, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st427[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st428[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 433, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st429[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 434, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st430[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 435, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st431[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st432[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st433[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st434[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - -static DfaState st435[28] = { - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 436 -}; - - -DfaState *dfa[436] = { - st0, - st1, - st2, - st3, - st4, - st5, - st6, - st7, - st8, - st9, - st10, - st11, - st12, - st13, - st14, - st15, - st16, - st17, - st18, - st19, - st20, - st21, - st22, - st23, - st24, - st25, - st26, - st27, - st28, - st29, - st30, - st31, - st32, - st33, - st34, - st35, - st36, - st37, - st38, - st39, - st40, - st41, - st42, - st43, - st44, - st45, - st46, - st47, - st48, - st49, - st50, - st51, - st52, - st53, - st54, - st55, - st56, - st57, - st58, - st59, - st60, - st61, - st62, - st63, - st64, - st65, - st66, - st67, - st68, - st69, - st70, - st71, - st72, - st73, - st74, - st75, - st76, - st77, - st78, - st79, - st80, - st81, - st82, - st83, - st84, - st85, - st86, - st87, - st88, - st89, - st90, - st91, - st92, - st93, - st94, - st95, - st96, - st97, - st98, - st99, - st100, - st101, - st102, - st103, - st104, - st105, - st106, - st107, - st108, - st109, - st110, - st111, - st112, - st113, - st114, - st115, - st116, - st117, - st118, - st119, - st120, - st121, - st122, - st123, - st124, - st125, - st126, - st127, - st128, - st129, - st130, - st131, - st132, - st133, - st134, - st135, - st136, - st137, - st138, - st139, - st140, - st141, - st142, - st143, - st144, - st145, - st146, - st147, - st148, - st149, - st150, - st151, - st152, - st153, - st154, - st155, - st156, - st157, - st158, - st159, - st160, - st161, - st162, - st163, - st164, - st165, - st166, - st167, - st168, - st169, - st170, - st171, - st172, - st173, - st174, - st175, - st176, - st177, - st178, - st179, - st180, - st181, - st182, - st183, - st184, - st185, - st186, - st187, - st188, - st189, - st190, - st191, - st192, - st193, - st194, - st195, - st196, - st197, - st198, - st199, - st200, - st201, - st202, - st203, - st204, - st205, - st206, - st207, - st208, - st209, - st210, - st211, - st212, - st213, - st214, - st215, - st216, - st217, - st218, - st219, - st220, - st221, - st222, - st223, - st224, - st225, - st226, - st227, - st228, - st229, - st230, - st231, - st232, - st233, - st234, - st235, - st236, - st237, - st238, - st239, - st240, - st241, - st242, - st243, - st244, - st245, - st246, - st247, - st248, - st249, - st250, - st251, - st252, - st253, - st254, - st255, - st256, - st257, - st258, - st259, - st260, - st261, - st262, - st263, - st264, - st265, - st266, - st267, - st268, - st269, - st270, - st271, - st272, - st273, - st274, - st275, - st276, - st277, - st278, - st279, - st280, - st281, - st282, - st283, - st284, - st285, - st286, - st287, - st288, - st289, - st290, - st291, - st292, - st293, - st294, - st295, - st296, - st297, - st298, - st299, - st300, - st301, - st302, - st303, - st304, - st305, - st306, - st307, - st308, - st309, - st310, - st311, - st312, - st313, - st314, - st315, - st316, - st317, - st318, - st319, - st320, - st321, - st322, - st323, - st324, - st325, - st326, - st327, - st328, - st329, - st330, - st331, - st332, - st333, - st334, - st335, - st336, - st337, - st338, - st339, - st340, - st341, - st342, - st343, - st344, - st345, - st346, - st347, - st348, - st349, - st350, - st351, - st352, - st353, - st354, - st355, - st356, - st357, - st358, - st359, - st360, - st361, - st362, - st363, - st364, - st365, - st366, - st367, - st368, - st369, - st370, - st371, - st372, - st373, - st374, - st375, - st376, - st377, - st378, - st379, - st380, - st381, - st382, - st383, - st384, - st385, - st386, - st387, - st388, - st389, - st390, - st391, - st392, - st393, - st394, - st395, - st396, - st397, - st398, - st399, - st400, - st401, - st402, - st403, - st404, - st405, - st406, - st407, - st408, - st409, - st410, - st411, - st412, - st413, - st414, - st415, - st416, - st417, - st418, - st419, - st420, - st421, - st422, - st423, - st424, - st425, - st426, - st427, - st428, - st429, - st430, - st431, - st432, - st433, - st434, - st435 -}; - - -DfaState accepts[437] = { - 0, 1, 2, 3, 3, 4, 25, 6, 0, 50, - 59, 57, 57, 43, 26, 13, 14, 0, 57, 58, - 57, 21, 57, 23, 24, 27, 28, 44, 0, 35, - 36, 42, 45, 46, 58, 51, 52, 3, 5, 9, - 7, 8, 59, 59, 59, 59, 59, 59, 59, 59, - 57, 57, 12, 40, 59, 57, 58, 57, 57, 57, - 33, 34, 53, 58, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 57, 59, 57, 57, 57, 57, 0, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 57, 57, 57, 57, 57, 0, 0, 59, 59, 59, - 59, 59, 59, 32, 59, 59, 59, 59, 59, 59, - 59, 59, 57, 57, 57, 22, 56, 48, 49, 0, - 11, 11, 0, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 41, 59, 59, 59, 18, 57, 47, - 57, 0, 11, 0, 10, 10, 0, 59, 59, 59, - 59, 59, 15, 19, 59, 59, 59, 17, 57, 55, - 10, 0, 11, 11, 59, 59, 59, 59, 59, 59, - 20, 59, 57, 0, 0, 0, 11, 59, 59, 59, - 37, 38, 59, 39, 54, 0, 0, 0, 10, 10, - 0, 31, 29, 30, 59, 10, 59, 59, 59, 59, - 16, 0, 60, 61, 62, 62, 0, 65, 62, 64, - 63, 63, 63, 0, 66, 67, 68, 68, 0, 71, - 68, 70, 69, 69, 69, 0, 72, 73, 74, 74, - 0, 76, 74, 75, 0, 77, 79, 81, 80, 80, - 78, 80, 0, 82, 84, 86, 85, 85, 83, 85, - 0, 87, 88, 88, 89, 88, 0, 90, 91, 91, - 92, 91, 0, 93, 94, 94, 95, 94, 0, 96, - 98, 100, 99, 99, 97, 99, 0, 101, 108, 143, - 104, 143, 129, 127, 107, 107, 109, 128, 126, 134, - 0, 133, 139, 143, 102, 143, 107, 116, 110, 112, - 113, 123, 123, 125, 124, 117, 120, 132, 138, 130, - 131, 137, 137, 135, 136, 142, 140, 141, 103, 143, - 116, 111, 114, 123, 123, 119, 118, 137, 143, 115, - 123, 143, 123, 143, 0, 123, 0, 122, 122, 123, - 143, 0, 122, 0, 121, 121, 0, 143, 121, 0, - 122, 122, 143, 0, 0, 0, 122, 143, 0, 0, - 0, 121, 121, 0, 143, 121, 143, 0, 0, 0, - 0, 106, 0, 106, 0, 0, 0, 0, 105, 0, - 105, 0, 144, 145, 146, 146, 0, 0, 164, 164, - 158, 159, 160, 161, 162, 163, 146, 147, 148, 0, - 0, 0, 0, 164, 164, 150, 0, 0, 0, 0, - 0, 164, 0, 0, 0, 0, 0, 0, 0, 157, - 0, 0, 0, 0, 0, 152, 0, 149, 0, 0, - 0, 153, 154, 151, 155, 156, 0 -}; - -void (*actions[165])() = { - zzerraction, - act1, - act2, - act3, - act4, - act5, - act6, - act7, - act8, - act9, - act10, - act11, - act12, - act13, - act14, - act15, - act16, - act17, - act18, - act19, - act20, - act21, - act22, - act23, - act24, - act25, - act26, - act27, - act28, - act29, - act30, - act31, - act32, - act33, - act34, - act35, - act36, - act37, - act38, - act39, - act40, - act41, - act42, - act43, - act44, - act45, - act46, - act47, - act48, - act49, - act50, - act51, - act52, - act53, - act54, - act55, - act56, - act57, - act58, - act59, - act60, - act61, - act62, - act63, - act64, - act65, - act66, - act67, - act68, - act69, - act70, - act71, - act72, - act73, - act74, - act75, - act76, - act77, - act78, - act79, - act80, - act81, - act82, - act83, - act84, - act85, - act86, - act87, - act88, - act89, - act90, - act91, - act92, - act93, - act94, - act95, - act96, - act97, - act98, - act99, - act100, - act101, - act102, - act103, - act104, - act105, - act106, - act107, - act108, - act109, - act110, - act111, - act112, - act113, - act114, - act115, - act116, - act117, - act118, - act119, - act120, - act121, - act122, - act123, - act124, - act125, - act126, - act127, - act128, - act129, - act130, - act131, - act132, - act133, - act134, - act135, - act136, - act137, - act138, - act139, - act140, - act141, - act142, - act143, - act144, - act145, - act146, - act147, - act148, - act149, - act150, - act151, - act152, - act153, - act154, - act155, - act156, - act157, - act158, - act159, - act160, - act161, - act162, - act163, - act164 -}; - -static DfaState dfa_base[] = { - 0, - 201, - 213, - 225, - 234, - 242, - 250, - 256, - 262, - 268, - 276, - 381 -}; - -static unsigned char *b_class_no[] = { - shift0, - shift1, - shift2, - shift3, - shift4, - shift5, - shift6, - shift7, - shift8, - shift9, - shift10, - shift11 -}; - - - -#define ZZSHIFT(c) (b_class_no[zzauto][1+c]) -#define MAX_MODE 12 -#include "dlgauto.h" diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/stdpccts.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/stdpccts.h deleted file mode 100644 index 7dfead82f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/stdpccts.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef STDPCCTS_H -#define STDPCCTS_H -/* - * stdpccts.h -- P C C T S I n c l u d e - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#ifndef ANTLR_VERSION -#define ANTLR_VERSION 13333 -#endif - -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include "pcctscfg.h" -#include "set.h" -#include -#include "syn.h" -#include "hash.h" -#include "generic.h" -#define zzcr_attr(attr,tok,t) -#define zzSET_SIZE 20 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "mode.h" -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/syn.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/syn.h deleted file mode 100644 index 87d725e08..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/syn.h +++ /dev/null @@ -1,390 +0,0 @@ -/* - * syn.h - * - * This file includes definitions and macros associated with syntax diagrams - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include "set.h" - -#define NumNodeTypes 4 -#define NumJuncTypes 9 - -/* List the different node types */ -#define nJunction 1 -#define nRuleRef 2 -#define nToken 3 -#define nAction 4 - -/* Different types of junctions */ -#define aSubBlk 1 -#define aOptBlk 2 -#define aLoopBlk 3 -#define EndBlk 4 -#define RuleBlk 5 -#define Generic 6 /* just a junction--no unusual characteristics */ -#define EndRule 7 -#define aPlusBlk 8 -#define aLoopBegin 9 - -typedef int NodeType; - -#define TreeBlockAllocSize 500 -#define JunctionBlockAllocSize 200 -#define ActionBlockAllocSize 50 -#define RRefBlockAllocSize 100 -#define TokenBlockAllocSize 100 - -#ifdef __cplusplus -class ActionNode; -class Junction; -#endif - -/* note that 'right' is used by the tree node allocator as a ptr for linked list */ -typedef struct _tree { - struct _tree *down, *right; - int token; - union { - int rk; /* if token==EpToken, => how many more tokens req'd */ - struct _tree *tref; /* if token==TREE_REF */ - set sref; /* if token==SET */ - } v; -#ifdef TREE_DEBUG - int in_use; - int seq; -#endif - } Tree; - - -/* a predicate is defined to be a predicate action and a token tree with - * context info (if used); later, this struct may include the - * "hoisting distance" when we hoist past tokens. - * - * A tree is used to indicate && vs || - * - * p - * | - * q--r - * - * indicates p && (q||r). - * - * If expr is PRED_AND_LIST or PRED_OR_LIST, then it's an operation node - * and indicates the start of an && or || list. - */ - -typedef struct _Predicate { - struct _Predicate *down, *right; /* these have to be first */ - struct _Predicate *up, *left; /* doubly-link me */ - char *expr; - Tree *tcontext; /* used if lookahead depth of > one is needed (tree) */ - int k; /* lookahead depth for this tcontext */ - set scontext[2];/* used if lookahead depth of one is needed (set) */ - /* scontext[0] is not used; only needed so genExprSets() - routine works (it expects an array) - */ - set completionTree; /* which lookahead depths are required to complete tcontext? */ - set completionSet; /* MR10 separate completion set for sets and trees */ - struct _PredEntry *predEntry; /* MR11 */ - -#ifdef __cplusplus - ActionNode *source; /* where did this predicate come from? */ -#else - struct _anode *source; /* where did this predicate come from? */ -#endif - - char cloned; /* MR10 don't want to free original guard pred */ - char redundant; /* MR10 predicate tree simplification */ - char ampersandStyle; /* MR10 (g)? && <

>? */ - char inverted; /* MR11 ! predName */ - char isConst; /* MR11 */ - char constValue; /* MR11 */ - char conflictReported; /* MR11 */ - - set plainSet; /* MR12b */ - - /*** remember to change new_predicate() and predicate_dup() when changing this ***/ - -} Predicate; - -typedef struct _ExceptionHandler { - char *signalname; - char *action; - } ExceptionHandler; - -typedef struct _ExceptionGroup { - struct _ListNode *handlers; /* list of ExceptionHandler's */ - char *label; /* label==""; implies not attached to any - * particular rule ref. - */ - char *altID; /* which alt did it come from (blk#:alt#) */ - - struct _ExceptionGroup *pendingLink; /* for alternative EG MR7 */ - struct _ExceptionGroup *outerEG; /* for alternative EG MR7 */ - struct _LabelEntry *labelEntry; /* for alternative EG MR7 */ - int forRule; /* MR7 */ - int used; /* MR7 */ - } ExceptionGroup ; - - -#define TokenString(_i) ((TokenInd!=NULL)?TokenStr[TokenInd[_i]]:TokenStr[_i]) -#define ExprString(_i) ((TokenInd!=NULL)?ExprStr[TokenInd[_i]]:ExprStr[_i]) - - - /* M e s s a g e P a s s i n g T o N o d e s */ - -/* - * assumes a 'Junction *r' exists. This macro calls a function with - * the pointer to the node to operate on and a pointer to the rule - * in which it is enclosed. - */ -#define TRANS(p) {if ( (p)==NULL ) fatal("TRANS: NULL object"); \ - if ( (p)->ntype == nJunction ) (*(fpJTrans[((Junction *)(p))->jtype]))( p );\ - else (*(fpTrans[(p)->ntype]))( p );} - -#define PRINT(p) {if ( (p)==NULL ) fatal("PRINT: NULL object");\ - (*(fpPrint[(p)->ntype]))( p );} - -#define REACH(p,k,rk,a) {if ( (p)==NULL ) fatal("REACH: NULL object");\ - (a) = (*(fpReach[(p)->ntype]))( p, k, rk );} - -#define TRAV(p,k,rk,a) {if ( (p)==NULL ) {\ - if ( ContextGuardTRAV ) (a)=NULL; \ - else fatal("TRAV: NULL object");\ - } \ - else (a) = (*(fpTraverse[(p)->ntype]))( p, k, rk );} - -/** -*** #define TRAV(p,k,rk,a) {if ( (p)==NULL ) fatal("TRAV: NULL object");\ -*** (a) = (*(fpTraverse[(p)->ntype]))( p, k, rk );} -**/ - -/* All syntax diagram nodes derive from Node -- superclass - */ -#ifdef __cplusplus -class Node { -public: - NodeType ntype; - char *rname; /* what rule does this element live in? */ - int file; /* index in FileStr */ - int line; /* line number that element occurs on */ - }; -#else -typedef struct _node { - NodeType ntype; - char *rname; /* what rule does this element live in? */ - int file; /* index in FileStr */ - int line; /* line number that element occurs on */ - } Node; -#endif - -#ifdef __cplusplus -class ActionNode : public Node { -public: -#else -typedef struct _anode { - NodeType ntype; - char *rname; /* what rule does this action live in? */ - int file; /* index in FileStr (name of file with action) */ - int line; /* line number that action occurs on */ -#endif - Node *next; - char *action; - int is_predicate; /* true if action is a <<...>>? predicate action */ - int done; /* don't dump if action dumped (used for predicates) */ - int init_action; /* is this the 1st action of 1st prod of block? */ - char *pred_fail; /* what to do/print when predicate fails */ - Predicate *guardpred; /* if '(context)? =>' was present, already done */ - unsigned char frmwarned;/* have we dumped a warning for pred yet? */ - unsigned char ctxwarned;/* have we dumped a warning for pred yet? */ - unsigned char predTooLong; /* MR10 have we dumped warning for pred yet */ - unsigned char noHoist; /* MR12 literally "noHoist" */ - Predicate *ampersandPred; /* MR10 (g)? && <

>? expr */ -#ifdef __cplusplus - Junction *guardNodes; /* MR11 */ -#else - struct _junct *guardNodes; /* MR11 */ -#endif - struct _PredEntry *predEntry; /* MR11 */ - int inverted; /* MR11 <>? */ -#ifdef __cplusplus - }; -#else - } ActionNode; -#endif - -#ifdef __cplusplus -class TokNode : public Node { -public: -#else -typedef struct _toknode { - NodeType ntype; - char *rname; /* name of rule it's in */ - int file; /* index in FileStr (name of file with rule) */ - int line; /* line number that token occurs on */ -#endif - Node *next; - int token; - int astnode; /* leaf/root/excluded (used to build AST's) */ - unsigned char label;/* token label or expression ? */ - unsigned char remapped; - /* used if token id's are forced to certain positions; - * a function walks the tree reassigning token numbers */ - int upper_range; /* MR13 - was char */ - /* used only if Token is of type T1..T2; in this case, - * use token..upper_range as the range; else - * upper_range must be 0 */ - unsigned char wild_card; - /* indicates that the token is the "." wild-card; - * field token is ignored if wild_card is set - */ - unsigned int elnum; /* element number within the alternative */ -#ifdef __cplusplus - Junction *altstart; /* pointer to node that starts alt */ -#else - struct _junct *altstart; /* pointer to node that starts alt */ -#endif - struct _TCnode *tclass; /* token class if tokclass ref */ - set tset; /* set of tokens represented by meta token */ - char *el_label; /* el_label:toknode */ - unsigned char complement; /* complement the set? */ - ExceptionGroup *ex_group; /* any exception[el_label] attached? */ - unsigned char use_def_MT_handler; - unsigned char label_used_in_semantic_pred; /* MR10 */ -#ifdef __cplusplus - }; -#else - } TokNode; -#endif - -#ifdef __cplusplus -class RuleRefNode : public Node { -public: -#else -typedef struct _rrnode { - NodeType ntype; - char *rname; /* name of rule it's in */ - int file; /* index in FileStr (name of file with rule) - it's in */ - int line; /* line number that rule ref occurs on */ -#endif - Node *next; - char *text; /* reference to which rule */ - char *parms; /* point to parameters of rule invocation - (if present) */ - char *assign; /* point to left-hand-side of assignment - (if any) */ - int linked; /* Has a FoLink already been established? */ - int astnode; /* excluded? (used to build AST's) */ - unsigned int elnum; /* element number within the alternative */ -#ifdef __cplusplus - Junction *altstart; -#else - struct _junct *altstart; -#endif - char *el_label; /* el_label:rrnode */ - ExceptionGroup *ex_group; /* any exception[el_label] attached? */ -#ifdef __cplusplus - }; -#else - } RuleRefNode; -#endif - -#ifdef __cplusplus -class Junction : public Node { -public: -#else -typedef struct _junct { - NodeType ntype; - char *rname; /* name of rule junction is in */ - int file; /* index in FileStr (name of file with rule) - if blk == RuleBlk */ - int line; /* line number that rule occurs on */ -#endif - int seq; /* MR10 sequence number */ - char ignore; /* used by FIRST computation to ignore - empty alt added for the (...)+ blks */ - char visited; /* used by recursive routines to avoid - infinite recursion */ - char pvisited; /* used by print routines to avoid - infinite recursion */ - char fvisited; /* used by FoLink() to avoid - infinite recursion */ - char *lock; /* used by REACH to track infinite recursion */ - char *pred_lock; /* used by find_predicates to track infinite recursion */ - int altnum; /* used in subblocks. altnum==0 means not an - alt of subrule */ - int jtype; /* annotation for code-gen/FIRST/FOLLOW. - Junction type */ -#ifdef __cplusplus - Junction *end; /* pointer to node with EndBlk in it - if blk == a block type */ -#else - struct _junct *end; /* pointer to node with EndBlk in it - if blk == a block type */ -#endif - Node *p1, *p2; - char halt; /* never move past a junction with halt==TRUE */ /* MR10 was int */ - char *pdecl; /* point to declaration of parameters on rule - (if present) */ - char *parm; /* point to parameter of block invocation - (if present) */ - char predparm; /* indicates that the 'parm' is a predicate - * to be used in the while loop generated - * for blocks */ /* MR10 was int */ - char *ret; /* point to return type of rule (if present) */ - char *erraction; /* point to error action (if present) */ - int blockid; /* this is a unique ID */ - char *exception_label; /* goto label for this alt */ - set *fset; /* used for code generation */ - Tree *ftree; /* used for code generation */ - Predicate *predicate;/* predicate that can be used to disambiguate */ - char guess; /* true if (...)? block */ - char alpha_beta_guess_end; /* MR14 1 => end block of guess sub block */ - Node *guess_analysis_point; /* MR14 */ - char approx; /* limit block to use linear approx lookahead? */ - set tokrefs; /* if ith element of alt is tokref then i is member */ - set rulerefs; /* if ith element of alt is rule ref then i is member */ - struct _ListNode *exceptions; /* list of exceptions groups for rule */ - struct _ListNode *el_labels; /* list of element labels for rule */ - ExceptionGroup *outerEG; /* MR7 */ - int curAltNum; /* MR7 */ - char* pFirstSetSymbol; /* #pragma FirstSetSymbol(Foo) MR21 */ -#ifdef __cplusplus - Junction *pendingLink; /* MR7 */ -#else - struct _junct *pendingLink; /* MR7 */ -#endif - char overlap_warning; /* MR10 */ -#ifdef __cplusplus - }; -#else - } Junction; -#endif - -typedef struct { Node *left, *right;} Graph; - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/tokens.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/tokens.h deleted file mode 100644 index 8643c7879..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/tokens.h +++ /dev/null @@ -1,247 +0,0 @@ -#ifndef tokens_h -#define tokens_h -/* tokens.h -- List of labelled tokens and stuff - * - * Generated from: antlr.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * ANTLR Version 1.33MR33 - */ -#define zzEOF_TOKEN 1 -#define Eof 1 -#define QuotedTerm 2 -#define Action 34 -#define Pred 35 -#define PassAction 36 -#define WildCard 87 -#define LABEL 89 -#define Pragma 92 -#define FirstSetSymbol 93 -#define NonTerminal 100 -#define TokenTerm 101 -#define ID 148 -#define INT 150 - -#ifdef __USE_PROTOS -void grammar(void); -#else -extern void grammar(); -#endif - -#ifdef __USE_PROTOS -void class_def(void); -#else -extern void class_def(); -#endif - -#ifdef __USE_PROTOS -void rule(void); -#else -extern void rule(); -#endif - -#ifdef __USE_PROTOS -void laction(void); -#else -extern void laction(); -#endif - -#ifdef __USE_PROTOS -void lmember(void); -#else -extern void lmember(); -#endif - -#ifdef __USE_PROTOS -void lprefix(void); -#else -extern void lprefix(); -#endif - -#ifdef __USE_PROTOS -void aPred(void); -#else -extern void aPred(); -#endif - -#ifdef __USE_PROTOS -extern Predicate * predOrExpr(void); -#else -extern Predicate * predOrExpr(); -#endif - -#ifdef __USE_PROTOS -extern Predicate * predAndExpr(void); -#else -extern Predicate * predAndExpr(); -#endif - -#ifdef __USE_PROTOS -extern Predicate * predPrimary(void); -#else -extern Predicate * predPrimary(); -#endif - -#ifdef __USE_PROTOS -void aLexclass(void); -#else -extern void aLexclass(); -#endif - -#ifdef __USE_PROTOS -void error(void); -#else -extern void error(); -#endif - -#ifdef __USE_PROTOS -void tclass(void); -#else -extern void tclass(); -#endif - -#ifdef __USE_PROTOS -void token(void); -#else -extern void token(); -#endif - -#ifdef __USE_PROTOS -void block(set * toksrefd,set * rulesrefd); -#else -extern void block(); -#endif - -#ifdef __USE_PROTOS -void alt(set * toksrefd,set * rulesrefd); -#else -extern void alt(); -#endif - -#ifdef __USE_PROTOS -extern LabelEntry * element_label(void); -#else -extern LabelEntry * element_label(); -#endif - -#ifdef __USE_PROTOS -extern Node * element(int old_not,int first_on_line,int use_def_MT_handler); -#else -extern Node * element(); -#endif - -#ifdef __USE_PROTOS -void default_exception_handler(void); -#else -extern void default_exception_handler(); -#endif - -#ifdef __USE_PROTOS -extern ExceptionGroup * exception_group(void); -#else -extern ExceptionGroup * exception_group(); -#endif - -#ifdef __USE_PROTOS -extern ExceptionHandler * exception_handler(void); -#else -extern ExceptionHandler * exception_handler(); -#endif - -#ifdef __USE_PROTOS -void enum_file(char * fname); -#else -extern void enum_file(); -#endif - -#ifdef __USE_PROTOS -void defines(char * fname); -#else -extern void defines(); -#endif - -#ifdef __USE_PROTOS -void enum_def(char * fname); -#else -extern void enum_def(); -#endif - -extern SetWordType zzerr1[]; -extern SetWordType zzerr2[]; -extern SetWordType zzerr3[]; -extern SetWordType zzerr4[]; -extern SetWordType setwd1[]; -extern SetWordType zzerr5[]; -extern SetWordType zzerr6[]; -extern SetWordType zzerr7[]; -extern SetWordType zzerr8[]; -extern SetWordType zzerr9[]; -extern SetWordType setwd2[]; -extern SetWordType zzerr10[]; -extern SetWordType zzerr11[]; -extern SetWordType zzerr12[]; -extern SetWordType zzerr13[]; -extern SetWordType setwd3[]; -extern SetWordType zzerr14[]; -extern SetWordType zzerr15[]; -extern SetWordType zzerr16[]; -extern SetWordType zzerr17[]; -extern SetWordType zzerr18[]; -extern SetWordType zzerr19[]; -extern SetWordType zzerr20[]; -extern SetWordType zzerr21[]; -extern SetWordType setwd4[]; -extern SetWordType zzerr22[]; -extern SetWordType zzerr23[]; -extern SetWordType zzerr24[]; -extern SetWordType zzerr25[]; -extern SetWordType zzerr26[]; -extern SetWordType setwd5[]; -extern SetWordType zzerr27[]; -extern SetWordType zzerr28[]; -extern SetWordType zzerr29[]; -extern SetWordType zzerr30[]; -extern SetWordType zzerr31[]; -extern SetWordType zzerr32[]; -extern SetWordType zzerr33[]; -extern SetWordType setwd6[]; -extern SetWordType zzerr34[]; -extern SetWordType zzerr35[]; -extern SetWordType zzerr36[]; -extern SetWordType zzerr37[]; -extern SetWordType zzerr38[]; -extern SetWordType zzerr39[]; -extern SetWordType zzerr40[]; -extern SetWordType zzerr41[]; -extern SetWordType zzerr42[]; -extern SetWordType setwd7[]; -extern SetWordType zzerr43[]; -extern SetWordType zzerr44[]; -extern SetWordType zzerr45[]; -extern SetWordType zzerr46[]; -extern SetWordType zzerr47[]; -extern SetWordType zzerr48[]; -extern SetWordType zzerr49[]; -extern SetWordType zzerr50[]; -extern SetWordType zzerr51[]; -extern SetWordType zzerr52[]; -extern SetWordType zzerr53[]; -extern SetWordType setwd8[]; -extern SetWordType zzerr54[]; -extern SetWordType zzerr55[]; -extern SetWordType zzerr56[]; -extern SetWordType zzerr57[]; -extern SetWordType setwd9[]; -extern SetWordType zzerr58[]; -extern SetWordType zzerr59[]; -extern SetWordType zzerr60[]; -extern SetWordType zzerr61[]; -extern SetWordType zzerr62[]; -extern SetWordType zzerr63[]; -extern SetWordType zzerr64[]; -extern SetWordType zzerr65[]; -extern SetWordType setwd10[]; -extern SetWordType setwd11[]; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/watantlr.mak b/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/watantlr.mak deleted file mode 100644 index 9e7ce7d5d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/antlr/watantlr.mak +++ /dev/null @@ -1,54 +0,0 @@ -SET=..\support\set -PCCTS_H=..\h - -# -# Watcom -# -CC=wcl386 -ANTLR=..\bin\antlr -DLG=..\bin\dlg -CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC -OUT_OBJ = -o -OBJ_EXT = obj -LINK = wcl386 - -.c.obj : - $(CC) -c $[* $(CFLAGS) - -antlr.exe: antlr.obj scan.obj err.obj bits.obj build.obj fset2.obj & - fset.obj gen.obj globals.obj hash.obj lex.obj main.obj & - misc.obj set.obj pred.obj - $(LINK) -fe=antlr.exe *.obj -k14336 - copy *.exe ..\bin - -# *********** Target list of PC machines *********** -# -# Don't worry about the ambiguity messages coming from antlr -# for making antlr.c etc... [should be 10 of them, I think] -# -antlr.c stdpccts.h parser.dlg tokens.h err.c : antlr.g - $(ANTLR) antlr.g - -antlr.$(OBJ_EXT): antlr.c mode.h tokens.h - -scan.$(OBJ_EXT): scan.c mode.h tokens.h - -scan.c mode.h: parser.dlg - $(DLG) -C2 parser.dlg scan.c - -set.$(OBJ_EXT): $(SET)\set.c - $(CC) $(CFLAGS) -c set.$(OBJ_EXT) $(SET)\set.c - -# -# ****** These next targets are common to UNIX and PC world ******** -# - -#clean up all the intermediate files -clean: - del *.obj - -#remove everything in clean plus the PCCTS files generated -scrub: - del $(PCCTS_GEN) - del *.$(OBJ_EXT) -EOF_watantlr.mak diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMS.mak b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMS.mak deleted file mode 100644 index 374b24cf3..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMS.mak +++ /dev/null @@ -1,106 +0,0 @@ -# PCCTS directory -PCCTS_HOME= -DLG_SRC=$(PCCTS_HOME)\dlg -PCCTS_H=$(PCCTS_HOME)\h - - -# Support directories -SET=$(PCCTS_HOME)\support\set - - -# Compiler stuff -CC = cl -CFLAGS = -I "." -I "$(PCCTS_H)" -I "$(SET)" -D "USER_ZZSYN" -D "PC" \ - -D "ZZLEXBUFSIZE=65536" /D "LONGFILENAMES" /W3 /Zi - -DLG_OBJS = dlg_p.obj dlg_a.obj main.obj err.obj support.obj \ - output.obj relabel.obj automata.obj - -SUPPORT_OBJS = set.obj - -# Dependencies - -dlg.exe: $(DLG_OBJS) $(SUPPORT_OBJS) - $(CC) $(CFLAGS) -o dlg.exe $(DLG_OBJS) $(SUPPORT_OBJS) - del *.obj - -dlg_p.obj: $(DLG_SRC)\dlg_p.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - $(DLG_SRC)\mode.h \ - $(DLG_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_p.c - -dlg_a.obj: $(DLG_SRC)\dlg_a.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgauto.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - $(DLG_SRC)\mode.h \ - $(DLG_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\dlg_a.c - -main.obj: $(DLG_SRC)\main.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - $(DLG_SRC)\mode.h \ - $(DLG_SRC)\stdpccts.h \ - $(DLG_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\main.c - -err.obj: $(DLG_SRC)\err.c \ - $(PCCTS_H)\antlr.h \ - $(PCCTS_H)\config.h \ - $(PCCTS_H)\dlgdef.h \ - $(PCCTS_H)\err.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - $(DLG_SRC)\tokens.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\err.c - -support.obj: $(DLG_SRC)\support.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\support.c - -output.obj: $(DLG_SRC)\output.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\output.c - -relabel.obj: $(DLG_SRC)\relabel.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\relabel.c - -automata.obj: $(DLG_SRC)\automata.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - $(DLG_SRC)\dlg.h \ - - $(CC) -c $(CFLAGS) $(DLG_SRC)\automata.c - - -set.obj: $(SET)\set.c \ - $(PCCTS_H)\config.h \ - $(SET)\set.h \ - - $(CC) -c $(CFLAGS) $(SET)\set.c diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsp deleted file mode 100644 index fd52d707b..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsp +++ /dev/null @@ -1,217 +0,0 @@ -# Microsoft Developer Studio Project File - Name="DLG" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=DLG - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "DlgMSVC50.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "DlgMSVC50.mak" CFG="DLG - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "DLG - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "DLG - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "DLG - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /O2 /I "..\h" /I "..\support\set" /D "__STDC__" /D "NDEBUG" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"./Dlg.exe" -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Copy to ..\bin directory -PostBuild_Cmds=mkdir ..\bin copy ..\bin\dlg.exe dlg_old.exe copy dlg.exe\ - ..\bin\. -# End Special Build Tool - -!ELSEIF "$(CFG)" == "DLG - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /Zi /Od /I "..\h" /I "..\support\set" /D "__STDC__" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"./Dlg.exe" /pdbtype:sept -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Copy to ..\bin directory -PostBuild_Cmds=mkdir ..\bin copy ..\bin\dlg.exe dlg_old.exe copy dlg.exe\ - ..\bin\. -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "DLG - Win32 Release" -# Name "DLG - Win32 Debug" -# Begin Source File - -SOURCE=.\automata.c -# End Source File -# Begin Source File - -SOURCE=.\dlg_a.c -# End Source File -# Begin Source File - -SOURCE=.\dlg_p.c - -!IF "$(CFG)" == "DLG - Win32 Release" - -!ELSEIF "$(CFG)" == "DLG - Win32 Debug" - -# SUBTRACT CPP /YX - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dlg_p.g - -!IF "$(CFG)" == "DLG - Win32 Release" - -# Begin Custom Build - Building DLG Parser from ANTLR Grammar -InputPath=.\dlg_p.g -InputName=dlg_p - -BuildCmds= \ - ..\bin\antlr $(InputName).g -gh \ - ..\bin\dlg -C2 parser.dlg dlg_a.c \ - - -"dlg_a.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"dlg_p.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "DLG - Win32 Debug" - -# Begin Custom Build - Building DLG Parser from ANTLR Grammar -InputPath=.\dlg_p.g -InputName=dlg_p - -BuildCmds= \ - ..\bin\antlr $(InputName).g -gh \ - ..\bin\dlg -C2 parser.dlg dlg_a.c \ - - -"dlg_a.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"dlg_p.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\err.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\output.c -# End Source File -# Begin Source File - -SOURCE=.\relabel.c -# End Source File -# Begin Source File - -SOURCE=..\support\set\set.c -# End Source File -# Begin Source File - -SOURCE=.\support.c -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsw deleted file mode 100644 index 3434d5990..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC50.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "DLG"=.\DlgMSVC50.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsp deleted file mode 100644 index 11937a9d9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsp +++ /dev/null @@ -1,216 +0,0 @@ -# Microsoft Developer Studio Project File - Name="DLG" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=DLG - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "DlgMSVC60.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "DlgMSVC60.mak" CFG="DLG - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "DLG - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "DLG - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "DlgMSVC60" -# PROP Scc_LocalPath ".." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "DLG - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /O2 /I "..\h" /I "..\support\set" /D "__STDC__" /D "NDEBUG" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"./Dlg.exe" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy to ..\bin directory -PostBuild_Cmds=mkdir ..\bin copy ..\bin\dlg.exe dlg_old.exe copy dlg.exe ..\bin\. -# End Special Build Tool - -!ELSEIF "$(CFG)" == "DLG - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /ZI /Od /I "..\h" /I "..\support\set" /D "__STDC__" /D "LONGFILENAMES" /D "PC" /D "USER_ZZSYN" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"./Dlg.exe" /pdbtype:sept -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy to ..\bin directory -PostBuild_Cmds=mkdir ..\bin copy ..\bin\dlg.exe dlg_old.exe copy dlg.exe ..\bin\. -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "DLG - Win32 Release" -# Name "DLG - Win32 Debug" -# Begin Source File - -SOURCE=.\automata.c -# End Source File -# Begin Source File - -SOURCE=.\dlg_a.c -# End Source File -# Begin Source File - -SOURCE=.\dlg_p.c - -!IF "$(CFG)" == "DLG - Win32 Release" - -!ELSEIF "$(CFG)" == "DLG - Win32 Debug" - -# SUBTRACT CPP /YX - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\dlg_p.g - -!IF "$(CFG)" == "DLG - Win32 Release" - -# Begin Custom Build - Building DLG Parser from ANTLR Grammar -InputPath=.\dlg_p.g -InputName=dlg_p - -BuildCmds= \ - ..\bin\antlr $(InputName).g -gh \ - ..\bin\dlg -C2 parser.dlg dlg_a.c \ - - -"dlg_a.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"dlg_p.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "DLG - Win32 Debug" - -# Begin Custom Build - Building DLG Parser from ANTLR Grammar -InputPath=.\dlg_p.g -InputName=dlg_p - -BuildCmds= \ - ..\bin\antlr $(InputName).g -gh \ - ..\bin\dlg -C2 parser.dlg dlg_a.c \ - - -"dlg_a.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"dlg_p.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"tokens.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\err.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\output.c -# End Source File -# Begin Source File - -SOURCE=.\relabel.c -# End Source File -# Begin Source File - -SOURCE=..\support\set\set.c -# End Source File -# Begin Source File - -SOURCE=.\support.c -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsw deleted file mode 100644 index 46a07f42e..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/DlgMSVC60.dsw +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "DLG"=.\DlgMSVC60.dsp - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - DlgMSVC60 - .. - end source code control -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/automata.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/automata.c deleted file mode 100644 index 194e206ca..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/automata.c +++ /dev/null @@ -1,353 +0,0 @@ -/* Automata conversion functions for DLG - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * DLG 1.33 - * Will Cohen - * With mods by Terence Parr; AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "pcctscfg.h" -#include "dlg.h" -#ifdef MEMCHK -#include "trax.h" -#else -#ifdef __STDC__ -#include -#else -#include -#endif /* __STDC__ */ -#endif - -#define hash_list struct _hash_list_ -hash_list{ - hash_list *next; /* next thing in list */ - dfa_node *node; - }; - -int dfa_allocated = 0; /* keeps track of number of dfa nodes */ -dfa_node **dfa_array; /* root of binary tree that stores dfa array */ -dfa_node *dfa_model_node; -hash_list *dfa_hash[HASH_SIZE]; /* used to quickly find */ - /* desired dfa node */ - -void -#ifdef __USE_PROTOS -make_dfa_model_node(int width) -#else -make_dfa_model_node(width) -int width; -#endif -{ - register int i; - dfa_model_node = (dfa_node*) malloc(sizeof(dfa_node) - + sizeof(int)*width); - dfa_model_node->node_no = -1; /* impossible value for real dfa node */ - dfa_model_node->dfa_set = 0; - dfa_model_node->alternatives = FALSE; - dfa_model_node->done = FALSE; - dfa_model_node->nfa_states = empty; - for(i = 0; itrans[i] = NIL_INDEX; - } -} - - -/* adds a new nfa to the binary tree and returns a pointer to it */ -dfa_node * -#ifdef __USE_PROTOS -new_dfa_node(set nfa_states) -#else -new_dfa_node(nfa_states) -set nfa_states; -#endif -{ - register int j; - register dfa_node *t; - static int dfa_size=0; /* elements dfa_array[] can hold */ - - ++dfa_allocated; - if (dfa_size<=dfa_allocated){ - /* need to redo array */ - if (!dfa_array){ - /* need some to do inital allocation */ - dfa_size=dfa_allocated+DFA_MIN; - dfa_array=(dfa_node **) malloc(sizeof(dfa_node*)* - dfa_size); - }else{ - /* need more space */ - dfa_size=2*(dfa_allocated+1); - dfa_array=(dfa_node **) realloc(dfa_array, - sizeof(dfa_node*)*dfa_size); - } - } - /* fill out entry in array */ - t = (dfa_node*) malloc(sizeof(nfa_node)+sizeof(int)*class_no); - *t = *dfa_model_node; - for (j=0; jtrans[j] = NIL_INDEX; - t->node_no = dfa_allocated; - t->nfa_states = set_dup(nfa_states); - dfa_array[dfa_allocated] = t; - return t; -} - - -/* past a pointer to the start start of the nfa graph - * nfa_to_dfa convers this graph to dfa. The function returns - * a pointer to the first dfa state. - * NOTE: The function that prints out the table will have to figure out how - * to find the other dfa states given the first dfa_state and the number of dfa - * nodes allocated - */ -dfa_node ** -#ifdef __USE_PROTOS -nfa_to_dfa(nfa_node *start) -#else -nfa_to_dfa(start) -nfa_node *start; -#endif -{ - register dfa_node *d_state, *trans_d_state; - register int a; - set t; - int last_done; - unsigned *nfa_list; - unsigned *reach_list; - - reach_list = (unsigned *) malloc((2+nfa_allocated)*sizeof(unsigned)); - if (!start) return NULL; - t = set_of(NFA_NO(start)); - _set_pdq(t,reach_list); - closure(&t,reach_list); - /* Make t a dfa state */ - d_state = dfastate(t); - last_done = DFA_NO(d_state); - - do { - /* Mark dfa state x as "done" */ - d_state->done = TRUE; - nfa_list = set_pdq(d_state->nfa_states); - for (a = 0; at, labeled with a */ - d_state->trans[a] = DFA_NO(trans_d_state); - d_state->alternatives = TRUE; - } - } - free(nfa_list); - ++last_done; /* move forward in queue */ - /* And so forth until nothing isn't done */ - d_state = DFA(last_done); - } while (last_done<=dfa_allocated); - - free(reach_list); - set_free(t); - - /* returns pointer to the array that holds the automaton */ - return dfa_array; -} - -void -#ifdef __USE_PROTOS -clear_hash(void) -#else -clear_hash() -#endif -{ - register int i; - - for(i=0; inext; - } - total+=j; - fprintf(f,"bin[%d] has %d\n",i,j); - } - fprintf(f,"total = %d\n",total); -} -#endif - -/* Returns a pointer to a dfa node that has the same nfa nodes in it. - * This may or maynot be a newly created node. - */ -dfa_node * -#ifdef __USE_PROTOS -dfastate(set nfa_states) -#else -dfastate(nfa_states) -set nfa_states; -#endif -{ - register hash_list *p; - int bin; - - /* hash using set and see if it exists */ - bin = set_hash(nfa_states,HASH_SIZE); - p = dfa_hash[bin]; - while(p && !set_equ(nfa_states,(p->node)->nfa_states)){ - p = p->next; - } - if(!p){ - /* next state to add to hash table */ - p = (hash_list*)malloc(sizeof(hash_list)); - p->node = new_dfa_node(nfa_states); - p->next = dfa_hash[bin]; - dfa_hash[bin] = p; - } - return (p->node); -} - - -/* this reach assumes the closure has been done already on set */ -int -#ifdef __USE_PROTOS -reach(unsigned *nfa_list, register int a, unsigned *reach_list) -#else -reach(nfa_list, a, reach_list) -unsigned *nfa_list; -register int a; -unsigned *reach_list; -#endif -{ - register unsigned *e; - register nfa_node *node; - int t=0; - - e = nfa_list; - if (e){ - while (*e != nil){ - node = NFA(*e); - if (set_el(a,node->label)){ - t=1; - *reach_list=NFA_NO(node->trans[0]); - ++reach_list; - } - ++e; - } - } - *reach_list=nil; - return t; -} - -/* finds all the nodes that can be reached by epsilon transitions - from the set of a nodes and returns puts them back in set b */ -set -#ifdef __USE_PROTOS -closure(set *b, unsigned *reach_list) -#else -closure(b, reach_list) -set *b; -unsigned *reach_list; -#endif -{ - register nfa_node *node,*n; /* current node being examined */ - register unsigned *e; - - ++operation_no; -#if 0 - t = e = set_pdq(*b); -#else - e=reach_list; -#endif - while (*e != nil){ - node = NFA(*e); - set_orel(NFA_NO(node),b); - /* mark it done */ - node->nfa_set = operation_no; - if ((n=node->trans[0]) != NIL_INDEX && set_nil(node->label) && - (n->nfa_set != operation_no)){ - /* put in b */ - set_orel(NFA_NO(n),b); - close1(n,operation_no,b); - } - if ((n=node->trans[1]) != NIL_INDEX && - (n->nfa_set != operation_no)){ - /* put in b */ - set_orel(NFA_NO(node->trans[1]),b); - close1(n,operation_no,b); - } - ++e; - } -#if 0 - free(t); -#endif - return *b; -} - -#ifdef __USE_PROTOS -void close1(nfa_node *node, int o, set *b) -#else -void close1(node,o,b) -nfa_node *node; -int o; /* marker to avoid cycles */ -set *b; -#endif -{ - register nfa_node *n; /* current node being examined */ - - /* mark it done */ - node->nfa_set = o; - if ((n=node->trans[0]) != NIL_INDEX && set_nil(node->label) && - (n->nfa_set != o)){ - /* put in b */ - set_orel(NFA_NO(n),b); - close1(n,o,b); - } - if ((n=node->trans[1]) != NIL_INDEX && - (n->nfa_set != o)){ - /* put in b */ - set_orel(NFA_NO(node->trans[1]),b); - close1(n,o,b); - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.1 b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.1 deleted file mode 100644 index 3a1694eef..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.1 +++ /dev/null @@ -1,79 +0,0 @@ -.TH dlg 1 "April 1994" "DLG" "PCCTS Manual Pages" -.SH NAME -dlg \- DFA Lexical Analyzer Generator -.SH SYNTAX -.LP -\fBdlg\fR [\fIoptions\fR] \fIlexical_spec\fR [\fIoutput_file\fR] -.SH DESCRIPTION -.B dlg -is a tool that produces fast deterministic finite automata for recognizing -regular expressions in input. -.SH OPTIONS -.IP "\fB-CC\fR" -Generate C++ output. The \fIoutput_file\fP is not specified in this -case. -.IP "\fB-C\fR[\fP level\fR] -Where \fPlevel\fR is the compression level used. 0 indications no -compression, 1 removes all unused characters from the transition from table, -and 2 maps equivalent characters into the same character classes. It is -suggested that level -C2 is used, since it will significantly reduce the size -of the dfa produced for lexical analyzer. -.IP "\fB-m\fP -Produces the header file for the lexical mode with a name other than -the default name of "mode.h". -.IP \fB-i\fP -An interactive, or as interactive as possible, parser is produced. A character -is only obtained when required to decide which state to go to. Some care -must be taken to obtain accept states that do not require look ahead at the -next character to determine if that is the stop state. Any regular expression -with a Kleene closure at the end is guaranteed to require another character -of look ahead. -.IP "\fB-cl\fP class -Specify a class name for DLG to generate. The default is DLGLexer. -'class' will be a subclass of DLGLexerBase; only used for -CC. -.IP \fB-ci\fP -The automaton will treat upper and lower case characters identically. -This is accomplished in the automaton; the characters in the lexical -buffer are unmodified. -.IP \fB-cs\fP -Upper and lower case characters are treated as distinct. This is the -default. -.IP "\fB-o\fP dir -Directory where output files should go (default="."). This is very -nice for keeping the source directory clear of ANTLR and DLG spawn. -.IP \fB-Wambiguity\fP -Warns if more than one regular expression could match the same character -sequence. The warnings give the numbers of the expressions in the dlg -lexical specification file. The numbering of the expressions starts at one. -Multiple warnings may be print for the same expressions. -.IP \- -Used in place of file names to get input from standard in or send output -to standard out. -.SH "SPECIAL CONSIDERATIONS" -.PP -\fIDlg\fP works... we think. There is no implicit guarantee of -anything. We reserve no \fBlegal\fP rights to the software known as -the Purdue Compiler Construction Tool Set (PCCTS) \(em PCCTS is in the -public domain. An individual or company may do whatever they wish -with source code distributed with PCCTS or the code generated by -PCCTS, including the incorporation of PCCTS, or its output, into -commercial software. We encourage users to develop software with -PCCTS. However, we do ask that credit is given to us for developing -PCCTS. By "credit", we mean that if you incorporate our source code -into one of your programs (commercial product, research project, or -otherwise) that you acknowledge this fact somewhere in the -documentation, research report, etc... If you like PCCTS and have -developed a nice tool with the output, please mention that you -developed it using PCCTS. As long as these guidelines are followed, we -expect to continue enhancing this system and expect to make other -tools available as they are completed. -.SH FILES -.B mode.h -, -.B dlgauto.h -, -.B dlgdef.h -.SH SEE ALSO -.BR antlr (1), -.BR pccts (1) -.SH BUGS diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.h deleted file mode 100644 index 38ab01ae9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.h +++ /dev/null @@ -1,250 +0,0 @@ -/* dlg header file - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * DLG 1.33 - * Will Cohen - * With mods by Terence Parr; AHPCRC, University of Minnesota - * 1989-2001 - */ - -/* MR1 Move pcctscfg.h to top of file */ - -#include "pcctscfg.h" - -/* turn off warnings for unreferenced labels */ - -#ifdef _MSC_VER -#pragma warning(disable:4102) -#endif - -#include "set.h" - -#define TRUE 1 -#define FALSE 0 - -/***** output related stuff *******************/ -#define IN input_stream -#define OUT output_stream - -#define MAX_MODES 50 /* number of %%names allowed */ -#define MAX_ON_LINE 10 - -#define NFA_MIN 64 /* minimum nfa_array size */ -#define DFA_MIN 64 /* minimum dfa_array size */ - -#define DEFAULT_CLASSNAME "DLGLexer" - -/* these macros allow the size of the character set to be easily changed */ -/* NOTE: do NOT change MIN_CHAR since EOF is the lowest char, -1 */ -#define MIN_CHAR (-1) /* lowest possible character possible on input */ -#define MAX_CHAR 255 /* highest possible character possible on input */ -#define CHAR_RANGE (1+(MAX_CHAR) - (MIN_CHAR)) - -/* indicates that the not an "array" reference */ -#define NIL_INDEX 0 - -/* size of hash table used to find dfa_states quickly */ -#define HASH_SIZE 211 - -#define nfa_node struct _nfa_node -nfa_node { - int node_no; - int nfa_set; - int accept; /* what case to use */ - nfa_node *trans[2]; - set label; /* one arc always labelled with epsilon */ -}; - -#define dfa_node struct _dfa_node -dfa_node { - int node_no; - int dfa_set; - int alternatives; /* used for interactive mode */ - /* are more characters needed */ - int done; - set nfa_states; - int trans[1];/* size of transition table depends on - * number of classes required for automata. - */ - - -}; - -/******** macros for accessing the NFA and DFA nodes ****/ -#define NFA(x) (nfa_array[x]) -#define DFA(x) (dfa_array[x]) -#define DFA_NO(x) ( (x) ? (x)->node_no : NIL_INDEX) -#define NFA_NO(x) ( (x) ? (x)->node_no : NIL_INDEX) - -/******** wrapper for memory checking ***/ -/*#define malloc(x) dlg_malloc((x),__FILE__,__LINE__)*/ - -/*#define calloc(x,y) dlg_calloc((x),(y),__FILE__,__LINE__)*/ - -/******** antlr attributes *************/ -typedef struct { - unsigned char letter; - nfa_node *l,*r; - set label; - } Attrib; - -#define zzcr_attr(attr, token, text) { \ - (attr)->letter = text[0]; (attr)->l = NULL; \ - (attr)->r = NULL; (attr)->label = empty; \ -} -#define zzd_attr(a) set_free((a)->label); - -/******************** Variable ******************************/ -extern char program[]; /* tells what program this is */ -extern char version[]; /* tells what version this is */ -extern char *file_str[]; /* file names being used */ -extern int err_found; /* flag to indicate error occured */ -extern int action_no; /* last action function printed */ -extern int func_action; /* should actions be turned into functions?*/ -extern set used_chars; /* used to label trans. arcs */ -extern set used_classes; /* classes or chars used to label trans. arcs */ -extern int class_no; /* number of classes used */ -extern set class_sets[]; /* shows char. in each class */ -extern set normal_chars; /* mask off unused portion of set */ -extern int comp_level; /* what compression level to use */ -extern int interactive; /* interactive scanner (avoid lookahead)*/ -extern int mode_counter; /* keeps track of the number of %%name */ -extern int dfa_basep[]; /* start of each group of dfa */ -extern int dfa_class_nop[];/* number of transistion arcs in */ - /* each dfa in each mode */ -extern int nfa_allocated; -extern int dfa_allocated; -extern nfa_node **nfa_array; /* start of nfa "array" */ -extern dfa_node **dfa_array; /* start of dfa "array" */ -extern int operation_no; /* unique number for each operation */ -extern FILE *input_stream; /* where description read from */ -extern FILE *output_stream; /* where to put the output */ -extern FILE *mode_stream; /* where to put the mode output */ -extern FILE *class_stream; -extern char *mode_file; /* name of file for mode output */ -extern int gen_ansi; /* produce ansi compatible code */ -extern int case_insensitive;/* ignore case of input spec. */ -extern int warn_ambig; /* show if regular expressions ambiguous */ -extern int gen_cpp; -extern char *cl_file_str; -extern int firstLexMember; /* MR1 */ -extern char *OutputDirectory; -extern char *class_name; - -/******************** Functions ******************************/ -#ifdef __USE_PROTOS -extern char *dlg_malloc(int, char *, int); /* wrapper malloc */ -extern char *dlg_calloc(int, int, char *, int); /* wrapper calloc */ -extern int reach(unsigned *, register int, unsigned *); -extern set closure(set *, unsigned *); -extern dfa_node *new_dfa_node(set); -extern nfa_node *new_nfa_node(void); -extern dfa_node *dfastate(set); -extern dfa_node **nfa_to_dfa(nfa_node *); -extern void internal_error(char *, char *, int); /* MR9 23-Sep-97 */ -extern FILE *read_stream(char *); /* opens file for reading */ -extern FILE *write_stream(char *); /* opens file for writing */ -extern void make_nfa_model_node(void); -extern void make_dfa_model_node(int); -extern char *ClassName(char *); -extern char *OutMetaName(char *); -extern void error(char*, int); -extern void warning(char*, int); -extern void p_head(void); -extern void p_class_hdr(void); -extern void p_includes(void); -extern void p_tables(void); -extern void p_tail(void); /* MR1 */ -extern void p_class_def1(void); /* MR1 */ -extern void new_automaton_mode(void); /* MR1 */ -extern int relabel(nfa_node *,int); /* MR1 */ -extern void p_shift_table(int); /* MR1 */ -extern void p_bshift_table(void); /* MR1 */ -extern void p_class_table(void); /* MR1 */ -extern void p_mode_def(char *,int); /* MR1 */ -extern void init(void); /* MR1 */ -extern void p_class_def2(void); /* MR1 */ -extern void clear_hash(void); /* MR1 */ -extern void p_alternative_table(void); /* MR1 */ -extern void p_node_table(void); /* MR1 */ -extern void p_dfa_table(void); /* MR1 */ -extern void p_accept_table(void); /* MR1 */ -extern void p_action_table(void); /* MR1 */ -extern void p_base_table(void); /* MR1 */ -extern void p_single_node(int,int); /* MR1 */ -extern char * minsize(int); /* MR1 */ -extern void close1(nfa_node *,int,set *); /* MR1 */ -extern void partition(nfa_node *,int); /* MR1 */ -extern void intersect_nfa_labels(nfa_node *,set *); /* MR1 */ -extern void r_intersect(nfa_node *,set *); /* MR1 */ -extern void label_node(nfa_node *); /* MR1 */ -extern void label_with_classes(nfa_node *); /* MR1 */ - -#else -extern char *dlg_malloc(); /* wrapper malloc */ -extern char *dlg_calloc(); /* wrapper calloc */ -extern int reach(); -extern set closure(); -extern dfa_node *new_dfa_node(); -extern nfa_node *new_nfa_node(); -extern dfa_node *dfastate(); -extern dfa_node **nfa_to_dfa(); -extern void internal_error(); /* MR9 23-Sep-97 */ -extern FILE *read_stream(); /* opens file for reading */ -extern FILE *write_stream(); /* opens file for writing */ -extern void make_nfa_model_node(); -extern void make_dfa_model_node(); -extern char *ClassName(); -extern char *OutMetaName(); -extern void error(); -extern void warning(); -extern void p_head(); /* MR9 */ -extern void p_class_hdr(); /* MR9 */ -extern void p_includes(); /* MR9 */ -extern void p_tables(); /* MR9 */ -extern void p_tail(); /* MR1 */ -extern void p_class_def1(); /* MR1 */ -extern void new_automaton_mode(); /* MR1 */ -extern int relabel(); /* MR1 */ -extern void p_shift_table(); /* MR1 */ -extern void p_bshift_table(); /* MR1 */ -extern void p_class_table(); /* MR1 */ -extern void p_mode_def(); /* MR1 */ -extern void init(); /* MR1 */ -extern void p_class_def2(); /* MR1 */ -extern void clear_hash(); /* MR1 */ -extern void p_alternative_table(); /* MR1 */ -extern void p_node_table(); /* MR1 */ -extern void p_dfa_table(); /* MR1 */ -extern void p_accept_table(); /* MR1 */ -extern void p_action_table(); /* MR1 */ -extern void p_base_table(); /* MR1 */ -extern void p_single_node(); /* MR1 */ -extern char * minsize(); /* MR1 */ -extern void close1(); /* MR1 */ -extern void partition(); /* MR1 */ -extern void intersect_nfa_labels(); /* MR1 */ -extern void r_intersect(); /* MR1 */ -extern void label_node(); /* MR1 */ -extern void label_with_classes(); /* MR1 */ - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.r b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.r deleted file mode 100644 index 2b0b1185f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg.r +++ /dev/null @@ -1,275 +0,0 @@ -/* - File: dlgMPW.r - Target: dlg 133MR - Created: Monday, June 15, 1998 4:44:11 AM - Author: Kenji Tanaka (kentar@osa.att.ne.jp) -*/ - -#include "cmdo.r" - -resource 'cmdo' (128, "Dlg") { - { /* array dialogs: 1 elements */ - /* [1] */ - 295, - "DLG -- Purdue Compiler Construction Tool" - " Set (PCCTS) lexical analyzer generator.", - { /* array itemArray: 18 elements */ - /* [1] */ - NotDependent { - - }, - CheckOption { - NotSet, - {35, 175, 50, 225}, - "On", - "-CC", - "When this control is checked, DLG genera" - "tes a scanner using C++ classes rather t" - "han C functions." - }, - /* [2] */ - Or { - { /* array OrArray: 1 elements */ - /* [1] */ - 1 - } - }, - RegularEntry { - "Lexer Class Name:", - {35, 225, 50, 355}, - {35, 355, 51, 450}, - "DLGLexer", - keepCase, - "-cl", - "This entry specifies the name DLG uses f" - "or the C++ lexer class." - }, - /* [3] */ - NotDependent { - - }, - TextBox { - gray, - {25, 165, 60, 460}, - "C++ Code Generation" - }, - /* [4] */ - NotDependent { - - }, - Files { - InputFile, - RequiredFile { - {37, 25, 56, 135}, - "Input File", - "", - "Choose the lexical description file for " - "DLG to process." - }, - Additional { - "", - "", - "", - "", - { /* array TypesArray: 1 elements */ - /* [1] */ - text - } - } - }, - /* [5] */ - Or { - { /* array OrArray: 1 elements */ - /* [1] */ - -1 - } - }, - Files { - OutputFile, - RequiredFile { - {66, 25, 85, 135}, - "Output File", - "", - "Choose the name of the file that will ho" - "ld the DLG-produced scanner." - }, - NoMore { - - } - }, - /* [6] */ - Or { - { /* array OrArray: 2 elements */ - /* [1] */ - 1, - /* [2] */ - 5 - } - }, - Dummy { - - }, - /* [7] */ - NotDependent { - - }, - Redirection { - DiagnosticOutput, - {90, 25} - }, - /* [8] */ - NotDependent { - - }, - TextBox { - gray, - {25, 20, 132, 145}, - "Files" - }, - /* [9] */ - NotDependent { - - }, - Files { - DirOnly, - OptionalFile { - {68, 175, 84, 305}, - {88, 175, 107, 305}, - "Output Directory", - ":", - "-o", - "", - "Choose the directory where DLG will put " - "its output.", - dim, - "Output DirectoryI", - "", - "" - }, - NoMore { - - } - }, - /* [10] */ - NotDependent { - - }, - RegularEntry { - "Mode File Name:", - {68, 315, 83, 450}, - {88, 315, 104, 450}, - "mode.h", - keepCase, - "-m", - "This entry specifies the name DLG uses f" - "or its lexical mode output file." - }, - /* [11] */ - NotDependent { - - }, - RadioButtons { - { /* array radioArray: 3 elements */ - /* [1] */ - {134, 175, 149, 255}, "None", "", Set, "When this option is selected, DLG will n" - "ot compress its tables.", - /* [2] */ - {134, 265, 149, 345}, "Level 1", "-C1", NotSet, "When this option is selected, DLG will r" - "emove all unused characters from the tra" - "nsition-from table.", - /* [3] */ - {134, 360, 149, 450}, "Level 2", "-C2", NotSet, "When this option is selected, DLG will p" - "erform level 1 compression plus it will " - "map equivalent characters into the same " - "character classes." - } - }, - /* [12] */ - NotDependent { - - }, - TextBox { - gray, - {124, 165, 156, 460}, - "Table Compression" - }, - /* [13] */ - NotDependent { - - }, - CheckOption { - Set, - {165, 20, 180, 145}, - "Case Sensitive", - "-ci", - "When this control is checked, the DLG au" - "tomaton will treat upper and lower case " - "characters identically." - }, - /* [14] */ - NotDependent { - - }, - CheckOption { - NotSet, - {165, 150, 180, 300}, - "Interactive Scanner", - "-i", - "When this control is checked, DLG will g" - "enerate as interactive a scanner as poss" - "ible." - }, - /* [15] */ - NotDependent { - - }, - CheckOption { - NotSet, - {165, 310, 180, 460}, - "Ambiguity Warnings", - "-Wambiguity", - "When this control is checked, DLG warns " - "if more than one regular expression coul" - "d match the same character sequence." - }, - /* [16] */ - NotDependent { - - }, - VersionDialog { - VersionString { - "1.33MR" - }, - "PCCTS was written by Terence Parr, Russe" - "ll Quong, Will Cohen, and Hank Dietz: 19" - "89-1998. MPW port by Scott Haney.", - noDialog - }, - /* [17] */ - And { - { /* array AndArray: 2 elements */ - /* [1] */ - 4, - /* [2] */ - 6 - } - }, - DoItButton { - - }, - /* [18] */ - NotDependent { - - }, - CheckOption { - NotSet, - {142, 20, 157, 148}, - "Generate ANSI C", - "-ga", - "When this control is checked, DLG genera" - "tes ANSI C compatible code." - } - } - } -}; - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg1.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg1.txt deleted file mode 100644 index 79f6690a5..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg1.txt +++ /dev/null @@ -1,132 +0,0 @@ - - - -dlg(1) PCCTS Manual Pages dlg(1) - - - -NAME - dlg - DFA Lexical Analyzer Generator - -SYNTAX - dlg [_o_p_t_i_o_n_s] _l_e_x_i_c_a_l__s_p_e_c [_o_u_t_p_u_t__f_i_l_e] - -DESCRIPTION - dlg is a tool that produces fast deterministic finite auto- - mata for recognizing regular expressions in input. - -OPTIONS - -CC Generate C++ output. The _o_u_t_p_u_t__f_i_l_e is not specified - in this case. - - -C[ level] - Where level is the compression level used. 0 indica- - tions no compression, 1 removes all unused characters - from the transition from table, and 2 maps equivalent - characters into the same character classes. It is sug- - gested that level -C2 is used, since it will signifi- - cantly reduce the size of the dfa produced for lexical - analyzer. - - -m Produces the header file for the lexical mode with a - name other than the default name of "mode.h". - - -i An interactive, or as interactive as possible, parser - is produced. A character is only obtained when - required to decide which state to go to. Some care - must be taken to obtain accept states that do not - require look ahead at the next character to determine - if that is the stop state. Any regular expression with - a Kleene closure at the end is guaranteed to require - another character of look ahead. - - -cl class - Specify a class name for DLG to generate. The default - is DLGLexer. - - -ci The automaton will treat upper and lower case charac- - ters identically. This is accomplished in the automa- - ton; the characters in the lexical buffer are unmodi- - fied. - - -cs Upper and lower case characters are treated as dis- - tinct. This is the default. - - -o dir - Directory where output files should go (default="."). - This is very nice for keeping the source directory - clear of ANTLR and DLG spawn. - - -Wambiguity - Warns if more than one regular expression could match - the same character sequence. The warnings give the - numbers of the expressions in the dlg lexical specifi- - cation file. The numbering of the expressions starts - at one. Multiple warnings may be print for the same - expressions. - - - Used in place of file names to get input from standard - in or send output to standard out. - -SPECIAL CONSIDERATIONS - _D_l_g works... we think. There is no implicit guarantee of - anything. We reserve no legal rights to the software known - as the Purdue Compiler Construction Tool Set (PCCTS) - PCCTS - is in the public domain. An individual or company may do - whatever they wish with source code distributed with PCCTS - or the code generated by PCCTS, including the incorporation - of PCCTS, or its output, into commercial software. We - encourage users to develop software with PCCTS. However, we - do ask that credit is given to us for developing PCCTS. By - "credit", we mean that if you incorporate our source code - into one of your programs (commercial product, research pro- - ject, or otherwise) that you acknowledge this fact somewhere - in the documentation, research report, etc... If you like - PCCTS and have developed a nice tool with the output, please - mention that you developed it using PCCTS. As long as these - guidelines are followed, we expect to continue enhancing - this system and expect to make other tools available as they - are completed. - -FILES - mode.h , dlgauto.h , dlgdef.h - -SEE ALSO - antlr(1), pccts(1) - -BUGS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg68K.make b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg68K.make deleted file mode 100644 index 6e81dd675..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg68K.make +++ /dev/null @@ -1,90 +0,0 @@ -# File: dlg68K.make -# Target: dlg68K -# Sources: automata.c -# dlg_a.c -# dlg_p.c -# err.c -# main.c -# output.c -# relabel.c -# support.c -# ::support:set:set.c -# Created: Sunday, May 17, 1998 10:58:10 PM -# Author: Kenji Tanaka - - -MAKEFILE = dlg68K.make -¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified -Includes = ¶ - -i "::h:" ¶ - -i "::support:set:" -Sym¥68K = -ObjDir¥68K = ":Obj:" - -COptions = {Includes} {Sym¥68K} -model far -mc68020 -w off -d MPW -d __STDC__=1 -d USER_ZZSYN - -Objects¥68K = ¶ - "{ObjDir¥68K}automata.c.o" ¶ - "{ObjDir¥68K}dlg_a.c.o" ¶ - "{ObjDir¥68K}dlg_p.c.o" ¶ - "{ObjDir¥68K}err.c.o" ¶ - "{ObjDir¥68K}main.c.o" ¶ - "{ObjDir¥68K}output.c.o" ¶ - "{ObjDir¥68K}relabel.c.o" ¶ - "{ObjDir¥68K}support.c.o" ¶ - "{ObjDir¥68K}set.c.o" - - -dlg68K ÄÄ {¥MondoBuild¥} {Objects¥68K} - Link ¶ - -o {Targ} -d {Sym¥68K} ¶ - {Objects¥68K} ¶ - -t 'MPST' ¶ - -c 'MPS ' ¶ - -model far ¶ - -mf ¶ - -br ON ¶ - -srtsg ALL ¶ - "{Libraries}Stubs.o" ¶ - "{Libraries}MathLib.o" ¶ - #"{CLibraries}Complex.o" ¶ - "{CLibraries}StdCLib.o" ¶ - "{Libraries}MacRuntime.o" ¶ - "{Libraries}IntEnv.o" ¶ - "{Libraries}ToolLibs.o" ¶ - "{Libraries}Interface.o" - - -"{ObjDir¥68K}automata.c.o" Ä {¥MondoBuild¥} automata.c - {C} automata.c -o {Targ} {COptions} - -"{ObjDir¥68K}dlg_a.c.o" Ä {¥MondoBuild¥} dlg_a.c - {C} dlg_a.c -o {Targ} {COptions} - -"{ObjDir¥68K}dlg_p.c.o" Ä {¥MondoBuild¥} dlg_p.c - {C} dlg_p.c -o {Targ} {COptions} - -"{ObjDir¥68K}err.c.o" Ä {¥MondoBuild¥} err.c - {C} err.c -o {Targ} {COptions} - -"{ObjDir¥68K}main.c.o" Ä {¥MondoBuild¥} main.c - {C} main.c -o {Targ} {COptions} - -"{ObjDir¥68K}output.c.o" Ä {¥MondoBuild¥} output.c - {C} output.c -o {Targ} {COptions} - -"{ObjDir¥68K}relabel.c.o" Ä {¥MondoBuild¥} relabel.c - {C} relabel.c -o {Targ} {COptions} - -"{ObjDir¥68K}support.c.o" Ä {¥MondoBuild¥} support.c - {C} support.c -o {Targ} {COptions} - -"{ObjDir¥68K}set.c.o" Ä {¥MondoBuild¥} "::support:set:set.c" - {C} "::support:set:set.c" -o {Targ} {COptions} - - -dlg68K ÄÄ dlg.r - Rez dlg.r -o dlg68K -a - -Install Ä dlg68K - Duplicate -y dlg68K "{MPW}"Tools:dlg diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlgPPC.make b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlgPPC.make deleted file mode 100644 index 6b1dc6a0b..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlgPPC.make +++ /dev/null @@ -1,84 +0,0 @@ -# File: dlgPPC.make -# Target: dlgPPC -# Sources: automata.c -# dlg_a.c -# dlg_p.c -# err.c -# main.c -# output.c -# relabel.c -# support.c -# ::support:set:set.c -# Created: Sunday, May 17, 1998 11:34:20 PM -# Author: Kenji Tanaka - - -MAKEFILE = dlgPPC.make -¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified -Includes = ¶ - -i "::h:" ¶ - -i "::support:set:" -Sym¥PPC = -ObjDir¥PPC = ":Obj:" - -PPCCOptions = {Includes} {Sym¥PPC} -w off -d MPW -d __STDC__=1 -d USER_ZZSYN - -Objects¥PPC = ¶ - "{ObjDir¥PPC}automata.c.x" ¶ - "{ObjDir¥PPC}dlg_a.c.x" ¶ - "{ObjDir¥PPC}dlg_p.c.x" ¶ - "{ObjDir¥PPC}err.c.x" ¶ - "{ObjDir¥PPC}main.c.x" ¶ - "{ObjDir¥PPC}output.c.x" ¶ - "{ObjDir¥PPC}relabel.c.x" ¶ - "{ObjDir¥PPC}support.c.x" ¶ - "{ObjDir¥PPC}set.c.x" - - -dlgPPC ÄÄ {¥MondoBuild¥} {Objects¥PPC} - PPCLink ¶ - -o {Targ} {Sym¥PPC} ¶ - {Objects¥PPC} ¶ - -t 'MPST' ¶ - -c 'MPS ' ¶ - "{SharedLibraries}InterfaceLib" ¶ - "{SharedLibraries}StdCLib" ¶ - "{SharedLibraries}MathLib" ¶ - "{PPCLibraries}StdCRuntime.o" ¶ - "{PPCLibraries}PPCCRuntime.o" ¶ - "{PPCLibraries}PPCToolLibs.o" - - -"{ObjDir¥PPC}automata.c.x" Ä {¥MondoBuild¥} automata.c - {PPCC} automata.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}dlg_a.c.x" Ä {¥MondoBuild¥} dlg_a.c - {PPCC} dlg_a.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}dlg_p.c.x" Ä {¥MondoBuild¥} dlg_p.c - {PPCC} dlg_p.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}err.c.x" Ä {¥MondoBuild¥} err.c - {PPCC} err.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}main.c.x" Ä {¥MondoBuild¥} main.c - {PPCC} main.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}output.c.x" Ä {¥MondoBuild¥} output.c - {PPCC} output.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}relabel.c.x" Ä {¥MondoBuild¥} relabel.c - {PPCC} relabel.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}support.c.x" Ä {¥MondoBuild¥} support.c - {PPCC} support.c -o {Targ} {PPCCOptions} - -"{ObjDir¥PPC}set.c.x" Ä {¥MondoBuild¥} "::support:set:set.c" - {PPCC} "::support:set:set.c" -o {Targ} {PPCCOptions} - - -dlgPPC ÄÄ dlg.r - Rez dlg.r -o dlgPPC -a - -Install Ä dlgPPC - Duplicate -y dlgPPC "{MPW}"Tools:dlg diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_a.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_a.c deleted file mode 100644 index 70ff1e5d5..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_a.c +++ /dev/null @@ -1,1414 +0,0 @@ - -/* parser.dlg -- DLG Description of scanner - * - * Generated from: dlg_p.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include -#include "dlg.h" -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -LOOKAHEAD - -void -#ifdef __USE_PROTOS -zzerraction() -#else -zzerraction() -#endif -{ - (*zzerr)("invalid token"); - zzadvance(); - zzskip(); -} -/* - * D L G tables - * - * Generated from: parser.dlg - * - * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz - * Purdue University Electrical Engineering - * DLG Version 1.33MR33 - */ - -#include "mode.h" - - - - -int func_action; /* should actions be turned into functions?*/ -int lex_mode_counter = 0; /* keeps track of the number of %%names */ -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via <<%%lexmember...>> */ -/* MR1 */ -int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */ -int lexAction = 0; /* <<%%lexaction ...>> MR1 */ -int parserClass = 0; /* <<%%parserclass ...>> MR1 */ -int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */ -char theClassName[100]; /* MR11 */ -char *pClassName=theClassName; /* MR11 */ -int firstLexMember=1; /* MR1 */ - -#ifdef __USE_PROTOS -void xxputc(int c) { /* MR1 */ -#else - void xxputc(c) /* MR1 */ - int c; /* MR1 */ - { /* MR1 */ -#endif - if (parserClass) { /* MR1 */ - *pClassName++=c; /* MR1 */ - *pClassName=0; /* MR1 */ - } else if (lexMember || lexPrefix) { /* MR1 */ - if (class_stream != NULL) fputc(c,class_stream); /* MR1 */ - } else { /* MR1 */ - fputc(c,OUT); /* MR1 */ - }; /* MR1 */ - } /* MR1 */ - -#ifdef __USE_PROTOS - void xxprintf(char *format,char *string) { /* MR1 */ -#else - void xxprintf(format,string) /* MR1 */ - char *format; /* MR1 */ - char *string; /* MR1 */ - { /* MR1 */ -#endif - if (lexMember || lexPrefix || parserClass) { /* MR1 */ - if (class_stream != NULL) /* MR1 */ - fprintf(class_stream,format,string); /* MR1 */ - } else { /* MR1 */ - fprintf(OUT,format,string); /* MR1 */ - }; /* MR1 */ - } /* MR1 */ - -static void act1() -{ - NLA = 1; - } - - -static void act2() -{ - NLA = 2; - zzskip(); - } - - -static void act3() -{ - NLA = 3; - zzline++; zzskip(); DAWDLE; - } - - -static void act4() -{ - NLA = L_EOF; - } - - -static void act5() -{ - NLA = PER_PER; - } - - -static void act6() -{ - NLA = NAME_PER_PER; - p_mode_def(&zzlextext[2],lex_mode_counter++); - } - - -static void act7() -{ - NLA = LEXMEMBER; - lexMember=1; /* MR1 */ - if (firstLexMember != 0) { /* MR1 */ - firstLexMember=0; /* MR1 */ - p_class_def1(); /* MR1 */ - }; /* MR1 */ - zzmode(ACT); /* MR1 */ - } - - -static void act8() -{ - NLA = LEXACTION; - lexAction=1;zzmode(ACT); - } - - -static void act9() -{ - NLA = PARSERCLASS; - parserClass=1; /* MR1 */ - zzmode(ACT); /* MR1 */ - } - - -static void act10() -{ - NLA = LEXPREFIX; - lexPrefix=1;zzmode(ACT); - } - - -static void act11() -{ - NLA = ACTION; - if (func_action) - fprintf(OUT,"\n%s %sact%d()\n{ ", - gen_cpp?"ANTLRTokenType":"static void", - gen_cpp?ClassName("::"):"", ++action_no); - zzmode(ACT); zzskip(); - } - - -static void act12() -{ - NLA = GREAT_GREAT; - } - - -static void act13() -{ - NLA = L_BRACE; - } - - -static void act14() -{ - NLA = R_BRACE; - } - - -static void act15() -{ - NLA = L_PAR; - } - - -static void act16() -{ - NLA = R_PAR; - } - - -static void act17() -{ - NLA = L_BRACK; - } - - -static void act18() -{ - NLA = R_BRACK; - } - - -static void act19() -{ - NLA = ZERO_MORE; - } - - -static void act20() -{ - NLA = ONE_MORE; - } - - -static void act21() -{ - NLA = OR; - } - - -static void act22() -{ - NLA = RANGE; - } - - -static void act23() -{ - NLA = NOT; - } - - -static void act24() -{ - NLA = OCTAL_VALUE; - {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;} - } - - -static void act25() -{ - NLA = HEX_VALUE; - {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;} - } - - -static void act26() -{ - NLA = DEC_VALUE; - {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;} - } - - -static void act27() -{ - NLA = TAB; - zzlextext[0] = '\t'; - } - - -static void act28() -{ - NLA = NL; - zzlextext[0] = '\n'; - } - - -static void act29() -{ - NLA = CR; - zzlextext[0] = '\r'; - } - - -static void act30() -{ - NLA = BS; - zzlextext[0] = '\b'; - } - - -static void act31() -{ - NLA = CONTINUATION; - zzline++; zzskip(); - } - - -static void act32() -{ - NLA = LIT; - zzlextext[0] = zzlextext[1]; - } - - -static void act33() -{ - NLA = REGCHAR; - } - -static unsigned char shift0[257] = { - 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 1, 2, 40, 40, 1, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 1, 40, 40, 40, 40, 4, 40, - 40, 30, 31, 34, 35, 40, 37, 40, 40, 23, - 24, 24, 24, 24, 24, 24, 24, 25, 25, 40, - 40, 26, 40, 27, 40, 3, 21, 21, 21, 21, - 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 20, - 22, 22, 32, 39, 33, 40, 22, 40, 11, 9, - 12, 21, 6, 19, 22, 22, 14, 22, 22, 5, - 8, 16, 15, 17, 22, 10, 18, 13, 22, 22, - 22, 7, 22, 22, 28, 36, 29, 38, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40 -}; - - -static void act34() -{ - NLA = 1; - error("unterminated action", zzline); zzmode(START); - } - - -static void act35() -{ - NLA = ACTION; - if (func_action) fprintf(OUT,"}\n\n"); - zzmode(START); - /* MR1 */ - /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ - /* MR1 via <<%%lexmember ...>> */ - /* MR1 This is a consequence of not saving actions */ - /* MR1 */ - /* MR1 */ parserClass=0; - /* MR1 */ lexPrefix=0; - /* MR1 */ lexAction=0; - /* MR1 */ lexMember=0; - } - - -static void act36() -{ - NLA = 34; - xxputc(zzlextext[0]); zzskip(); - } - - -static void act37() -{ - NLA = 35; - xxputc('>'); zzskip(); - } - - -static void act38() -{ - NLA = 36; - xxputc('\\'); zzskip(); - } - - -static void act39() -{ - NLA = 37; - xxputc(zzlextext[0]); ++zzline; zzskip(); - } - - -static void act40() -{ - NLA = 38; - zzmode(ACTION_COMMENTS); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - } - - -static void act41() -{ - NLA = 39; - zzmode(ACTION_CPP_COMMENTS); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - } - - -static void act42() -{ - NLA = 40; - xxputc(zzlextext[0]); zzskip(); - } - -static unsigned char shift1[257] = { - 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 5, 6, 6, 6, 6, 4, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 2, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6 -}; - - -static void act43() -{ - NLA = 1; - } - - -static void act44() -{ - NLA = 41; - zzmode(ACT); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - } - - -static void act45() -{ - NLA = 42; - zzline++; xxputc(zzlextext[0]); zzskip(); - } - - -static void act46() -{ - NLA = 43; - xxputc(zzlextext[0]); zzskip(); - } - -static unsigned char shift2[257] = { - 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 3, 4, 4, 3, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 1, 4, 4, 4, 4, 2, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4 -}; - - -static void act47() -{ - NLA = 1; - } - - -static void act48() -{ - NLA = 44; - zzmode(ACT); zzline++; /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - } - - -static void act49() -{ - NLA = 45; - xxputc(zzlextext[0]); zzskip(); - } - -static unsigned char shift3[257] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2 -}; - -#define DfaStates 94 -typedef unsigned char DfaState; - -static DfaState st0[42] = { - 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 6, 94 -}; - -static DfaState st1[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st2[42] = { - 94, 21, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st3[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st4[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st5[42] = { - 94, 94, 94, 94, 22, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st6[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st7[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 23, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st8[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 24, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st9[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st10[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st11[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st12[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st13[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st14[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st15[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st16[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st17[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st18[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st19[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st20[42] = { - 94, 25, 26, 25, 25, 25, 25, 25, 25, 27, - 28, 25, 25, 29, 25, 25, 30, 25, 25, 25, - 25, 25, 25, 31, 32, 32, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 94 -}; - -static DfaState st21[42] = { - 94, 21, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st22[42] = { - 94, 94, 94, 94, 94, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st23[42] = { - 94, 94, 94, 94, 34, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st24[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st25[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st26[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st27[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st28[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st29[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st30[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st31[42] = { - 94, 94, 94, 94, 94, 94, 94, 35, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 35, 94, 94, 36, 36, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st32[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 37, 37, 37, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st33[42] = { - 94, 94, 94, 94, 94, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st34[42] = { - 94, 94, 94, 94, 39, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st35[42] = { - 94, 94, 94, 94, 94, 94, 40, 94, 94, 40, - 94, 40, 40, 94, 94, 94, 94, 94, 94, 40, - 94, 40, 94, 40, 40, 40, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st36[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 36, 36, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st37[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 37, 37, 37, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st38[42] = { - 94, 94, 94, 94, 94, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st39[42] = { - 94, 94, 94, 94, 94, 41, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 42, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st40[42] = { - 94, 94, 94, 94, 94, 94, 40, 94, 94, 40, - 94, 40, 40, 94, 94, 94, 94, 94, 94, 40, - 94, 40, 94, 40, 40, 40, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st41[42] = { - 94, 94, 94, 94, 94, 94, 43, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st42[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 44, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st43[42] = { - 94, 94, 94, 94, 94, 94, 94, 45, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st44[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 46, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st45[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 47, 94, - 94, 48, 94, 94, 94, 94, 94, 49, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st46[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 50, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st47[42] = { - 94, 94, 94, 94, 94, 94, 51, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st48[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 52, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st49[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 53, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st50[42] = { - 94, 94, 94, 94, 94, 94, 54, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st51[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 55, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st52[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 56, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st53[42] = { - 94, 94, 94, 94, 94, 94, 57, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st54[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 58, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st55[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 59, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st56[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 60, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st57[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 61, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st58[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 62, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st59[42] = { - 94, 94, 94, 94, 94, 94, 63, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st60[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 64, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st61[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 65, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st62[42] = { - 94, 94, 94, 94, 94, 66, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st63[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 67, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st64[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 68, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st65[42] = { - 94, 94, 94, 94, 94, 94, 94, 69, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st66[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 70, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st67[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st68[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st69[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st70[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 71, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st71[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 72, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st72[42] = { - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94 -}; - -static DfaState st73[8] = { - 74, 75, 76, 77, 78, 79, 79, 94 -}; - -static DfaState st74[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st75[8] = { - 94, 80, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st76[8] = { - 94, 81, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st77[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st78[8] = { - 94, 94, 94, 94, 82, 83, 94, 94 -}; - -static DfaState st79[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st80[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st81[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st82[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st83[8] = { - 94, 94, 94, 94, 94, 94, 94, 94 -}; - -static DfaState st84[6] = { - 85, 86, 87, 88, 87, 94 -}; - -static DfaState st85[6] = { - 94, 94, 94, 94, 94, 94 -}; - -static DfaState st86[6] = { - 94, 94, 89, 94, 94, 94 -}; - -static DfaState st87[6] = { - 94, 94, 94, 94, 94, 94 -}; - -static DfaState st88[6] = { - 94, 94, 94, 94, 94, 94 -}; - -static DfaState st89[6] = { - 94, 94, 94, 94, 94, 94 -}; - -static DfaState st90[4] = { - 91, 92, 93, 94 -}; - -static DfaState st91[4] = { - 94, 94, 94, 94 -}; - -static DfaState st92[4] = { - 94, 94, 94, 94 -}; - -static DfaState st93[4] = { - 94, 94, 94, 94 -}; - - -DfaState *dfa[94] = { - st0, - st1, - st2, - st3, - st4, - st5, - st6, - st7, - st8, - st9, - st10, - st11, - st12, - st13, - st14, - st15, - st16, - st17, - st18, - st19, - st20, - st21, - st22, - st23, - st24, - st25, - st26, - st27, - st28, - st29, - st30, - st31, - st32, - st33, - st34, - st35, - st36, - st37, - st38, - st39, - st40, - st41, - st42, - st43, - st44, - st45, - st46, - st47, - st48, - st49, - st50, - st51, - st52, - st53, - st54, - st55, - st56, - st57, - st58, - st59, - st60, - st61, - st62, - st63, - st64, - st65, - st66, - st67, - st68, - st69, - st70, - st71, - st72, - st73, - st74, - st75, - st76, - st77, - st78, - st79, - st80, - st81, - st82, - st83, - st84, - st85, - st86, - st87, - st88, - st89, - st90, - st91, - st92, - st93 -}; - - -DfaState accepts[95] = { - 0, 1, 2, 3, 4, 33, 33, 33, 33, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 0, 2, 5, 11, 12, 32, 31, 30, 29, 27, - 28, 24, 26, 6, 0, 0, 24, 26, 6, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 8, 10, - 0, 0, 9, 0, 34, 36, 38, 39, 42, 42, - 35, 37, 41, 40, 0, 43, 46, 46, 45, 44, - 0, 47, 48, 49, 0 -}; - -void (*actions[50])() = { - zzerraction, - act1, - act2, - act3, - act4, - act5, - act6, - act7, - act8, - act9, - act10, - act11, - act12, - act13, - act14, - act15, - act16, - act17, - act18, - act19, - act20, - act21, - act22, - act23, - act24, - act25, - act26, - act27, - act28, - act29, - act30, - act31, - act32, - act33, - act34, - act35, - act36, - act37, - act38, - act39, - act40, - act41, - act42, - act43, - act44, - act45, - act46, - act47, - act48, - act49 -}; - -static DfaState dfa_base[] = { - 0, - 73, - 84, - 90 -}; - -static unsigned char *b_class_no[] = { - shift0, - shift1, - shift2, - shift3 -}; - - - -#define ZZSHIFT(c) (b_class_no[zzauto][1+c]) -#define MAX_MODE 4 -#include "dlgauto.h" diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.c deleted file mode 100644 index b81474af9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.c +++ /dev/null @@ -1,959 +0,0 @@ -/* - * A n t l r T r a n s l a t i o n H e a d e r - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - * - * ..\bin\antlr dlg_p.g -gh - * - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include -#include "dlg.h" -#define zzSET_SIZE 8 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "mode.h" - -/* MR23 In order to remove calls to PURIFY use the antlr -nopurify option */ - -#ifndef PCCTS_PURIFY -#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\0',(s)); -#endif - -ANTLR_INFO - - -/* MR20 G. Hobbelt -Fix for Borland C++ 4.x & 5.x compiling with ALL warnings enabled -*/ - -#ifdef __TURBOC__ -#pragma warn -aus /* unused assignment of 'xxx' */ -#endif - -int action_no = 0; /* keep track of actions outputed */ -int nfa_allocated = 0; /* keeps track of number of nfa nodes */ -nfa_node **nfa_array = NULL;/* root of binary tree that stores nfa array */ -nfa_node nfa_model_node; /* model to initialize new nodes */ -set used_chars; /* used to label trans. arcs */ -set used_classes; /* classes or chars used to label trans. arcs */ -set normal_chars; /* mask to get rid elements that aren't used -in set */ -int flag_paren = FALSE; -int flag_brace = FALSE; -int mode_counter = 0; /* keep track of number of %%names */ - - - -void -#ifdef __USE_PROTOS -grammar(void) -#else -grammar() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - p_head(); p_class_hdr(); func_action = FALSE; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (setwd1[LA(1)]&0x1) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==LEXACTION) ) { - zzmatch(LEXACTION); zzCONSUME; - } - else { - if ( (LA(1)==LEXMEMBER) ) { - zzmatch(LEXMEMBER); zzCONSUME; - } - else { - if ( (LA(1)==LEXPREFIX) ) { - zzmatch(LEXPREFIX); zzCONSUME; - } - else { - if ( (LA(1)==PARSERCLASS) ) { - zzmatch(PARSERCLASS); zzCONSUME; - } - else { - if ( (LA(1)==ACTION) ) { - } - else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - } - zzEXIT(zztasp3); - } - } - zzmatch(ACTION); zzCONSUME; - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - if ( gen_cpp ) p_includes(); - start_states(); - func_action = FALSE; p_tables(); p_tail(); - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==ACTION) ) { - zzmatch(ACTION); zzCONSUME; - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(1); - if (firstLexMember != 0) p_class_def1(); - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x2); - } -} - -void -#ifdef __USE_PROTOS -start_states(void) -#else -start_states() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==PER_PER) ) { - zzmatch(PER_PER); zzCONSUME; - do_conversion(); - } - else { - if ( (LA(1)==NAME_PER_PER) ) { - zzmatch(NAME_PER_PER); zzCONSUME; - do_conversion(); - { - zzBLOCK(zztasp3); - zzMake0; - { - while ( (LA(1)==NAME_PER_PER) ) { - zzmatch(NAME_PER_PER); zzCONSUME; - do_conversion(); - zzLOOP(zztasp3); - } - zzEXIT(zztasp3); - } - } - } - else {zzFAIL(1,zzerr2,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzmatch(PER_PER); zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x4); - } -} - -void -#ifdef __USE_PROTOS -do_conversion(void) -#else -do_conversion() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - new_automaton_mode(); func_action = TRUE; - rule_list(); - - dfa_class_nop[mode_counter] = - relabel(zzaArg(zztasp1,1 ).l,comp_level); - if (comp_level) - p_shift_table(mode_counter); - dfa_basep[mode_counter] = dfa_allocated+1; - make_dfa_model_node(dfa_class_nop[mode_counter]); - nfa_to_dfa(zzaArg(zztasp1,1 ).l); - ++mode_counter; - func_action = FALSE; -#ifdef HASH_STAT - fprint_hash_stats(stderr); -#endif - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x8); - } -} - -void -#ifdef __USE_PROTOS -rule_list(void) -#else -rule_list() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - if ( (setwd1[LA(1)]&0x10) ) { - rule(); - zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (setwd1[LA(1)]&0x20) ) { - rule(); - {nfa_node *t1; - t1 = new_nfa_node(); - (t1)->trans[0]=zzaRet.l; - (t1)->trans[1]=zzaArg(zztasp2,1 ).l; - /* all accept nodes "dead ends" */ - zzaRet.l=t1; zzaRet.r=NULL; - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - } - else { - if ( (setwd1[LA(1)]&0x40) ) { - zzaRet.l = new_nfa_node(); zzaRet.r = NULL; - warning("no regular expressions", zzline); - } - else {zzFAIL(1,zzerr3,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x80); - } -} - -void -#ifdef __USE_PROTOS -rule(void) -#else -rule() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - if ( (setwd2[LA(1)]&0x1) ) { - reg_expr(); - zzmatch(ACTION); - if (zzaArg(zztasp1,1 ).r != NULL) { - zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; (zzaArg(zztasp1,1 ).r)->accept=action_no; - } - zzCONSUME; - - } - else { - if ( (LA(1)==ACTION) ) { - zzmatch(ACTION); - zzaRet.l = NULL; zzaRet.r = NULL; - error("no expression for action ", zzline); - zzCONSUME; - - } - else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x2); - } -} - -void -#ifdef __USE_PROTOS -reg_expr(void) -#else -reg_expr() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - and_expr(); - zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==OR) ) { - zzmatch(OR); zzCONSUME; - and_expr(); - {nfa_node *t1, *t2; - t1 = new_nfa_node(); t2 = new_nfa_node(); - (t1)->trans[0]=zzaRet.l; - (t1)->trans[1]=zzaArg(zztasp2,2 ).l; - /* MR23 */ if (zzaRet.r != NULL) (zzaRet.r)->trans[1]=t2; - if (zzaArg(zztasp2,2 ).r) { - (zzaArg(zztasp2,2 ).r)->trans[1]=t2; /* MR20 */ - } - zzaRet.l=t1; zzaRet.r=t2; - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x4); - } -} - -void -#ifdef __USE_PROTOS -and_expr(void) -#else -and_expr() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - repeat_expr(); - - zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (setwd2[LA(1)]&0x8) ) { - repeat_expr(); - if (zzaRet.r != NULL) { - (zzaRet.r)->trans[1]=zzaArg(zztasp2,1 ).l; - zzaRet.r=zzaArg(zztasp2,1 ).r; - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x10); - } -} - -void -#ifdef __USE_PROTOS -repeat_expr(void) -#else -repeat_expr() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - if ( (setwd2[LA(1)]&0x20) ) { - expr(); - zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==ZERO_MORE) ) { - zzmatch(ZERO_MORE); - { nfa_node *t1,*t2; - /* MR23 */ if (zzaRet.r != NULL) (zzaRet.r)->trans[0] = zzaRet.l; - t1 = new_nfa_node(); t2 = new_nfa_node(); - t1->trans[0]=zzaRet.l; - t1->trans[1]=t2; - /* MR23 */ if (zzaRet.r != NULL) (zzaRet.r)->trans[1]=t2; - zzaRet.l=t1;zzaRet.r=t2; - } - zzCONSUME; - - } - else { - if ( (LA(1)==ONE_MORE) ) { - zzmatch(ONE_MORE); - if (zzaRet.r != NULL) (zzaRet.r)->trans[0] = zzaRet.l; - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp2); - } - } - } - else { - if ( (LA(1)==ZERO_MORE) ) { - zzmatch(ZERO_MORE); - error("no expression for *", zzline); - zzCONSUME; - - } - else { - if ( (LA(1)==ONE_MORE) ) { - zzmatch(ONE_MORE); - error("no expression for +", zzline); - zzCONSUME; - - } - else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x80); - } -} - -void -#ifdef __USE_PROTOS -expr(void) -#else -expr() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - zzaRet.l = new_nfa_node(); - zzaRet.r = new_nfa_node(); - if ( (LA(1)==L_BRACK) ) { - zzmatch(L_BRACK); zzCONSUME; - atom_list(); - zzmatch(R_BRACK); - - /* MR23 */ if (zzaRet.l != NULL) { - (zzaRet.l)->trans[0] = zzaRet.r; - (zzaRet.l)->label = set_dup(zzaArg(zztasp1,2 ).label); - set_orin(&used_chars,(zzaRet.l)->label); - } - zzCONSUME; - - } - else { - if ( (LA(1)==NOT) ) { - zzmatch(NOT); zzCONSUME; - zzmatch(L_BRACK); zzCONSUME; - atom_list(); - zzmatch(R_BRACK); - - /* MR23 */ if (zzaRet.l != NULL) { - (zzaRet.l)->trans[0] = zzaRet.r; - (zzaRet.l)->label = set_dif(normal_chars,zzaArg(zztasp1,3 ).label); - set_orin(&used_chars,(zzaRet.l)->label); - } - zzCONSUME; - - } - else { - if ( (LA(1)==L_PAR) ) { - zzmatch(L_PAR); zzCONSUME; - reg_expr(); - zzmatch(R_PAR); - - /* MR23 */ if (zzaRet.l != NULL) { - (zzaRet.l)->trans[0] = zzaArg(zztasp1,2 ).l; - if (zzaArg(zztasp1,2 ).r) { - (zzaArg(zztasp1,2 ).r)->trans[1] = zzaRet.r; /* MR20 */ - } - } - zzCONSUME; - - } - else { - if ( (LA(1)==L_BRACE) ) { - zzmatch(L_BRACE); zzCONSUME; - reg_expr(); - zzmatch(R_BRACE); - - /* MR23 */ if (zzaRet.l != NULL) { - (zzaRet.l)->trans[0] = zzaArg(zztasp1,2 ).l; - (zzaRet.l)->trans[1] = zzaRet.r; - if (zzaArg(zztasp1,2 ).r) { - (zzaArg(zztasp1,2 ).r)->trans[1] = zzaRet.r; /* MR20 */ - } - } - zzCONSUME; - - } - else { - if ( (setwd3[LA(1)]&0x1) ) { - atom(); - - /* MR23 */ if (zzaRet.l != NULL) { - (zzaRet.l)->trans[0] = zzaRet.r; - (zzaRet.l)->label = set_dup(zzaArg(zztasp1,1 ).label); - set_orin(&used_chars,(zzaRet.l)->label); - } - } - else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x2); - } -} - -void -#ifdef __USE_PROTOS -atom_list(void) -#else -atom_list() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - set_free(zzaRet.label); - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (setwd3[LA(1)]&0x4) ) { - near_atom(); - set_orin(&(zzaRet.label),zzaArg(zztasp2,1 ).label); - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x8); - } -} - -void -#ifdef __USE_PROTOS -near_atom(void) -#else -near_atom() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - register int i; - register int i_prime; - anychar(); - zzaRet.letter=zzaArg(zztasp1,1 ).letter; zzaRet.label=set_of(zzaArg(zztasp1,1 ).letter); - i_prime = zzaArg(zztasp1,1 ).letter + MIN_CHAR; - if (case_insensitive && islower(i_prime)) - set_orel(toupper(i_prime)-MIN_CHAR, - &(zzaRet.label)); - if (case_insensitive && isupper(i_prime)) - set_orel(tolower(i_prime)-MIN_CHAR, - &(zzaRet.label)); - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==RANGE) ) { - zzmatch(RANGE); zzCONSUME; - anychar(); - if (case_insensitive){ - i_prime = zzaRet.letter+MIN_CHAR; - zzaRet.letter = (islower(i_prime) ? - toupper(i_prime) : i_prime)-MIN_CHAR; - i_prime = zzaArg(zztasp2,2 ).letter+MIN_CHAR; - zzaArg(zztasp2,2 ).letter = (islower(i_prime) ? - toupper(i_prime) : i_prime)-MIN_CHAR; - } - /* check to see if range okay */ - { - int debugLetter1 = zzaRet.letter; - int debugLetter2 = zzaArg(zztasp2,2 ).letter; - } - if (zzaRet.letter > zzaArg(zztasp2,2 ).letter - && zzaArg(zztasp2,2 ).letter != 0xff){ /* MR16 */ - error("invalid range ", zzline); - } - for (i=zzaRet.letter; i<= (int)zzaArg(zztasp2,2 ).letter; ++i){ - set_orel(i,&(zzaRet.label)); - i_prime = i+MIN_CHAR; - if (case_insensitive && islower(i_prime)) - set_orel(toupper(i_prime)-MIN_CHAR, - &(zzaRet.label)); - if (case_insensitive && isupper(i_prime)) - set_orel(tolower(i_prime)-MIN_CHAR, - &(zzaRet.label)); - } - } - else { - if ( (setwd3[LA(1)]&0x10) ) { - } - else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x20); - } -} - -void -#ifdef __USE_PROTOS -atom(void) -#else -atom() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - register int i_prime; - anychar(); - zzaRet.label = set_of(zzaArg(zztasp1,1 ).letter); - i_prime = zzaArg(zztasp1,1 ).letter + MIN_CHAR; - if (case_insensitive && islower(i_prime)) - set_orel(toupper(i_prime)-MIN_CHAR, - &(zzaRet.label)); - if (case_insensitive && isupper(i_prime)) - set_orel(tolower(i_prime)-MIN_CHAR, - &(zzaRet.label)); - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x40); - } -} - -void -#ifdef __USE_PROTOS -anychar(void) -#else -anychar() -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - if ( (LA(1)==REGCHAR) ) { - zzmatch(REGCHAR); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==OCTAL_VALUE) ) { - zzmatch(OCTAL_VALUE); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==HEX_VALUE) ) { - zzmatch(HEX_VALUE); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==DEC_VALUE) ) { - zzmatch(DEC_VALUE); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==TAB) ) { - zzmatch(TAB); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==NL) ) { - zzmatch(NL); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==CR) ) { - zzmatch(CR); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==BS) ) { - zzmatch(BS); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==LIT) ) { - zzmatch(LIT); - zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR; - zzCONSUME; - - } - else { - if ( (LA(1)==L_EOF) ) { - zzmatch(L_EOF); - zzaRet.letter = 0; - zzCONSUME; - - } - else {zzFAIL(1,zzerr9,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - } - } - } - } - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - /* empty action */ - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x80); - } -} - -/* adds a new nfa to the binary tree and returns a pointer to it */ -nfa_node * -#ifdef __USE_PROTOS -new_nfa_node(void) -#else -new_nfa_node() -#endif -{ - register nfa_node *t; - static int nfa_size=0; /* elements nfa_array[] can hold */ - - ++nfa_allocated; - if (nfa_size<=nfa_allocated){ - /* need to redo array */ - if (!nfa_array){ - /* need some to do inital allocation */ - nfa_size=nfa_allocated+NFA_MIN; - nfa_array=(nfa_node **) malloc(sizeof(nfa_node*)* - nfa_size); - }else{ - /* need more space */ - nfa_size=2*(nfa_allocated+1); - nfa_array=(nfa_node **) realloc(nfa_array, - sizeof(nfa_node*)*nfa_size); - } - } - /* fill out entry in array */ - t = (nfa_node*) malloc(sizeof(nfa_node)); - nfa_array[nfa_allocated] = t; - *t = nfa_model_node; - t->node_no = nfa_allocated; - return t; -} - - -/* initialize the model node used to fill in newly made nfa_nodes */ -void -#ifdef __USE_PROTOS -make_nfa_model_node(void) -#else -make_nfa_model_node() -#endif -{ - nfa_model_node.node_no = -1; /* impossible value for real nfa node */ - nfa_model_node.nfa_set = 0; - nfa_model_node.accept = 0; /* error state default*/ - nfa_model_node.trans[0] = NULL; - nfa_model_node.trans[1] = NULL; - nfa_model_node.label = empty; -} - -#if defined(DEBUG) || defined(_DEBUG) - -/* print out the pointer value and the node_number */ -void -#ifdef __USE_PROTOS -fprint_dfa_pair(FILE *f, nfa_node *p) -#else -fprint_dfa_pair(f, p) -FILE *f; -nfa_node *p; -#endif -{ - if (p){ - fprintf(f, "%x (%d)", p, p->node_no); - }else{ - fprintf(f, "(nil)"); - } -} - -/* print out interest information on a set */ -void -#ifdef __USE_PROTOS -fprint_set(FILE *f, set s) -#else -fprint_set(f,s) -FILE *f; -set s; -#endif -{ - unsigned int *x; - - fprintf(f, "n = %d,", s.n); - if (s.setword){ - fprintf(f, "setword = %x, ", s.setword); - /* print out all the elements in the set */ - x = set_pdq(s); - while (*x!=nil){ - fprintf(f, "%d ", *x); - ++x; - } - }else{ - fprintf(f, "setword = (nil)"); - } -} - -/* code to be able to dump out the nfas -return 0 if okay dump -return 1 if screwed up -*/ -int -#ifdef __USE_PROTOS -dump_nfas(int first_node, int last_node) -#else -dump_nfas(first_node, last_node) -int first_node; -int last_node; -#endif -{ - register int i; - nfa_node *t; - - for (i=first_node; i<=last_node; ++i){ - t = NFA(i); - if (!t) break; - fprintf(stderr, "nfa_node %d {\n", t->node_no); - fprintf(stderr, "\n\tnfa_set = %d\n", t->nfa_set); - fprintf(stderr, "\taccept\t=\t%d\n", t->accept); - fprintf(stderr, "\ttrans\t=\t("); - fprint_dfa_pair(stderr, t->trans[0]); - fprintf(stderr, ","); - fprint_dfa_pair(stderr, t->trans[1]); - fprintf(stderr, ")\n"); - fprintf(stderr, "\tlabel\t=\t{ "); - fprint_set(stderr, t->label); - fprintf(stderr, "\t}\n"); - fprintf(stderr, "}\n\n"); - } - return 0; -} -#endif - -/* DLG-specific syntax error message generator -* (define USER_ZZSYN when compiling so don't get 2 definitions) -*/ -void -#ifdef __USE_PROTOS -zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text) -#else -zzsyn(text, tok, egroup, eset, etok, k, bad_text) -char *text, *egroup, *bad_text; -int tok; -int etok; -int k; -SetWordType *eset; -#endif -{ -fprintf(stderr, ErrHdr, file_str[0]!=NULL?file_str[0]:"stdin", zzline); -fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text); -if ( !etok && !eset ) {fprintf(stderr, "\n"); return;} -if ( k==1 ) fprintf(stderr, " missing"); -else -{ -fprintf(stderr, "; \"%s\" not", bad_text); -if ( zzset_deg(eset)>1 ) fprintf(stderr, " in"); -} -if ( zzset_deg(eset)>0 ) zzedecode(eset); -else fprintf(stderr, " %s", zztokens[etok]); -if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup); -fprintf(stderr, "\n"); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.g b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.g deleted file mode 100644 index 7a16299e7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/dlg_p.g +++ /dev/null @@ -1,614 +0,0 @@ -/* This is the parser for the dlg - * This is a part of the Purdue Compiler Construction Tool Set - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * DLG 1.33 - * Will Cohen - * With mods by Terence Parr; AHPCRC, University of Minnesota - * 1989-1995 - */ - -#header << -#include -#include "dlg.h" ->> - -<< - -/* MR20 G. Hobbelt - Fix for Borland C++ 4.x & 5.x compiling with ALL warnings enabled -*/ - -#ifdef __TURBOC__ -#pragma warn -aus /* unused assignment of 'xxx' */ -#endif - -int action_no = 0; /* keep track of actions outputed */ -int nfa_allocated = 0; /* keeps track of number of nfa nodes */ -nfa_node **nfa_array = NULL;/* root of binary tree that stores nfa array */ -nfa_node nfa_model_node; /* model to initialize new nodes */ -set used_chars; /* used to label trans. arcs */ -set used_classes; /* classes or chars used to label trans. arcs */ -set normal_chars; /* mask to get rid elements that aren't used - in set */ -int flag_paren = FALSE; -int flag_brace = FALSE; -int mode_counter = 0; /* keep track of number of %%names */ - ->> - -#lexaction << -int func_action; /* should actions be turned into functions?*/ -int lex_mode_counter = 0; /* keeps track of the number of %%names */ -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via <<%%lexmember...>> */ -/* MR1 */ -int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */ -int lexAction = 0; /* <<%%lexaction ...>> MR1 */ -int parserClass = 0; /* <<%%parserclass ...>> MR1 */ -int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */ -char theClassName[100]; /* MR11 */ -char *pClassName=theClassName; /* MR11 */ -int firstLexMember=1; /* MR1 */ - -#ifdef __USE_PROTOS -void xxputc(int c) { /* MR1 */ -#else -void xxputc(c) /* MR1 */ - int c; /* MR1 */ -{ /* MR1 */ -#endif - if (parserClass) { /* MR1 */ - *pClassName++=c; /* MR1 */ - *pClassName=0; /* MR1 */ - } else if (lexMember || lexPrefix) { /* MR1 */ - if (class_stream != NULL) fputc(c,class_stream); /* MR1 */ - } else { /* MR1 */ - fputc(c,OUT); /* MR1 */ - }; /* MR1 */ -} /* MR1 */ - -#ifdef __USE_PROTOS -void xxprintf(char *format,char *string) { /* MR1 */ -#else -void xxprintf(format,string) /* MR1 */ - char *format; /* MR1 */ - char *string; /* MR1 */ -{ /* MR1 */ -#endif - if (lexMember || lexPrefix || parserClass) { /* MR1 */ - if (class_stream != NULL) /* MR1 */ - fprintf(class_stream,format,string); /* MR1 */ - } else { /* MR1 */ - fprintf(OUT,format,string); /* MR1 */ - }; /* MR1 */ -} /* MR1 */ ->> - -#token "[\r\t\ ]+" << zzskip(); >> /* Ignore white */ -#token "\n" << zzline++; zzskip(); DAWDLE; >> /* Track Line # */ -#token L_EOF "\@" -#token PER_PER "\%\%" -#token NAME_PER_PER "\%\%[a-zA-Z_][a-zA-Z0-9_]*" - << p_mode_def(&zzlextext[2],lex_mode_counter++); >> - -#token LEXMEMBER "\<\<\%\%lexmember" /* MR1 */ - <> /* MR1 */ -#token LEXACTION "\<\<\%\%lexaction" /* MR1 */ - <> /* MR1 */ -#token PARSERCLASS "\<\<\%\%parserclass" /* MR1 */ - <> /* MR1 */ -#token LEXPREFIX "\<\<\%\%lexprefix" /* MR1 */ - <> /* MR1 */ - -#token ACTION "\<\<" - << if (func_action) - fprintf(OUT,"\n%s %sact%d()\n{ ", - gen_cpp?"ANTLRTokenType":"static void", - gen_cpp?ClassName("::"):"", ++action_no); - zzmode(ACT); zzskip(); - >> -#token GREAT_GREAT "\>\>" -#token L_BRACE "\{" -#token R_BRACE "\}" -#token L_PAR "\(" -#token R_PAR "\)" -#token L_BRACK "\[" -#token R_BRACK "\]" -#token ZERO_MORE "\*" -#token ONE_MORE "\+" -#token OR "\|" -#token RANGE "\-" -#token NOT "\~" -#token OCTAL_VALUE "\\0[0-7]*" - << {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}>> -#token HEX_VALUE "\\0[Xx][0-9a-fA-F]+" - << {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}>> -#token DEC_VALUE "\\[1-9][0-9]*" - << {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}>> -#token TAB "\\t" << zzlextext[0] = '\t';>> -#token NL "\\n" << zzlextext[0] = '\n';>> -#token CR "\\r" << zzlextext[0] = '\r';>> -#token BS "\\b" << zzlextext[0] = '\b';>> - -/* MR1 */ -/* MR1 10-Apr-97 MR1 Allow #token regular expressions to cross lines */ -/* MR1 */ -#token CONTINUATION "\\ \n" << zzline++; zzskip();>> /* MR1 */ - -/* NOTE: this takes ANYTHING after the \ */ -#token LIT "\\~[tnrb]" << zzlextext[0] = zzlextext[1];>> - -/* NOTE: this takes ANYTHING that doesn't match the other tokens */ -#token REGCHAR "~[\\]" - - -grammar : << p_head(); p_class_hdr(); func_action = FALSE;>> - ( {LEXACTION | LEXMEMBER | LEXPREFIX | PARSERCLASS } ACTION)* /* MR1 */ - <> - start_states - << func_action = FALSE; p_tables(); p_tail(); >> - (ACTION)* "@" - << if (firstLexMember != 0) p_class_def1(); >> /* MR1 */ - ; - -start_states : ( PER_PER do_conversion - | NAME_PER_PER do_conversion (NAME_PER_PER do_conversion)*) - PER_PER - ; - -do_conversion : <> - rule_list - << - dfa_class_nop[mode_counter] = - relabel($1.l,comp_level); - if (comp_level) - p_shift_table(mode_counter); - dfa_basep[mode_counter] = dfa_allocated+1; - make_dfa_model_node(dfa_class_nop[mode_counter]); - nfa_to_dfa($1.l); - ++mode_counter; - func_action = FALSE; -#ifdef HASH_STAT - fprint_hash_stats(stderr); -#endif - >> - ; - -rule_list : rule <<$$.l=$1.l; $$.r=$1.r;>> - (rule - <<{nfa_node *t1; - t1 = new_nfa_node(); - (t1)->trans[0]=$$.l; - (t1)->trans[1]=$1.l; - /* all accept nodes "dead ends" */ - $$.l=t1; $$.r=NULL; - } - >> - )* - | /* empty */ - <<$$.l = new_nfa_node(); $$.r = NULL; - warning("no regular expressions", zzline); - >> - ; - -rule : reg_expr ACTION -/* MR23 */ << if ($1.r != NULL) { - $$.l=$1.l; $$.r=$1.r; ($1.r)->accept=action_no; - } - >> - | ACTION - <<$$.l = NULL; $$.r = NULL; - error("no expression for action ", zzline); - >> - ; - -reg_expr : and_expr <<$$.l=$1.l; $$.r=$1.r;>> - (OR and_expr - <<{nfa_node *t1, *t2; - t1 = new_nfa_node(); t2 = new_nfa_node(); - (t1)->trans[0]=$$.l; - (t1)->trans[1]=$2.l; -/* MR23 */ if ($$.r != NULL) ($$.r)->trans[1]=t2; - if ($2.r) { - ($2.r)->trans[1]=t2; /* MR20 */ - } - $$.l=t1; $$.r=t2; - } - >> - )* - ; - -and_expr : repeat_expr - << - $$.l=$1.l; $$.r=$1.r; - >> - (repeat_expr -/* MR23 */ << if ($$.r != NULL) { - ($$.r)->trans[1]=$1.l; - $$.r=$1.r; - } - >> - )* - ; - -repeat_expr : expr <<$$.l=$1.l; $$.r=$1.r;>> - { ZERO_MORE - <<{ nfa_node *t1,*t2; -/* MR23 */ if ($$.r != NULL) ($$.r)->trans[0] = $$.l; - t1 = new_nfa_node(); t2 = new_nfa_node(); - t1->trans[0]=$$.l; - t1->trans[1]=t2; -/* MR23 */ if ($$.r != NULL) ($$.r)->trans[1]=t2; - $$.l=t1;$$.r=t2; - } - >> - | ONE_MORE -/* MR23 */ <trans[0] = $$.l;>> - } - | ZERO_MORE - << error("no expression for *", zzline);>> - | ONE_MORE - << error("no expression for +", zzline);>> - ; - -expr : << $$.l = new_nfa_node(); - $$.r = new_nfa_node(); - >> - L_BRACK atom_list R_BRACK - << -/* MR23 */ if ($$.l != NULL) { - ($$.l)->trans[0] = $$.r; - ($$.l)->label = set_dup($2.label); - set_orin(&used_chars,($$.l)->label); - } - >> - | NOT L_BRACK atom_list R_BRACK - << -/* MR23 */ if ($$.l != NULL) { - ($$.l)->trans[0] = $$.r; - ($$.l)->label = set_dif(normal_chars,$3.label); - set_orin(&used_chars,($$.l)->label); - } - >> - | L_PAR reg_expr R_PAR - << -/* MR23 */ if ($$.l != NULL) { - ($$.l)->trans[0] = $2.l; - if ($2.r) { - ($2.r)->trans[1] = $$.r; /* MR20 */ - } - } - >> - | L_BRACE reg_expr R_BRACE - << -/* MR23 */ if ($$.l != NULL) { - ($$.l)->trans[0] = $2.l; - ($$.l)->trans[1] = $$.r; - if ($2.r) { - ($2.r)->trans[1] = $$.r; /* MR20 */ - } - } - >> - | atom - << -/* MR23 */ if ($$.l != NULL) { - ($$.l)->trans[0] = $$.r; - ($$.l)->label = set_dup($1.label); - set_orin(&used_chars,($$.l)->label); - } - >> - ; - -atom_list : << set_free($$.label); >> - (near_atom <>)* - ; - -near_atom : << register int i; - register int i_prime; - >> - anychar - <<$$.letter=$1.letter; $$.label=set_of($1.letter); - i_prime = $1.letter + MIN_CHAR; - if (case_insensitive && islower(i_prime)) - set_orel(toupper(i_prime)-MIN_CHAR, - &($$.label)); - if (case_insensitive && isupper(i_prime)) - set_orel(tolower(i_prime)-MIN_CHAR, - &($$.label)); - >> - { RANGE anychar - << if (case_insensitive){ - i_prime = $$.letter+MIN_CHAR; - $$.letter = (islower(i_prime) ? - toupper(i_prime) : i_prime)-MIN_CHAR; - i_prime = $2.letter+MIN_CHAR; - $2.letter = (islower(i_prime) ? - toupper(i_prime) : i_prime)-MIN_CHAR; - } - /* check to see if range okay */ - { - int debugLetter1 = $$.letter; - int debugLetter2 = $2.letter; - } - if ($$.letter > $2.letter - && $2.letter != 0xff){ /* MR16 */ - error("invalid range ", zzline); - } - for (i=$$.letter; i<= (int)$2.letter; ++i){ - set_orel(i,&($$.label)); - i_prime = i+MIN_CHAR; - if (case_insensitive && islower(i_prime)) - set_orel(toupper(i_prime)-MIN_CHAR, - &($$.label)); - if (case_insensitive && isupper(i_prime)) - set_orel(tolower(i_prime)-MIN_CHAR, - &($$.label)); - } - >> - } - ; - -atom : << register int i_prime;>> - anychar - <<$$.label = set_of($1.letter); - i_prime = $1.letter + MIN_CHAR; - if (case_insensitive && islower(i_prime)) - set_orel(toupper(i_prime)-MIN_CHAR, - &($$.label)); - if (case_insensitive && isupper(i_prime)) - set_orel(tolower(i_prime)-MIN_CHAR, - &($$.label)); - >> - ; - -anychar : REGCHAR <<$$.letter = $1.letter - MIN_CHAR;>> - | OCTAL_VALUE <<$$.letter = $1.letter - MIN_CHAR;>> - | HEX_VALUE <<$$.letter = $1.letter - MIN_CHAR;>> - | DEC_VALUE <<$$.letter = $1.letter - MIN_CHAR;>> - | TAB <<$$.letter = $1.letter - MIN_CHAR;>> - | NL <<$$.letter = $1.letter - MIN_CHAR;>> - | CR <<$$.letter = $1.letter - MIN_CHAR;>> - | BS <<$$.letter = $1.letter - MIN_CHAR;>> - | LIT <<$$.letter = $1.letter - MIN_CHAR;>> - /* NOTE: LEX_EOF is ALWAYS shifted to 0 = MIN_CHAR - MIN_CHAR*/ - | L_EOF <<$$.letter = 0;>> - ; - -<> - -#lexclass ACT -#token "@" << error("unterminated action", zzline); zzmode(START); >> -#token ACTION "\>\>" - << if (func_action) fprintf(OUT,"}\n\n"); - zzmode(START); -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via <<%%lexmember ...>> */ -/* MR1 This is a consequence of not saving actions */ -/* MR1 */ -/* MR1 */ parserClass=0; -/* MR1 */ lexPrefix=0; -/* MR1 */ lexAction=0; -/* MR1 */ lexMember=0; - >> -#token "\>" << xxputc(zzlextext[0]); zzskip(); >> /* MR1 */ -#token "\\\>" << xxputc('>'); zzskip(); >> /* MR1 */ -#token "\\" << xxputc('\\'); zzskip(); >> /* MR1 */ -#token "\n" << xxputc(zzlextext[0]); ++zzline; zzskip(); >> /* MR1 */ -#token "/\*" << zzmode(ACTION_COMMENTS); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> /* MR1 */ -#token "//" << zzmode(ACTION_CPP_COMMENTS); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> /* MR1 */ -#token "~[]" << xxputc(zzlextext[0]); zzskip(); >> /* MR1 */ - /* MR1 */ -#lexclass ACTION_COMMENTS /* MR1 */ -#token "\*/" << zzmode(ACT); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> /* MR1 */ -#token "[\n\r]" << zzline++; xxputc(zzlextext[0]); zzskip();>> /* MR1 */ -#token "~[]" << xxputc(zzlextext[0]); zzskip();>> /* MR1 */ - /* MR1 */ -#lexclass ACTION_CPP_COMMENTS /* MR1 */ -#token "[\n\r]" << zzmode(ACT); zzline++; /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> /* MR1 */ -#token "~[]" << xxputc(zzlextext[0]); zzskip();>> /* MR1 */ - -<< -/* adds a new nfa to the binary tree and returns a pointer to it */ -nfa_node * -#ifdef __USE_PROTOS -new_nfa_node(void) -#else -new_nfa_node() -#endif -{ - register nfa_node *t; - static int nfa_size=0; /* elements nfa_array[] can hold */ - - ++nfa_allocated; - if (nfa_size<=nfa_allocated){ - /* need to redo array */ - if (!nfa_array){ - /* need some to do inital allocation */ - nfa_size=nfa_allocated+NFA_MIN; - nfa_array=(nfa_node **) malloc(sizeof(nfa_node*)* - nfa_size); - }else{ - /* need more space */ - nfa_size=2*(nfa_allocated+1); - nfa_array=(nfa_node **) realloc(nfa_array, - sizeof(nfa_node*)*nfa_size); - } - } - /* fill out entry in array */ - t = (nfa_node*) malloc(sizeof(nfa_node)); - nfa_array[nfa_allocated] = t; - *t = nfa_model_node; - t->node_no = nfa_allocated; - return t; -} - - -/* initialize the model node used to fill in newly made nfa_nodes */ -void -#ifdef __USE_PROTOS -make_nfa_model_node(void) -#else -make_nfa_model_node() -#endif -{ - nfa_model_node.node_no = -1; /* impossible value for real nfa node */ - nfa_model_node.nfa_set = 0; - nfa_model_node.accept = 0; /* error state default*/ - nfa_model_node.trans[0] = NULL; - nfa_model_node.trans[1] = NULL; - nfa_model_node.label = empty; -} ->> - -<< -#if defined(DEBUG) || defined(_DEBUG) - -/* print out the pointer value and the node_number */ -void -#ifdef __USE_PROTOS -fprint_dfa_pair(FILE *f, nfa_node *p) -#else -fprint_dfa_pair(f, p) -FILE *f; -nfa_node *p; -#endif -{ - if (p){ - fprintf(f, "%x (%d)", p, p->node_no); - }else{ - fprintf(f, "(nil)"); - } -} - -/* print out interest information on a set */ -void -#ifdef __USE_PROTOS -fprint_set(FILE *f, set s) -#else -fprint_set(f,s) -FILE *f; -set s; -#endif -{ - unsigned int *x; - - fprintf(f, "n = %d,", s.n); - if (s.setword){ - fprintf(f, "setword = %x, ", s.setword); - /* print out all the elements in the set */ - x = set_pdq(s); - while (*x!=nil){ - fprintf(f, "%d ", *x); - ++x; - } - }else{ - fprintf(f, "setword = (nil)"); - } -} - -/* code to be able to dump out the nfas - return 0 if okay dump - return 1 if screwed up - */ -int -#ifdef __USE_PROTOS -dump_nfas(int first_node, int last_node) -#else -dump_nfas(first_node, last_node) -int first_node; -int last_node; -#endif -{ - register int i; - nfa_node *t; - - for (i=first_node; i<=last_node; ++i){ - t = NFA(i); - if (!t) break; - fprintf(stderr, "nfa_node %d {\n", t->node_no); - fprintf(stderr, "\n\tnfa_set = %d\n", t->nfa_set); - fprintf(stderr, "\taccept\t=\t%d\n", t->accept); - fprintf(stderr, "\ttrans\t=\t("); - fprint_dfa_pair(stderr, t->trans[0]); - fprintf(stderr, ","); - fprint_dfa_pair(stderr, t->trans[1]); - fprintf(stderr, ")\n"); - fprintf(stderr, "\tlabel\t=\t{ "); - fprint_set(stderr, t->label); - fprintf(stderr, "\t}\n"); - fprintf(stderr, "}\n\n"); - } - return 0; -} -#endif ->> - -<< -/* DLG-specific syntax error message generator - * (define USER_ZZSYN when compiling so don't get 2 definitions) - */ -void -#ifdef __USE_PROTOS -zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text) -#else -zzsyn(text, tok, egroup, eset, etok, k, bad_text) -char *text, *egroup, *bad_text; -int tok; -int etok; -int k; -SetWordType *eset; -#endif -{ - fprintf(stderr, ErrHdr, file_str[0]!=NULL?file_str[0]:"stdin", zzline); - fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text); - if ( !etok && !eset ) {fprintf(stderr, "\n"); return;} - if ( k==1 ) fprintf(stderr, " missing"); - else - { - fprintf(stderr, "; \"%s\" not", bad_text); - if ( zzset_deg(eset)>1 ) fprintf(stderr, " in"); - } - if ( zzset_deg(eset)>0 ) zzedecode(eset); - else fprintf(stderr, " %s", zztokens[etok]); - if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup); - fprintf(stderr, "\n"); -} ->> diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/err.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/err.c deleted file mode 100644 index 896c44772..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/err.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * A n t l r S e t s / E r r o r F i l e H e a d e r - * - * Generated from: dlg_p.g - * - * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001 - * Parr Research Corporation - * with Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include -#include "dlg.h" -#define zzSET_SIZE 8 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "err.h" - -ANTLRChar *zztokens[46]={ - /* 00 */ "Invalid", - /* 01 */ "@", - /* 02 */ "[\\r\\t\\ ]+", - /* 03 */ "\\n", - /* 04 */ "L_EOF", - /* 05 */ "PER_PER", - /* 06 */ "NAME_PER_PER", - /* 07 */ "LEXMEMBER", - /* 08 */ "LEXACTION", - /* 09 */ "PARSERCLASS", - /* 10 */ "LEXPREFIX", - /* 11 */ "ACTION", - /* 12 */ "GREAT_GREAT", - /* 13 */ "L_BRACE", - /* 14 */ "R_BRACE", - /* 15 */ "L_PAR", - /* 16 */ "R_PAR", - /* 17 */ "L_BRACK", - /* 18 */ "R_BRACK", - /* 19 */ "ZERO_MORE", - /* 20 */ "ONE_MORE", - /* 21 */ "OR", - /* 22 */ "RANGE", - /* 23 */ "NOT", - /* 24 */ "OCTAL_VALUE", - /* 25 */ "HEX_VALUE", - /* 26 */ "DEC_VALUE", - /* 27 */ "TAB", - /* 28 */ "NL", - /* 29 */ "CR", - /* 30 */ "BS", - /* 31 */ "CONTINUATION", - /* 32 */ "LIT", - /* 33 */ "REGCHAR", - /* 34 */ "\\>", - /* 35 */ "\\\\>", - /* 36 */ "\\", - /* 37 */ "\\n", - /* 38 */ "/\\*", - /* 39 */ "//", - /* 40 */ "~[]", - /* 41 */ "\\*/", - /* 42 */ "[\\n\\r]", - /* 43 */ "~[]", - /* 44 */ "[\\n\\r]", - /* 45 */ "~[]" -}; -SetWordType zzerr1[8] = {0x80,0xf,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr2[8] = {0x60,0x0,0x0,0x0, 0x0,0x0,0x0,0x0}; -SetWordType zzerr3[8] = {0x70,0xa8,0x9a,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType setwd1[46] = {0x0,0x6,0x0,0x0,0x30,0xc8,0xc8, - 0x1,0x1,0x1,0x1,0x35,0x0,0x30,0x0, - 0x30,0x0,0x30,0x0,0x30,0x30,0x0,0x0, - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0x0,0x30,0x30,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr4[8] = {0x10,0xa8,0x9a,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType zzerr5[8] = {0x10,0xe8,0xbb,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType zzerr6[8] = {0x10,0xa0,0x9a,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType setwd2[46] = {0x0,0x0,0x0,0x0,0xeb,0x2,0x2, - 0x0,0x0,0x0,0x0,0xd6,0x0,0xeb,0xd4, - 0xeb,0xd4,0xeb,0x0,0xcb,0xcb,0xd0,0x0, - 0xeb,0xeb,0xeb,0xeb,0xeb,0xeb,0xeb,0xeb, - 0x0,0xeb,0xeb,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr7[8] = {0x10,0xa0,0x82,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType zzerr8[8] = {0x10,0x0,0x44,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType zzerr9[8] = {0x10,0x0,0x0,0x7f, 0x3,0x0,0x0,0x0}; -SetWordType setwd3[46] = {0x0,0x0,0x0,0x0,0xf7,0x0,0x0, - 0x0,0x0,0x0,0x0,0xc2,0x0,0xc2,0xc2, - 0xc2,0xc2,0xc2,0xb8,0xc2,0xc2,0xc2,0x80, - 0xc2,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7, - 0x0,0xf7,0xf7,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/main.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/main.c deleted file mode 100644 index 4ef38af72..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/main.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Main function for dlg version - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * DLG 1.33 - * Will Cohen - * With mods by Terence Parr; AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "stdpccts.h" - -char program[] = "dlg"; -char version[] = "1.33MR33"; /* MRXXX */ -int numfiles = 0; -char *file_str[2] = {NULL, NULL}; -char *mode_file = "mode.h"; -char *class_name = DEFAULT_CLASSNAME; -char *OutputDirectory = TopDirectory; - -/* Option variables */ -int comp_level = 0; -int interactive = FALSE; -int case_insensitive = FALSE; -int warn_ambig = FALSE; -int gen_cpp = FALSE; - -#ifdef __USE_PROTOS -static int ci_strequ(char *a,char *b) -#else -static int ci_strequ(a,b) - char *a; - char *b; -#endif -{ - for ( ;*a != 0 && *b != 0; a++, b++) { - if (toupper(*a) != toupper(*b)) return 0; - } - return (*a == *b); -} - -/* Option List Stuff */ -#ifdef __USE_PROTOS -void p_comp0(void) {comp_level = 0;} -void p_comp1(void) {comp_level = 1;} -void p_comp2(void) {comp_level = 2;} -void p_stdio(void) { file_str[numfiles++] = NULL;} -void p_file(char *s) { file_str[numfiles++] = s;} -void p_cl_name(char *s, char *t) - { - if ( gen_cpp ) { - class_name = t; - } - else { - warning("-cl only valid in C++ mode; -cl ignored...",0); - } - } -void p_mode_file(char *s, char *t){mode_file=t;} -void p_outdir(char *s,char *t) {OutputDirectory=t;} -void p_ansi(void) {gen_ansi = TRUE;} -void p_interactive(void) {interactive = TRUE;} -void p_case_s(void) { case_insensitive = FALSE; } -void p_case_i(void) { case_insensitive = TRUE; } -void p_warn_ambig(void) { warn_ambig = TRUE; } -void p_cpp(void) { gen_cpp = TRUE; } -#else -void p_comp0() {comp_level = 0;} -void p_comp1() {comp_level = 1;} -void p_comp2() {comp_level = 2;} -void p_stdio() { file_str[numfiles++] = NULL;} -void p_file(s) char *s; { file_str[numfiles++] = s;} -void p_cl_name(s,t) - char *s, *t; - { - if ( gen_cpp ) { - class_name = t; - } - else { - warning("-cl only valid in C++ mode; -cl ignored...",0); - } - } -void p_mode_file(s,t) char *s,*t;{mode_file=t;} -void p_outdir(s,t) char *s,*t;{OutputDirectory=t;} -void p_ansi() {gen_ansi = TRUE;} -void p_interactive() {interactive = TRUE;} -void p_case_s() { case_insensitive = FALSE; } -void p_case_i() { case_insensitive = TRUE; } -void p_warn_ambig() { warn_ambig = TRUE; } -void p_cpp() { gen_cpp = TRUE; } -#endif - -#ifdef __cplusplus -typedef void (*WildFunc)(...); -#else -typedef void (*WildFunc)(); -#endif - -typedef struct { - char *option; - int arg; - WildFunc process; - char *descr; - } Opt; - -Opt options[] = { - { "-CC", 0, (WildFunc)p_cpp, "Generate C++ output" }, - { "-C0", 0, (WildFunc)p_comp0, "No compression (default)" }, - { "-C1", 0, (WildFunc)p_comp1, "Compression level 1" }, - { "-C2", 0, (WildFunc)p_comp2, "Compression level 2" }, - { "-ga", 0, (WildFunc)p_ansi, "Generate ansi C"}, - { "-Wambiguity", 0, (WildFunc)p_warn_ambig, "Warn if expressions ambiguous"}, - { "-m", 1, (WildFunc)p_mode_file, "Rename lexical mode output file"}, - { "-i", 0, (WildFunc)p_interactive, "Build interactive scanner (not valid for C++ mode)"}, - { "-ci", 0, (WildFunc)p_case_i, "Make lexical analyzer case insensitive"}, - { "-cl", 1, (WildFunc)p_cl_name, "Rename lexer class (DLGLexer); only used for -CC"}, - { "-cs", 0, (WildFunc)p_case_s, "Make lexical analyzer case sensitive (default)"}, - { "-o", 1, (WildFunc)p_outdir, OutputDirectoryOption}, - { "-", 0, (WildFunc)p_stdio, "Use standard i/o rather than file"}, - { "*", 0, (WildFunc)p_file, ""}, /* anything else is a file */ - { NULL, 0, NULL } - }; - -#ifdef __USE_PROTOS -void ProcessArgs(int argc, char **argv, Opt *options) -#else -void ProcessArgs(argc, argv, options) -int argc; -char **argv; -Opt *options; -#endif -{ - Opt *p; - - while ( argc-- > 0 ) - { - p = options; - while ( p->option != NULL ) - { - if ( strcmp(p->option, "*") == 0 || - ci_strequ(p->option,*argv) ) - { - if ( p->arg ) - { - (*p->process)( *argv, *(argv+1) ); - argv++; - argc--; - } - else - (*p->process)( *argv ); - break; - } - p++; - } - argv++; - } -} - -#ifdef __USE_PROTOS -int main(int argc, char *argv[]) -#else -int main(argc, argv) -int argc; -char *argv[]; -#endif -{ - init(); - fprintf(stderr, "%s Version %s 1989-2001\n", &(program[0]), - &(version[0])); - if ( argc == 1 ) - { - Opt *p = options; - fprintf(stderr, "%s [options] f1 f2 ... fn\n",argv[0]); - while ( *(p->option) != '*' ) - { - fprintf(stderr, "\t%s %s\t%s\n", - p->option, - (p->arg)?"___":" ", - p->descr); - p++; - } - }else{ - ProcessArgs(argc-1, &(argv[1]), options); - if (interactive && gen_cpp) { - fprintf(stderr,"\n"); -/*** MR21a This statement is wrong ! ***/ -#if 0 -*** fprintf(stderr,"Interactive lexer option (\"-i\") has no effect when in C++ mode\n"); -*** fprintf(stderr,"because of extra buffering provided by ANTLRTokenBuffer class.\n"); -*** fprintf(stderr,"\n"); -#endif - } - input_stream = read_stream(file_str[0]); - if (input_stream) { - /* don't overwrite unless input okay */ - if ( gen_cpp ) { - output_stream = write_stream(ClassName(CPP_FILE_SUFFIX)); - if ( file_str[1]!=NULL ) { - warning("output file implicit in C++ mode; ignored...",0); - } - class_stream = write_stream(ClassName(".h")); - mode_stream = class_stream; - } - else { - output_stream = write_stream(file_str[1]); - mode_stream = write_stream(mode_file); - } - } - /* make sure that error reporting routines in grammar - know what the file really is */ - /* make sure that reading and writing somewhere */ - if (input_stream && output_stream && mode_stream){ - ANTLR(grammar(), input_stream); - } - p_class_def2(); /* MR1 */ - } - if ( output_stream!=NULL ) fclose(output_stream); - if ( !gen_cpp && mode_stream!=NULL ) fclose(mode_stream); - if ( class_stream!=NULL ) fclose(class_stream); - exit(PCCTS_EXIT_SUCCESS); - return 0; /* get rid of warning message MR1 */ -} - -/* initialize all the variables */ -void -#ifdef __USE_PROTOS -init(void) -#else -init() -#endif -{ - register int i; - -#ifdef SPECIAL_INITS - special_inits(); /* MR1 */ -#endif - used_chars = empty; - used_classes = empty; - /* make the valid character set */ - normal_chars = empty; - /* NOTE: MIN_CHAR is EOF */ - /* NOTE: EOF is not quite a valid char, it is special. Skip it*/ - for (i = 1; i -#include -#include "dlg.h" -#ifdef MEMCHK -#include "trax.h" -#else -#ifdef __STDC__ -#include -#else -#include -#endif /* __STDC__ */ -#endif - -static char *mode_name[MAX_MODES]; -static int mode_number[MAX_MODES]; -static int cur_mode=0; - -int operation_no = 0; /* used to mark nodes so that infinite loops avoided */ -int dfa_basep[MAX_MODES]; /* start of each group of states */ -int dfa_class_nop[MAX_MODES]; /* number of elements in each group of states*/ - -int gen_ansi = FALSE; /* allows ansi code to be generated */ - -FILE *input_stream; /* where to read description from */ -FILE *output_stream; /* where to put the output */ -FILE *mode_stream; /* where to put the mode.h stuff */ -FILE *class_stream; /* where to put the scan.h stuff (if gen_cpp) */ - -/* NOTE: This section is MACHINE DEPENDENT */ -#define DIF_SIZE 4 -#if defined(PC) && !defined(PC32) -unsigned long typesize[DIF_SIZE] = { 0x7f, 0x7fff, 0x7ffful, 0x7ffffffful }; /* MR20 */ -char t0[] = "unsigned char"; -char t1[] = "unsigned short"; -char t2[] = "unsigned int"; -char t3[] = "unsigned long"; -char *typevar[DIF_SIZE] = { t0, t1, t2, t3}; -#else -unsigned long typesize[DIF_SIZE] = { 0x7f, 0x7fff, 0x7ffffffful, 0x7ffffffful }; /* MR20 */ -char t0[] = "unsigned char"; -char t1[] = "unsigned short"; -char t2[] = "unsigned int"; -char t3[] = "unsigned long"; -char *typevar[DIF_SIZE] = { t0, t1, t2, t3}; -#endif - -/* Added by TJP August 1994 */ -/* Take in MyLexer and return MyLexer_h */ - -static char * -#ifdef __USE_PROTOS -gate_symbol(char *name) -#else -gate_symbol(name) -char *name; -#endif -{ - static char buf[100]; - sprintf(buf, "%s_h", name); - return buf; -} - -/* Added by TJP August 1994 */ -static char * -#ifdef __USE_PROTOS -mystrdup(char *s) -#else -mystrdup(s) -char *s; -#endif -{ - char *p = (char *)malloc(strlen(s)+1); - strcpy(p, s); - return p; -} - -#ifdef __USE_PROTOS -void p_class_hdr(void) -#else -void p_class_hdr() -#endif -{ - if ( class_stream == NULL ) return; - fprintf(class_stream, "#ifndef %s\n", gate_symbol(ClassName(""))); - fprintf(class_stream, "#define %s\n", gate_symbol(ClassName(""))); - fprintf(class_stream, "/*\n"); - fprintf(class_stream, " * D L G L e x e r C l a s s D e f i n i t i o n\n"); - fprintf(class_stream, " *\n"); - fprintf(class_stream, " * Generated from:"); - fprintf(class_stream, " %s", file_str[0]); - fprintf(class_stream, "\n"); - fprintf(class_stream, " *\n"); - fprintf(class_stream, " * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz\n"); - fprintf(class_stream, " * Purdue University Electrical Engineering\n"); - fprintf(class_stream, " * DLG Version %s\n", version); - fprintf(class_stream, " */\n\n"); - fprintf(class_stream, "\n"); - fprintf(class_stream, "#include \"%s\"\n", DLEXERBASE_H); -} - -/* MR1 */ -/* MR1 16-Apr-97 Split printing of class header up into several parts */ -/* MR1 so that #lexprefix <<...>>and #lexmember <<...>> */ -/* MR1 can be inserted in the appropriate spots */ -/* MR1 */ - -#ifdef __USE_PROTOS -void p_class_def1(void) -#else -void p_class_def1() -#endif -{ - if ( class_stream == NULL ) return; - fprintf(class_stream, "\nclass %s : public DLGLexerBase {\n", ClassName("")); - fprintf(class_stream, "public:\n"); -} - -#ifdef __USE_PROTOS -void p_class_def2(void) -#else -void p_class_def2() -#endif -{ - int i, m; - if ( class_stream == NULL ) return; - fprintf(class_stream, "public:\n"); - fprintf(class_stream, "\tstatic const int MAX_MODE;\n"); - fprintf(class_stream, "\tstatic const int DfaStates;\n"); - for (i=0; i> */ -/* MR1 */ -/* MR1 */ fprintf(class_stream,"//\n"); -/* MR1 */ fprintf(class_stream, -/* MR1 */ "// 133MR1 Deprecated feature to allow inclusion of "); -/* MR1 */ fprintf(class_stream, -/* MR1 */ "user-defined code in DLG class header\n"); -/* MR1 */ fprintf(class_stream,"//\n"); -/* MR1 */ -/* MR1 */ fprintf(class_stream,"#ifdef DLGLexerIncludeFile\n"); -/* MR1 */ fprintf(class_stream,"#include DLGLexerIncludeFile\n"); -/* MR1 */ fprintf(class_stream,"#endif\n"); - - fprintf(class_stream, "};\n"); - - fprintf(class_stream, "typedef ANTLRTokenType (%s::*Ptr%sMemberFunc)();\n", - ClassName(""), ClassName("")); - - fprintf(class_stream, "#endif\n"); -} - -/* generate required header on output */ - -#ifdef __USE_PROTOS -void p_head(void) -#else -void p_head() -#endif -{ - fprintf(OUT, "/*\n"); - fprintf(OUT, " * D L G tables\n"); - fprintf(OUT, " *\n"); - fprintf(OUT, " * Generated from:"); - fprintf(OUT, " %s", file_str[0]); - fprintf(OUT, "\n"); - fprintf(OUT, " *\n"); - fprintf(OUT, " * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz\n"); - fprintf(OUT, " * Purdue University Electrical Engineering\n"); - fprintf(OUT, " * DLG Version %s\n", version); - fprintf(OUT, " */\n\n"); - if ( gen_cpp) fprintf(OUT, "#include \"pcctscfg.h\"\n"); - if ( gen_cpp ) fprintf(OUT, "#include \"pccts_stdio.h\"\n"); - if ( !gen_cpp ) fprintf(OUT, "#include \"%s\"\n\n", mode_file); - fprintf(OUT,"\n"); -} - -#ifdef __USE_PROTOS -void p_includes(void) -#else -void p_includes() -#endif -{ - fprintf(OUT, "#include \"%s\"\n", APARSER_H); - fprintf(OUT, "#include \"%s\"\n", DLEXERBASE_H); - fprintf(OUT, "#include \"%s\"\n", ClassName(".h")); -} - -/* generate code to tie up any loose ends */ - -#ifdef __USE_PROTOS -void p_tail(void) /* MR1 */ -#else -void p_tail() /* MR1 */ -#endif -{ - if ( gen_cpp ) { - if ( strcmp(ClassName(""), DEFAULT_CLASSNAME)!=0 ) - fprintf(OUT, "#define DLGLexer %s\n", ClassName("")); - fprintf(OUT, "#include \"%s\"\n", DLEXER_H); /* MR23 Rename DLexer.cpp to DLexer.h */ - return; - } - fprintf(OUT, "\n"); - fprintf(OUT, "\n"); - if (comp_level) - fprintf(OUT, "#define ZZSHIFT(c) (b_class_no[zzauto][1+c])\n"); - else - fprintf(OUT, "#define ZZSHIFT(c) (1+c)\n"); - if ( !gen_cpp ) fprintf(OUT, "#define MAX_MODE %d\n",mode_counter); - fprintf(OUT, "#include \"dlgauto.h\"\n"); -} - - -/* output the table of DFA for general use */ - -#ifdef __USE_PROTOS -void p_tables() -#else -void p_tables() -#endif -{ - if ( !gen_cpp ) { - fprintf(OUT, "#define DfaStates\t%d\n", dfa_allocated); - fprintf(OUT, "typedef %s DfaState;\n\n", minsize(dfa_allocated)); - } - - if ( gen_cpp ) { - int i; - fprintf(OUT, "\n"); - fprintf(OUT, "const int %s::MAX_MODE=%d;\n", - ClassName(""), - mode_counter); - fprintf(OUT, "const int %s::DfaStates=%d;\n", - ClassName(""), - dfa_allocated); - for (i=0; i typesize[i]) /* MR20 */ - ++i; - return typevar[i]; -} - - -#ifdef __USE_PROTOS -void p_node_table(void) -#else -void p_node_table() -#endif -{ - register int i; - register int m = 0; - - for(m=0; m<(mode_counter-1); ++m){ - for(i=dfa_basep[m]; itrans[j]; - if (trans == NIL_INDEX) - trans = dfa_allocated+1; - /* all of DFA moved down one in array */ - fprintf(OUT, "%d", trans-1); - fprintf(OUT, ", "); - if (!(--items_on_line)){ - fprintf(OUT, "\n "); - items_on_line = MAX_ON_LINE; - } - } -#if 1 - /* put in jump to error state */ - fprintf(OUT, "%d\n};\n\n", dfa_allocated); -#else - fprintf(OUT, "\n};\n\n"); -#endif -} - - -#ifdef __USE_PROTOS -void p_dfa_table(void) -#else -void p_dfa_table() -#endif -{ - register int i; - - fprintf(OUT, "\n%sDfaState *%sdfa[%d] = {\n", - gen_cpp?ClassName("::"):"",gen_cpp?ClassName("::"):"", dfa_allocated); - for (i=0; i<(dfa_allocated-1); ++i){ - fprintf(OUT, "\tst%d,\n", i); - } - fprintf(OUT, "\tst%d\n", i); - fprintf(OUT, "};\n\n"); -} - - -#ifdef __USE_PROTOS -void p_accept_table(void) -#else -void p_accept_table() -#endif -{ - register int i = 1; - register int items_on_line = 0; - int true_interactive = TRUE; - - /* make sure element for one past (zzerraction) -WEC 12/16/92 */ - fprintf(OUT,"\n%sDfaState %saccepts[%d] = {\n ", - gen_cpp?ClassName("::"):"", - gen_cpp?ClassName("::"):"", - dfa_allocated+1); - /* don't do anything if no dfa nodes */ - if (i>dfa_allocated) goto skip_accepts; - for (;;) { - int accept=0; /* MR14a - Manuel Kessler (mlkessle@cip.physik.uni-wuerzburg.de) */ - set accept_set; - set nfa_states; - unsigned int *t, *nfa_i; - unsigned int *q, *regular_expr; - - accept_set = empty; - nfa_states = DFA(i)->nfa_states; - t = nfa_i = set_pdq(nfa_states); - /* NOTE: picks lowest accept because accepts monotonic */ - /* with respect to nfa node numbers and set_pdq */ - /* returns in that order */ - while((*nfa_i != nil) && (!(accept = NFA(*nfa_i)->accept))){ - nfa_i++; - } - - /* figure out if more than one accept state there */ - if (warn_ambig ){ - set_orel(accept, &accept_set); - while(*nfa_i != nil){ - set_orel(NFA(*nfa_i)->accept, &accept_set); - nfa_i++; - } - /* remove error action from consideration */ - set_rm(0, accept_set); - - if( set_deg(accept_set)>1){ - fprintf(stderr, "dlg warning: ambiguous regular expression "); - q = regular_expr = set_pdq(accept_set); - while(*regular_expr != nil){ - fprintf(stderr," %d ", *regular_expr); - ++regular_expr; - } - fprintf(stderr, "\n"); - free(q); - } - } - - if ((DFA(i)->alternatives) && (accept != 0)){ - true_interactive = FALSE; - } - fprintf(OUT, "%d, ", accept); - - /* free up memory before we "break" below -ATG 4/6/95 */ - free(t); - set_free(accept_set); - - if ((++i)>dfa_allocated) - break; - if ((++items_on_line)>=MAX_ON_LINE){ - fprintf(OUT,"\n "); - items_on_line = 0; - } -/* - free(t); - set_free(accept_set); -*/ - } - /* make sure element for one past (zzerraction) -WEC 12/16/92 */ -skip_accepts: - fprintf(OUT, "0\n};\n\n"); -} - - -#ifdef __USE_PROTOS -void p_action_table(void) -#else -void p_action_table() -#endif -{ - register int i; - char* theClassName = ClassName(""); - - if ( gen_cpp ) - fprintf(OUT, "Ptr%sMemberFunc %s::actions[%d] = {\n", theClassName, - theClassName, action_no+1); - else - fprintf(OUT, "void (*actions[%d])() = {\n", action_no+1); - if ( gen_cpp ) -/* fprintf(OUT, "\t(Ptr%sMemberFunc)&%s::erraction,\n", theClassName, theClassName);*/ - fprintf(OUT, "\t&%s::erraction,\n", theClassName); - else - fprintf(OUT, "\tzzerraction,\n"); - for (i=1; i=CHAR_RANGE) - break; - fprintf(OUT,", "); - if ((++items_on_line)>=MAX_ON_LINE){ - fprintf(OUT,"\n "); - items_on_line = 0; - } - } - fprintf(OUT, "\n};\n\n"); -} - - -#ifdef __USE_PROTOS -void p_base_table(void) -#else -void p_base_table() -#endif -{ - register int m; - - fprintf(OUT, "%sDfaState %sdfa_base[] = {\n", - gen_cpp?ClassName("::"):"static ", - gen_cpp?ClassName("::"):""); - for(m=0; m<(mode_counter-1); ++m) - fprintf(OUT, "\t%d,\n", dfa_basep[m]-1); - fprintf(OUT, "\t%d\n};\n\n", dfa_basep[m]-1); -} - - -#ifdef __USE_PROTOS -void p_class_table(void) /* MR1 */ -#else -void p_class_table() /* MR1 */ -#endif -{ -#if 0 - register int m; - - fprintf(OUT,"%s int %sdfa_class_no[] = {\n", - gen_cpp?"":"static", - gen_cpp?ClassName("::"):""); - for(m=0; m<(mode_counter-1); ++m) - fprintf(OUT,"\t%d,\n", dfa_class_nop[m]); - fprintf(OUT,"\t%d\n};\n\n", dfa_class_nop[m]); -#endif -} - - -#ifdef __USE_PROTOS -void p_bshift_table(void) /* MR1 */ -#else -void p_bshift_table() /* MR1 */ -#endif -{ - register int m; - - fprintf(OUT,"%s unsigned char *%sb_class_no[] = {\n", - gen_cpp?"":"static", - gen_cpp?ClassName("::"):""); - for(m=0; m<(mode_counter-1); ++m) - fprintf(OUT, "\tshift%d,\n", m); - fprintf(OUT, "\tshift%d\n};\n\n", m); -} - - -#ifdef __USE_PROTOS -void p_alternative_table(void) /* MR1 */ -#else -void p_alternative_table() /* MR1 */ -#endif -{ - register int i; - - if ( !gen_cpp ) fprintf(OUT, "#define ZZINTERACTIVE\n\n"); - if ( gen_cpp ) - fprintf(OUT, "DLGChar %salternatives[%d] = {\n", /* mr23 vhs %sDfaStates+1 */ - ClassName("::"), - dfa_allocated+1); /* vhs ClassName("::")); */ - else - fprintf(OUT, "static %s zzalternatives[DfaStates+1] = {\n", - minsize(dfa_allocated)); - - for(i=1; i<=dfa_allocated; ++i) - fprintf(OUT, "\t%d,\n", DFA(i)->alternatives); - fprintf(OUT, "/* must have 0 for zzalternatives[DfaStates] */\n"); - fprintf(OUT, "\t0\n};\n\n"); -} - - -#ifdef __USE_PROTOS -void p_mode_def(char *s,int m) /* MR1 */ -#else -void p_mode_def(s,m) /* MR1 */ -char *s; -int m; -#endif -{ - if ( gen_cpp ) - { - mode_name[cur_mode] = mystrdup(s); - mode_number[cur_mode] = m; - cur_mode++; - } - else - fprintf(mode_stream, "#define %s %d\n", s, m); -} - -#ifdef __USE_PROTOS -char * ClassName(char *suffix) -#else -char * ClassName(suffix) -char *suffix; -#endif -{ - static char buf[200]; - extern char *class_name; - - sprintf(buf, "%s%s", class_name, suffix); - return buf; -} - -#ifdef DEBUG - -/* print out a particular nfa node that is pointed to by p */ - -#ifdef __USE_PROTOS -void p_nfa_node(nfa_node *p) -#else -void p_nfa_node(p) -nfa_node *p; -#endif -{ - register nfa_node *t; - - if (p != NIL_INDEX){ - printf("NFA state : %d\naccept state : %d\n", - NFA_NO(p),p->accept); - if (p->trans[0] != NIL_INDEX){ - printf("trans[0] => %d on ", NFA_NO(p->trans[0])); - p_set(p->label); - printf("\n"); - } - else - printf("trans[0] => nil\n"); - if (p->trans[1] != NIL_INDEX) - printf("trans[1] => %d on epsilon\n", - NFA_NO(p->trans[1])); - else - printf("trans[1] => nil\n"); - printf("\n"); - } -} -#endif - -#ifdef DEBUG - -/* code to print out special structures when using a debugger */ - -#ifdef __USE_PROTOS -void p_nfa(p) -#else -void p_nfa(nfa_node *p) -nfa_node *p; /* state number also index into array */ -#endif -{ -/* each node has a marker on it so it only gets printed once */ - - operation_no++; /* get new number */ - s_p_nfa(p); -} - -#ifdef __USE_PROTOS -void s_p_nfa(nfa_node *p) -#else -void s_p_nfa(p) -nfa_node *p; /* state number also index into array */ -#endif -{ - if ((p != NIL_INDEX) && (p->nfa_set != operation_no)){ - /* so it is only printed once */ - p->nfa_set = operation_no; - p_nfa_node(p); - s_p_nfa(p->trans[0]); - s_p_nfa(p->trans[1]); - } -} - -#ifdef __USE_PROTOS -void p_dfa_node(dfa_node *p) -#else -void p_dfa_node(p) -dfa_node *p; -#endif -{ - int i; - - if (p != NIL_INDEX){ - printf("DFA state :%d\n",NFA_NO(p)); - if (p->done) - printf("done\n"); - else - printf("undone\n"); - printf("from nfa states : "); - p_set(p->nfa_states); - printf("\n"); - /* NOTE: trans arcs stored as ints rather than pointer*/ - for (i=0; itrans[i]); - } - printf("\n\n"); - } -} - -#ifdef __USE_PROTOS -void p_dfa(void) -#else -void p_dfa() -#endif -{ -/* prints out all the dfa nodes actually allocated */ - - int i; - - for (i = 1; i<=dfa_allocated; i++) - p_dfa_node(NFA(i)); -} - - -/* print out numbers in the set label */ - -#ifdef __USE_PROTOS -void p_set(set label) -#else -void p_set(label) -set label; -#endif -{ - unsigned *t, *e; - - if (set_nil(label)){ - printf("epsilon\n"); - }else{ - t = e = set_pdq(label); - while(*e != nil){ - printf("%d ", (*e+MIN_CHAR)); - e++; - } - printf("\n"); - free(t); - } - -} -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/parser.dlg b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/parser.dlg deleted file mode 100644 index 0ef4685ed..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/parser.dlg +++ /dev/null @@ -1,398 +0,0 @@ -<< -/* parser.dlg -- DLG Description of scanner - * - * Generated from: dlg_p.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include -#include "dlg.h" -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -LOOKAHEAD - -void -#ifdef __USE_PROTOS -zzerraction() -#else -zzerraction() -#endif -{ - (*zzerr)("invalid token"); - zzadvance(); - zzskip(); -} ->> - -<<%%lexaction - -int func_action; /* should actions be turned into functions?*/ -int lex_mode_counter = 0; /* keeps track of the number of %%names */ -/* MR1 */ -/* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ -/* MR1 via <<%%lexmember...>> */ -/* MR1 */ -int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */ -int lexAction = 0; /* <<%%lexaction ...>> MR1 */ -int parserClass = 0; /* <<%%parserclass ...>> MR1 */ -int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */ -char theClassName[100]; /* MR11 */ -char *pClassName=theClassName; /* MR11 */ -int firstLexMember=1; /* MR1 */ - -#ifdef __USE_PROTOS -void xxputc(int c) { /* MR1 */ -#else - void xxputc(c) /* MR1 */ - int c; /* MR1 */ - { /* MR1 */ -#endif - if (parserClass) { /* MR1 */ - *pClassName++=c; /* MR1 */ - *pClassName=0; /* MR1 */ - } else if (lexMember || lexPrefix) { /* MR1 */ - if (class_stream != NULL) fputc(c,class_stream); /* MR1 */ - } else { /* MR1 */ - fputc(c,OUT); /* MR1 */ - }; /* MR1 */ - } /* MR1 */ - -#ifdef __USE_PROTOS - void xxprintf(char *format,char *string) { /* MR1 */ -#else - void xxprintf(format,string) /* MR1 */ - char *format; /* MR1 */ - char *string; /* MR1 */ - { /* MR1 */ -#endif - if (lexMember || lexPrefix || parserClass) { /* MR1 */ - if (class_stream != NULL) /* MR1 */ - fprintf(class_stream,format,string); /* MR1 */ - } else { /* MR1 */ - fprintf(OUT,format,string); /* MR1 */ - }; /* MR1 */ - } /* MR1 */ ->> - - -%%START - -@ - << - NLA = 1; - >> - -[\r\t\ ]+ - << - NLA = 2; - zzskip(); - >> - -\n - << - NLA = 3; - zzline++; zzskip(); DAWDLE; - >> - -\@ - << - NLA = L_EOF; - >> - -\%\% - << - NLA = PER_PER; - >> - -\%\%[a-zA-Z_][a-zA-Z0-9_]* - << - NLA = NAME_PER_PER; - p_mode_def(&zzlextext[2],lex_mode_counter++); - >> - -\<\<\%\%lexmember - << - NLA = LEXMEMBER; - lexMember=1; /* MR1 */ - if (firstLexMember != 0) { /* MR1 */ - firstLexMember=0; /* MR1 */ - p_class_def1(); /* MR1 */ - }; /* MR1 */ - zzmode(ACT); /* MR1 */ - >> - -\<\<\%\%lexaction - << - NLA = LEXACTION; - lexAction=1;zzmode(ACT); - >> - -\<\<\%\%parserclass - << - NLA = PARSERCLASS; - parserClass=1; /* MR1 */ - zzmode(ACT); /* MR1 */ - >> - -\<\<\%\%lexprefix - << - NLA = LEXPREFIX; - lexPrefix=1;zzmode(ACT); - >> - -\<\< - << - NLA = ACTION; - if (func_action) - fprintf(OUT,"\n%s %sact%d()\n{ ", - gen_cpp?"ANTLRTokenType":"static void", - gen_cpp?ClassName("::"):"", ++action_no); - zzmode(ACT); zzskip(); - >> - -\>\> - << - NLA = GREAT_GREAT; - >> - -\{ - << - NLA = L_BRACE; - >> - -\} - << - NLA = R_BRACE; - >> - -\( - << - NLA = L_PAR; - >> - -\) - << - NLA = R_PAR; - >> - -\[ - << - NLA = L_BRACK; - >> - -\] - << - NLA = R_BRACK; - >> - -\* - << - NLA = ZERO_MORE; - >> - -\+ - << - NLA = ONE_MORE; - >> - -\| - << - NLA = OR; - >> - -\- - << - NLA = RANGE; - >> - -\~ - << - NLA = NOT; - >> - -\\0[0-7]* - << - NLA = OCTAL_VALUE; - {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;} - >> - -\\0[Xx][0-9a-fA-F]+ - << - NLA = HEX_VALUE; - {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;} - >> - -\\[1-9][0-9]* - << - NLA = DEC_VALUE; - {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;} - >> - -\\t - << - NLA = TAB; - zzlextext[0] = '\t'; - >> - -\\n - << - NLA = NL; - zzlextext[0] = '\n'; - >> - -\\r - << - NLA = CR; - zzlextext[0] = '\r'; - >> - -\\b - << - NLA = BS; - zzlextext[0] = '\b'; - >> - -\\ \n - << - NLA = CONTINUATION; - zzline++; zzskip(); - >> - -\\~[tnrb] - << - NLA = LIT; - zzlextext[0] = zzlextext[1]; - >> - -~[\\] - << - NLA = REGCHAR; - >> - - -%%ACT - -@ - << - NLA = 1; - error("unterminated action", zzline); zzmode(START); - >> - -\>\> - << - NLA = ACTION; - if (func_action) fprintf(OUT,"}\n\n"); - zzmode(START); - /* MR1 */ - /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ - /* MR1 via <<%%lexmember ...>> */ - /* MR1 This is a consequence of not saving actions */ - /* MR1 */ - /* MR1 */ parserClass=0; - /* MR1 */ lexPrefix=0; - /* MR1 */ lexAction=0; - /* MR1 */ lexMember=0; - >> - -\> - << - NLA = 34; - xxputc(zzlextext[0]); zzskip(); - >> - -\\\> - << - NLA = 35; - xxputc('>'); zzskip(); - >> - -\\ - << - NLA = 36; - xxputc('\\'); zzskip(); - >> - -\n - << - NLA = 37; - xxputc(zzlextext[0]); ++zzline; zzskip(); - >> - -/\* - << - NLA = 38; - zzmode(ACTION_COMMENTS); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> - -// - << - NLA = 39; - zzmode(ACTION_CPP_COMMENTS); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> - -~[] - << - NLA = 40; - xxputc(zzlextext[0]); zzskip(); - >> - - -%%ACTION_COMMENTS - -@ - << - NLA = 1; - >> - -\*/ - << - NLA = 41; - zzmode(ACT); /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> - -[\n\r] - << - NLA = 42; - zzline++; xxputc(zzlextext[0]); zzskip(); - >> - -~[] - << - NLA = 43; - xxputc(zzlextext[0]); zzskip(); - >> - - -%%ACTION_CPP_COMMENTS - -@ - << - NLA = 1; - >> - -[\n\r] - << - NLA = 44; - zzmode(ACT); zzline++; /* MR1 */ - xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ - >> - -~[] - << - NLA = 45; - xxputc(zzlextext[0]); zzskip(); - >> - -%% diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/relabel.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/relabel.c deleted file mode 100644 index 393ad0b29..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/relabel.c +++ /dev/null @@ -1,217 +0,0 @@ -/* This group of functions does the character class compression. - It goes over the dfa and relabels the arcs with the partitions - of characters in the NFA. The partitions are stored in the - array class. - - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * DLG 1.33 - * Will Cohen - * With mods by Terence Parr; AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include "dlg.h" -#ifdef MEMCHK -#include "trax.h" -#else -#ifdef __STDC__ -#include -#else -#include -#endif /* __STDC__ */ -#endif - -int class_no = CHAR_RANGE; /* number of classes for labels */ -int first_el[CHAR_RANGE]; /* first element in each class partition */ -set class_sets[CHAR_RANGE]; /* array holds partitions from class */ - /* compression */ - -/* goes through labels on NFA graph and partitions the characters into - * character classes. This reduces the amount of space required for each - * dfa node, since only one arc is required each class instead of one arc - * for each character - * level: - * 0 no compression done - * 1 remove unused characters from classes - * 2 compress equivalent characters into same class - * - * returns the number of character classes required - */ -#ifdef __USE_PROTOS -int relabel(nfa_node* start,int level) -#else -int relabel(start,level) -int level; -nfa_node *start; -#endif -{ - if (level){ - set_free(used_classes); - partition(start,level); - label_with_classes(start); - }else{ - /* classes equivalent to all characters in alphabet */ - class_no = CHAR_RANGE; - } - return class_no; -} - -/* makes character class sets for new labels */ -#ifdef __USE_PROTOS -void partition(nfa_node* start,int level) -#else -void partition(start,level) -nfa_node *start; /* beginning of nfa graph */ -int level; /* compression level to uses */ -#endif -{ - set current_class; - set unpart_chars; - set temp; - - unpart_chars = set_dup(used_chars); -#if 0 - /* EOF (-1+1) alway in class 0 */ - class_sets[0] = set_of(0); - first_el[0] = 0; - used_classes = set_of(0); - temp = set_dif(unpart_chars, class_sets[0]); - set_free(unpart_chars); - unpart_chars = temp; - class_no = 1; -#else - class_no = 0; -#endif - while (!set_nil(unpart_chars)){ - /* don't look for equivalent labels if c <= 1 */ - if (level <= 1){ - current_class = set_of(set_int(unpart_chars)); - }else{ - current_class = set_dup(unpart_chars); - intersect_nfa_labels(start,¤t_class); - } - set_orel(class_no,&used_classes); - first_el[class_no] = set_int(current_class); - class_sets[class_no] = current_class; - temp = set_dif(unpart_chars,current_class); - set_free(unpart_chars); - unpart_chars = temp; - ++class_no; - } - - /* free unpart_chars -ATG 5/6/95 */ - set_free(unpart_chars); - -#if 0 - /* group all the other unused characters into a class */ - set_orel(class_no,&used_classes); - first_el[class_no] = set_int(current_class); - class_sets[class_no] = set_dif(normal_chars,used_chars); - ++class_no; -#endif -} - - -/* given pointer to beginning of graph and recursively walks it trying - * to find a maximal partition. This partion in returned in maximal_class - */ -#ifdef __USE_PROTOS -void intersect_nfa_labels(nfa_node* start,set* maximal_class) -#else -void intersect_nfa_labels(start,maximal_class) -nfa_node *start; -set *maximal_class; -#endif -{ - /* pick a new operation number */ - ++operation_no; - r_intersect(start,maximal_class); -} - -#ifdef __USE_PROTOS -void r_intersect(nfa_node* start,set* maximal_class) -#else -void r_intersect(start,maximal_class) -nfa_node *start; -set * maximal_class; -#endif -{ - set temp; - - if(start && start->nfa_set != operation_no) - { - start->nfa_set = operation_no; - temp = set_and(*maximal_class,start->label); - if (!set_nil(temp)) - { - set_free(*maximal_class); - *maximal_class = temp; - }else{ - set_free(temp); - } - r_intersect(start->trans[0],maximal_class); - r_intersect(start->trans[1],maximal_class); - } -} - - -/* puts class labels in place of old character labels */ -#ifdef __USE_PROTOS -void label_with_classes(nfa_node* start) -#else -void label_with_classes(start) -nfa_node *start; -#endif -{ - ++operation_no; - label_node(start); -} - -#ifdef __USE_PROTOS -void label_node(nfa_node *start) -#else -void label_node(start) -nfa_node *start; -#endif -{ - set new_label; - register int i; - - /* only do node if it hasn't been done before */ - if (start && start->nfa_set != operation_no){ - start->nfa_set = operation_no; - new_label = empty; - for (i = 0; ilabel)) - set_orel(i,&new_label); - } - set_free(start->label); - start->label = new_label; - /* do any nodes that can be reached from this one */ - label_node(start->trans[0]); - label_node(start->trans[1]); - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/stdpccts.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/stdpccts.h deleted file mode 100644 index 12c1c7697..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/stdpccts.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef STDPCCTS_H -#define STDPCCTS_H -/* - * stdpccts.h -- P C C T S I n c l u d e - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#ifndef ANTLR_VERSION -#define ANTLR_VERSION 13333 -#endif - -#include "pcctscfg.h" -#include "pccts_stdio.h" - -#include -#include "dlg.h" -#define zzSET_SIZE 8 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "mode.h" -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/support.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/support.c deleted file mode 100644 index e41c5e8d2..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/support.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * DLG 1.33 - * Will Cohen - * With mods by Terence Parr; AHPCRC, University of Minnesota - * 1989-2001 - */ - -#include -#include -#include "dlg.h" -#ifdef MEMCHK -#include "trax.h" -#else -#ifdef __STDC__ -#include -#else -#include -#endif /* __STDC__ */ -#endif - -int err_found = 0; /* indicates whether problem found */ - -#ifdef __USE_PROTOS -void internal_error(char *s, char *file,int line) /* MR9 23-Sep-97 */ -#else -void internal_error(s,file,line) /* MR9 23-Sep-97 */ -char *s,*file; -int line; -#endif -{ - fprintf(stderr,s,file,line); - exit(PCCTS_EXIT_FAILURE); -} - -#ifdef __USE_PROTOS -char *dlg_malloc(int bytes,char *file,int line) -#else -char *dlg_malloc(bytes,file,line) -int bytes; -char *file; -int line; -#endif -{ - char *t; - - t = (char *) malloc(bytes); - if (!t){ - /* error */ - internal_error("%s(%d): unable to allocate memory\n", - file,line); - } - return t; -} - - -#ifdef __USE_PROTOS -char *dlg_calloc(int n,int bytes,char *file,int line) -#else -char *dlg_calloc(n,bytes,file,line) -int n,bytes; -char *file; -int line; -#endif -{ - char *t; - - t = (char *) calloc(n,bytes); - if (!t){ - /* error */ - internal_error("%s(%d): unable to allocate memory\n", - file,line); - } - return t; -} - - -#ifdef __USE_PROTOS -FILE *read_stream(char *name) -#else -FILE *read_stream(name) -char *name; -#endif -{ - FILE *f; - - if (name){ - if (name[0] == '-') { - fprintf(stderr, "dlg: invalid option: '%s'\n", name); - f = NULL; - }else{ - f = fopen(name, "r"); - if (f == NULL){ - /* couldn't open file */ - fprintf(stderr, - "dlg: Warning: Can't read file %s.\n", - name); - } - } - }else{ - /* open stdin if nothing there */ - f = stdin; - } - return f; -} - -#ifdef __USE_PROTOS -FILE *write_stream(char *name) -#else -FILE *write_stream(name) -char *name; -#endif -{ - FILE *f; - - if (name){ - if (name[0] == '-') { - fprintf(stderr, "dlg: invalid option: '%s'\n", name); - f = NULL; - }else{ - f = fopen(OutMetaName(name), "w"); - if (f == NULL){ - /* couldn't open file */ - fprintf(stderr, - "dlg: Warning: Can't write to file %s.\n", - name); - } - else -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(name)); /* MR1 */ -#else - ; /* MR1 */ -#endif - } - }else{ - /* open stdout if nothing there */ - f = stdout; - } - return f; -} - - -#ifdef __USE_PROTOS -void fatal(char *message,int line_no) -#else -void fatal(message,line_no) -char *message; -int line_no; -#endif -{ - fprintf(stderr,ErrHdr, - (file_str[0] ? file_str[0] : "stdin"), line_no); - fprintf(stderr, " Fatal: %s\n", message); - exit(PCCTS_EXIT_FAILURE); -} - -#ifdef __USE_PROTOS -void error(char *message,int line_no) -#else -void error(message,line_no) -char *message; -int line_no; -#endif -{ - fprintf(stderr,ErrHdr, - (file_str[0] ? file_str[0] : "stdin"), line_no); - fprintf(stderr, " Error: %s\n", message); - err_found = 1; -} - -#ifdef __USE_PROTOS -void warning(char *message,int line_no) -#else -void warning(message,line_no) -char *message; -int line_no; -#endif -{ - fprintf(stderr,ErrHdr, - (file_str[0] ? file_str[0] : "stdin"), line_no); - fprintf(stderr, " Warning: %s\n", message); -} - -/* MR10: Jeff Vincent - MR10: Changed to remove directory information from n only if - MR10: if OutputDirectory was changed by user (-o option) -*/ - -#ifdef __USE_PROTOS -char *OutMetaName(char *n) -#else -char *OutMetaName(n) -char *n; -#endif -{ - static char *dir_sym = DirectorySymbol; - static char newname[MaxFileName+1]; - char *p; - - /* If OutputDirectory is same as TopDirectory (platform default) then leave n alone. */ - if (strcmp(OutputDirectory, TopDirectory) == 0) - return n; - - /* p will point to filename without path information */ - if ((p = strrchr(n, *dir_sym)) != NULL) - p++; - else - p = n; - - /* Copy new output directory into newname[] */ - strcpy(newname, OutputDirectory); - - /* if new output directory does not have trailing dir_sym, add it! */ - if (newname[strlen(newname)-1] != *dir_sym) - strcat(newname, dir_sym); - - /* contatenate FILE NAME ONLY to new output directory */ - strcat(newname, p); - - return newname; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/tokens.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/tokens.h deleted file mode 100644 index 70b4b0576..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/tokens.h +++ /dev/null @@ -1,134 +0,0 @@ -#ifndef tokens_h -#define tokens_h -/* tokens.h -- List of labelled tokens and stuff - * - * Generated from: dlg_p.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * ANTLR Version 1.33MR33 - */ -#define zzEOF_TOKEN 1 -#define L_EOF 4 -#define PER_PER 5 -#define NAME_PER_PER 6 -#define LEXMEMBER 7 -#define LEXACTION 8 -#define PARSERCLASS 9 -#define LEXPREFIX 10 -#define ACTION 11 -#define GREAT_GREAT 12 -#define L_BRACE 13 -#define R_BRACE 14 -#define L_PAR 15 -#define R_PAR 16 -#define L_BRACK 17 -#define R_BRACK 18 -#define ZERO_MORE 19 -#define ONE_MORE 20 -#define OR 21 -#define RANGE 22 -#define NOT 23 -#define OCTAL_VALUE 24 -#define HEX_VALUE 25 -#define DEC_VALUE 26 -#define TAB 27 -#define NL 28 -#define CR 29 -#define BS 30 -#define CONTINUATION 31 -#define LIT 32 -#define REGCHAR 33 - -#ifdef __USE_PROTOS -void grammar(void); -#else -extern void grammar(); -#endif - -#ifdef __USE_PROTOS -void start_states(void); -#else -extern void start_states(); -#endif - -#ifdef __USE_PROTOS -void do_conversion(void); -#else -extern void do_conversion(); -#endif - -#ifdef __USE_PROTOS -void rule_list(void); -#else -extern void rule_list(); -#endif - -#ifdef __USE_PROTOS -void rule(void); -#else -extern void rule(); -#endif - -#ifdef __USE_PROTOS -void reg_expr(void); -#else -extern void reg_expr(); -#endif - -#ifdef __USE_PROTOS -void and_expr(void); -#else -extern void and_expr(); -#endif - -#ifdef __USE_PROTOS -void repeat_expr(void); -#else -extern void repeat_expr(); -#endif - -#ifdef __USE_PROTOS -void expr(void); -#else -extern void expr(); -#endif - -#ifdef __USE_PROTOS -void atom_list(void); -#else -extern void atom_list(); -#endif - -#ifdef __USE_PROTOS -void near_atom(void); -#else -extern void near_atom(); -#endif - -#ifdef __USE_PROTOS -void atom(void); -#else -extern void atom(); -#endif - -#ifdef __USE_PROTOS -void anychar(void); -#else -extern void anychar(); -#endif - -extern SetWordType zzerr1[]; -extern SetWordType zzerr2[]; -extern SetWordType zzerr3[]; -extern SetWordType setwd1[]; -extern SetWordType zzerr4[]; -extern SetWordType zzerr5[]; -extern SetWordType zzerr6[]; -extern SetWordType setwd2[]; -extern SetWordType zzerr7[]; -extern SetWordType zzerr8[]; -extern SetWordType zzerr9[]; -extern SetWordType setwd3[]; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/watdlg.mak b/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/watdlg.mak deleted file mode 100644 index 4bda7c951..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/dlg/watdlg.mak +++ /dev/null @@ -1,47 +0,0 @@ -SET=..\support\set -PCCTS_H=..\h - -# -# Watcom -# -CC=wcl386 -ANTLR=..\bin\antlr -DLG=..\bin\dlg -CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC -LIBS= -OBJ_EXT = obj -LINK = wcl386 - -.c.obj : - $(CC) -c $[* $(CFLAGS) - -dlg.exe : dlg_p.obj dlg_a.obj main.obj err.obj set.obj support.obj & - output.obj relabel.obj automata.obj - $(LINK) -fe=dlg.exe *.obj -k14336 - copy *.exe ..\bin - -SRC = dlg_p.c dlg_a.c main.c err.c $(SET)\set.c support.c output.c & - relabel.c automata.c - -dlg_p.c parser.dlg err.c tokens.h : dlg_p.g - $(ANTLR) dlg_p.g - -dlg_a.c mode.h : parser.dlg - $(DLG) -C2 parser.dlg dlg_a.c - -dlg_p.$(OBJ_EXT) : dlg_p.c dlg.h tokens.h mode.h - $(CC) $(CFLAGS) -c dlg_p.c - -dlg_a.$(OBJ_EXT) : dlg_a.c dlg.h tokens.h mode.h - $(CC) $(CFLAGS) -c dlg_a.c - -main.$(OBJ_EXT) : main.c dlg.h - $(CC) $(CFLAGS) -c main.c - -set.$(OBJ_EXT) : $(SET)\set.c - $(CC) -c $(CFLAGS) $(SET)\set.c - -#clean up all the intermediate files -clean: - del *.$(OBJ_EXT) -EOF_watdlg.mak diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.cpp deleted file mode 100644 index 36210855d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.cpp +++ /dev/null @@ -1,871 +0,0 @@ -/* ANTLRParser.C - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#include "pcctscfg.h" - -#include "pccts_stdlib.h" -#include "pccts_stdarg.h" -#include "pccts_string.h" -#include "pccts_stdio.h" - -PCCTS_NAMESPACE_STD - -/* I have to put this here due to C++ limitation - * that you can't have a 'forward' decl for enums. - * I hate C++!!!!!!!!!!!!!!! - * Of course, if I could use real templates, this would go away. - */ -// MR1 -// MR1 10-Apr-97 133MR1 Prevent use of varying sizes for the -// MR1 ANTLRTokenType enum -// MR1 - -enum ANTLRTokenType { TER_HATES_CPP=0, ITS_TOO_COMPLICATED=9999}; // MR1 - -#define ANTLR_SUPPORT_CODE - -#include ATOKEN_H -#include ATOKENBUFFER_H -#include APARSER_H - -static const int zzINF_DEF_TOKEN_BUFFER_SIZE = 2000; /* MR14 */ -static const int zzINF_BUFFER_TOKEN_CHUNK_SIZE = 1000; /* MR14 */ - - /* L o o k a h e a d M a c r o s */ - -/* maximum of 32 bits/unsigned int and must be 8 bits/byte; - * we only use 8 bits of it. - */ -SetWordType ANTLRParser::bitmask[sizeof(SetWordType)*8] = { - 0x00000001, 0x00000002, 0x00000004, 0x00000008, - 0x00000010, 0x00000020, 0x00000040, 0x00000080 -}; - -char ANTLRParser::eMsgBuffer[500] = ""; - -ANTLRParser:: -~ANTLRParser() -{ - delete [] token_type; - delete [] zzFAILtext; // MR16 Manfred Kogler -} - -ANTLRParser:: -ANTLRParser(ANTLRTokenBuffer *_inputTokens, - int k, - int use_inf_look, - int dlook, - int ssize) -{ - LLk = k; - can_use_inf_look = use_inf_look; -/* MR14 */ if (dlook != 0) { -/* MR14 */ panic("ANTLRParser::ANTLRParser - Demand lookahead not supported in C++ mode"); -/* MR14 */ -/* MR14 */ }; - demand_look = 0; /* demand_look = dlook; */ - bsetsize = ssize; - guessing = 0; - token_tbl = NULL; - eofToken = (ANTLRTokenType)1; - - // allocate lookahead buffer - token_type = new ANTLRTokenType[LLk]; - lap = 0; - labase = 0; -#ifdef ZZDEFER_FETCH - stillToFetch = 0; // MR19 -#endif - dirty = 0; - inf_labase = 0; // MR7 - inf_last = 0; // MR7 - /* prime lookahead buffer, point to inputTokens */ - this->inputTokens = _inputTokens; - this->inputTokens->setMinTokens(k); - _inputTokens->setParser(this); // MR1 - resynchConsumed=1; // MR8 - zzFAILtext=NULL; // MR9 - traceOptionValueDefault=0; // MR10 - traceReset(); // MR10 - zzGuessSeq=0; // MR10 - syntaxErrCount=0; // MR11 -} - -void ANTLRParser::init() -{ - prime_lookahead(); - resynchConsumed=1; // MR8 - traceReset(); // MR10 -} - -void ANTLRParser::traceReset() -{ - traceOptionValue=traceOptionValueDefault; - traceGuessOptionValue=1; - traceCurrentRuleName=NULL; - traceDepth=0; -} - - -#ifdef _MSC_VER // MR23 -//Turn off warning: -//interaction between '_setjmp' and C++ object destruction is non-portable -#pragma warning(disable : 4611) -#endif -int ANTLRParser:: -guess(ANTLRParserState *st) -{ - saveState(st); - guessing = 1; - return setjmp(guess_start.state); -} -#ifdef _MSC_VER // MR23 -#pragma warning(default: 4611) -#endif - -void ANTLRParser:: -saveState(ANTLRParserState *buf) -{ - buf->guess_start = guess_start; - buf->guessing = guessing; - buf->inf_labase = inf_labase; - buf->inf_last = inf_last; - buf->dirty = dirty; - buf->traceOptionValue=traceOptionValue; /* MR10 */ - buf->traceGuessOptionValue=traceGuessOptionValue; /* MR10 */ - buf->traceCurrentRuleName=traceCurrentRuleName; /* MR10 */ - buf->traceDepth=traceDepth; /* MR10 */ -} - -void ANTLRParser:: -restoreState(ANTLRParserState *buf) -{ - int i; - int prevTraceOptionValue; - - guess_start = buf->guess_start; - guessing = buf->guessing; - inf_labase = buf->inf_labase; - inf_last = buf->inf_last; - dirty = buf->dirty; - - // restore lookahead buffer from k tokens before restored TokenBuffer position - // if demand_look, then I guess we don't look backwards for these tokens. - for (i=1; i<=LLk; i++) token_type[i-1] = - inputTokens->bufferedToken(i-LLk)->getType(); - lap = 0; - labase = 0; - - /* MR10 */ - - prevTraceOptionValue=traceOptionValue; - traceOptionValue=buf->traceOptionValue; - if ( (prevTraceOptionValue > 0) != - (traceOptionValue > 0)) { - if (traceCurrentRuleName != NULL) { /* MR21 */ - if (traceOptionValue > 0) { - /* MR23 */ printMessage(stderr, - "trace enable restored in rule %s depth %d\n", - traceCurrentRuleName, - traceDepth); - }; - if (traceOptionValue <= 0) { - /* MR23 */ printMessage(stderr, - "trace disable restored in rule %s depth %d\n", - traceCurrentRuleName, /* MR21 */ - traceDepth); - }; - } - }; - traceGuessOptionValue=buf->traceGuessOptionValue; - traceCurrentRuleName=buf->traceCurrentRuleName; - traceDepth=buf->traceDepth; - traceGuessDone(buf); -} - -/* Get the next symbol from the input stream; put it into lookahead buffer; - * fill token_type[] fast reference cache also. NLA is the next place where - * a lookahead ANTLRAbstractToken should go. - */ -void ANTLRParser:: -consume() -{ - -#ifdef ZZDEBUG_CONSUME_ACTION - zzdebug_consume_action(); -#endif - -// MR19 V.H. Simonis -// Defer Fetch feature -// Moves action of consume() into LA() function - -#ifdef ZZDEFER_FETCH - stillToFetch++; -#else - NLA = inputTokens->getToken()->getType(); - dirty--; - lap = (lap+1)&(LLk-1); -#endif - -} - -_ANTLRTokenPtr ANTLRParser:: -LT(int i) -{ - -// MR19 V.H. Simonis -// Defer Fetch feature -// Moves action of consume() into LA() function - -#ifdef ZZDEFER_FETCH - undeferFetch(); -#endif - -#ifdef DEBUG_TOKENBUFFER - if ( i >= inputTokens->bufferSize() || inputTokens->minTokens() < LLk ) /* MR20 Was "<=" */ - { - char buf[2000]; /* MR20 Was "static" */ - sprintf(buf, "The minimum number of tokens you requested that the\nANTLRTokenBuffer buffer is not enough to satisfy your\nLT(%d) request; increase 'k' argument to constructor for ANTLRTokenBuffer\n", i); - panic(buf); - } -#endif - return inputTokens->bufferedToken(i-LLk); -} - -void -ANTLRParser:: -look(int k) -{ - int i, c = k - (LLk-dirty); - for (i=1; i<=c; i++) consume(); -} - -/* fill the lookahead buffer up with k symbols (even if DEMAND_LOOK); - */ -void -ANTLRParser:: -prime_lookahead() -{ - int i; - for(i=1;i<=LLk; i++) consume(); - dirty=0; - // lap = 0; // MR14 Sinan Karasu (sinan.karasu@boeing.com) - // labase = 0; // MR14 - labase=lap; // MR14 -} - -/* check to see if the current input symbol matches '_t'. - * During NON demand lookahead mode, dirty will always be 0 and - * hence the extra code for consuming tokens in _match is never - * executed; the same routine can be used for both modes. - */ -int ANTLRParser:: -_match(ANTLRTokenType _t, ANTLRChar **MissText, - ANTLRTokenType *MissTok, _ANTLRTokenPtr *BadTok, - SetWordType **MissSet) -{ - if ( dirty==LLk ) { - consume(); - } - if ( LA(1)!=_t ) { - *MissText=NULL; - *MissTok= _t; - *BadTok = LT(1); - *MissSet=NULL; - return 0; - } - dirty++; - labase = (labase+1)&(LLk-1); // labase maintained even if !demand look - return 1; -} - -/* check to see if the current input symbol matches '_t'. - * Used during exception handling. - */ -int ANTLRParser:: -_match_wsig(ANTLRTokenType _t) -{ - if ( dirty==LLk ) { - consume(); - } - if ( LA(1)!=_t ) return 0; - dirty++; - labase = (labase+1)&(LLk-1); // labase maintained even if !demand look - return 1; -} - -/* check to see if the current input symbol matches any token in a set. - * During NON demand lookahead mode, dirty will always be 0 and - * hence the extra code for consuming tokens in _match is never - * executed; the same routine can be used for both modes. - */ -int ANTLRParser:: -_setmatch(SetWordType *tset, ANTLRChar **MissText, - ANTLRTokenType *MissTok, _ANTLRTokenPtr *BadTok, - SetWordType **MissSet, SetWordType *tokclassErrset) -{ - if ( dirty==LLk ) { - consume(); - } - if ( !set_el(LA(1), tset) ) { - *MissText=NULL; /* MR23 */ - *MissTok=(ANTLRTokenType) 0; /* MR23 */ - *BadTok=LT(1); /* MR23 */ - *MissSet=tokclassErrset; /* MR23 */ - return 0; - } - dirty++; - labase = (labase+1)&(LLk-1); // labase maintained even if !demand look - return 1; -} - -int ANTLRParser:: -_setmatch_wsig(SetWordType *tset) -{ - if ( dirty==LLk ) { - consume(); - } - if ( !set_el(LA(1), tset) ) return 0; - dirty++; - labase = (labase+1)&(LLk-1); // labase maintained even if !demand look - return 1; -} - - /* Exception handling routines */ -// -// 7-Apr-97 133MR1 -// Change suggested by Eli Sternheim (eli@interhdl.com) -// -void ANTLRParser:: -consumeUntil(SetWordType *st) -{ - ANTLRTokenType tmp; // MR1 - const int Eof=1; // MR1 - while ( !set_el( (tmp=LA(1)), st) && tmp!=Eof) { consume(); } // MR1 -} - -// -// 7-Apr-97 133MR1 -// Change suggested by Eli Sternheim (eli@interhdl.com) -// -void ANTLRParser:: -consumeUntilToken(int t) -{ - int tmp; // MR1 - const int Eof=1; // MR1 - while ( (tmp=LA(1)) !=t && tmp!=Eof) { consume(); } // MR1 -} - - - /* Old error stuff */ - -void ANTLRParser:: -resynch(SetWordType *wd,SetWordType mask) -{ - -/* MR8 S.Bochnak@microtool.com.pl */ -/* MR8 Change file scope static "consumed" to instance var */ - - /* if you enter here without having consumed a token from last resynch - * force a token consumption. - */ -/* MR8 */ if ( !resynchConsumed ) {consume(); resynchConsumed=1; return;} - - /* if current token is in resynch set, we've got what we wanted */ - -/* MR8 */ if ( wd[LA(1)]&mask || LA(1) == eofToken ) {resynchConsumed=0; return;} - - /* scan until we find something in the resynch set */ - - while ( !(wd[LA(1)]&mask) && LA(1) != eofToken ) {consume();} - -/* MR8 */ resynchConsumed=1; -} - -/* standard error reporting function that assumes DLG-based scanners; - * you should redefine in subclass to change it or if you use your - * own scanner. - */ - -/* MR23 THM There appears to be a parameter "badText" passed to syn() - which is not present in the parameter list. This may be - because in C mode there is no attribute function which - returns the text, so the text representation of the token - must be passed explicitly. I think. -*/ - -void ANTLRParser:: -syn(_ANTLRTokenPtr /*tok MR23*/, ANTLRChar *egroup, SetWordType *eset, - ANTLRTokenType etok, int k) -{ - int line; - - line = LT(1)->getLine(); - - syntaxErrCount++; /* MR11 */ - - /* MR23 If the token is not an EOF token, then use the ->getText() value. - - If the token is the EOF token the text returned by ->getText() - may be garbage. If the text from the token table is "@" use - "" instead, because end-users don't know what "@" means. - If the text is not "@" then use that text, which must have been - supplied by the grammar writer. - */ - const char * errorAt = LT(1)->getText(); - if (LA(1) == eofToken) { - errorAt = parserTokenName(LA(1)); - if (errorAt[0] == '@') errorAt = ""; - } - /* MR23 */ printMessage(stderr, "line %d: syntax error at \"%s\"", - line, errorAt); - if ( !etok && !eset ) {/* MR23 */ printMessage(stderr, "\n"); return;} - if ( k==1 ) /* MR23 */ printMessage(stderr, " missing"); - else - { - /* MR23 */ printMessage(stderr, "; \"%s\" not", LT(k)->getText()); // MR23 use LT(k) since k>1 - if ( set_deg(eset)>1 ) /* MR23 */ printMessage(stderr, " in"); - } - if ( set_deg(eset)>0 ) edecode(eset); - else /* MR23 */ printMessage(stderr, " %s", token_tbl[etok]); - if ( strlen(egroup) > 0 ) /* MR23 */ printMessage(stderr, " in %s", egroup); - /* MR23 */ printMessage(stderr, "\n"); -} - -/* is b an element of set p? */ -int ANTLRParser:: -set_el(ANTLRTokenType b, SetWordType *p) -{ - return( p[DIVWORD(b)] & bitmask[MODWORD(b)] ); -} - -int ANTLRParser:: -set_deg(SetWordType *a) -{ - /* Fast compute degree of a set... the number - of elements present in the set. Assumes - that all word bits are used in the set - */ - register SetWordType *p = a; - register SetWordType *endp = &(a[bsetsize]); - register int degree = 0; - - if ( a == NULL ) return 0; - while ( p < endp ) - { - register SetWordType t = *p; - register SetWordType *b = &(bitmask[0]); - do { - if (t & *b) ++degree; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); - p++; - } - - return(degree); -} - -void ANTLRParser:: -edecode(SetWordType *a) -{ - register SetWordType *p = a; - register SetWordType *endp = &(p[bsetsize]); - register unsigned e = 0; - - if ( set_deg(a)>1 ) /* MR23 */ printMessage(stderr, " {"); - do { - register SetWordType t = *p; - register SetWordType *b = &(bitmask[0]); - do { - if ( t & *b ) /* MR23 */ printMessage(stderr, " %s", token_tbl[e]); - e++; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); - } while (++p < endp); - if ( set_deg(a)>1 ) /* MR23 */ printMessage(stderr, " }"); -} - -/* input looks like: - * zzFAIL(k, e1, e2, ...,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk) - * where the zzMiss stuff is set here to the token that did not match - * (and which set wasn't it a member of). - */ - -// MR9 29-Sep-97 Stan Bochnak (S.Bochnak@microTool.com.pl) -// MR9 Original fix to static allocated text didn't -// MR9 work because a pointer to it was passed back -// MR9 to caller. Replace with instance variable. - -const int SETWORDCOUNT=20; - -void -ANTLRParser::FAIL(int k, ...) -{ -// -// MR1 10-Apr-97 -// - - if (zzFAILtext == NULL) zzFAILtext=new char [1000]; // MR9 - SetWordType **f=new SetWordType *[SETWORDCOUNT]; // MR1 // MR9 - SetWordType **miss_set; - ANTLRChar **miss_text; - _ANTLRTokenPtr *bad_tok; - ANTLRChar **bad_text; -// -// 7-Apr-97 133MR1 -// err_k is passed as a "int *", not "unsigned *" -// - int *err_k; // MR1 - int i; - va_list ap; - - va_start(ap, k); - - zzFAILtext[0] = '\0'; - if ( k > SETWORDCOUNT ) panic("FAIL: overflowed buffer"); - for (i=1; i<=k; i++) /* collect all lookahead sets */ - { - f[i-1] = va_arg(ap, SetWordType *); - } - for (i=1; i<=k; i++) /* look for offending token */ - { - if ( i>1 ) strcat(zzFAILtext, " "); - strcat(zzFAILtext, LT(i)->getText()); - if ( !set_el(LA(i), f[i-1]) ) break; - } - miss_set = va_arg(ap, SetWordType **); - miss_text = va_arg(ap, ANTLRChar **); - bad_tok = va_arg(ap, _ANTLRTokenPtr *); - bad_text = va_arg(ap, ANTLRChar **); - err_k = va_arg(ap, int *); // MR1 - if ( i>k ) - { - /* bad; lookahead is permutation that cannot be matched, - * but, the ith token of lookahead is valid at the ith position - * (The old LL sub 1 (k) versus LL(k) parsing technique) - */ - *miss_set = NULL; - *miss_text = LT(1)->getText(); - *bad_tok = LT(1); - *bad_text = (*bad_tok)->getText(); - *err_k = k; -// -// MR4 20-May-97 erroneously deleted contents of f[] -// MR4 reported by Bruce Guenter (bruceg@qcc.sk.ca) -// MR1 10-Apr-97 release temporary storage -// - delete [] f; // MR1 - return; // MR1 - } -/* MR23 printMessage(stderr, "%s not in %dth set\n", zztokens[LA(i)], i);*/ - *miss_set = f[i-1]; - *miss_text = zzFAILtext; - *bad_tok = LT(i); - *bad_text = (*bad_tok)->getText(); - if ( i==1 ) *err_k = 1; - else *err_k = k; -// -// MR4 20-May-97 erroneously deleted contents of f[] -// MR4 reported by Bruce Guenter (bruceg@qcc.sk.ca) -// MR1 10-Apr-97 release temporary storage -// - delete [] f; // MR1 - return; // MR1 -} - -int ANTLRParser:: -_match_wdfltsig(ANTLRTokenType tokenWanted, SetWordType *whatFollows) -{ - if ( dirty==LLk ) consume(); - - if ( LA(1)!=tokenWanted ) - { - syntaxErrCount++; /* MR11 */ - /* MR23 */ printMessage(stderr, - "line %d: syntax error at \"%s\" missing %s\n", - LT(1)->getLine(), - (LA(1)==eofToken && LT(1)->getText()[0] == '@')?"":LT(1)->getText(), /* MR21a */ - token_tbl[tokenWanted]); - consumeUntil( whatFollows ); - return 0; - } - else { - dirty++; - labase = (labase+1)&(LLk-1); // labase maintained even if !demand look -/* if ( !demand_look ) consume(); */ - return 1; - } -} - - -int ANTLRParser:: -_setmatch_wdfltsig(SetWordType *tokensWanted, - ANTLRTokenType tokenTypeOfSet, - SetWordType *whatFollows) -{ - if ( dirty==LLk ) consume(); - if ( !set_el(LA(1), tokensWanted) ) - { - syntaxErrCount++; /* MR11 */ - /* MR23 */ printMessage(stderr, - "line %d: syntax error at \"%s\" missing %s\n", - LT(1)->getLine(), - (LA(1)==eofToken && LT(1)->getText()[0] == '@')?"":LT(1)->getText(), /* MR21a */ - token_tbl[tokenTypeOfSet]); - consumeUntil( whatFollows ); - return 0; - } - else { - dirty++; - labase = (labase+1)&(LLk-1); // labase maintained even if !demand look -/* if ( !demand_look ) consume(); */ - return 1; - } -} - -char *ANTLRParser:: -eMsgd(char *err,int d) -{ - sprintf(eMsgBuffer, err, d); // dangerous, but I don't care - return eMsgBuffer; -} - -char *ANTLRParser:: -eMsg(char *err, char *s) -{ - sprintf(eMsgBuffer, err, s); - return eMsgBuffer; -} - -char *ANTLRParser:: -eMsg2(char *err,char *s, char *t) -{ - sprintf(eMsgBuffer, err, s, t); - return eMsgBuffer; -} - -void ANTLRParser:: -panic(const char *msg) // MR20 const -{ - /* MR23 */ printMessage(stderr, "ANTLR panic: %s\n", msg); - exit(PCCTS_EXIT_FAILURE); // MR1 -} - -const ANTLRChar *ANTLRParser:: // MR1 -parserTokenName(int tok) { // MR1 - return token_tbl[tok]; // MR1 -} // MR1 - -void ANTLRParser::traceGuessDone(const ANTLRParserState *state) { - - int doIt=0; - - if (traceCurrentRuleName == NULL) return; - - if (traceOptionValue <= 0) { - doIt=0; - } else if (traceGuessOptionValue <= 0) { - doIt=0; - } else { - doIt=1; - }; - - if (doIt) { - /* MR23 */ printMessage(stderr,"guess done - returning to rule %s {\"%s\"} at depth %d", - state->traceCurrentRuleName, - LT(1)->getType() == eofToken ? "@" : LT(1)->getText(), - state->traceDepth); - if (state->guessing != 0) { - /* MR23 */ printMessage(stderr," (guess mode continues - an enclosing guess is still active)"); - } else { - /* MR23 */ printMessage(stderr," (guess mode ends)"); - }; - /* MR23 */ printMessage(stderr,"\n"); - }; -} - -void ANTLRParser::traceGuessFail() { - - int doIt=0; - - if (traceCurrentRuleName == NULL) return; /* MR21 */ - - if (traceOptionValue <= 0) { - doIt=0; - } else if (guessing && traceGuessOptionValue <= 0) { - doIt=0; - } else { - doIt=1; - }; - - if (doIt) { - /* MR23 */ printMessage(stderr,"guess failed in %s\n",traceCurrentRuleName); - }; -} - -/* traceOption: - zero value turns off trace -*/ - -void ANTLRParser::tracein(const ANTLRChar * rule) { - - int doIt=0; - - traceDepth++; - traceCurrentRuleName=rule; - - if (traceOptionValue <= 0) { - doIt=0; - } else if (guessing && traceGuessOptionValue <= 0) { - doIt=0; - } else { - doIt=1; - }; - - if (doIt) { - /* MR23 */ printMessage(stderr,"enter rule %s {\"%s\"} depth %d", - rule, - LT(1)->getType() == eofToken ? "@" : LT(1)->getText(), - traceDepth); - if (guessing) /* MR23 */ printMessage(stderr," guessing"); - /* MR23 */ printMessage(stderr,"\n"); - }; - return; -} - -void ANTLRParser::traceout(const ANTLRChar * rule) { - - int doIt=0; - - traceDepth--; - - if (traceOptionValue <= 0) { - doIt=0; - } else if (guessing && traceGuessOptionValue <= 0) { - doIt=0; - } else { - doIt=1; - }; - - if (doIt) { - /* MR23 */ printMessage(stderr,"exit rule %s {\"%s\"} depth %d", - rule, - LT(1)->getType() == eofToken ? "@" : LT(1)->getText(), - traceDepth+1); - if (guessing) /* MR23 */ printMessage(stderr," guessing"); - /* MR23 */ printMessage(stderr,"\n"); - }; -} - -int ANTLRParser::traceOption(int delta) { - - int prevValue=traceOptionValue; - - traceOptionValue=traceOptionValue+delta; - - if (traceCurrentRuleName != NULL) { - if (prevValue <= 0 && traceOptionValue > 0) { - /* MR23 */ printMessage(stderr,"trace enabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth); - }; - if (prevValue > 0 && traceOptionValue <= 0) { - /* MR23 */ printMessage(stderr,"trace disabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth); - }; - }; - - return prevValue; -} - -int ANTLRParser::traceGuessOption(int delta) { - - int prevValue=traceGuessOptionValue; - - traceGuessOptionValue=traceGuessOptionValue+delta; - - if (traceCurrentRuleName != NULL) { - if (prevValue <= 0 && traceGuessOptionValue > 0) { - /* MR23 */ printMessage(stderr,"guess trace enabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth); - }; - if (prevValue > 0 && traceGuessOptionValue <= 0) { - /* MR23 */ printMessage(stderr,"guess trace disabled in rule %s depth %d\n",traceCurrentRuleName,traceDepth); - }; - }; - return prevValue; -} - -// MR19 V.H. Simonis Defer Fetch feature - -void ANTLRParser::undeferFetch() -{ - -#ifdef ZZDEFER_FETCH - if (stillToFetch) { - for (int stillToFetch_x = 0; stillToFetch_x < stillToFetch; ++stillToFetch_x) { - NLA = inputTokens->getToken()->getType(); - dirty--; - lap = (lap+1)&(LLk-1); - } - stillToFetch = 0; - } -#else - return; -#endif - -} - -int ANTLRParser::isDeferFetchEnabled() -{ -#ifdef ZZDEFER_FETCH - return 1; -#else - return 0; -#endif -} - -//MR23 -int ANTLRParser::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - int iRet = printMessageV(pFile, pFormat, marker); - va_end( marker ); - return iRet; -} - -int ANTLRParser::printMessageV(FILE* pFile, const char* pFormat, va_list arglist) // MR23 -{ - return vfprintf(pFile, pFormat, arglist); -} - -// MR23 Move semantic predicate error handling from macro to virtual function -// -// Called by the zzfailed_pred - -void ANTLRParser::failedSemanticPredicate(const char* predicate) -{ - printMessage(stdout,"line %d: semantic error; failed predicate: '%s'\n", - LT(1)->getLine(), predicate); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.h deleted file mode 100644 index 8272e08ef..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AParser.h +++ /dev/null @@ -1,376 +0,0 @@ -/* ANTLRParser.h - * - * Define the generic ANTLRParser superclass, which is subclassed to - * define an actual parser. - * - * Before entry into this file: ANTLRTokenType must be set. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef APARSER_H_GATE -#define APARSER_H_GATE - -#include "pcctscfg.h" - -#include "pccts_stdio.h" -#include "pccts_setjmp.h" - -PCCTS_NAMESPACE_STD - -#include ATOKEN_H -#include ATOKENBUFFER_H - -#ifdef ZZCAN_GUESS -#ifndef ZZINF_LOOK -#define ZZINF_LOOK -#endif -#endif - - -#define NLA (token_type[lap&(LLk-1)])/* --> next LA */ - -typedef unsigned char SetWordType; - -/* Define external bit set stuff (for SetWordType) */ -#define EXT_WORDSIZE (sizeof(char)*8) -#define EXT_LOGWORDSIZE 3 - - /* s y n t a c t i c p r e d i c a t e s t u f f */ - -#ifndef zzUSER_GUESS_HOOK -#define zzUSER_GUESS_HOOK(seqFrozen,zzrv) -#endif - -#ifndef zzUSER_GUESS_DONE_HOOK -#define zzUSER_GUESS_DONE_HOOK(seqFrozen) -#endif - -/* MR14 Add zzUSER_GUESS_FAIL_HOOK and related code */ - -#define zzUSER_GUESS_FAIL_HOOK_INTERNAL zzUSER_GUESS_FAIL_HOOK(SeqFrozen) -#ifndef zzUSER_GUESS_FAIL_HOOK -#define zzUSER_GUESS_FAIL_HOOK(zzGuessSeq) -#endif - - -typedef struct _zzjmp_buf { - jmp_buf state; - } zzjmp_buf; - -/* these need to be macros not member functions */ -#define zzGUESS_BLOCK ANTLRParserState zzst; int zzrv; int _marker; int zzGuessSeqFrozen; -#define zzNON_GUESS_MODE if ( !guessing ) -#define zzGUESS_FAIL guess_fail(); - -/* Note: zzGUESS_DONE does not execute longjmp() */ - -#define zzGUESS_DONE {zzrv=1; inputTokens->rewind(_marker); guess_done(&zzst);zzUSER_GUESS_DONE_HOOK(zzGuessSeqFrozen) } -#define zzGUESS saveState(&zzst); \ - guessing = 1; \ - zzGuessSeqFrozen = ++zzGuessSeq; \ - _marker = inputTokens->mark(); \ - zzrv = setjmp(guess_start.state); \ - zzUSER_GUESS_HOOK(zzGuessSeqFrozen,zzrv) \ - if ( zzrv ) zzGUESS_DONE - -#define zzTRACEdata const ANTLRChar *zzTracePrevRuleName = NULL; - -#ifndef zzTRACEIN -#define zzTRACEIN(r) zzTracePrevRuleName=traceCurrentRuleName;tracein(r); -#endif -#ifndef zzTRACEOUT -#define zzTRACEOUT(r) traceout(r);traceCurrentRuleName=zzTracePrevRuleName; -#endif - - /* a n t l r p a r s e r d e f */ - -struct ANTLRParserState { - /* class variables */ - zzjmp_buf guess_start; - int guessing; - - int inf_labase; - int inf_last; - - int dirty; - - int traceOptionValue; // MR10 - int traceGuessOptionValue; // MR10 - const ANTLRChar *traceCurrentRuleName; // MR10 - int traceDepth; // MR10 - -}; - -/* notes: - * - * multiple inheritance is a cool way to include what stuff is needed - * in this structure (like guess stuff). however, i'm not convinced that - * multiple inheritance works correctly on all platforms. not that - * much space is used--just include all possibly useful members. - * - * the class should also be a template with arguments for the lookahead - * depth and so on. that way, more than one parser can be defined (as - * each will probably have different lookahead requirements). however, - * am i sure that templates work? no, i'm not sure. - * - * no attributes are maintained and, hence, the 'asp' variable is not - * needed. $i can still be referenced, but it refers to the token - * associated with that rule element. question: where are the token's - * stored if not on the software stack? in local variables created - * and assigned to by antlr. - */ -class ANTLRParser { -protected: - /* class variables */ - static SetWordType bitmask[sizeof(SetWordType)*8]; - static char eMsgBuffer[500]; - -protected: - int LLk; // number of lookahead symbols (old LL_K) - int demand_look; - ANTLRTokenType eofToken; // when do I stop during resynch()s - int bsetsize; // size of bitsets created by ANTLR in - // units of SetWordType - - ANTLRTokenBuffer *inputTokens; //place to get input tokens - - zzjmp_buf guess_start; // where to jump back to upon failure - int guessing; // if guessing (using (...)? predicate) - - // infinite lookahead stuff - int can_use_inf_look; // set by subclass (generated by ANTLR) - int inf_lap; - int inf_labase; - int inf_last; - int *_inf_line; - - const ANTLRChar **token_tbl; // pointer to table of token type strings MR20 const - - int dirty; // used during demand lookahead - - ANTLRTokenType *token_type; // fast reference cache of token.getType() -// ANTLRLightweightToken **token; // the token with all its attributes - int lap; - int labase; -#ifdef ZZDEFER_FETCH - int stillToFetch; // MR19 V.H. Simonis -#endif - -private: - void fill_inf_look(); - -protected: - virtual void guess_fail() { // MR9 27-Sep-97 make virtual - traceGuessFail(); // MR10 - longjmp(guess_start.state, 1); } // MR9 - virtual void guess_done(ANTLRParserState *st) { // MR9 27-Sep-97 make virtual - restoreState(st); } // MR9 - virtual int guess(ANTLRParserState *); // MR9 27-Sep-97 make virtual - void look(int); - int _match(ANTLRTokenType, ANTLRChar **, ANTLRTokenType *, - _ANTLRTokenPtr *, SetWordType **); - int _setmatch(SetWordType *, ANTLRChar **, ANTLRTokenType *, - _ANTLRTokenPtr *, SetWordType **, - SetWordType * tokclassErrset /* MR23 */); - int _match_wsig(ANTLRTokenType); - int _setmatch_wsig(SetWordType *); - virtual void consume(); - virtual void resynch(SetWordType *wd,SetWordType mask); // MR21 - void prime_lookahead(); - virtual void tracein(const ANTLRChar *r); // MR10 - virtual void traceout(const ANTLRChar *r); // MR10 - static unsigned MODWORD(unsigned x) {return x & (EXT_WORDSIZE-1);} // x % EXT_WORDSIZE // MR9 - static unsigned DIVWORD(unsigned x) {return x >> EXT_LOGWORDSIZE;} // x / EXT_WORDSIZE // MR9 - int set_deg(SetWordType *); - int set_el(ANTLRTokenType, SetWordType *); - virtual void edecode(SetWordType *); // MR1 - virtual void FAIL(int k, ...); // MR1 - int traceOptionValue; // MR10 - int traceGuessOptionValue; // MR10 - const ANTLRChar *traceCurrentRuleName; // MR10 - int traceDepth; // MR10 - void traceReset(); // MR10 - virtual void traceGuessFail(); // MR10 - virtual void traceGuessDone(const ANTLRParserState *); // MR10 - int zzGuessSeq; // MR10 - -public: - ANTLRParser(ANTLRTokenBuffer *, - int k=1, - int use_inf_look=0, - int demand_look=0, - int bsetsize=1); - virtual ~ANTLRParser(); - - virtual void init(); - - ANTLRTokenType LA(int i) - { -// -// MR14 demand look will always be 0 for C++ mode -// -//// return demand_look ? token_type[(labase+(i)-1)&(LLk-1)] : -//// token_type[(lap+(i)-1)&(LLk-1)]; - -// MR19 V.H. Simonis Defer fetch feature - -#ifdef ZZDEFER_FETCH - undeferFetch(); -#endif - return token_type[(lap+(i)-1)&(LLk-1)]; - } - _ANTLRTokenPtr LT(int i); - - void setEofToken(ANTLRTokenType t) { eofToken = t; } - ANTLRTokenType getEofToken() const { return eofToken; } // MR14 - - void noGarbageCollectTokens() { inputTokens->noGarbageCollectTokens(); } - void garbageCollectTokens() { inputTokens->garbageCollectTokens(); } - - virtual void syn(_ANTLRTokenPtr tok, ANTLRChar *egroup, - SetWordType *eset, ANTLRTokenType etok, int k); - virtual void saveState(ANTLRParserState *); // MR9 27-Sep-97 make virtual - virtual void restoreState(ANTLRParserState *); // MR9 27-Sep-97 make virtual - - virtual void panic(const char *msg); // MR20 const - - static char *eMsgd(char *,int); - static char *eMsg(char *,char *); - static char *eMsg2(char *,char *,char *); - - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 - virtual int printMessageV(FILE* pFile, const char* pFormat, va_list arglist); // MR23 - - void consumeUntil(SetWordType *st); - void consumeUntilToken(int t); - - virtual int _setmatch_wdfltsig(SetWordType *tokensWanted, - ANTLRTokenType tokenTypeOfSet, - SetWordType *whatFollows); - virtual int _match_wdfltsig(ANTLRTokenType tokenWanted, - SetWordType *whatFollows); - - const ANTLRChar * parserTokenName(int tok); // MR1 - - int traceOptionValueDefault; // MR11 - int traceOption(int delta); // MR11 - int traceGuessOption(int delta); // MR11 - -// MR8 5-Aug-97 S.Bochnak@microtool.com.pl -// MR8 Move resynch static local variable -// MR8 to class instance - - int syntaxErrCount; // MR12 - ANTLRTokenStream *getLexer() const { // MR12 - return inputTokens ? inputTokens->getLexer() : 0; } // MR12 -protected: // MR8 - int resynchConsumed; // MR8 - char *zzFAILtext; // workarea required by zzFAIL // MR9 - void undeferFetch(); // MR19 V.H. Simonis - int isDeferFetchEnabled(); // MR19 V.H. Simonis - virtual void failedSemanticPredicate(const char* predicate); /* MR23 */ -}; - -#define zzmatch(_t) \ - if ( !_match((ANTLRTokenType)_t, &zzMissText, &zzMissTok, \ - (_ANTLRTokenPtr *) &zzBadTok, &zzMissSet) ) goto fail; - -#define zzmatch_wsig(_t,handler) \ - if ( !_match_wsig((ANTLRTokenType)_t) ) if ( guessing ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;} - -#define zzsetmatch(_ts,_tokclassErrset) \ - if ( !_setmatch(_ts, &zzMissText, &zzMissTok, \ - (_ANTLRTokenPtr *) &zzBadTok, &zzMissSet, _tokclassErrset) ) goto fail; - -#define zzsetmatch_wsig(_ts, handler) \ - if ( !_setmatch_wsig(_ts) ) if ( guessing ) zzGUESS_FAIL else {_signal=MismatchedToken; goto handler;} - -/* For the dflt signal matchers, a FALSE indicates that an error occurred - * just like the other matchers, but in this case, the routine has already - * recovered--we do NOT want to consume another token. However, when - * the match was successful, we do want to consume hence _signal=0 so that - * a token is consumed by the "if (!_signal) consume(); _signal=NoSignal;" - * preamble. - */ -#define zzsetmatch_wdfltsig(tokensWanted, tokenTypeOfSet, whatFollows) \ - if ( !_setmatch_wdfltsig(tokensWanted, tokenTypeOfSet, whatFollows) ) \ - _signal = MismatchedToken; - -#define zzmatch_wdfltsig(tokenWanted, whatFollows) \ - if ( !_match_wdfltsig(tokenWanted, whatFollows) ) _signal = MismatchedToken; - - -// MR1 10-Apr-97 zzfailed_pred() macro does not backtrack in guess mode. -// MR1 Identification and correction due to J. Lilley -// -// MR23 Call virtual method to report error. -// MR23 Provide more control over failed predicate action -// without any need for user to worry about guessing internals. - -#ifndef zzfailed_pred -#define zzfailed_pred(_p,_hasuseraction,_useraction) \ - if (guessing) { \ - zzGUESS_FAIL; \ - } else { \ - zzfailed_pred_action(_p,_hasuseraction,_useraction) \ - } -#endif - -// MR23 Provide more control over failed predicate action -// without any need for user to worry about guessing internals. -// _hasuseraction == 0 => no user specified error action -// _hasuseraction == 1 => user specified error action - -#ifndef zzfailed_pred_action -#define zzfailed_pred_action(_p,_hasuseraction,_useraction) \ - if (_hasuseraction) { _useraction } else { failedSemanticPredicate(_p); } -#endif - -#define zzRULE \ - SetWordType *zzMissSet=NULL; ANTLRTokenType zzMissTok=(ANTLRTokenType)0; \ - _ANTLRTokenPtr zzBadTok=NULL; ANTLRChar *zzBadText=(ANTLRChar *)""; \ - int zzErrk=1,zzpf=0; \ - zzTRACEdata \ - ANTLRChar *zzMissText=(ANTLRChar *)""; - -#endif - - /* S t a n d a r d E x c e p t i o n S i g n a l s */ - -#define NoSignal 0 -#define MismatchedToken 1 -#define NoViableAlt 2 -#define NoSemViableAlt 3 - -/* MR7 Allow more control over signalling */ -/* by adding "Unwind" and "SetSignal" */ - -#define Unwind 4 -#define setSignal(newValue) *_retsignal=_signal=(newValue) -#define suppressSignal *_retsignal=_signal=0 -#define exportSignal *_retsignal=_signal diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.cpp deleted file mode 100644 index ba08616b2..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* Abstract syntax tree manipulation functions - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#include "pcctscfg.h" - -#include "pccts_stdio.h" -#include "pccts_stdarg.h" - -PCCTS_NAMESPACE_STD - -#define ANTLR_SUPPORT_CODE - -#include "ASTBase.h" - -/* ensure that tree manipulation variables are current after a rule - * reference - */ -void -ASTBase::link(ASTBase **_root, ASTBase **_sibling, ASTBase **_tail) -{ - if ( *_sibling == NULL ) return; - if ( *_root == NULL ) *_root = *_sibling; - else if ( *_root != *_sibling ) (*_root)->_down = *_sibling; - if ( *_tail==NULL ) *_tail = *_sibling; - while ( (*_tail)->_right != NULL ) *_tail = (*_tail)->_right; -} - -/* add a child node to the current sibling list */ -void -ASTBase::subchild(ASTBase **_root, ASTBase **_sibling, ASTBase **_tail) -{ - if ( *_tail != NULL ) (*_tail)->_right = this; - else { - *_sibling = this; - if ( *_root != NULL ) (*_root)->_down = *_sibling; - } - *_tail = this; - if ( *_root == NULL ) *_root = *_sibling; -} - -/* make a new AST node. Make the newly-created - * node the root for the current sibling list. If a root node already - * exists, make the newly-created node the root of the current root. - */ -void -ASTBase::subroot(ASTBase **_root, ASTBase **_sibling, ASTBase **_tail) -{ - if ( *_root != NULL ) - if ( (*_root)->_down == *_sibling ) *_sibling = *_tail = *_root; - *_root = this; - (*_root)->_down = *_sibling; -} - -/* Apply preorder_action(), etc.. to root then each sibling */ -// -// 7-Apr-97 133MR1 -// Fix suggested by Ron House (house@helios.usq.edu.au) -// -void -ASTBase::preorder(void* pData /*= NULL*/ /* MR23 */) -{ - ASTBase *tree = this; - - while ( tree!= NULL ) - { - if ( tree->_down != NULL ) { - tree->preorder_before_action(pData); // MR1 - }; - tree->preorder_action(pData); - if ( tree->_down!=NULL ) - { - tree->_down->preorder(pData); - tree->preorder_after_action(pData); // MR1 - } - tree = tree->_right; - } -} - -/* free all AST nodes in tree; apply func to each before freeing */ -void -ASTBase::destroy() -{ - ASTBase* tree = this; - while (tree) { - if (tree->_down) tree->_down->destroy(); - - ASTBase* cur = tree; - tree = tree->_right; - delete cur; - } -} - -/* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the children siblings and return ptr - * to 1st sibling (child1). If root is not single node, return NULL. - * - * Siblings that are actually siblins lists themselves are handled - * correctly. For example #( NULL, #( NULL, A, B, C), D) results - * in the tree ( NULL A B C D ). - * - * Requires at least two parameters with the last one being NULL. If - * both are NULL, return NULL. - */ -ASTBase * -ASTBase::tmake(ASTBase *root, ...) -{ - va_list ap; - register ASTBase *child, *sibling=NULL, *tail=NULL /*MR23*/, *w; - - va_start(ap, root); - - if ( root != NULL ) - if ( root->_down != NULL ) { - root->reportOverwriteOfDownPointer(); /* MR21 Report problem which almost always an error */ - return NULL; - } - child = va_arg(ap, ASTBase *); - while ( child != NULL ) - { - for (w=child; w->_right!=NULL; w=w->_right) {;} /* find end of child */ - if ( sibling == NULL ) {sibling = child; tail = w;} - else {tail->_right = child; tail = w;} - child = va_arg(ap, ASTBase *); - } - if ( root==NULL ) root = sibling; - else root->_down = sibling; - va_end(ap); - return root; -} - -#ifndef PCCTS_NOT_USING_SOR - -/* tree duplicate */ -// forgot to check for NULL this (TJP July 23,1995) -ASTBase * -ASTBase::dup() -{ - ASTBase *u, *t=this; - - if ( t == NULL ) return NULL; -/* - u = new ASTBase; - *u = *t; -*/ - u = (ASTBase *)this->shallowCopy(); - if ( t->_right!=NULL ) u->_right = t->_right->dup(); - else u->_right = NULL; - if ( t->_down!=NULL ) u->_down = t->_down->dup(); - else u->_down = NULL; - return u; -} -#endif - -// -// 7-Apr-97 133MR1 -// Fix suggested by Asgeir Olafsson (olafsson@cstar.ac.com) -// -/* tree duplicate */ - -#ifndef PCCTS_NOT_USING_SOR - -ASTBase * -ASTDoublyLinkedBase::dup() -{ - ASTDoublyLinkedBase *u, *t=this; - - if ( t == NULL ) return NULL; - u = (ASTDoublyLinkedBase *)this->shallowCopy(); - u->_up = NULL; /* set by calling invocation */ - u->_left = NULL; - if (t->_right!=NULL) { // MR1 - u->_right=t->_right->dup(); // MR1 - ((ASTDoublyLinkedBase *)u->_right)->_left = u; // MR1 - } else { // MR1 - u->_right = NULL; // MR1 - }; // MR1 - if (t->_down!=NULL) { // MR1 - u->_down = t->_down->dup(); // MR1 - ((ASTDoublyLinkedBase *)u->_down)->_up = u; // MR1 - } else { // MR1 - u->_down = NULL; // MR1 - }; // MR1 - return u; -} - -#endif - -/* - * Set the 'up', and 'left' pointers of all nodes in 't'. - * Initial call is double_link(your_tree, NULL, NULL). - */ -void -ASTDoublyLinkedBase::double_link(ASTBase *left, ASTBase *up) -{ - ASTDoublyLinkedBase *t = this; - - t->_left = (ASTDoublyLinkedBase *) left; - t->_up = (ASTDoublyLinkedBase *) up; - if (t->_down != NULL) - ((ASTDoublyLinkedBase *)t->_down)->double_link(NULL, t); - if (t->_right != NULL) - ((ASTDoublyLinkedBase *)t->_right)->double_link(t, up); -} - -// MR21 ASTBase::reportOverwriteOfDownPointer - -void ASTBase::reportOverwriteOfDownPointer() -{ - panic("Attempt to overwrite down pointer in ASTBase::tmake"); -} - -// MR21 ASTBase::panic - -void ASTBase::panic(const char *msg) -{ - /* MR23 */ printMessage(stderr,"ASTBase panic: %s\n", msg); - exit(PCCTS_EXIT_FAILURE); -} - -#ifdef PCCTS_NOT_USING_SOR -//MR23 -int ASTBase::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - int iRet = vfprintf(pFile, pFormat, marker); - va_end( marker ); - return iRet; -} -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.h deleted file mode 100644 index 9085fe576..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ASTBase.h +++ /dev/null @@ -1,122 +0,0 @@ -/* Abstract syntax tree - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ASTBase_H -#define ASTBase_H - -#include "pcctscfg.h" - -#include "pccts_stdio.h" -#include "pccts_stdlib.h" - -PCCTS_NAMESPACE_STD - -#ifndef PCCTS_NOT_USING_SOR -#include "PCCTSAST.h" -#endif - -/* - * Notes: - * - * To specify a copy constructor, subclass one of these classes and - * give the copy constructor. To use dup(), you must define shallowCopy(). - * shallowCopy() can use either a copy constructor or just copy the node - * itself. - */ - -#ifdef PCCTS_NOT_USING_SOR -class DllExportPCCTS ASTBase { -#else -class DllExportPCCTS ASTBase : public PCCTS_AST { -#endif - -protected: - ASTBase *_right, *_down; - -public: - -#ifdef PCCTS_NOT_USING_SOR - ASTBase *right() { return _right; } - ASTBase *down() { return _down; } - void setRight(ASTBase *t) { _right = (ASTBase *)t; } - void setDown(ASTBase *t) { _down = (ASTBase *)t; } -#else - PCCTS_AST *right() { return _right; } // define the SORCERER interface - PCCTS_AST *down() { return _down; } - void setRight(PCCTS_AST *t) { _right = (ASTBase *)t; } - void setDown(PCCTS_AST *t) { _down = (ASTBase *)t; } -#endif - ASTBase() { _right = _down = NULL; } - virtual ~ASTBase() { ; } -#ifndef PCCTS_NOT_USING_SOR - virtual ASTBase *dup(); -#endif - void destroy(); - void preorder(void* pData = NULL /* MR23 */); - static ASTBase *tmake(ASTBase *, ...); - static void link(ASTBase **, ASTBase **, ASTBase **); - void subchild(ASTBase **, ASTBase **, ASTBase **); - void subroot(ASTBase **, ASTBase **, ASTBase **); - virtual void preorder_action(void* /*pData*/ = NULL /* MR23 */) { ; } - virtual void preorder_before_action(void* /*pData*/ = NULL /* MR23 */) { /* MR23 */ printMessage(stdout, " ("); } - virtual void preorder_after_action(void* /*pData*/ = NULL /* MR23 */) { /* MR23 */ printMessage(stdout, " )"); } - virtual void panic(const char *msg); /* MR21 */ - virtual void reportOverwriteOfDownPointer(); /* MR21 */ -#ifdef PCCTS_NOT_USING_SOR - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 -#endif -}; - -class DllExportPCCTS ASTDoublyLinkedBase : public ASTBase { -protected: - ASTDoublyLinkedBase *_left, *_up; - -public: - void double_link(ASTBase *left, ASTBase *up); - -#ifndef PCCTS_NOT_USING_SOR - virtual ASTBase *dup(); -#endif - -#ifdef PCCTS_NOT_USING_SOR - ASTBase *left() { return _left; } - ASTBase *up() { return _up; } - void setLeft(ASTBase *t) { _left = (ASTDoublyLinkedBase *)t; } // MR6 - void setUp(ASTBase *t) { _up = (ASTDoublyLinkedBase *)t; } // MR6 -#else - PCCTS_AST *left() { return _left; } - PCCTS_AST *up() { return _up; } - void setLeft(PCCTS_AST *t) { _left = (ASTDoublyLinkedBase *)t; } // MR6 - void setUp(PCCTS_AST *t) { _up = (ASTDoublyLinkedBase *)t; } // MR6 -#endif - -}; - -class AST; // announce that this class will be coming along shortly -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtr.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtr.h deleted file mode 100644 index d3387ddd8..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtr.h +++ /dev/null @@ -1,88 +0,0 @@ -/* ATokPtr.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Written by Russell Quong June 30, 1995 - * Adapted by Terence Parr to ANTLR stuff - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ATokPtr_h -#define ATokPtr_h - -#include "pcctscfg.h" - -#include "pccts_stdio.h" - -PCCTS_NAMESPACE_STD - -// pointer to a reference counted object -// robust in that an unused ANTLRTokenPtr can point to NULL. - -class ANTLRAbstractToken; - -class DllExportPCCTS ANTLRTokenPtr { -public: - ANTLRTokenPtr(ANTLRAbstractToken *addr=NULL){ptr_ = addr; ref();} - ANTLRTokenPtr(const ANTLRTokenPtr &lhs) {ptr_ = lhs.ptr_; lhs.ref();} - ~ANTLRTokenPtr(); - - // use ANTLRTokenPtr as a pointer to ANTLRToken -// -// 8-Apr-97 MR1 Make operator -> a const member function -// as well as some other member functions -// - ANTLRAbstractToken *operator-> () const { return ptr_; } // MR1 -// -// 7-Apr-97 133MR1 -// Fix suggested by Andreas Magnusson -// (Andreas.Magnusson@mailbox.swipnet.se) - void operator = (const ANTLRTokenPtr & lhs); // MR1 - void operator = (ANTLRAbstractToken *addr); - int operator != (const ANTLRTokenPtr &q) const // MR1 // MR11 unsigned -> int - { return this->ptr_ != q.ptr_; } - int operator == (const ANTLRTokenPtr &q) const // MR1 // MR11 unsigned -> int - { return this->ptr_ == q.ptr_; } - int operator == (const ANTLRAbstractToken *addr) const // MR11 - { return this->ptr_ == addr; } - int operator != (const ANTLRAbstractToken *addr) const // MR11 - { return this->ptr_ != addr; } - - void ref() const; - void deref(); - -protected: - ANTLRAbstractToken *ptr_; -}; - -//typedef ANTLRTokenPtr _ANTLRTokenPtr; - -/* - * Since you cannot redefine operator->() to return one of the user's - * token object types, we must down cast. This is a drag. Here's - * a macro that helps. template: "mytoken(a-smart-ptr)->myfield". - */ -#define mytoken(tk) ((ANTLRToken *)(tk.operator->())) - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtrImpl.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtrImpl.h deleted file mode 100644 index b76f61f06..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokPtrImpl.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * ATokPtrImpl.h (formerly ATokPtr.cpp) - * - * This is #included in ATokBuffer.cpp for historical reasons. - * It has been renamed because of problems with the .cpp extension - * when used with IDE. - * - * - * ANTLRToken MUST be defined before entry to this file. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Written by Russell Quong June 30, 1995 - * Adapted by Terence Parr to ANTLR stuff - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#include "pcctscfg.h" - -PCCTS_NAMESPACE_STD - -#include "ATokPtr.h" - -void ANTLRTokenPtr::ref() const -{ - if (ptr_ != NULL) { - ptr_->ref(); - } -} - -void ANTLRTokenPtr::deref() -{ - if (ptr_ != NULL) - { - ptr_->deref(); - if ( ptr_->nref()==0 ) - { - delete ptr_; - ptr_ = NULL; - } - } -} - -ANTLRTokenPtr::~ANTLRTokenPtr() -{ - deref(); -} - -// -// 8-Apr-97 MR1 Make operator -> a const member function -// as weall as some other member functions -// -void ANTLRTokenPtr::operator = (const ANTLRTokenPtr & lhs) // MR1 -{ - lhs.ref(); // protect against "xp = xp"; ie same underlying object - deref(); - ptr_ = lhs.ptr_; -} - -void ANTLRTokenPtr::operator = (ANTLRAbstractToken *addr) -{ - if (addr != NULL) { - addr->ref(); - } - deref(); - ptr_ = addr; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AToken.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AToken.h deleted file mode 100644 index a63601241..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/AToken.h +++ /dev/null @@ -1,325 +0,0 @@ -/* ANTLRToken.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ATOKEN_H_GATE -#define ATOKEN_H_GATE - -#include "pcctscfg.h" - -#include "pccts_string.h" -#include "pccts_stdio.h" -#include "pccts_stdlib.h" -#include "pccts_stdarg.h" // MR23 - -PCCTS_NAMESPACE_STD - -// MR9 RJV (JVincent@novell.com) Not needed for variable length strings - -//// MR9 #ifndef ANTLRCommonTokenTEXTSIZE -//// MR9 #define ANTLRCommonTokenTEXTSIZE 100 -//// MR9 #endif - - -/* must define what a char looks like; can make this a class too */ -typedef char ANTLRChar; - -/* D E F I N E S M A R T P O I N T E R S */ - -//#include ATOKPTR_H not tested yet, leave out -class ANTLRAbstractToken; -typedef ANTLRAbstractToken *_ANTLRTokenPtr; - -class ANTLRAbstractToken { -public: - virtual ~ANTLRAbstractToken() {;} - virtual ANTLRTokenType getType() const = 0; - virtual void setType(ANTLRTokenType t) = 0; - virtual int getLine() const = 0; - virtual void setLine(int line) = 0; - virtual ANTLRChar *getText() const = 0; - virtual void setText(const ANTLRChar *) = 0; - - /* This function will disappear when I can use templates */ - virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt, - ANTLRChar *text, - int line) = 0; - - /* define to satisfy ANTLRTokenBuffer's need to determine whether or - not a token object can be destroyed. If nref()==0, no one has - a reference, and the object may be destroyed. This function defaults - to 1, hence, if you use deleteTokens() message with a token object - not derived from ANTLRCommonRefCountToken, the parser will compile - but will not delete objects after they leave the token buffer. - */ - - virtual unsigned nref() const { return 1; } // MR11 - virtual void ref() {;} - virtual void deref() {;} - - virtual void panic(const char *msg) // MR20 const - { - /* MR23 */ printMessage(stderr, "ANTLRAbstractToken panic: %s\n", msg); - exit(PCCTS_EXIT_FAILURE); - } - - virtual int printMessage(FILE* pFile, const char* pFormat, ...) // MR23 - { - va_list marker; - va_start( marker, pFormat ); - int iRet = vfprintf(pFile, pFormat, marker); - va_end( marker ); - return iRet; - } -}; - -/* This class should be subclassed. It cannot store token type or text */ - -class ANTLRRefCountToken : public ANTLRAbstractToken { -public: -#ifdef DBG_REFCOUNTTOKEN - static int ctor; - static int dtor; -#endif -protected: - unsigned refcnt_; -#ifdef DBG_REFCOUNTTOKEN - char object[200]; -#endif - -public: - - // MR23 - No matter what you do, you're hammered. - // Don't give names to formals something breaks. - // Give names to formals and don't use them it breaks. - -#ifndef DBG_REFCOUNTTOKEN - ANTLRRefCountToken(ANTLRTokenType /* t MR23 */, const ANTLRChar * /* s MR23 */) -#else - ANTLRRefCountToken(ANTLRTokenType t, const ANTLRChar * s) -#endif - -#ifndef DBG_REFCOUNTTOKEN - { - refcnt_ = 0; - } -#else - { - ctor++; - refcnt_ = 0; - if ( t==1 ) sprintf(object,"tok_EOF"); - else sprintf(object,"tok_%s",s); - /* MR23 */ printMessage(stderr, "ctor %s #%d\n",object,ctor); - } -#endif - ANTLRRefCountToken() -#ifndef DBG_REFCOUNTTOKEN - { refcnt_ = 0; } -#else - { - ctor++; - refcnt_ = 0; - sprintf(object,"tok_blank"); - /* MR23 */ printMessage(stderr, "ctor %s #%d\n",object,ctor); - } - virtual ~ANTLRRefCountToken() - { - dtor++; - if ( dtor>ctor ) /* MR23 */ printMessage(stderr, "WARNING: dtor>ctor\n"); - /* MR23 */ printMessage(stderr, "dtor %s #%d\n", object, dtor); - object[0]='\0'; - } -#endif - - // reference counting stuff needed by ANTLRTokenPtr. - // User should not access these; for C++ language reasons, we had - // to make these public. Yuck. - - void ref() { refcnt_++; } - void deref() { refcnt_--; } - unsigned nref() const { return refcnt_; } // MR11 - - virtual ANTLRAbstractToken *makeToken(ANTLRTokenType /*tt MR23*/, - ANTLRChar * /*txt MR23*/, - int /*line MR23*/) - { - panic("call to ANTLRRefCountToken::makeToken()\n"); - return NULL; - } -}; - -class ANTLRCommonNoRefCountToken : public ANTLRAbstractToken { -protected: - ANTLRTokenType _type; - int _line; - ANTLRChar *_text; // MR9 RJV - -public: - ANTLRCommonNoRefCountToken(ANTLRTokenType t, const ANTLRChar *s) - { setType(t); _line = 0; _text = NULL; setText(s); } - ANTLRCommonNoRefCountToken() - { setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); } - - ~ANTLRCommonNoRefCountToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string - - ANTLRTokenType getType() const { return _type; } - void setType(ANTLRTokenType t) { _type = t; } - virtual int getLine() const { return _line; } - void setLine(int line) { _line = line; } - ANTLRChar *getText() const { return _text; } - int getLength() const { return strlen(getText()); } // MR11 - -// MR9 RJV: Added code for variable length strings to setText() - - void setText(const ANTLRChar *s) - { if (s != _text) { - if (_text) delete [] _text; - if (s != NULL) { - _text = new ANTLRChar[strlen(s)+1]; - if (_text == NULL) panic("ANTLRCommonNoRefCountToken::setText new failed"); - strcpy(_text,s); - } else { - _text = new ANTLRChar[1]; - if (_text == NULL) panic("ANTLRCommonNoRefCountToken::setText new failed"); - strcpy(_text,""); - }; - }; - } - - virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt, - ANTLRChar *txt, - int line) - { - ANTLRAbstractToken *t = new ANTLRCommonNoRefCountToken; - t->setType(tt); t->setText(txt); t->setLine(line); - return t; - } - -// MR9 THM Copy constructor required when heap allocated string is used with copy semantics - - ANTLRCommonNoRefCountToken (const ANTLRCommonNoRefCountToken& from) : - ANTLRAbstractToken(from) { - setType(from._type); - setLine(from._line); - _text=NULL; - setText(from._text); - }; - -// MR9 THM operator =() required when heap allocated string is used with copy semantics - - virtual ANTLRCommonNoRefCountToken& operator =(const ANTLRCommonNoRefCountToken& rhs) { - -////// MR15 WatCom can't hack use of operator =() -////// Use this: *( (ANTRLAbstractToken *) this)=rhs; - - *( (ANTLRAbstractToken *) this ) = rhs; - - setType(rhs._type); - setLine(rhs._line); - setText(rhs._text); - return *this; - }; -}; - -class ANTLRCommonToken : public ANTLRRefCountToken { -protected: - ANTLRTokenType _type; - int _line; - ANTLRChar *_text; // MR9 RJV:Added - -public: - ANTLRCommonToken(ANTLRTokenType t, const ANTLRChar *s) : ANTLRRefCountToken(t,s) - { setType(t); _line = 0; _text = NULL; setText(s); } // MR9 - ANTLRCommonToken() - { setType((ANTLRTokenType)0); _line = 0; _text = NULL; setText(""); } // MR9 - - virtual ~ANTLRCommonToken() { if (_text) delete [] _text; } // MR9 RJV: Added Destructor to remove string - - ANTLRTokenType getType() const { return _type; } - void setType(ANTLRTokenType t) { _type = t; } - virtual int getLine() const { return _line; } - void setLine(int line) { _line = line; } - ANTLRChar *getText() const { return _text; } - int getLength() const { return strlen(getText()); } // MR11 - -// MR9 RJV: Added code for variable length strings to setText() - - void setText(const ANTLRChar *s) - { if (s != _text) { - if (_text) delete [] _text; - if (s != NULL) { - _text = new ANTLRChar[strlen(s)+1]; - if (_text == NULL) panic("ANTLRCommonToken::setText new failed"); - strcpy(_text,s); - } else { - _text = new ANTLRChar[1]; - if (_text == NULL) panic("ANTLRCommonToken::setText new failed"); - strcpy(_text,""); - }; - }; - } - - virtual ANTLRAbstractToken *makeToken(ANTLRTokenType tt, - ANTLRChar *txt, - int line) - { - ANTLRAbstractToken *t = new ANTLRCommonToken(tt,txt); - t->setLine(line); - return t; - } - -// MR9 THM Copy constructor required when heap allocated string is used with copy semantics - - ANTLRCommonToken (const ANTLRCommonToken& from) : - ANTLRRefCountToken(from) { - setType(from._type); - setLine(from._line); - _text=NULL; - setText(from._text); - }; - -// MR9 THM operator =() required when heap allocated string is used with copy semantics - - virtual ANTLRCommonToken& operator =(const ANTLRCommonToken& rhs) { - -////// MR15 WatCom can't hack use of operator =() -////// Use this instead: *( (ANTRLRRefCountToken *) this)=rhs; - - *( (ANTLRRefCountToken *) this) = rhs; - - setType(rhs._type); - setLine(rhs._line); - setText(rhs._text); - return *this; - }; -}; - -// used for backward compatibility -typedef ANTLRCommonToken ANTLRCommonBacktrackingToken; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.cpp deleted file mode 100644 index f01216148..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.cpp +++ /dev/null @@ -1,374 +0,0 @@ -/* ANTLRTokenBuffer.cpp - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -typedef int ANTLRTokenType; // fool AToken.h into compiling - -class ANTLRParser; /* MR1 */ - -#define ANTLR_SUPPORT_CODE - -#include "pcctscfg.h" - -#include ATOKENBUFFER_H -#include APARSER_H // MR23 - -typedef ANTLRAbstractToken *_ANTLRTokenPtr; - -#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW) -static unsigned char test[1000]; -#endif - -#ifdef DBG_REFCOUNTTOKEN -int ANTLRRefCountToken::ctor = 0; /* MR23 */ -int ANTLRRefCountToken::dtor = 0; /* MR23 */ -#endif - -ANTLRTokenBuffer:: -ANTLRTokenBuffer(ANTLRTokenStream *_input, int _k, int _chunk_size_formal) /* MR14 */ -{ - this->input = _input; - this->k = _k; - buffer_size = chunk_size = _chunk_size_formal; - buffer = (_ANTLRTokenPtr *) - calloc(chunk_size+1,sizeof(_ANTLRTokenPtr )); - if ( buffer == NULL ) { - panic("cannot alloc token buffer"); - } - buffer++; // leave the first elem empty so tp-1 is valid ptr - - tp = &buffer[0]; - last = tp-1; - next = &buffer[0]; - num_markers = 0; - end_of_buffer = &buffer[buffer_size-1]; - threshold = &buffer[(int)(buffer_size/2)]; // MR23 - Used to be 1.0/2.0 ! - _deleteTokens = 1; // assume we delete tokens - parser=NULL; // MR5 - uninitialized reference -} - -static void f() {;} -ANTLRTokenBuffer:: -~ANTLRTokenBuffer() -{ - f(); - // Delete all remaining tokens (from 0..last inclusive) - if ( _deleteTokens ) - { - _ANTLRTokenPtr *z; - for (z=buffer; z<=last; z++) - { - (*z)->deref(); -// z->deref(); -#ifdef DBG_REFCOUNTTOKEN - /* MR23 */ printMessage(stderr, "##########dtor: deleting token '%s' (ref %d)\n", - ((ANTLRCommonToken *)*z)->getText(), (*z)->nref()); -#endif - if ( (*z)->nref()==0 ) - { - delete (*z); - } - } - } - - if ( buffer!=NULL ) free((char *)(buffer-1)); -} - -#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW) -#include "pccts_stdio.h" -PCCTS_NAMESPACE_STD -#endif - -_ANTLRTokenPtr ANTLRTokenBuffer:: -getToken() -{ - if ( tp <= last ) // is there any buffered lookahead still to be read? - { - return *tp++; // read buffered lookahead - } - // out of buffered lookahead, get some more "real" - // input from getANTLRToken() - if ( num_markers==0 ) - { - if( next > threshold ) - { -#ifdef DBG_TBUF -/* MR23 */ printMessage(stderr,"getToken: next > threshold (high water is %d)\n", threshold-buffer); -#endif - makeRoom(); - } - } - else { - if ( next > end_of_buffer ) - { -#ifdef DBG_TBUF -/* MR23 */ printMessage(stderr,"getToken: next > end_of_buffer (size is %d)\n", buffer_size); -#endif - extendBuffer(); - } - } - *next = getANTLRToken(); - (*next)->ref(); // say we have a copy of this pointer in buffer - last = next; - next++; - tp = last; - return *tp++; -} - -void ANTLRTokenBuffer:: -rewind(int pos) -{ -#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW) - /* MR23 */ printMessage(stderr, "rewind(%d)[nm=%d,from=%d,%d.n=%d]\n", pos, num_markers, tp-buffer,pos,test[pos]); - test[pos]--; -#endif - tp = &buffer[pos]; - num_markers--; -} - -/* - * This function is used to specify that the token pointers read - * by the ANTLRTokenBuffer should be buffered up (to be reused later). - */ -int ANTLRTokenBuffer:: -mark() -{ -#if defined(DBG_TBUF)||defined(DBG_TBUF_MARK_REW) - test[tp-buffer]++; - /* MR23 */ printMessage(stderr,"mark(%d)[nm=%d,%d.n=%d]\n",tp-buffer,num_markers+1,tp-buffer,test[tp-buffer]); -#endif - num_markers++; - return tp - buffer; -} - -/* - * returns the token pointer n positions ahead. - * This implies that bufferedToken(1) gets the NEXT symbol of lookahead. - * This is used in conjunction with the ANTLRParser lookahead buffer. - * - * No markers are set or anything. A bunch of input is buffered--that's all. - * The tp pointer is left alone as the lookahead has not been advanced - * with getToken(). The next call to getToken() will find a token - * in the buffer and won't have to call getANTLRToken(). - * - * If this is called before a consume() is done, how_many_more_i_need is - * set to 'n'. - */ -_ANTLRTokenPtr ANTLRTokenBuffer:: -bufferedToken(int n) -{ -// int how_many_more_i_need = (last-tp < 0) ? n : n-(last-tp)-1; - int how_many_more_i_need = (tp > last) ? n : n-(last-tp)-1; - // Make sure that at least n tokens are available in the buffer -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, "bufferedToken(%d)\n", n); -#endif - for (int i=1; i<=how_many_more_i_need; i++) - { - if ( next > end_of_buffer ) // buffer overflow? - { - extendBuffer(); - } - *next = getANTLRToken(); - (*next)->ref(); // say we have a copy of this pointer in buffer - last = next; - next++; - } - return tp[n - 1]; -} - -/* If no markers are set, the none of the input needs to be saved (except - * for the lookahead Token pointers). We save only k-1 token pointers as - * we are guaranteed to do a getANTLRToken() right after this because otherwise - * we wouldn't have needed to extend the buffer. - * - * If there are markers in the buffer, we need to save things and so - * extendBuffer() is called. - */ -void ANTLRTokenBuffer:: -makeRoom() -{ -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, "in makeRoom.................\n"); - /* MR23 */ printMessage(stderr, "num_markers==%d\n", num_markers); -#endif -/* - if ( num_markers == 0 ) - { -*/ -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, "moving lookahead and resetting next\n"); - - _ANTLRTokenPtr *r; - /* MR23 */ printMessage(stderr, "tbuf = ["); - for (r=buffer; r<=last; r++) - { - if ( *r==NULL ) /* MR23 */ printMessage(stderr, " xxx"); - else /* MR23 */ printMessage(stderr, " '%s'", ((ANTLRCommonToken *)*r)->getText()); - } - /* MR23 */ printMessage(stderr, " ]\n"); - - /* MR23 */ printMessage(stderr, - "before: tp=%d, last=%d, next=%d, threshold=%d\n",tp-buffer,last-buffer,next-buffer,threshold-buffer); -#endif - - // Delete all tokens from 0..last-(k-1) inclusive - if ( _deleteTokens ) - { - _ANTLRTokenPtr *z; - for (z=buffer; z<=last-(k-1); z++) - { - (*z)->deref(); -// z->deref(); -#ifdef DBG_REFCOUNTTOKEN - /* MR23 */ printMessage(stderr, "##########makeRoom: deleting token '%s' (ref %d)\n", - ((ANTLRCommonToken *)*z)->getText(), (*z)->nref()); -#endif - if ( (*z)->nref()==0 ) - { - delete (*z); - } - } - } - - // reset the buffer to initial conditions, but move k-1 symbols - // to the beginning of buffer and put new input symbol at k - _ANTLRTokenPtr *p = buffer, *q = last-(k-1)+1; -// ANTLRAbstractToken **p = buffer, **q = end_of_buffer-(k-1)+1; -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, "lookahead buffer = ["); -#endif - for (int i=1; i<=(k-1); i++) - { - *p++ = *q++; -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, - " '%s'", ((ANTLRCommonToken *)buffer[i-1])->getText()); -#endif - } -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, " ]\n"); -#endif - next = &buffer[k-1]; - tp = &buffer[k-1]; // tp points to what will be filled in next - last = tp-1; -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, - "after: tp=%d, last=%d, next=%d\n", - tp-buffer, last-buffer, next-buffer); -#endif -/* - } - else { - extendBuffer(); - } -*/ -} - -/* This function extends 'buffer' by chunk_size and returns with all - * pointers at the same relative positions in the buffer (the buffer base - * address could have changed in realloc()) except that 'next' comes - * back set to where the next token should be stored. All other pointers - * are untouched. - */ -void -ANTLRTokenBuffer:: -extendBuffer() -{ - int save_last = last-buffer, save_tp = tp-buffer, save_next = next-buffer; -#ifdef DBG_TBUF - /* MR23 */ printMessage(stderr, "extending physical buffer\n"); -#endif - buffer_size += chunk_size; - buffer = (_ANTLRTokenPtr *) - realloc((char *)(buffer-1), - (buffer_size+1)*sizeof(_ANTLRTokenPtr )); - if ( buffer == NULL ) { - panic("cannot alloc token buffer"); - } - buffer++; // leave the first elem empty so tp-1 is valid ptr - - tp = buffer + save_tp; // put the pointers back to same relative position - last = buffer + save_last; - next = buffer + save_next; - end_of_buffer = &buffer[buffer_size-1]; - threshold = &buffer[(int)(buffer_size*(1.0/2.0))]; - -/* - // zero out new token ptrs so we'll know if something to delete in buffer - ANTLRAbstractToken **p = end_of_buffer-chunk_size+1; - for (; p<=end_of_buffer; p++) *p = NULL; -*/ -} - -ANTLRParser * ANTLRTokenBuffer:: // MR1 -setParser(ANTLRParser *p) { // MR1 - ANTLRParser *old=parser; // MR1 - parser=p; // MR1 - input->setParser(p); // MR1 - return old; // MR1 -} // MR1 - // MR1 -ANTLRParser * ANTLRTokenBuffer:: // MR1 -getParser() { // MR1 - return parser; // MR1 -} // MR1 - -void ANTLRTokenBuffer::panic(const char *msg) // MR23 -{ - if (parser) //MR23 - parser->panic(msg); //MR23 - else //MR23 - exit(PCCTS_EXIT_FAILURE); -} - -//MR23 -int ANTLRTokenBuffer::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - - int iRet = 0; - if (parser) - parser->printMessageV(pFile, pFormat, marker); - else - iRet = vfprintf(pFile, pFormat, marker); - - va_end( marker ); - return iRet; -} - -/* to avoid having to link in another file just for the smart token ptr - * stuff, we include it here. Ugh. - * - * MR23 This causes nothing but problems for IDEs. - * Change from .cpp to .h - * - */ - -#include ATOKPTR_IMPL_H diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.h deleted file mode 100644 index a6bec6396..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenBuffer.h +++ /dev/null @@ -1,109 +0,0 @@ -/* ANTLRTokenBuffer.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ATOKENBUFFER_H_GATE -#define ATOKENBUFFER_H_GATE - -#include "pcctscfg.h" - -#include "pccts_stdlib.h" - -PCCTS_NAMESPACE_STD - -#include ATOKEN_H -#include ATOKENSTREAM_H - -/* - * The parser is "attached" to an ANTLRTokenBuffer via interface - * functions: getToken() and bufferedToken(). The object that actually - * consumes characters and constructs tokens is connected to the - * ANTLRTokenBuffer via interface function ANTLRTokenStream::getToken(); - * where ANTLRTokenStream is really just a behavior (class with no data). - * C++ does not have this abstraction and hence we simply have come up - * with a fancy name for "void *". See the note in ANTLRTokenStream.h on - * the "behavior" of ANTLRTokenStream. - */ - -class ANTLRParser; // MR1 - -class DllExportPCCTS ANTLRTokenBuffer { -protected: - ANTLRTokenStream *input; // where do I get tokens - int buffer_size; - int chunk_size; - int num_markers; - int k; // Need at least this many tokens in buffer - _ANTLRTokenPtr *buffer; // buffer used for arbitrary lookahead - _ANTLRTokenPtr *tp; // pts into buffer; current token ptr - _ANTLRTokenPtr *last; // pts to last valid token in buffer - _ANTLRTokenPtr *next; // place to put token from getANTLRToken() - _ANTLRTokenPtr *end_of_buffer; - /* when you try to write a token past this and there are no markers - set, then move k-1 tokens back to the beginning of the buffer. - We want to stay away from the end of the buffer because we have - to extend it if a marker is set and we reach the end (we cannot - move tokens to the beginning of the buffer in this case). - */ - _ANTLRTokenPtr *threshold; - unsigned char _deleteTokens; - - // This function is filled in by the subclass; it initiates fetch of input - virtual _ANTLRTokenPtr getANTLRToken() { return input->getToken(); } - void makeRoom(); - void extendBuffer(); - -public: - ANTLRTokenBuffer(ANTLRTokenStream *in, int k=1, int chksz=50); - virtual ~ANTLRTokenBuffer(); - virtual _ANTLRTokenPtr getToken(); - virtual void rewind(int pos); - virtual int mark(); - virtual _ANTLRTokenPtr bufferedToken(int i); - - void noGarbageCollectTokens() { _deleteTokens=0; } - void garbageCollectTokens() { _deleteTokens=1; } - - virtual int bufferSize() { return buffer_size; } - virtual int minTokens() { return k; } - virtual void setMinTokens(int k_new) { k = k_new; } - - virtual void panic(const char *msg); /* MR20 const */ - - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 - -protected: // MR1 - ANTLRParser *parser; // MR1 -public: // MR1 - ANTLRParser *setParser(ANTLRParser *p); // MR1 - ANTLRParser *getParser(); // MR1 - ANTLRTokenStream *getLexer() const { // MR12 - return input;} // MR12 -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenStream.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenStream.h deleted file mode 100644 index 3df6385d7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ATokenStream.h +++ /dev/null @@ -1,51 +0,0 @@ -/* ANTLRTokenStream.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ATOKENSTREAM_H_GATE -#define ATOKENSTREAM_H_GATE - -#include "pcctscfg.h" - -/* This is really a behavior or protocol; it merely indicates the behavior - * required of the input and output of an ANTLRTokenBuffer. You could - * subclass it, but you can also just pass any old pointer to ANTLRTokenBuffer - * with a type cast (in which case, your getANTLRToken() would have to - * explicitly cast the input pointer to your REAL type (typically your lexer)). - */ - -class ANTLRParser; // MR1 - -class DllExportPCCTS ANTLRTokenStream { -public: - virtual _ANTLRTokenPtr getToken() = 0; - virtual ANTLRParser * setParser(ANTLRParser * /*p MR23*/) {return 0; }; // MR12 - virtual ANTLRParser * getParser() { return 0; }; // MR12 -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.cpp deleted file mode 100644 index 738d47ccb..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// FILE: BufFileInput.cpp -// AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru -// CREATION: 26-JAN-1998 -// DESCRIPTION: File Input Stream with lookahead for Scanner. -// See file BufFileInput.h for details - -// Change History: -// -// 22-Jun-1998 assert.h -> PCCTS_ASSERT_H -// string.h -> PCCTS_STRING_H -// -// 28-May-1998 Add virtual destructor to release buffer. -// -// Add dummy definition for ANTLRTokenType -// to allow compilation without knowing -// token type codes. -// -// Manfred Kogler (km@cast.uni-linz.ac.at) -// (1.33MR14) -// -// 20-Jul-1998 MR14a - Reorder initialization list for ctor. -// - -enum ANTLRTokenType {TER_HATES_CPP=0, SO_DO_OTHERS=9999 }; - -#include "pcctscfg.h" -#include "pccts_assert.h" -#include "pccts_string.h" - -PCCTS_NAMESPACE_STD - -#include "BufFileInput.h" - -BufFileInput::BufFileInput( FILE *f, int buf_size ) -: input( f ), - buf( new int[buf_size] ), - size( buf_size ), - start( 0 ), - len( 0 ) -{ -} - -BufFileInput::~BufFileInput() -{ - delete [] buf; -} - -int BufFileInput::nextChar( void ) -{ - if( len > 0 ) - { - // get char from buffer - int c = buf[start]; - - if( c != EOF ) - { - start++; start %= size; - len--; - } - return c; - } else { - // get char from file - int c = getc( input ); - - if( c == EOF ) - { - // if EOF - put it in the buffer as indicator - buf[start] = EOF; - len++; - } - return c; - } -} - -int BufFileInput::lookahead( char* s ) -{ - int l = strlen( s ); - - assert( 0 < l && l <= size ); - - while( len < l ) - { - int c = getc( input ); - - buf[ (start+len) % size ] = c; - - len++; - - if( c == EOF ) return 0; - } - - for( int i = 0; i < l; i++ ) - { - if( s[i] != buf[ (start+i) % size ] ) return 0; - } - return 1; -} - -// End of file BufFileInput.cpp - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.h deleted file mode 100644 index d53340e35..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/BufFileInput.h +++ /dev/null @@ -1,53 +0,0 @@ -// FILE: BufFileInput.h -// AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru -// CREATION: 26-JAN-1998 -// DESCRIPTION: File Input Stream with lookahead for Scanner -// Tested under Win32 with ANTLR 1.33 MR10 and MSVC 5.0 - -// Change History: -// -// 28-May-1998 Add virtual destructor to release buffer -// Manfred Kogler (km@cast.uni-linz.ac.at) -// (1.33MR14) - -#ifndef BufFileInput_h -#define BufFileInput_h - -#include "pcctscfg.h" - -#include "pccts_stdio.h" - -PCCTS_NAMESPACE_STD - -#include "DLexerBase.h" - -class DllExportPCCTS BufFileInput : public DLGInputStream -{ -public: - // constructor - // f - input stream - // buf_size - size of buffer (maximal length for string in is_in) - - BufFileInput(FILE *f, int buf_size = 8 ); - - virtual ~BufFileInput(); - - // gets next char from stream - - virtual int nextChar( void ); - - // looks in stream and compares next l characters with s - // returns the result of comparision - - int lookahead( char* s ); - -private: - FILE *input; // input stream; - int* buf; // buffer - int size; // size of buffer - int start; // position of the first symbol in buffer - int len; // count of characters in buffers -}; - -#endif -// end of file BufFileInput.h diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLG_stream_input.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLG_stream_input.h deleted file mode 100644 index 08f8a3298..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLG_stream_input.h +++ /dev/null @@ -1,98 +0,0 @@ - -/************************************************************/ -/* */ -/* Predefined char stream: Input from (c++) stream. */ -/* */ -/* By Hubert Holin (Hubert.Holin@Bigfoot.com), 1998. */ -/* */ -/* This is completely free stuff, do whatever you want with */ -/* it (but then, I will take no responsability for whatever */ -/* may happen if you do either... caveat emptor!). */ -/* */ -/************************************************************/ - -#ifndef _DLG_STREAM_INPUT_H -#define _DLG_STREAM_INPUT_H - -#include "pccts_istream.h" - -PCCTS_NAMESPACE_STD - -#ifndef DLGX_H -#include "DLexerBase.h" -#endif - - -// NOTES: The semantics of the copy constructor -// and the affectation operator may be unwaranted... -// and the stream may not be reset. -// -// It would have been so much nicer for nextChar() -// to throw (of for the DLGInputStream to change status) -// upon hiting EOF than to return an "int"... - -template < - class E, - class T = ::std::char_traits - > -class DLG_stream_input : public DLGInputStream -{ -public: - - DLG_stream_input(::std::basic_istream * p_input_stream) - : input(p_input_stream) - { - // nothing to do! - }; - - DLG_stream_input(const DLG_stream_input & a_recopier) - : input(a_recopier.input) - { - // nothing to do! - }; - - virtual ~DLG_stream_input() - { - this->purge(); // bloody templarized lookup... - }; - - DLG_stream_input operator = (const DLG_stream_input & a_affecter) - { - if (this != &a_affecter) - { - input = a_affecter.input; - } - - return(*this); - }; - - virtual int nextChar() - { - E extracted_stuff; - - input->get(extracted_stuff); - - if (*input) - { - return(int(extracted_stuff)); - } - else - { - return(EOF); - } - }; - -protected: - - ::std::basic_istream * input; - -private: - - void purge() - { - // nothing to do! - }; -}; - -#endif /* _DLG_STREAM_INPUT_H */ - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexer.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexer.h deleted file mode 100644 index c96706520..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexer.h +++ /dev/null @@ -1,191 +0,0 @@ -/* DLexer.h (formerly DLexer.cpp) - * - * This was renamed because the use of the .cpp extension caused problems - * with IDEs. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#define ZZINC {if ( track_columns ) (++_endcol);} - -#define ZZGETC {ch = input->nextChar(); cl = ZZSHIFT(ch);} - -#define ZZNEWSTATE (newstate = dfa[state][cl]) - -#ifndef ZZCOPY -#define ZZCOPY \ - /* Truncate matching buffer to size (not an error) */ \ - if (nextpos < lastpos){ \ - *(nextpos++) = ch; \ - }else{ \ - bufovf = 1; \ - } -#endif - -void DLGLexer:: -mode( int m ) -{ - /* points to base of dfa table */ - if (m*actions[accepts[state]])(); - -// MR1 -// MR1 11-Apr-97 Help for tracking DLG results -// MR1 - -#ifdef DEBUG_LEXER - -/* MR1 */ if (debugLexerFlag) { -/* MR1 */ if (parser != NULL) { -/* MR1 */ /* MR23 */ printMessage(stdout, "\ntoken name=%s",parser->parserTokenName(tk)); -/* MR1 */ } else { -/* MR1 */ /* MR23 */ printMessage(stdout, "\ntoken nnumber=%d",tk); -/* MR1 */ }; -/* MR1 */ /* MR23 */ printMessage(stdout, " lextext=(%s) mode=%d", -/* MR1 */ (_lextext[0]=='\n' && _lextext[1]==0) ? -/* MR1 */ "newline" : _lextext, -/* MR1 */ automaton); -/* MR1 */ if (interactive && !charfull) { -/* MR1 */ /* MR23 */ printMessage(stdout, " char=empty"); -/* MR1 */ } else { -/* MR1 */ if (ch=='\n') { -/* MR1 */ /* MR23 */ printMessage(stdout, " char=newline"); -/* MR1 */ } else { -/* MR1 */ /* MR23 */ printMessage(stdout, " char=(%c)",ch); -/* MR1 */ }; -/* MR1 */ }; -/* MR1 */ /* MR23 */ printMessage(stdout, " %s\n", -/* MR1 */ (add_erase==1 ? "skip()" : -/* MR1 */ add_erase==2 ? "more()" : -/* MR1 */ "")); -/* MR1 */ }; - -#endif - - switch (add_erase) { - case 1: goto skip; - case 2: goto more; - } - return tk; -} - -void DLGLexer:: -advance() -{ - if ( input==NULL ) err_in(); - ZZGETC; charfull = 1; ZZINC; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.cpp deleted file mode 100644 index 66907f8b3..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* DLGLexerBase.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#include "pcctscfg.h" - -#include "pccts_stdio.h" -#include "pccts_stdlib.h" - -PCCTS_NAMESPACE_STD - -/* I have to put this here due to C++ limitation - * that you can't have a 'forward' decl for enums. - * I hate C++!!!!!!!!!!!!!!! - */ - -// MR1 -// MR1 10-Apr-97 133MR1 Prevent use of varying sizes for the -// MR1 ANTLRTokenType enum -// MR1 - -enum ANTLRTokenType { TER_HATES_CPP=0, ITS_UTTER_GARBAGE, // MR1 - WITH_SOME_GOOD_IDEAS=9999}; // MR1 - -#define ANTLR_SUPPORT_CODE - -#include "pcctscfg.h" -#include DLEXERBASE_H -#include APARSER_H // MR23 - -DLGLexerBase:: -DLGLexerBase(DLGInputStream *in, - unsigned bufsize, - int _interactive, - int _track_columns) -{ - this->_bufsize = bufsize; - this->_lextext = new DLGChar[_bufsize]; - if ( this->_lextext==NULL ) { - panic("text buffer is NULL"); - } - this->_begexpr = this->_endexpr = NULL; - this->ch = this->bufovf = 0; - this->nextpos = NULL; - this->cl = 0; - this->add_erase = 0; - this->input = in; - this->_begcol = 0; - this->_endcol = 0; - this->_line = 1; - this->charfull = 0; - this->automaton = 0; - this->token_to_fill = NULL; - this->interactive = _interactive; - this->track_columns = _track_columns; - this->debugLexerFlag = 0; // MR1 - this->parser = NULL; // MR1 - this->lexErrCount=0; // MR11 -} - -// MR19 THM - -void DLGLexerBase::reset() -{ - this->charfull = 0; - this->_begcol = 0; - this->_endcol = 0; - this->automaton = 0; - this->_line=1; - this->lexErrCount=0; -} - -void DLGLexerBase:: -setInputStream( DLGInputStream *in ) -{ - this->input = in; - _line = 1; - charfull = 0; -} - -/* saves dlg state, but not what feeds dlg (such as file position) */ -void DLGLexerBase:: -saveState(DLGState *state) -{ - state->input = input; - state->interactive = interactive; - state->track_columns = track_columns; - state->auto_num = automaton; - state->add_erase = add_erase; - state->lookc = ch; - state->char_full = charfull; - state->begcol = _begcol; - state->endcol = _endcol; - state->line = _line; - state->lextext = _lextext; - state->begexpr = _begexpr; - state->endexpr = _endexpr; - state->bufsize = _bufsize; - state->bufovf = bufovf; - state->nextpos = nextpos; - state->class_num = cl; - state->debugLexerFlag = debugLexerFlag; // MR1 - state->parser = parser; // MR1 -} - -void DLGLexerBase:: -restoreState(DLGState *state) -{ - input = state->input; - interactive = state->interactive; - track_columns = state->track_columns; - automaton = state->auto_num; - add_erase = state->add_erase; - ch = state->lookc; - charfull = state->char_full; - _begcol = state->begcol; - _endcol = state->endcol; - _line = state->line; - _lextext = state->lextext; - _begexpr = state->begexpr; - _endexpr = state->endexpr; - _bufsize = state->bufsize; - bufovf = state->bufovf; - nextpos = state->nextpos; - cl = state->class_num; - debugLexerFlag = state->debugLexerFlag; // MR1 - parser = state->parser; // MR1 -} - -/* erase what is currently in the buffer, and get a new reg. expr */ -void DLGLexerBase:: -skip() -{ - add_erase = 1; -} - -/* don't erase what is in the lextext buffer, add on to it */ -void DLGLexerBase:: -more() -{ - add_erase = 2; -} - -/* substitute c for the reg. expr last matched and is in the buffer */ -void DLGLexerBase:: -replchar(DLGChar c) -{ - /* can't allow overwriting null at end of string */ - if (_begexpr < &_lextext[_bufsize-1]){ - *_begexpr = c; - *(_begexpr+1) = '\0'; - } - _endexpr = _begexpr; - if (c != '\0') { - nextpos = _begexpr + 1; - } - else { - nextpos = _begexpr; /* MR30 Zero terminates string. */ - } -} - -/* replace the string s for the reg. expr last matched and in the buffer */ - -#ifdef _MSC_VER // MR23 -//Turn off "assignment within conditional expression" warning -#pragma warning(disable : 4706) -#endif -void DLGLexerBase:: -replstr(const DLGChar *s) /* MR20 const */ -{ - register DLGChar *l= &_lextext[_bufsize -1]; - - nextpos = _begexpr; - if (s){ - while ((nextpos <= l) && (*(nextpos++) = *(s++))){ - /* empty */ - } - /* correct for NULL at end of string */ - nextpos--; - } - if ((nextpos <= l) && (*(--s) == 0)){ - bufovf = 0; - }else{ - bufovf = 1; - } - *(nextpos) = '\0'; - _endexpr = nextpos - 1; -} -#ifdef _MSC_VER // MR23 -#pragma warning(default: 4706) -#endif - -void DLGLexerBase:: -errstd(const char *s) /* MR20 const */ -{ - lexErrCount++; /* MR11 */ - /* MR23 */ printMessage(stderr, - "%s near line %d (text was '%s')\n", - ((s == NULL) ? "Lexical error" : s), - _line,_lextext); -} - -int DLGLexerBase:: -err_in() -{ - /* MR23 */ printMessage(stderr,"No input stream, function, or string\n"); - /* return eof to get out gracefully */ - return EOF; -} - -ANTLRTokenType DLGLexerBase:: -erraction() -{ - errstd("invalid token"); - advance(); - skip(); - return (ANTLRTokenType) 0; // bogus, but satisfies compiler -} - -_ANTLRTokenPtr DLGLexerBase:: -getToken() -{ - if ( token_to_fill==NULL ) panic("NULL token_to_fill"); - ANTLRTokenType tt = nextTokenType(); - _ANTLRTokenPtr tk = token_to_fill->makeToken(tt, _lextext,_line); - return tk; -} - -void DLGLexerBase:: -panic(const char *msg) /* MR20 const */ -{ - if (parser) //MR23 - parser->panic(msg); //MR23 - else //MR23 - { - /* MR23 */ printMessage(stderr, "DLG panic: %s\n", msg); - // - // 7-Apr-97 133MR1 - // - exit(PCCTS_EXIT_FAILURE); // MR1 - } -} - -ANTLRParser * DLGLexerBase:: // MR1 -setParser(ANTLRParser *p) { // MR1 - ANTLRParser *oldValue=parser; // MR1 - parser=p; // MR1 - return oldValue; // MR1 -} // MR1 - // MR1 -ANTLRParser * DLGLexerBase:: // MR1 -getParser() { // MR1 - return parser; // MR1 -} // MR1 - // MR1 -int DLGLexerBase:: // MR1 -debugLexer(int newValue) { // MR1 - int oldValue=debugLexerFlag; // MR1 - debugLexerFlag=newValue; // MR1 - return oldValue; // MR1 -} // MR1 - -//MR23 -int DLGLexerBase::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - - int iRet = 0; - if (parser) - parser->printMessageV(pFile, pFormat, marker); - else - iRet = vfprintf(pFile, pFormat, marker); - - va_end( marker ); - return iRet; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.h deleted file mode 100644 index e18a5d86c..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/DLexerBase.h +++ /dev/null @@ -1,198 +0,0 @@ -/* DLGLexerBase.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef DLGX_H -#define DLGX_H - -#include "pcctscfg.h" -#include "pccts_stdio.h" - -PCCTS_NAMESPACE_STD - -#include ATOKEN_H -#include ATOKENSTREAM_H - -class ANTLRParser; // MR1 - -/* must define what a char looks like; can make this a class too */ -typedef char DLGChar; - -/* Can have it as a class too: (ack this looks weird; is it right?) -class DllExportPCCTS DLGChar { -private: - int c; -public: - DLGChar(int ch) { c = ch; } - int atom() { return c; } -}; -*/ - -/* user must subclass this */ -class DllExportPCCTS DLGInputStream { -public: - virtual int nextChar() = 0; -}; - -/* Predefined char stream: Input from FILE */ -class DllExportPCCTS DLGFileInput : public DLGInputStream { -private: - int found_eof; - FILE *input; -public: - DLGFileInput(FILE *f) { input = f; found_eof = 0; } - int nextChar() { - int c; - if ( found_eof ) return EOF; - else { - c=getc(input); - if ( c==EOF ) found_eof = 1; - return c; - } - } - void DLGFileReset(FILE *f) {input=f; found_eof = 0; }; // MR11 -}; - -// MR9 Suggested by Bruce Guenter (bruceg@qcc.sk.ca) -// MR9 Make DLGStringInput const correct - -/* Predefined char stream: Input from string */ -class DllExportPCCTS DLGStringInput : public DLGInputStream { -private: - const DLGChar *input; // MR9 - const DLGChar *p; // MR9 -public: - DLGStringInput(const DLGChar *s) { input = s; p = &input[0];} // MR9 - int nextChar() - { - if (*p) return (int) (unsigned char) *p++; // MR14 - else return EOF; - } - - void DLGStringReset(const DLGChar *s) {input=s; p= &input[0]; }; // MR11 // MR16 -}; - -class DllExportPCCTS DLGState { -public: - DLGInputStream *input; - int interactive; - int track_columns; - int auto_num; - int add_erase; - int lookc; - int char_full; - int begcol, endcol; - int line; - DLGChar *lextext, *begexpr, *endexpr; - int bufsize; - int bufovf; - DLGChar *nextpos; - int class_num; - int debugLexerFlag; // MR1 - ANTLRParser *parser; // MR1 -}; - -/* user must subclass this */ -class DllExportPCCTS DLGLexerBase : public ANTLRTokenStream { -public: - virtual ANTLRTokenType erraction(); - -protected: - DLGInputStream *input; - int interactive; - int track_columns; - DLGChar *_lextext; /* text of most recently matched token */ - DLGChar *_begexpr; /* beginning of last reg expr recogn. */ - DLGChar *_endexpr; /* beginning of last reg expr recogn. */ - int _bufsize; /* number of characters in lextext */ - int _begcol; /* column that first character of token is in*/ - int _endcol; /* column that last character of token is in */ - int _line; /* line current token is on */ - int ch; /* character to determine next state */ - int bufovf; /* indicates that buffer too small for text */ - int charfull; - DLGChar *nextpos; /* points to next available position in lextext*/ - int cl; - int automaton; - int add_erase; - DLGChar ebuf[70]; - _ANTLRTokenPtr token_to_fill; - - int debugLexerFlag; // MR1 - ANTLRParser *parser; // MR1 -public: - virtual _ANTLRTokenPtr getToken(); // MR12 public - virtual void advance(void) = 0; - void skip(void); /* erase lextext, look for antoher token */ - void more(void); /* keep lextext, look for another token */ - void mode(int k); /* switch to automaton 'k' */ - void saveState(DLGState *); - void restoreState(DLGState *); - virtual ANTLRTokenType nextTokenType(void)=0;/* get next token */ - void replchar(DLGChar c); /* replace last recognized reg. expr. with - a character */ - void replstr(const DLGChar *s); /* replace last recognized reg. expr. with - a string */ /* MR20 const */ - virtual int err_in(); // MR1 - virtual void errstd(const char *); // MR1 MR20 const - int line() { return _line; } - void set_line(int newValue) { _line=newValue; }; // MR1 - virtual void newline() { _line++; } - DLGChar *lextext() { return _lextext; } - - int begcol() { return _begcol; } - int endcol() { return _endcol; } - void set_begcol(int a) { _begcol=a; } - void set_endcol(int a) { _endcol=a; } - DLGChar *begexpr() { return _begexpr; } - DLGChar *endexpr() { return _endexpr; } - int bufsize() { return _bufsize; } - - void setToken(ANTLRAbstractToken *t) { token_to_fill = t; } - - void setInputStream(DLGInputStream *); - DLGLexerBase(DLGInputStream *in, - unsigned bufsize=2000, - int interactive=0, - int track_columns=0); - void reset(); // MR19 - virtual ~DLGLexerBase() { delete [] _lextext; } - virtual void panic(const char *msg); // MR1 MR20 const - void trackColumns() { - track_columns = 1; - this->_begcol = 0; - this->_endcol = 0; - }; - virtual ANTLRParser *setParser(ANTLRParser *p); // MR1 - virtual ANTLRParser *getParser(); // MR1 - virtual int debugLexer(int value); // MR1 - int lexErrCount; // MR12 - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PBlackBox.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PBlackBox.h deleted file mode 100644 index 39f7d5789..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PBlackBox.h +++ /dev/null @@ -1,134 +0,0 @@ -#ifndef PBLACKBOX_H -#define PBLACKBOX_H - -/* - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -/* Completely rewritten by Chris Uzdavinis (chris@atdesk.com) for MR23 */ - -#include "pcctscfg.h" - -#include "pccts_iostream.h" - -PCCTS_NAMESPACE_STD - -// MR20 Added #include for "DLexerBase.h" - -#include "DLexerBase.h" - -// -// The default buffer size of the lexer is given by the -// second argument of the lexer's ctor. It is optional -// and defaults to 2000 -// - -template -class DllExportPCCTS ParserBlackBox { -private: - // no copy construction allowed - ParserBlackBox(ParserBlackBox const &); - - // no copy assignment allowed - ParserBlackBox & operator=(ParserBlackBox const &); - -protected: - DLGFileInput *in; - Lexer *scan; - _ANTLRTokenPtr tok; - ANTLRTokenBuffer *pipe; - Parser *_parser; - FILE *file; - int openByBlackBox; /* MR21 Don't close what we haven't opened */ -public: - - ParserBlackBox(FILE *f) - : in(0) - , scan(0) - , tok(0) - , pipe(0) - , _parser(0) - , file(0) - , openByBlackBox(0) - { - if (f == NULL) - { - cerr << "invalid file pointer\n"; - } - else - { - openByBlackBox = 0; /* MR21a */ - file = f; - in = new DLGFileInput(f); - scan = new Lexer(in); - pipe = new ANTLRTokenBuffer(scan); - tok = new Token; - scan->setToken(tok); - _parser = new Parser(pipe); - _parser->init(); - } - } - ParserBlackBox(char *fname) - : in(0) - , scan(0) - , tok(0) - , pipe(0) - , _parser(0) - , file(0) - , openByBlackBox(0) - { - FILE *f = fopen(fname, "r"); - if ( f==NULL ) { - openByBlackBox = 0; - cerr << "cannot open " << fname << "\n"; return; - } - else { - openByBlackBox = 1; - file = f; - in = new DLGFileInput(f); - scan = new Lexer(in); - pipe = new ANTLRTokenBuffer(scan); - tok = new Token; - scan->setToken(tok); - _parser = new Parser(pipe); - _parser->init(); - } - } - - ~ParserBlackBox() - { - delete in; delete scan; delete pipe; delete _parser; delete tok; - if (1 == openByBlackBox) { - fclose(file); - } - } - - Parser *parser() { return _parser; } - Lexer *getLexer() { return scan; } -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.cpp deleted file mode 100644 index f6b0295ef..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.cpp +++ /dev/null @@ -1,684 +0,0 @@ -/* - * PCCTSAST.C - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B14 and ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * AHPCRC, University of Minnesota - * 1992-2000 - */ - -#define ANTLR_SUPPORT_CODE - -#include "pcctscfg.h" - -#include "PCCTSAST.h" -#include "pccts_stdarg.h" - -PCCTS_NAMESPACE_STD - -#include - -//#include "SList.h" - - /* String Scanning/Parsing Stuff */ - -const char *PCCTS_AST::scan_token_tbl[] = { /* MR20 const */ - "invalid", /* 0 */ - "LPAREN", /* 1 */ - "RPAREN", /* 2 */ - "PERCENT", /* 3 */ - "INT", /* 4 */ - "COLON", /* 5 */ - "POUND", /* 6 */ - "PERIOD", /* 7 */ -}; - -void PCCTS_AST:: -addChild(PCCTS_AST *t) -{ - if ( t==NULL ) return; - PCCTS_AST *s = down(); - if ( s!=NULL ) - { - while ( s->right()!=NULL ) s = s->right(); - s->setRight(t); - } - else - this->setDown(t); -} - -void PCCTS_AST:: -lisp(FILE *f) -{ - if ( down() != NULL ) /* MR23 */ printMessage(f," ("); - lisp_action(f); - if ( down()!=NULL ) down()->lisp(f); - if ( down() != NULL ) /* MR23 */ printMessage(f," )"); - if ( right()!=NULL ) right()->lisp(f); -} - -/* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the children siblings and return ptr - * to 1st sibling (child1). If root is not single node, return NULL. - * - * Siblings that are actually sibling lists themselves are handled - * correctly. For example #( NULL, #( NULL, A, B, C), D) results - * in the tree ( NULL A B C D ). - * - * Requires at least two parameters with the last one being NULL. If - * both are NULL, return NULL. - * - * The down() and right() down/right pointers are used to make the tree. - */ -PCCTS_AST *PCCTS_AST:: -make(PCCTS_AST *rt, ...) -{ - va_list ap; - register PCCTS_AST *child, *sibling=NULL, *tail=NULL /*MR23*/, *w; - PCCTS_AST *root; - - va_start(ap, rt); - root = rt; - - if ( root != NULL ) - if ( root->down() != NULL ) return NULL; - child = va_arg(ap, PCCTS_AST *); - while ( child != NULL ) - { - /* find end of child */ - for (w=child; w->right()!=NULL; w=w->right()) {;} - if ( sibling == NULL ) {sibling = child; tail = w;} - else {tail->setRight(child); tail = w;} - child = va_arg(ap, PCCTS_AST *); - } - if ( root==NULL ) root = sibling; - else root->setDown(sibling); - va_end(ap); - return root; -} - -/* The following push and pop routines are only used by ast_find_all() */ - -void PCCTS_AST:: -_push(PCCTS_AST **st, int *sp, PCCTS_AST *e) -{ - (*sp)--; - require((*sp)>=0, "stack overflow"); - st[(*sp)] = e; -} - -PCCTS_AST *PCCTS_AST:: -_pop(PCCTS_AST **st, int *sp) -{ - PCCTS_AST *e = st[*sp]; - (*sp)++; - require((*sp)<=MaxTreeStackDepth, "stack underflow"); - return e; -} - -/* Find all occurrences of u in t. - * 'cursor' must be initialized to 't'. It eventually - * returns NULL when no more occurrences of 'u' are found. - */ -PCCTS_AST *PCCTS_AST:: -ast_find_all(PCCTS_AST *u, PCCTS_AST **cursor) -{ - PCCTS_AST *sib; - /*** static ***/ PCCTS_AST *template_stack[MaxTreeStackDepth]; /* MR23 Remove "static" */ - /*** static ***/ int tsp = MaxTreeStackDepth; /* MR23 Remove "static" */ - -////static int nesting = 0; /* MR23 Not referenced */ - - if ( *cursor == NULL ) return NULL; - if ( *cursor!=this ) sib = *cursor; - else { - /* else, first time--start at top of template 't' */ - tsp = MaxTreeStackDepth; - sib = this; - /* bottom of stack is always a NULL--"cookie" indicates "done" */ - _push(template_stack, &tsp, NULL); - } - -keep_looking: - if ( sib==NULL ) /* hit end of sibling list */ - { - sib = _pop(template_stack, &tsp); - if ( sib == NULL ) { *cursor = NULL; return NULL; } - } - - if ( sib->type() != u->type() ) - { - /* look for another match */ - if ( sib->down()!=NULL ) - { - if ( sib->right()!=NULL ) _push(template_stack, &tsp, sib->right()); - sib=sib->down(); - goto keep_looking; - } - /* nothing below to try, try next sibling */ - sib=sib->right(); - goto keep_looking; - } - - /* found a matching root node, try to match what's below */ - if ( match_partial(sib, u) ) - { - /* record sibling cursor so we can pick up next from there */ - if ( sib->down()!=NULL ) - { - if ( sib->right()!=NULL ) _push(template_stack, &tsp, sib->right()); - *cursor = sib->down(); - } - else if ( sib->right()!=NULL ) *cursor = sib->right(); - else *cursor = _pop(template_stack, &tsp); - return sib; - } - - /* no match, keep searching */ - if ( sib->down()!=NULL ) - { - if ( sib->right()!=NULL ) _push(template_stack, &tsp, sib->right()); - sib=sib->down(); - } - else sib = sib->right(); /* else, try to right if zip below */ - goto keep_looking; -} - -/* are two trees exactly alike? */ -int PCCTS_AST:: -match(PCCTS_AST *u) -{ - PCCTS_AST *t = this; - PCCTS_AST *sib; - - if ( u==NULL ) return 0; - - for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right(), u=u->right()) - { - if ( sib->type() != u->type() ) return 0; - if ( sib->down()!=NULL ) - if ( !sib->down()->match(u->down()) ) return 0; - } - return 1; -} - -/* Is 'u' a subtree of 't' beginning at the root? */ -int PCCTS_AST:: -match_partial(PCCTS_AST *t, PCCTS_AST *u) -{ - PCCTS_AST *sib; - - if ( u==NULL ) return 1; - if ( t==NULL ) return 0; /* MR23 removed unreachable code */ - - for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right(), u=u->right()) - { - if ( sib->type() != u->type() ) return 0; - if ( sib->down()!=NULL ) - if ( !match_partial(sib->down(), u->down()) ) return 0; - } - return 1; -} - -#ifdef _MSC_VER // MR23 -//Turn off "unreachable code" warning -#pragma warning(disable : 4702) -#endif -/* Walk the template tree 't' (matching against 'this'), filling in the - * 'labels' array, and setting 'n' according to how many labels were matched. - */ -int PCCTS_AST:: -scanmatch(ScanAST *t, PCCTS_AST **labels[], int *n) -{ - ScanAST *sib; - PCCTS_AST *u = this; - - if ( u==NULL ) return 0; - - for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right(), u=u->right()) - { - /* make sure tokens match; token of '0' means wildcard match */ - if ( sib->type() != u->type() && sib->type()!=0 ) return 0; - /* we have a matched token here; set label pointers if exists */ - if ( sib->label_num>0 ) - { - require(labels!=NULL, "label found in template, but no array of labels"); - (*n)++; - *(labels[sib->label_num-1]) = u; - } - /* match what's below if something there and current node is not wildcard */ - if ( sib->down()!=NULL && sib->type()!=0 ) - { - if ( sib->down()==NULL ) - { - if ( u->down()!=NULL ) - return 0; - else - return 1; - } - if ( !u->down()->scanmatch(sib->down(), labels, n) ) return 0; - } - } - return 1; -} -#ifdef _MSC_VER // MR23 -#pragma warning(default : 4702) -#endif - -void PCCTS_AST:: -insert_after(PCCTS_AST *b) -{ - PCCTS_AST *end; - if ( b==NULL ) return; - /* find end of b's child list */ - for (end=b; end->right()!=NULL; end=end->right()) {;} - end->setRight(this->right()); - this->setRight(b); -} - -void PCCTS_AST:: -append(PCCTS_AST *b) -{ - PCCTS_AST *end; - require(b!=NULL, "append: NULL input tree"); - /* find end of child list */ - for (end=this; end->right()!=NULL; end=end->right()) {;} - end->setRight(b); -} - -PCCTS_AST *PCCTS_AST:: -tail() -{ - PCCTS_AST *end; - /* find end of child list */ - for (end=this; end->right()!=NULL; end=end->right()) {;} - return end; -} - -PCCTS_AST *PCCTS_AST:: -bottom() -{ - PCCTS_AST *end; - /* find end of child list */ - for (end=this; end->down()!=NULL; end=end->down()) {;} - return end; -} - -PCCTS_AST *PCCTS_AST:: -cut_between(PCCTS_AST *a, PCCTS_AST *b) -{ - PCCTS_AST *end, *ret; - if (a==NULL||b==NULL) return NULL; - /* find node pointing to b */ - for (end=a; end->right()!=NULL&&end->right()!=b; end=end->right()) - {;} - if (end->right()==NULL) return NULL; //ast_cut_between: a,b not connected - end->setRight(NULL); /* don't want it point to 'b' anymore */ - ret = a->right(); - a->setRight(b); - return ret; -} - -#ifdef NOT_YET -SList *PCCTS_AST:: -to_slist() -{ - SList *list = new SList; - PCCTS_AST *p; - - for (p=this; p!=NULL; p=p->right()) - { - list->add(p); - } - return list; -} -#endif - -void PCCTS_AST:: -tfree() -{ - PCCTS_AST *t = this; - if ( t->down()!=NULL ) t->down()->tfree(); - if ( t->right()!=NULL ) t->right()->tfree(); - delete t; -} - -int PCCTS_AST:: -nsiblings() -{ - PCCTS_AST *t = this; - int n=0; - - while ( t!=NULL ) - { - n++; - t = t->right(); - } - return n; -} - -PCCTS_AST *PCCTS_AST:: -sibling_index(int i) -{ - PCCTS_AST *t = this; - int j=1; - require(i>0, "sibling_index: i<=0"); - - while ( t!=NULL ) - { - if ( j==i ) return t; - j++; - t = t->right(); - } - return NULL; -} - -/* Assume this is a root node of a tree-- - * duplicate that node and what's below; ignore siblings of root node. - */ - -// MR9 23-Sep-97 RJV -// MR9 -// MR9 RJV: Original version only duplicated the node and down elements. -// MR9 Made copies of the pointers to sibling. -// MR9 Changed call "down()->deepCopy()" to "down()->deepCopyBushy()" -// MR9 - -PCCTS_AST *PCCTS_AST:: -deepCopy() -{ - PCCTS_AST *u = this->shallowCopy(); - if ( down()!=NULL ) u->setDown(down()->deepCopyBushy()); - u->setRight(NULL); - return u; -} - -/* Copy all nodes including siblings of root. */ -PCCTS_AST *PCCTS_AST:: -deepCopyBushy() -{ - PCCTS_AST *u = this->shallowCopy(); - /* copy the rest of the tree */ - if ( down()!=NULL ) u->setDown(down()->deepCopyBushy()); - if ( right()!=NULL ) u->setRight(right()->deepCopyBushy()); - return u; -} - -void PCCTS_AST:: -scanast_free(ScanAST *t) -{ - if ( t == NULL ) return; - scanast_free( t->down() ); - scanast_free( t->right() ); - free( (char *) t ); // MR1 -} - -/* - * scan - * - * This function is like scanf(): it attempts to match a template - * against an input tree. A variable number of tree pointers - * may be set according to the '%i' labels in the template string. - * For example: - * - * t->ast_scan("#( 6 #(5 %1:4 %2:3) #(1 %3:3 %4:3) )", - * &w, &x, &y, &z); - * - * Naturally, you'd want this converted from - * - * t->ast_scan("#( RangeOp #(Minus %1:IConst %2:Var) #(Plus %3:Var %4Var) )", - * &w, &x, &y, &z); - * - * by SORCERER. - * - * This function call must be done withing a SORCERER file because SORCERER - * must convert the token references to the associated token number. - * - * This functions parses the template and creates trees which are then - * matched against the input tree. The labels are set as they are - * encountered; hence, partial matches may leave some pointers set - * and some NULL. This routines initializes all argument pointers to NULL - * at the beginning. - * - * This function returns the number of labels matched. - */ -int PCCTS_AST:: -ast_scan(char *templ, ...) -{ - va_list ap; - ScanAST *tmpl; - int n, i, found=0; - PCCTS_AST ***label_ptrs=NULL; - - va_start(ap, templ); - - /* make a ScanAST tree out of the template */ - tmpl = stringparser_parse_scanast(templ, &n); - - /* make an array out of the labels */ - if ( n>0 ) - { - label_ptrs = (PCCTS_AST ***) calloc(n, sizeof(PCCTS_AST **)); - require(label_ptrs!=NULL, "scan: out of memory"); - for (i=1; i<=n; i++) - { - label_ptrs[i-1] = va_arg(ap, PCCTS_AST **); - *(label_ptrs[i-1]) = NULL; - } - } - - /* match the input tree against the template */ - scanmatch(tmpl, label_ptrs, &found); - - scanast_free(tmpl); - free( (char *) label_ptrs); // MR1 - - return found; -} - -ScanAST *PCCTS_AST:: -new_scanast(int tok) -{ - ScanAST *p = (ScanAST *) calloc(1, sizeof(ScanAST)); -// -// 7-Apr-97 133MR1 -// - if ( p == NULL ) - panic("out of memory\n"); // MR23 - p->_token = tok; - return p; -} - -ScanAST *PCCTS_AST:: -stringparser_parse_scanast(char *templ, int *num_labels) -{ - StringLexer lex; - StringParser parser; - ScanAST *t; - - stringlexer_init(&lex, templ); - stringparser_init(&parser, &lex); - t = stringparser_parse_tree(&parser); - *num_labels = parser.num_labels; - return t; -} - -void PCCTS_AST:: -stringparser_match(StringParser *parser, int token) -{ - if ( parser->token != token ) panic("bad tree in scan()"); -} - -/* - * Match a tree of the form: - * (root child1 child2 ... childn) - * or, - * node - * - * where the elements are integers or labeled integers. - */ -ScanAST *PCCTS_AST:: -stringparser_parse_tree(StringParser *parser) -{ - ScanAST *t=NULL, *root, *child, *last=NULL /*MR23*/; - - if ( parser->token != __POUND ) - { - return stringparser_parse_element(parser); - } - stringparser_match(parser,__POUND); - parser->token = stringscan_gettok(parser->lexer); - stringparser_match(parser,__LPAREN); - parser->token = stringscan_gettok(parser->lexer); - root = stringparser_parse_element(parser); - while ( parser->token != __RPAREN ) - { - child = stringparser_parse_element(parser); - if ( t==NULL ) { t = child; last = t; } - else { last->_right = child; last = child; } - } - stringparser_match(parser,__RPAREN); - parser->token = stringscan_gettok(parser->lexer); - root->_down = t; - return root; -} - -ScanAST *PCCTS_AST:: -stringparser_parse_element(StringParser *parser) -{ - char ebuf[100]; - int label = 0; - - if ( parser->token == __POUND ) - { - return stringparser_parse_tree(parser); - } - if ( parser->token == __PERCENT ) - { - parser->token = stringscan_gettok(parser->lexer); - stringparser_match(parser,__INT); - label = atoi(parser->lexer->text); - parser->num_labels++; - if ( label==0 ) panic("%%0 is an invalid label"); - parser->token = stringscan_gettok(parser->lexer); - stringparser_match(parser,__COLON); - parser->token = stringscan_gettok(parser->lexer); - /* can label tokens and wildcards */ - if ( parser->token != __INT && parser->token != __PERIOD ) - panic("can only label tokens"); - } - if ( parser->token == __INT ) - { - ScanAST *p = new_scanast(atoi(parser->lexer->text)); - parser->token = stringscan_gettok(parser->lexer); - p->label_num = label; - return p; - } - if ( parser->token == __PERIOD ) - { - ScanAST *p = new_scanast(0); /* token of 0 is wildcard */ - parser->token = stringscan_gettok(parser->lexer); - p->label_num = label; - return p; - } - sprintf(ebuf, "mismatch token in scan(): %s", scan_token_str(parser->token)); - panic(ebuf); - return NULL; -} - -void PCCTS_AST:: -stringparser_init(StringParser *parser, StringLexer *input) -{ - parser->lexer = input; - parser->token = stringscan_gettok(parser->lexer); - parser->num_labels = 0; -} - -void PCCTS_AST:: -stringlexer_init(StringLexer *scanner, char *input) -{ - scanner->text[0]='\0'; - scanner->input = input; - scanner->p = input; - stringscan_advance(scanner); -} - -void PCCTS_AST:: -stringscan_advance(StringLexer *scanner) -{ - if ( *(scanner->p) == '\0' ) scanner->c = __StringScanEOF; - scanner->c = *(scanner->p)++; -} - -int PCCTS_AST:: -stringscan_gettok(StringLexer *scanner) -{ - char *index = &scanner->text[0]; - char ebuf[100]; /* MR23 Remove static */ - - while ( isspace(scanner->c) ) { stringscan_advance(scanner); } - if ( isdigit(scanner->c) ) - { - int tok = __INT; - while ( isdigit(scanner->c) ) { - *index++ = (char) /* static_cast */ (scanner->c); // MR23 - stringscan_advance(scanner); - } - *index = '\0'; - return tok; - } - switch ( scanner->c ) - { - case '#' : stringscan_advance(scanner); return __POUND; - case '(' : stringscan_advance(scanner); return __LPAREN; - case ')' : stringscan_advance(scanner); return __RPAREN; - case '%' : stringscan_advance(scanner); return __PERCENT; - case ':' : stringscan_advance(scanner); return __COLON; - case '.' : stringscan_advance(scanner); return __PERIOD; - case '\0' : return __StringScanEOF; - case __StringScanEOF : return __StringScanEOF; - default : - sprintf(ebuf, "invalid char in scan: '%c'", scanner->c); - panic(ebuf); - } - return __StringScanEOF; // never reached -} - -const char *PCCTS_AST:: /* MR20 const */ -scan_token_str(int t) -{ - if ( VALID_SCAN_TOKEN(t) ) return scan_token_tbl[t]; - else if ( t==__StringScanEOF ) return ""; - else return ""; -} - -//MR23 -int PCCTS_AST::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - int iRet = vfprintf(pFile, pFormat, marker); - va_end( marker ); - return iRet; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.h deleted file mode 100644 index 9fb3fd7a1..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/PCCTSAST.h +++ /dev/null @@ -1,143 +0,0 @@ -/* Abstract syntax tree - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef PCCTSAST_H -#define PCCTSAST_H - -#include "pcctscfg.h" - -#include "pccts_stdio.h" -#include "pccts_stdlib.h" - -PCCTS_NAMESPACE_STD - -//class SList; - -#define StringScanMaxText 50 -#define MaxTreeStackDepth 400 - -// -// 7-Apr-97 133MR1 signed int not accepted by AT&T cfront -// -typedef struct stringlexer { - int c; // MR1 - char *input; - char *p; - char text[StringScanMaxText]; - } StringLexer; - -/* Define the structures needed for ast_scan() */ -typedef struct stringparser { - int token; - StringLexer *lexer; - int num_labels; - } StringParser; - -typedef struct _scanast { - struct _scanast *_right, *_down; - int _token; - int label_num; - int type() { return _token; } - struct _scanast *right() { return _right; } - struct _scanast *down() { return _down; } - } ScanAST; - -#define VALID_SCAN_TOKEN(t) (t>=__LPAREN && t<=__PERIOD) - -class DllExportPCCTS PCCTS_AST { -protected: - static const char *scan_token_tbl[]; /* MR20 const */ - enum { - __LPAREN=1, - __RPAREN=2, - __PERCENT=3, - __INT=4, - __COLON=5, - __POUND=6, - __PERIOD=7, - __StringScanEOF=-1}; - -protected: - const char *scan_token_str(int t); /* MR20 const */ - void stringlexer_init(StringLexer *scanner, char *input); - void stringparser_init(StringParser *, StringLexer *); - ScanAST *stringparser_parse_scanast(char *templ, int *n); - ScanAST *stringparser_parse_tree(StringParser *parser); - ScanAST *stringparser_parse_element(StringParser *parser); - void stringscan_advance(StringLexer *scanner); - int stringscan_gettok(StringLexer *scanner); - void _push(PCCTS_AST **st, int *sp, PCCTS_AST *e); - PCCTS_AST *_pop(PCCTS_AST **st, int *sp); - int match_partial(PCCTS_AST *t, PCCTS_AST *u); - int scanmatch(ScanAST *t, PCCTS_AST **labels[], int *n); - void scanast_free(ScanAST *t); - ScanAST *new_scanast(int tok); - void stringparser_match(StringParser *parser, int type); - virtual PCCTS_AST *deepCopyBushy(); - -public: - PCCTS_AST() {;} - virtual ~PCCTS_AST() {;} - - /* This group must be defined for SORCERER to work correctly */ - virtual PCCTS_AST *right() = 0; - virtual PCCTS_AST *down() = 0; - virtual void setRight(PCCTS_AST *t) = 0; - virtual void setDown(PCCTS_AST *t) = 0; -// we define these so ANTLR doesn't have to - virtual int type() { return 0; } - virtual void setType(int /*t MR23 */) {;} - virtual PCCTS_AST *shallowCopy() {panic("no shallowCopy() defined"); return NULL;} - - /* These are not needed by ANTLR, but are support functions */ - virtual PCCTS_AST *deepCopy(); // used by SORCERER in transform mode - virtual void addChild(PCCTS_AST *t); - virtual void lisp_action(FILE * /*f MR23 */) {;} - virtual void lisp(FILE *f); - static PCCTS_AST *make(PCCTS_AST *rt, ...); - virtual PCCTS_AST *ast_find_all(PCCTS_AST *u, PCCTS_AST **cursor); - virtual int match(PCCTS_AST *u); - virtual void insert_after(PCCTS_AST *b); - virtual void append(PCCTS_AST *b); - virtual PCCTS_AST *tail(); - virtual PCCTS_AST *bottom(); - static PCCTS_AST *cut_between(PCCTS_AST *a, PCCTS_AST *b); -// virtual SList *to_slist(); - virtual void tfree(); - int ast_scan(char *templ, ...); - virtual int nsiblings(); - virtual PCCTS_AST *sibling_index(int i); - - void require(int e,const char *err){ if ( !e ) panic(err); } /* MR20 const */ - virtual void panic(const char *err) // MR20 const - { /* MR23 */ printMessage(stderr, "PCCTS_AST: %s\n", err); exit(PCCTS_EXIT_FAILURE); } - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 -}; - -#endif /* PCCTSAST_H */ diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/SList.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/SList.h deleted file mode 100644 index 34354ccda..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/SList.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef SList_h -#define SList_h - -/* - * SList.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * PCCTS 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1992-2000 - */ - -#include "pcctscfg.h" - -#include "pccts_stdio.h" -#include "pccts_stdlib.h" - -PCCTS_NAMESPACE_STD - -#include "PCCTSAST.h" - -class PCCTS_AST; - -class SListNode { -protected: - void *_elem; /* pointer to any kind of element */ - SListNode *_next; -public: - SListNode() {_elem=_next=NULL;} - virtual ~SListNode() {_elem=_next=NULL;} - void *elem() { return _elem; } - void setElem(void *e) { _elem = e; } - void setNext(SListNode *t) { _next = t; } - SListNode *next() { return _next; } -}; - -class SList { - SListNode *head, *tail; -public: - SList() {head=tail=NULL;} - virtual ~SList() {head=tail=NULL;} - virtual void *iterate(SListNode **); - virtual void add(void *e); - virtual void lfree(); - virtual PCCTS_AST *to_ast(SList list); - virtual void require(int e,char *err){ if ( !e ) panic(err); } - virtual void panic(char *err){ /* MR23 */ printMessage(stderr, "SList panic: %s\n", err); exit(PCCTS_EXIT_FAILURE); } - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/antlr.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/antlr.h deleted file mode 100644 index 628ed14f0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/antlr.h +++ /dev/null @@ -1,807 +0,0 @@ -/* antlr.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ANTLR_H -#define ANTLR_H - -#include "pcctscfg.h" - -#include "pccts_stdio.h" - -/* turn off warnings for unreferenced labels */ - -#ifdef _MSC_VER -#pragma warning(disable:4102) -#endif - -/* - * Define all of the stack setup and manipulation of $i, #i variables. - * - * Notes: - * The type 'Attrib' must be defined before entry into this .h file. - */ - - -#ifdef __USE_PROTOS -#include "pccts_stdlib.h" -#else -#ifdef VAXC -#include -#else -#include -#endif -#endif -#include "pccts_string.h" - -#if 0 -#include "set.h" -#endif - - -typedef int ANTLRTokenType; -typedef unsigned char SetWordType; - -typedef char ANTLRChar; - - /* G u e s s S t u f f */ - -#ifdef ZZCAN_GUESS -#ifndef ZZINF_LOOK -#define ZZINF_LOOK -#endif -#endif - -#ifdef ZZCAN_GUESS -typedef struct _zzjmp_buf { - jmp_buf state; - } zzjmp_buf; -#endif - - -/* can make this a power of 2 for more efficient lookup */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 8000 /* MR22 raise from 2k to 8k */ -#endif - -#define zzOvfChk \ - if ( zzasp <= 0 ) \ - { \ - fprintf(stderr, zzStackOvfMsg, __FILE__, __LINE__); \ - exit(PCCTS_EXIT_FAILURE); \ - } - -#ifndef ZZA_STACKSIZE -#define ZZA_STACKSIZE 400 -#endif -#ifndef ZZAST_STACKSIZE -#define ZZAST_STACKSIZE 400 -#endif - -#ifndef zzfailed_pred -#ifdef ZZCAN_GUESS -#define zzfailed_pred(_p,_hasuseraction,_useraction) \ - if (zzguessing) { \ - zzGUESS_FAIL; \ - } else { \ - zzfailed_pred_action(_p,_hasuseraction,_useraction); \ - } -#else -#define zzfailed_pred(_p,_hasuseraction,_useraction) \ - zzfailed_pred_action(_p,_hasuseraction,_useraction); -#endif -#endif - -/* MR23 Provide more control over failed predicate action - without any need for user to worry about guessing internals. - _hasuseraction == 0 => no user specified error action - _hasuseraction == 1 => user specified error action -*/ - -#ifndef zzfailed_pred_action -#define zzfailed_pred_action(_p,_hasuseraction,_useraction) \ - if (_hasuseraction) { _useraction } \ - else { fprintf(stderr, "semantic error; failed predicate: '%s'\n",_p); } -#endif - -/* MR19 zzchar_t additions */ - -#ifdef LL_K -#define LOOKAHEAD \ - int zztokenLA[LL_K]; \ - zzchar_t zztextLA[LL_K][ZZLEXBUFSIZE]; \ - int zzlap = 0, zzlabase=0; /* labase only used for DEMAND_LOOK */ -#else -#define LOOKAHEAD \ - int zztoken; -#endif - -#ifndef zzcr_ast -#define zzcr_ast(ast,attr,tok,text) -#endif - -#ifdef DEMAND_LOOK -#define DemandLookData int zzdirty=1; -#else -#define DemandLookData -#endif - -#ifndef zzUSER_GUESS_HOOK -#define zzUSER_GUESS_HOOK(seqFrozen,zzrv) -#endif - -#ifndef zzUSER_GUESS_DONE_HOOK -#define zzUSER_GUESS_DONE_HOOK(seqFrozen) -#endif - - /* S t a t e S t u f f */ - -#ifdef ZZCAN_GUESS -#define zzGUESS_BLOCK zzantlr_state zzst; int zzrv; int zzGuessSeqFrozen; - -/* MR10 change zzGUESS: do zzGUESS_DONE when zzrv==1 after longjmp as in C++ mode */ - -#define zzGUESS zzsave_antlr_state(&zzst); \ - zzguessing = 1; \ - zzGuessSeqFrozen=++zzGuessSeq; \ - zzrv = setjmp(zzguess_start.state); \ - zzUSER_GUESS_HOOK(zzGuessSeqFrozen,zzrv) \ - if (zzrv) zzGUESS_DONE; -#ifdef zzTRACE_RULES -#define zzGUESS_FAIL { zzTraceGuessFail(); longjmp(zzguess_start.state, 1); } -#else -#define zzGUESS_FAIL longjmp(zzguess_start.state, 1) -#endif - -/* MR10 change zzGUESS_DONE: zzrv=1 to simulate longjmp() return value as in C++ mode */ - -#define zzGUESS_DONE { zzrestore_antlr_state(&zzst); zzrv=1; zzUSER_GUESS_DONE_HOOK(zzGuessSeqFrozen) } -#define zzNON_GUESS_MODE if ( !zzguessing ) -#define zzGuessData \ - zzjmp_buf zzguess_start; \ - int zzguessing; -#else -#define zzGUESS_BLOCK -#define zzGUESS -#define zzGUESS_FAIL -#define zzGUESS_DONE -#define zzNON_GUESS_MODE -#define zzGuessData -#endif - -typedef struct _zzantlr_state { -#ifdef ZZCAN_GUESS - zzjmp_buf guess_start; - int guessing; -#endif - int asp; - int ast_sp; -#ifdef ZZINF_LOOK - int inf_lap; /* not sure we need to save this one */ - int inf_labase; - int inf_last; - -/* MR6 Gunnar Rxnning (gunnar@candleweb.no) */ -/* MR6 Additional state needs to be saved/restored */ -/* MR6 Matching changes in err.h */ - - int *inf_tokens; /* MR6 */ - char **inf_text; /* MR6 */ - char *inf_text_buffer; /* MR6 */ - int *inf_line; /* MR6 */ -#endif -#ifdef DEMAND_LOOK - int dirty; -#endif - -#ifdef LL_K - int tokenLA[LL_K]; - char textLA[LL_K][ZZLEXBUFSIZE]; - int lap; - int labase; -#else - int token; - char text[ZZLEXBUFSIZE]; -#endif -#ifdef zzTRACE_RULES - int traceOptionValue; /* MR10 */ - int traceGuessOptionValue; /* MR10 */ - char *traceCurrentRuleName; /* MR10 */ - int traceDepth; /* MR10 */ -#endif - - } zzantlr_state; - -#ifdef zzTRACE_RULES -extern int zzTraceOptionValueDefault; -extern int zzTraceOptionValue; -extern int zzTraceGuessOptionValue; -extern char *zzTraceCurrentRuleName; -extern int zzTraceDepth; -#endif - -extern int zzGuessSeq; /* MR10 */ -extern int zzSyntaxErrCount; /* MR11 */ -extern int zzLexErrCount; /* MR11 */ - - /* I n f i n i t e L o o k a h e a d */ - - -#ifdef ZZINF_LOOK -#define InfLookData \ - int *zzinf_tokens; \ - char **zzinf_text; \ - char *zzinf_text_buffer; \ - int *zzinf_line; \ - int zzinf_labase; \ - int zzinf_last; -#else -#define InfLookData -#endif - -#ifdef ZZINF_LOOK - -#ifndef ZZINF_DEF_TEXT_BUFFER_SIZE -#define ZZINF_DEF_TEXT_BUFFER_SIZE 20000 -#endif -#ifndef ZZINF_DEF_TOKEN_BUFFER_SIZE -#define ZZINF_DEF_TOKEN_BUFFER_SIZE 2000 -#endif -/* WARNING!!!!!! - * ZZINF_BUFFER_TEXT_CHUNK_SIZE must be > sizeof(text) largest possible token. - */ -#ifndef ZZINF_BUFFER_TEXT_CHUNK_SIZE -#define ZZINF_BUFFER_TEXT_CHUNK_SIZE 5000 -#endif -#ifndef ZZINF_BUFFER_TOKEN_CHUNK_SIZE -#define ZZINF_BUFFER_TOKEN_CHUNK_SIZE 1000 -#endif - -#if ZZLEXBUFSIZE > ZZINF_BUFFER_TEXT_CHUNK_SIZE -#define ZZINF_BUFFER_TEXT_CHUNK_SIZE ZZLEXBUFSIZE+5 -#endif - -/* make inf_look user-access macros */ -#ifdef LL_K -#define ZZINF_LA_VALID(i) (((zzinf_labase+i-1)-LL_K+1) <= zzinf_last) -#define ZZINF_LA(i) zzinf_tokens[(zzinf_labase+i-1)-LL_K+1] -#define ZZINF_LATEXT(i) zzinf_text[(zzinf_labase+i-1)-LL_K+1] -/* MR6 In 1.33 vanilla the #define ZZINF_LINE(i) is was commented out */ -#define ZZINF_LINE(i) zzinf_line[(zzinf_labase+i-1)-LL_K+1] -#else -#define ZZINF_LA_VALID(i) (((zzinf_labase+i-1)) <= zzinf_last) -#define ZZINF_LA(i) zzinf_tokens[(zzinf_labase+i-1)] -#define ZZINF_LATEXT(i) zzinf_text[(zzinf_labase+i-1)] -#endif - -#define inf_zzgettok _inf_zzgettok() -extern void _inf_zzgettok(); - -#endif /* ZZINF_LOOK */ - - -#ifdef LL_K - -#ifdef __USE_PROTOS -#define ANTLR_INFO \ - Attrib zzempty_attr(void) {static Attrib a; return a;} \ - Attrib zzconstr_attr(int _tok, char *_text) \ - {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \ - int zzasp=ZZA_STACKSIZE; \ - char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \ - Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \ - InfLookData \ - zzGuessData -#else -#define ANTLR_INFO \ - Attrib zzempty_attr() {static Attrib a; return a;} \ - Attrib zzconstr_attr(_tok, _text) int _tok; char *_text; \ - {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \ - int zzasp=ZZA_STACKSIZE; \ - char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \ - Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \ - InfLookData \ - zzGuessData -#endif - -#else - -#ifdef __USE_PROTOS -#define ANTLR_INFO \ - Attrib zzempty_attr(void) {static Attrib a; return a;} \ - Attrib zzconstr_attr(int _tok, char *_text) \ - {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \ - int zzasp=ZZA_STACKSIZE; \ - char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \ - Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \ - InfLookData \ - zzGuessData -#else -#define ANTLR_INFO \ - Attrib zzempty_attr() {static Attrib a; return a;} \ - Attrib zzconstr_attr(_tok, _text) int _tok; char *_text; \ - {Attrib a; zzcr_attr((&a),_tok,_text); return a;} \ - int zzasp=ZZA_STACKSIZE; \ - char zzStackOvfMsg[]="fatal: attrib/AST stack overflow %s(%d)!\n"; \ - Attrib zzaStack[ZZA_STACKSIZE]; DemandLookData \ - InfLookData \ - zzGuessData -#endif - -#endif /* LL_k */ - - -#ifdef ZZINF_LOOK - -#ifdef LL_K -#ifdef DEMAND_LOOK -#define zzPrimeLookAhead {zzdirty=LL_K; zzlap = zzlabase = 0;} -#else -#define zzPrimeLookAhead {zzlap = zzlabase = 0; zzfill_inf_look();\ - {int _i; for(_i=1;_i<=LL_K; _i++) \ - {zzCONSUME;} zzlap = zzlabase = 0;}} -#endif - -#else /* LL_K */ - -#ifdef DEMAND_LOOK -#define zzPrimeLookAhead zzfill_inf_look(); zzdirty=1 -#else -#define zzPrimeLookAhead zzfill_inf_look(); inf_zzgettok - -#endif -#endif /* LL_K */ - -#else /* ZZINF_LOOK */ - -#ifdef LL_K -#ifdef DEMAND_LOOK -#define zzPrimeLookAhead {zzdirty=LL_K; zzlap = zzlabase = 0;} -#else -#define zzPrimeLookAhead {int _i; zzlap = 0; for(_i=1;_i<=LL_K; _i++) \ - {zzCONSUME;} zzlap = 0;} -#endif - -#else - -#ifdef DEMAND_LOOK -#define zzPrimeLookAhead zzdirty=1 -#else -#define zzPrimeLookAhead zzgettok() -#endif -#endif /* LL_K */ - -#endif /* ZZINF_LOOK */ - - -#ifdef LL_K -#define zzenterANTLRs(s) \ - zzlextext = &(zztextLA[0][0]); zzrdstr( s ); zzPrimeLookAhead; -#define zzenterANTLRf(f) \ - zzlextext = &(zztextLA[0][0]); zzrdfunc( f ); zzPrimeLookAhead; -#define zzenterANTLR(f) \ - zzlextext = &(zztextLA[0][0]); zzrdstream( f ); zzPrimeLookAhead; -#ifdef ZZINF_LOOK -#define zzleaveANTLR(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line); -#define zzleaveANTLRf(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line); -#define zzleaveANTLRs(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line); -#else -#define zzleaveANTLR(f) -#define zzleaveANTLRf(f) -#define zzleaveANTLRs(f) -#endif - -#else - -#define zzenterANTLRs(s) \ - {static char zztoktext[ZZLEXBUFSIZE]; \ - zzlextext = zztoktext; zzrdstr( s ); zzPrimeLookAhead;} -#define zzenterANTLRf(f) \ - {static char zztoktext[ZZLEXBUFSIZE]; \ - zzlextext = zztoktext; zzrdfunc( f ); zzPrimeLookAhead;} -#define zzenterANTLR(f) \ - {static char zztoktext[ZZLEXBUFSIZE]; \ - zzlextext = zztoktext; zzrdstream( f ); zzPrimeLookAhead;} -#ifdef ZZINF_LOOK -#define zzleaveANTLR(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line); -#define zzleaveANTLRf(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line); -#define zzleaveANTLRs(f) free(zzinf_text_buffer); free(zzinf_text); free(zzinf_tokens); free(zzinf_line); -#else -#define zzleaveANTLR(f) -#define zzleaveANTLRf(f) -#define zzleaveANTLRs(f) -#endif - -#endif - -/* MR19 Paul D. Smith (psmith@baynetworks.com) - Need to adjust AST stack pointer at exit. - Referenced in ANTLRx macros. -*/ - -#ifdef GENAST -#define ZZAST_ADJUST ++zzast_sp; -#else -#define ZZAST_ADJUST -#endif - -#define ANTLR(st, f) zzbufsize = ZZLEXBUFSIZE; \ - zzenterANTLR(f); \ - { \ - zzBLOCK(zztasp1); \ - st; /* ++zzasp; Removed MR20 G. Hobbelt */ \ - /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \ - /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \ - zzEXIT_ANTLR(zztasp1 + 1); \ - } \ - zzleaveANTLR(f); - -#define ANTLRm(st, f, _m) zzbufsize = ZZLEXBUFSIZE; \ - zzmode(_m); \ - zzenterANTLR(f); \ - { \ - zzBLOCK(zztasp1); \ - st; /* ++zzasp; Removed MR20 G. Hobbelt */ \ - /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \ - /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \ - zzEXIT_ANTLR(zztasp1 + 1); \ - } \ - zzleaveANTLR(f); - -#define ANTLRf(st, f) zzbufsize = ZZLEXBUFSIZE; \ - zzenterANTLRf(f); \ - { \ - zzBLOCK(zztasp1); \ - st; /* ++zzasp; Removed MR20 G. Hobbelt */ \ - /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \ - /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \ - zzEXIT_ANTLR(zztasp1 + 1); \ - } \ - zzleaveANTLRf(f); - -#define ANTLRs(st, s) zzbufsize = ZZLEXBUFSIZE; \ - zzenterANTLRs(s); \ - { \ - zzBLOCK(zztasp1); \ - st; /* ++zzasp; Removed MR20 G. Hobbelt */ \ - /* ZZAST_ADJUST Removed MR20 G. Hobbelt */ \ - /* MR20 G. Hobbelt. Kill the top' attribute (+AST stack corr.) */ \ - zzEXIT_ANTLR(zztasp1 + 1); \ - } \ - zzleaveANTLRs(s); - -#ifdef LL_K -#define zztext (&(zztextLA[zzlap][0])) -#else -#define zztext zzlextext -#endif - - - /* A r g u m e n t A c c e s s */ - -#define zzaCur (zzaStack[zzasp]) -#define zzaRet (*zzaRetPtr) -#define zzaArg(v,n) zzaStack[v-n] -#define zzMakeAttr { zzNON_GUESS_MODE {zzOvfChk; --zzasp; zzcr_attr(&(zzaStack[zzasp]),LA(1),LATEXT(1));}} -#ifdef zzdef0 -#define zzMake0 { zzOvfChk; --zzasp; zzdef0(&(zzaStack[zzasp]));} -#else -#define zzMake0 { zzOvfChk; --zzasp;} -#endif -#define zzaPush(_v) { zzOvfChk; zzaStack[--zzasp] = _v;} -#ifndef zzd_attr -#define zzREL(t) zzasp=(t); /* Restore state of stack */ -#else -#define zzREL(t) for (; zzasp<(t); zzasp++) \ - { zzd_attr(&(zzaStack[zzasp])); } -#endif - - -#define zzsetmatch(_es,_tokclassErrset) \ - if ( !_zzsetmatch(_es, &zzBadText, &zzMissText, &zzMissTok, &zzBadTok, &zzMissSet, _tokclassErrset) ) goto fail; /* MR23 */ - -#ifdef ZZCAN_GUESS -#define zzsetmatch_wsig(_es, handler) \ - if ( !_zzsetmatch_wsig(_es) ) if (zzguessing) { zzGUESS_FAIL; } else {_signal=MismatchedToken; goto handler;} -#else -#define zzsetmatch_wsig(_es, handler) \ - if ( !_zzsetmatch_wsig(_es) ) {_signal=MismatchedToken; goto handler;} -#endif - -#ifdef __USE_PROTOS -extern int _zzsetmatch(SetWordType *, char **, char **, int *, int *, SetWordType **, SetWordType * /* MR23 */); -extern int _zzsetmatch_wsig(SetWordType *); -#else -extern int _zzsetmatch(); -extern int _zzsetmatch_wsig(); -#endif - -#define zzmatch(_t) \ - if ( !_zzmatch(_t, &zzBadText, &zzMissText, &zzMissTok, &zzBadTok, &zzMissSet) ) goto fail; - -#ifdef ZZCAN_GUESS -#define zzmatch_wsig(_t,handler) \ - if ( !_zzmatch_wsig(_t) ) if (zzguessing) { zzGUESS_FAIL; } else {_signal=MismatchedToken; goto handler;} -#else -#define zzmatch_wsig(_t,handler) \ - if ( !_zzmatch_wsig(_t) ) {_signal=MismatchedToken; goto handler;} -#endif - -#ifdef __USE_PROTOS -extern int _zzmatch(int, char **, char **, int *, int *, SetWordType **); -extern int _zzmatch_wsig(int); -#else -extern int _zzmatch(); -extern int _zzmatch_wsig(); -#endif - -#define zzmatch_wdfltsig(_t,_f) \ - if ( !_zzmatch_wdfltsig(_t,_f) ) _signal=MismatchedToken; -#define zzsetmatch_wdfltsig(tw,tt,wf) \ - if ( !_zzsetmatch_wdfltsig(tw,tt,wf) ) _signal=MismatchedToken; - -#ifdef __USE_PROTOS -extern int _zzmatch_wdfltsig(int, SetWordType *); -extern int _zzsetmatch_wdfltsig(SetWordType *tokensWanted, - int tokenTypeOfSet, - SetWordType *whatFollows); -#else -extern int _zzmatch_wdfltsig(); -extern int _zzsetmatch_wdfltsig(); -#endif - -#ifdef GENAST -#define zzRULE Attrib *zzaRetPtr = &(zzaStack[zzasp-1]); \ - SetWordType *zzMissSet=NULL; int zzMissTok=0; \ - int zzBadTok=0; char *zzBadText=""; \ - int zzErrk=1,zzpf=0; \ - zzTRACEdata \ - char *zzMissText=""; zzASTVars -#else -#define zzRULE Attrib *zzaRetPtr = &(zzaStack[zzasp-1]); \ - int zzBadTok=0; char *zzBadText=""; \ - int zzErrk=1,zzpf=0; \ - zzTRACEdata \ - SetWordType *zzMissSet=NULL; int zzMissTok=0; char *zzMissText="" -#endif - -#ifdef GENAST -#define zzBLOCK(i) int i = zzasp - 1; int zztsp = zzast_sp -#define zzEXIT(i) zzREL(i); zzastREL; zzNON_GUESS_MODE { zzastPush(*_root); } -#define zzEXIT_ANTLR(i) zzREL(i); zzastREL /* [i_a] added as we want this for the ANTLRx() macros */ -#define zzLOOP(i) zzREL(i); zzastREL -#else -#define zzBLOCK(i) int i = zzasp - 1 -#define zzEXIT(i) zzREL(i) -#define zzEXIT_ANTLR(i) zzREL(i) /* [i_a] added as we want this for the ANTLRx() macros */ -#define zzLOOP(i) zzREL(i) -#endif - -#ifdef LL_K - -#ifdef DEMAND_LOOK -#define LOOK(_k) {int i,stop=_k-(LL_K-zzdirty); for (i=1; i<=stop; i++) \ - zzCONSUME;} -#define zzCONSUME {zzgettok(); zzdirty--; \ - zzlap = (zzlap+1)&(LL_K-1); \ - zzlextext = &(zztextLA[zzlap][0]);} -#else -#ifdef ZZINF_LOOK -#define zzCONSUME {inf_zzgettok; \ - zzlap = (zzlap+1)&(LL_K-1); \ - zzlextext = &(zztextLA[zzlap][0]); \ - } -#else -#define zzCONSUME {zzgettok(); \ - zzlap = (zzlap+1)&(LL_K-1); \ - zzlextext = &(zztextLA[zzlap][0]);} -#endif /* ZZINF_LOOK */ -#endif /* DEMAND_LOOK */ - -#else /* LL_K */ - -#ifdef DEMAND_LOOK -#define LOOK(_k) if ( zzdirty) zzCONSUME; -#ifdef ZZINF_LOOK -#define zzCONSUME inf_zzgettok; zzdirty=0; -#else -#define zzCONSUME zzgettok(); zzdirty=0; -#endif /* ZZINF_LOOK */ - -#else /* DEMAND_LOOK */ - -#ifdef ZZINF_LOOK -#define zzCONSUME inf_zzgettok -#else -#define zzCONSUME zzgettok(); -#endif - -#endif /* DEMAND_LOOK */ - -#endif /* LL_K */ - -#ifdef LL_K -#define NLA zztokenLA[zzlap&(LL_K-1)] /* --> next LA */ -#define NLATEXT zztextLA[zzlap&(LL_K-1)] /* --> next text of LA */ -#ifdef DEMAND_LOOK -#define LA(i) zztokenLA[(zzlabase+(i)-1)&(LL_K-1)] -#define LATEXT(i) (&(zztextLA[(zzlabase+(i)-1)&(LL_K-1)][0])) -#else -#define LA(i) zztokenLA[(zzlap+(i)-1)&(LL_K-1)] -#define LATEXT(i) (&(zztextLA[(zzlap+(i)-1)&(LL_K-1)][0])) -#endif -#else -#define NLA zztoken -#define NLATEXT zztext -#define LA(i) zztoken -#define LATEXT(i) zztext -#endif - - - /* S t a n d a r d S i g n a l s */ - -#define NoSignal 0 -#define MismatchedToken 1 -#define NoViableAlt 2 -#define NoSemViableAlt 3 - -/* MR7 Allow more control over signalling */ -/* by adding "Unwind" and "zzsetSignal" */ - -#define Unwind 4 -#define zzsetSignal(newValue) *_retsignal=_signal=(newValue) -#define zzsuppressSignal *_retsignal=_signal=0 -#define zzexportSignal *_retsignal=_signal - - /* F u n c t i o n T r a c i n g */ - -#ifndef zzTRACE_RULES -#define zzTRACEdata -#else -#ifndef zzTRACEdata -#define zzTRACEdata ANTLRChar *zzTracePrevRuleName = NULL; -#endif -#endif - -#ifndef zzTRACEIN -#define zzTRACEIN(r) zzTracePrevRuleName=zzTraceCurrentRuleName;zzTraceIn(r); -#endif -#ifndef zzTRACEOUT -#define zzTRACEOUT(r) zzTraceOut(r);zzTraceCurrentRuleName=zzTracePrevRuleName; -#endif - -/* MR19 zzchar_t additions */ - -#ifndef zzchar_t -#ifdef ZZWCHAR_T -#define zzchar_t wchar_t -#else -#define zzchar_t char -#endif -#endif - - -/* MR26 */ - -#ifdef PCCTS_USE_STDARG -extern void zzFAIL(int k, ...); -#else -extern void zzFAIL(); -#endif - /* E x t e r n D e f s */ - -#ifdef __USE_PROTOS -extern Attrib zzempty_attr(void); -extern Attrib zzconstr_attr(int, char *); -extern void zzsyn(char *, int, char *, SetWordType *, int, int, char *); -extern int zzset_el(unsigned, SetWordType *); -extern int zzset_deg(SetWordType *); -extern void zzedecode(SetWordType *); - -extern void zzresynch(SetWordType *, SetWordType); -extern void zzsave_antlr_state(zzantlr_state *); -extern void zzrestore_antlr_state(zzantlr_state *); -extern void zzfill_inf_look(void); -extern void zzconsumeUntil(SetWordType *st); /* MR7 */ -extern void zzconsumeUntilToken(int t); /* MR7 */ -extern void zzTraceIn(char * ruleName); /* MR10 */ -extern void zzTraceOut(char * ruleName); /* MR10 */ -extern int zzTraceOption(int delta); /* MR10 */ -extern int zzTraceGuessOption(int delta); /* MR10 */ -extern void zzTraceReset(void); /* MR10 */ -extern void zzTraceGuessFail(void); /* MR10 */ -#ifdef EXCEPTION_HANDLING -extern void zzdflthandlers(int, int *); -#endif -#else -extern Attrib zzempty_attr(); -extern Attrib zzconstr_attr(); -extern void zzsyn(); -extern int zzset_el(); -extern int zzset_deg(); -extern void zzedecode(); -extern void zzresynch(); -extern void zzsave_antlr_state(); -extern void zzrestore_antlr_state(); -extern void zzfill_inf_look(); -extern void zzconsumeUntil(); /* MR7 */ -extern void zzconsumeUntilToken(); /* MR7 */ -extern void zzTraceIn(); /* MR10 */ -extern void zzTraceOut(); /* MR10 */ -extern int zzTraceOption(); /* MR10 */ -extern int zzTraceGuessOption(); /* MR10 */ -extern void zzTraceReset(); /* MR10 */ -extern void zzTraceGuessFail(); /* MR10 */ -#ifdef EXCEPTION_HANDLING -extern void zzdflthandlers(); -#endif -#endif - - /* G l o b a l V a r i a b l e s */ - -/* Define a parser; user should do a "#parser myname" in their grammar file */ -/*extern struct pccts_parser zzparser;*/ - -extern char *zztokens[]; -#ifdef LL_K -extern int zztokenLA[]; -extern zzchar_t zztextLA[][ZZLEXBUFSIZE]; -extern int zzlap; -extern int zzlabase; -#else -extern int zztoken; -#endif - -extern char zzStackOvfMsg[]; -extern int zzasp; -extern Attrib zzaStack[]; -#ifdef ZZINF_LOOK -extern int *zzinf_tokens; -extern char **zzinf_text; -extern char *zzinf_text_buffer; -extern int *zzinf_line; -extern int zzinf_labase; -extern int zzinf_last; -#endif -#ifdef DEMAND_LOOK -extern int zzdirty; -#endif -#ifdef ZZCAN_GUESS -extern int zzguessing; -extern zzjmp_buf zzguess_start; -#endif - -/* Define global veriables that refer to values exported by the scanner. - * These declarations duplicate those in dlgdef.h, but are needed - * if ANTLR is not to generate a .dlg file (-gx); PS, this is a hack. - */ -extern zzchar_t *zzlextext; /* text of most recently matched token */ -extern int zzbufsize; /* how long zzlextext is */ - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.c deleted file mode 100644 index 25003be6d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.c +++ /dev/null @@ -1,345 +0,0 @@ -/* Abstract syntax tree manipulation functions - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#include "pcctscfg.h" - -#ifdef PCCTS_USE_STDARG -#include "pccts_stdarg.h" -#else -#include -#endif - -/* ensure that tree manipulation variables are current after a rule - * reference - */ - -void -#ifdef __USE_PROTOS -zzlink(AST **_root, AST **_sibling, AST **_tail) -#else -zzlink(_root, _sibling, _tail) -AST **_root, **_sibling, **_tail; -#endif -{ - if ( *_sibling == NULL ) return; - if ( *_root == NULL ) *_root = *_sibling; - else if ( *_root != *_sibling ) (*_root)->down = *_sibling; - if ( *_tail==NULL ) *_tail = *_sibling; - while ( (*_tail)->right != NULL ) *_tail = (*_tail)->right; -} - -AST * -#ifdef __USE_PROTOS -zzastnew(void) -#else -zzastnew() -#endif -{ - AST *p = (AST *) calloc(1, sizeof(AST)); - if ( p == NULL ) fprintf(stderr,"%s(%d): cannot allocate AST node\n",__FILE__,__LINE__); - return p; -} - -/* add a child node to the current sibling list */ -void -#ifdef __USE_PROTOS -zzsubchild(AST **_root, AST **_sibling, AST **_tail) -#else -zzsubchild(_root, _sibling, _tail) -AST **_root, **_sibling, **_tail; -#endif -{ - AST *n; - zzNON_GUESS_MODE { - n = zzastnew(); -#ifdef DEMAND_LOOK - zzcr_ast(n, &(zzaCur), LA(0), LATEXT(0)); -#else - zzcr_ast(n, &(zzaCur), LA(1), LATEXT(1)); -#endif - zzastPush( n ); - if ( *_tail != NULL ) (*_tail)->right = n; - else { - *_sibling = n; - if ( *_root != NULL ) (*_root)->down = *_sibling; - } - *_tail = n; - if ( *_root == NULL ) *_root = *_sibling; - } -} - -/* make a new AST node. Make the newly-created - * node the root for the current sibling list. If a root node already - * exists, make the newly-created node the root of the current root. - */ -void -#ifdef __USE_PROTOS -zzsubroot(AST **_root, AST **_sibling, AST **_tail) -#else -zzsubroot(_root, _sibling, _tail) -AST **_root, **_sibling, **_tail; -#endif -{ - AST *n; - zzNON_GUESS_MODE { - n = zzastnew(); -#ifdef DEMAND_LOOK - zzcr_ast(n, &(zzaCur), LA(0), LATEXT(0)); -#else - zzcr_ast(n, &(zzaCur), LA(1), LATEXT(1)); -#endif - zzastPush( n ); - if ( *_root != NULL ) - if ( (*_root)->down == *_sibling ) *_sibling = *_tail = *_root; - *_root = n; - (*_root)->down = *_sibling; - } -} - -/* Apply function to root then each sibling - * example: print tree in child-sibling LISP-format (AST has token field) - * - * void show(tree) - * AST *tree; - * { - * if ( tree == NULL ) return; - * printf(" %s", zztokens[tree->token]); - * } - * - * void before() { printf(" ("); } - * void after() { printf(" )"); } - * - * LISPdump() { zzpre_ast(tree, show, before, after); } - * - */ -void -#ifdef __USE_PROTOS -zzpre_ast( - AST *tree, - void (*func)(AST *), /* apply this to each tree node */ - void (*before)(AST *), /* apply this to root of subtree before preordering it */ - void (*after)(AST *)) /* apply this to root of subtree after preordering it */ -#else -zzpre_ast(tree, func, before, after) -AST *tree; -void (*func)(), /* apply this to each tree node */ - (*before)(), /* apply this to root of subtree before preordering it */ - (*after)(); /* apply this to root of subtree after preordering it */ -#endif -{ - while ( tree!= NULL ) - { - if ( tree->down != NULL ) (*before)(tree); - (*func)(tree); - zzpre_ast(tree->down, func, before, after); - if ( tree->down != NULL ) (*after)(tree); - tree = tree->right; - } -} - -/* free all AST nodes in tree; apply func to each before freeing */ - -#if 0 -////void -////#ifdef __USE_PROTOS -////zzfree_ast(AST *tree) -////#else -////zzfree_ast(tree) -////AST *tree; -////#endif -////{ -//// if ( tree == NULL ) return; -//// zzfree_ast( tree->down ); -//// zzfree_ast( tree->right ); -//// zztfree( tree ); -////} -#endif - -/* - MR19 Optimize freeing of the following structure to limit recursion - SAKAI Kiyotaka (ksakai@isr.co.jp) -*/ - -/* - NULL o - / \ - NULL o - / \ - NULL NULL -*/ - -/* - MR21 Another refinement to replace recursion with iteration - NAKAJIMA Mutsuki (muc@isr.co.jp). -*/ - -void -#ifdef __USE_PROTOS -zzfree_ast(AST *tree) -#else -zzfree_ast(tree) -AST *tree; -#endif -{ - - AST *otree; - - if (tree == NULL) return; - - while (tree->down == NULL || tree->right == NULL) { - - if (tree->down == NULL && tree->right == NULL) { - zztfree(tree); - return; - } - - otree = tree; - if (tree->down == NULL) { - tree = tree->right; - } else { - tree = tree->down; - } - zztfree( otree ); - } - - while (tree != NULL) { - zzfree_ast(tree->down); - otree = tree; - tree = otree->right; - zztfree(otree); - } -} - -/* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the children siblings and return ptr - * to 1st sibling (child1). If root is not single node, return NULL. - * - * Siblings that are actually siblins lists themselves are handled - * correctly. For example #( NULL, #( NULL, A, B, C), D) results - * in the tree ( NULL A B C D ). - * - * Requires at least two parameters with the last one being NULL. If - * both are NULL, return NULL. - */ -#ifdef PCCTS_USE_STDARG -AST *zztmake(AST *rt, ...) -#else -AST *zztmake(va_alist) -va_dcl -#endif -{ - va_list ap; - register AST *child, *sibling=NULL, *tail=NULL /* MR20 */, *w; - AST *root; - -#ifdef PCCTS_USE_STDARG - va_start(ap, rt); - root = rt; -#else - va_start(ap); - root = va_arg(ap, AST *); -#endif - - if ( root != NULL ) - if ( root->down != NULL ) return NULL; - child = va_arg(ap, AST *); - while ( child != NULL ) - { - for (w=child; w->right!=NULL; w=w->right) {;} /* find end of child */ - if ( sibling == NULL ) {sibling = child; tail = w;} - else {tail->right = child; tail = w;} - child = va_arg(ap, AST *); - } - if ( root==NULL ) root = sibling; - else root->down = sibling; - va_end(ap); - return root; -} - -/* tree duplicate */ -AST * -#ifdef __USE_PROTOS -zzdup_ast(AST *t) -#else -zzdup_ast(t) -AST *t; -#endif -{ - AST *u; - - if ( t == NULL ) return NULL; - u = zzastnew(); - *u = *t; -#ifdef zzAST_DOUBLE - u->up = NULL; /* set by calling invocation */ - u->left = NULL; -#endif - u->right = zzdup_ast(t->right); - u->down = zzdup_ast(t->down); -#ifdef zzAST_DOUBLE - if ( u->right!=NULL ) u->right->left = u; - if ( u->down!=NULL ) u->down->up = u; -#endif - return u; -} - -void -#ifdef __USE_PROTOS -zztfree(AST *t) -#else -zztfree(t) -AST *t; -#endif -{ -#ifdef zzd_ast - zzd_ast( t ); -#endif - free( t ); -} - -#ifdef zzAST_DOUBLE -/* - * Set the 'up', and 'left' pointers of all nodes in 't'. - * Initial call is double_link(your_tree, NULL, NULL). - */ -void -#ifdef __USE_PROTOS -zzdouble_link(AST *t, AST *left, AST *up) -#else -zzdouble_link(t, left, up) -AST *t, *left, *up; -#endif -{ - if ( t==NULL ) return; - t->left = left; - t->up = up; - zzdouble_link(t->down, NULL, t); - zzdouble_link(t->right, t, up); -} -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.h deleted file mode 100644 index 911f913d7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/ast.h +++ /dev/null @@ -1,121 +0,0 @@ -/* Abstract syntax tree - * - * Macros, definitions - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ZZAST_H -#define ZZAST_H - -#define zzastOvfChk \ - if ( zzast_sp <= 0 ) \ - { \ - fprintf(stderr, zzStackOvfMsg, __FILE__, __LINE__); \ - exit(PCCTS_EXIT_FAILURE); \ - } - -#ifndef USER_DEFINED_AST -#ifndef AST_FIELDS -#define AST_FIELDS -#endif - -typedef struct _ast { - struct _ast *right, *down; -#ifdef zzAST_DOUBLE - struct _ast *left, *up; -#endif - AST_FIELDS -} AST; - -#else - -#ifdef zzAST_DOUBLE -#define AST_REQUIRED_FIELDS struct _ast *right, *down, *left, *up; -#else -#define AST_REQUIRED_FIELDS struct _ast *right, *down; -#endif - -#endif - - -/* N o d e a c c e s s m a c r o s */ -#define zzchild(t) (((t)==NULL)? (AST *) NULL:(t->down)) /* MR19 */ -#define zzsibling(t) (((t)==NULL)? (AST *) NULL:(t->right)) /* MR19 */ - - -/* define global variables needed by #i stack */ -#define zzASTgvars \ - AST *zzastStack[ZZAST_STACKSIZE]; \ - int zzast_sp = ZZAST_STACKSIZE; - -#define zzASTVars AST *_ast = NULL, *_sibling = NULL, *_tail = NULL -#define zzSTR ( (_tail==NULL)?(&_sibling):(&(_tail->right)) ) -#define zzastCur (zzastStack[zzast_sp]) -#define zzastArg(i) (zzastStack[zztsp-i]) -#define zzastPush(p) zzastOvfChk; zzastStack[--zzast_sp] = p; -#define zzastDPush --zzast_sp -#define zzastMARK zztsp=zzast_sp; /* Save state of stack */ -#define zzastREL zzast_sp=zztsp; /* Return state of stack */ -#define zzrm_ast {zzfree_ast(*_root); _tail = _sibling = (*_root)=NULL;} - -extern int zzast_sp; -extern AST *zzastStack[]; - -/* MR26 */ - -#ifdef PCCTS_USE_STDARG -AST *zztmake(AST *, ...); -#else -AST *zztmake(); -#endif - -#ifdef __USE_PROTOS -void zzlink(AST **, AST **, AST **); -void zzsubchild(AST **, AST **, AST **); -void zzsubroot(AST **, AST **, AST **); -void zzpre_ast(AST *, void (*)(AST *), void (*)(AST *), void (*)(AST *)); -void zzfree_ast(AST *); -AST *zzdup_ast(AST *); -void zztfree(AST *); -void zzdouble_link(AST *, AST *, AST *); -AST *zzastnew(void); - -#else - -void zzlink(); -AST *zzastnew(); -void zzsubchild(); -void zzsubroot(); -void zzpre_ast(); -void zzfree_ast(); -AST *zzdup_ast(); -void zztfree(); -void zzdouble_link(); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charbuf.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charbuf.h deleted file mode 100644 index e10ba67d0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charbuf.h +++ /dev/null @@ -1,46 +0,0 @@ -/* ANTLR attribute definition -- constant width text - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ZZCHARBUF_H -#define ZZCHARBUF_H - -#include "pcctscfg.h" - -#include "pccts_string.h" - -#ifndef D_TextSize -#define D_TextSize 30 -#endif - -typedef struct { char text[D_TextSize]; } Attrib; - -#define zzcr_attr(a,tok,t) strncpy((a)->text, t, D_TextSize-1); \ - (a)->text[D_TextSize-1] = '\0'; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.c deleted file mode 100644 index 15a517667..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#include "pcctscfg.h" - -#ifdef __STDC__ -#include "pccts_stdlib.h" -#else -#include -#endif -#include "pccts_string.h" - -/* 133MR1 include stdio.h for fprintf in charptr.c */ - -#include "pccts_stdio.h" - -/* 133MR1 include charptr.h for Attrib in charptr.c */ - -#include "charptr.h" - -#ifdef __USE_PROTOS -zzcr_attr(Attrib *a,int token,char *text) -#else -zzcr_attr(a,token,text) -Attrib *a; -int token; -char *text; -#endif -{ - *a = (char *) malloc(strlen(text)+1); /* MR6 */ - if ( *a == NULL ) {fprintf(stderr, "zzcr_attr: out of memory!\n"); exit(-1);} - strcpy(*a, text); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.h deleted file mode 100644 index 2cc36d8da..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/charptr.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -/* - * WARNING!!!!: charptr.h does NOT make copies and the - * memory is freed after the attribute scope exits. - */ - -#ifndef ZZCHARPTR_H -#define ZZCHARPTR_H - -typedef char *Attrib; -#define zzdef0(a) {*(a)=NULL;} -/* MR8 Jens Tingleff (jensting@imaginet.fr) */ -/* Set memory pointer to null after free() */ -#define zzd_attr(a) {if ( *(a)!=NULL ) {free(*(a)); *(a)=NULL; }; } - -#ifdef __STDC__ -extern zzcr_attr(Attrib *,int,char *); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/config.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/config.h deleted file mode 100644 index 1cc4fbcd9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/config.h +++ /dev/null @@ -1 +0,0 @@ -#include "pcctscfg.h" diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/dlgauto.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/dlgauto.h deleted file mode 100644 index 2bf640bf7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/dlgauto.h +++ /dev/null @@ -1,504 +0,0 @@ -/* dlgauto.h automaton - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Will Cohen and Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ZZDEFAUTO_H -#define ZZDEFAUTO_H - -/* 10-Apr-97 133MR1 Uses __USE_PROTOS show should #include pcctscfg.h */ - -#include "pcctscfg.h" - -zzchar_t *zzlextext; /* text of most recently matched token */ -zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */ -zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */ -int zzbufsize = 0; /* number of characters in zzlextext */ /* MR7 */ -int zzbegcol = 0; /* column that first character of token is in*/ -int zzendcol = 0; /* column that last character of token is in */ -int zzline = 1; /* line current token is on */ -int zzreal_line=1; /* line of 1st portion of token that is not skipped */ -int zzchar; /* character to determine next state */ -int zzbufovf; /* indicates that buffer too small for text */ -int zzcharfull = 0; -static zzchar_t *zznextpos;/* points to next available position in zzlextext*/ -static int zzclass; - -#ifdef __USE_PROTOS -void zzerrstd(const char *); -void (*zzerr)(const char *)=zzerrstd;/* pointer to error reporting function */ -extern int zzerr_in(void); -static int (*zzfunc_in)(void) = zzerr_in; /* MR20 */ -#else -void zzerrstd(); -void (*zzerr)()=zzerrstd; /* pointer to error reporting function */ -extern int zzerr_in(); -static int (*zzfunc_in)() = zzerr_in; /* MR20 */ -#endif - -static FILE *zzstream_in=0; -static zzchar_t *zzstr_in=0; - -#ifdef USER_ZZMODE_STACK -int zzauto = 0; -#else -static int zzauto = 0; -#endif -static int zzadd_erase; -static char zzebuf[70]; - -#ifdef ZZCOL -#define ZZINC (++zzendcol) -#else -#define ZZINC -#endif - - -#define ZZGETC_STREAM {zzchar = getc(zzstream_in); zzclass = ZZSHIFT(zzchar);} -#define ZZGETC_FUNC {zzchar = (*zzfunc_in)(); zzclass = ZZSHIFT(zzchar);} -#define ZZGETC_STR { \ - if (*zzstr_in){ \ - zzchar = *zzstr_in; \ - ++zzstr_in; \ - }else{ \ - zzchar = EOF; \ - } \ - zzclass = ZZSHIFT(zzchar); \ -} - -#define ZZNEWSTATE (newstate = dfa[state][zzclass]) - -#ifndef ZZCOPY -#define ZZCOPY \ - /* Truncate matching buffer to size (not an error) */ \ - if (zznextpos < lastpos){ \ - *(zznextpos++) = zzchar; \ - }else{ \ - zzbufovf = 1; \ - } -#endif - -void -#ifdef __USE_PROTOS -zzrdstream( FILE *f ) -#else -zzrdstream( f ) -FILE *f; -#endif -{ - /* make sure that it is really set to something, otherwise just - leave it be. - */ - if (f){ - /* make sure that there is always someplace to get input - before closing zzstream_in - */ -#if 0 - if (zzstream_in && zzstream_in!=stdin) fclose( zzstream_in ); -#endif - zzline = 1; - zzstream_in = f; - zzfunc_in = NULL; - zzstr_in = 0; - zzcharfull = 0; - } -} - -void -#ifdef __USE_PROTOS -zzrdfunc( int (*f)(void) ) -#else -zzrdfunc( f ) -int (*f)(); -#endif -{ - /* make sure that it is really set to something, otherwise just - leave it be. - */ - if (f){ - /* make sure that there is always someplace to get input - before closing zzstream_in - */ -#if 0 - if (zzstream_in && zzstream_in!=stdin) fclose( zzstream_in ); -#endif - zzline = 1; - zzstream_in = NULL; - zzfunc_in = f; - zzstr_in = 0; - zzcharfull = 0; - } -} - - -void -#ifdef __USE_PROTOS -zzrdstr( zzchar_t *s ) -#else -zzrdstr( s ) -zzchar_t *s; -#endif -{ - /* make sure that it is really set to something, otherwise just - leave it be. - */ - if (s){ - /* make sure that there is always someplace to get input - before closing zzstream_in - */ -#if 0 - if (zzstream_in && zzstream_in!=stdin) fclose( zzstream_in ); -#endif - zzline = 1; - zzstream_in = NULL; - zzfunc_in = 0; - zzstr_in = s; - zzcharfull = 0; - } -} - - -#ifdef __USE_PROTOS -void zzclose_stream(void) -#else -void zzclose_stream() -#endif -{ -#if 0 - fclose( zzstream_in ); - zzstream_in = NULL; - zzfunc_in = NULL; -#endif -} - -/* saves dlg state, but not what feeds dlg (such as file position) */ -void -#ifdef __USE_PROTOS -zzsave_dlg_state(struct zzdlg_state *state) -#else -zzsave_dlg_state(state) -struct zzdlg_state *state; -#endif -{ - state->stream = zzstream_in; - state->func_ptr = zzfunc_in; - state->str = zzstr_in; - state->auto_num = zzauto; - state->add_erase = zzadd_erase; - state->lookc = zzchar; - state->char_full = zzcharfull; - state->begcol = zzbegcol; - state->endcol = zzendcol; - state->line = zzline; - state->lextext = zzlextext; - state->begexpr = zzbegexpr; - state->endexpr = zzendexpr; - state->bufsize = zzbufsize; - state->bufovf = zzbufovf; - state->nextpos = zznextpos; - state->class_num = zzclass; -} - -void -#ifdef __USE_PROTOS -zzrestore_dlg_state(struct zzdlg_state *state) -#else -zzrestore_dlg_state(state) -struct zzdlg_state *state; -#endif -{ - zzstream_in = state->stream; - zzfunc_in = state->func_ptr; - zzstr_in = state->str; - zzauto = state->auto_num; - zzadd_erase = state->add_erase; - zzchar = state->lookc; - zzcharfull = state->char_full; - zzbegcol = state->begcol; - zzendcol = state->endcol; - zzline = state->line; - zzlextext = state->lextext; - zzbegexpr = state->begexpr; - zzendexpr = state->endexpr; - zzbufsize = state->bufsize; - zzbufovf = state->bufovf; - zznextpos = state->nextpos; - zzclass = state->class_num; -} - -void -#ifdef __USE_PROTOS -zzmode( int m ) -#else -zzmode( m ) -int m; -#endif -{ - /* points to base of dfa table */ - if (m -#include - -/* */ -/* 7-Apr-97 133MR1 */ -/* Proper choice of STDC and cplusplus pre-processor symbols (?) */ -/* */ -#include "pccts_string.h" - -#ifdef PCCTS_USE_STDARG -#include "pccts_stdarg.h" -#else -#include -#endif - -#ifdef DUM -/* Define usable bits per unsigned int word (used for set stuff) */ -#ifdef PC -#define BSETWORDSIZE 16 -#define BSETLOGWORDSIZE 4 -#else -#define BSETWORDSIZE 32 -#define BSETLOGWORDSIZE 5 -#endif -#endif - -#define BSETWORDSIZE 8 -#define BSETLOGWORDSIZE 3 /* SetWordType is 8bits */ - -#define BSETMODWORD(x) ((x) & (BSETWORDSIZE-1)) /* x % BSETWORDSIZE */ -#define BSETDIVWORD(x) ((x) >> BSETLOGWORDSIZE) /* x / BSETWORDSIZE */ - -/* This is not put into the global pccts_parser structure because it is - * hidden and does not need to be saved during a "save state" operation - */ -/* maximum of 32 bits/unsigned int and must be 8 bits/byte */ -static SetWordType bitmask[] = { - 0x00000001, 0x00000002, 0x00000004, 0x00000008, - 0x00000010, 0x00000020, 0x00000040, 0x00000080 -}; - -#ifdef zzTRACE_RULES -int zzTraceOptionValueDefault=1; -int zzTraceOptionValue=1; -int zzTraceGuessOptionValue=1; -char *zzTraceCurrentRuleName=NULL; -int zzTraceDepth=0; -#endif - -int zzGuessSeq=0; /* MR10 */ -int zzSyntaxErrCount=0; /* MR11 */ -int zzLexErrCount=0; /* MR11 */ - -void -#ifdef __USE_PROTOS -zzresynch(SetWordType *wd,SetWordType mask) -#else -zzresynch(wd,mask) -SetWordType *wd, mask; -#endif -{ - static int consumed = 1; - - /* if you enter here without having consumed a token from last resynch - * force a token consumption. - */ - if ( !consumed ) {zzCONSUME; consumed=1; return;} /* MR10 */ - - /* if current token is in resynch set, we've got what we wanted */ - if ( wd[LA(1)]&mask || LA(1) == zzEOF_TOKEN ) {consumed=0; return;} - - /* scan until we find something in the resynch set */ - while ( !(wd[LA(1)]&mask) && LA(1) != zzEOF_TOKEN ) {zzCONSUME;} - consumed=1; -} - -/* */ -/* 7-Apr-97 133MR1 for C++ and MR7 for C */ -/* Change suggested by Eli Sternheim (eli@interhdl.com) */ -/* */ - -void -#ifdef __USE_PROTOS -zzconsumeUntil(SetWordType *st) -#else -zzconsumeUntil(st) -SetWordType *st; -#endif -{ - int tmp; /* MR7 */ - while ( !zzset_el( (tmp=LA(1)), st) && tmp!=1 /* Eof */) { /* MR7 */ - zzCONSUME; } /* MR7 */ -} - -/* */ -/* 7-Apr-97 133MR1 for C++ and MR7 for C */ -/* Change suggested by Eli Sternheim (eli@interhdl.com) */ -/* */ - -void -#ifdef __USE_PROTOS -zzconsumeUntilToken(int t) -#else -zzconsumeUntilToken(t) -int t; -#endif -{ - int tmp; /* MR7 */ - while ( (tmp=LA(1)) !=t && tmp!=1 /* Eof */) { zzCONSUME; } /* MR7 */ -} - -/* input looks like: - * zzFAIL(k, e1, e2, ...,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText) - * where the zzMiss stuff is set here to the token that did not match - * (and which set wasn't it a member of). - */ - -#ifdef PCCTS_USE_STDARG -void zzFAIL(int k, ...) -#else -void zzFAIL(va_alist) -va_dcl -#endif -{ -#ifdef LL_K - static char text[LL_K*ZZLEXBUFSIZE+1]; - SetWordType *f[LL_K]; -#else - static char text[ZZLEXBUFSIZE+1]; - SetWordType *f[1]; -#endif - SetWordType **miss_set; - char **miss_text; - int *bad_tok; - char **bad_text; - int *err_k; - int i; - va_list ap; -#ifndef PCCTS_USE_STDARG /* MR20 */ - int k; -#endif -#ifdef PCCTS_USE_STDARG /* MR20 */ - va_start(ap, k); -#else - va_start(ap); - k = va_arg(ap, int); /* how many lookahead sets? */ -#endif - assert(k <= sizeof(f)/sizeof(f[0])); /* MR20 G. Hobbelt */ - text[0] = '\0'; - for (i=1; i<=k; i++) /* collect all lookahead sets */ - { - f[i-1] = va_arg(ap, SetWordType *); - } - for (i=1; i<=k; i++) /* look for offending token */ - { - if ( i>1 ) strcat(text, " "); - strcat(text, LATEXT(i)); - if ( !zzset_el((unsigned)LA(i), f[i-1]) ) break; - } - miss_set = va_arg(ap, SetWordType **); - miss_text = va_arg(ap, char **); - bad_tok = va_arg(ap, int *); - bad_text = va_arg(ap, char **); - err_k = va_arg(ap, int *); - va_end(ap); - if ( i>k ) - { - /* bad; lookahead is permutation that cannot be matched, - * but, the ith token of lookahead is valid at the ith position - * (The old LL sub 1 (k) versus LL(k) parsing technique) - */ - *miss_set = NULL; - *miss_text = zzlextext; - *bad_tok = LA(1); - *bad_text = LATEXT(1); - *err_k = k; - return; - } -/* fprintf(stderr, "%s not in %dth set\n", zztokens[LA(i)], i);*/ - *miss_set = f[i-1]; - *miss_text = text; - *bad_tok = LA(i); - *bad_text = LATEXT(i); - if ( i==1 ) *err_k = 1; - else *err_k = k; -} - -#ifdef __USE_PROTOS -void zzTraceGuessDone(zzantlr_state *state) -#else -void zzTraceGuessDone(state) - zzantlr_state *state; -#endif -{ -#ifdef zzTRACE_RULES -#ifdef ZZCAN_GUESS - - int doIt=0; - - if (zzTraceCurrentRuleName == NULL) return; - - if (zzTraceOptionValue <= 0) { - doIt=0; - } else if (zzTraceGuessOptionValue <= 0) { - doIt=0; - } else { - doIt=1; - }; - - if (doIt) { - fprintf(stderr,"guess done - returning to rule %s {\"%s\"} at depth %d", - state->traceCurrentRuleName, - LATEXT(1), - state->traceDepth); - if (state->guessing != 0) { - fprintf(stderr," (guess mode continues - an enclosing guess is still active)"); - } else { - fprintf(stderr," (guess mode ends)"); - }; - fprintf(stderr,"\n"); - }; -#endif -#endif -} - -void -#ifdef __USE_PROTOS -zzsave_antlr_state(zzantlr_state *buf) -#else -zzsave_antlr_state(buf) -zzantlr_state *buf; -#endif -{ -#ifdef LL_K - int i; -#endif - -#ifdef ZZCAN_GUESS - buf->guess_start = zzguess_start; - buf->guessing = zzguessing; -#endif - buf->asp = zzasp; -#ifdef GENAST - buf->ast_sp = zzast_sp; -#endif -#ifdef ZZINF_LOOK - buf->inf_labase = zzinf_labase; - buf->inf_last = zzinf_last; - -/* MR6 Gunnar Rxnning (gunnar@candleweb.no) */ -/* MR6 Additional state needs to be saved/restored */ - - buf->inf_tokens = zzinf_tokens; /* MR6 */ - buf->inf_text = zzinf_text; /* MR6 */ - buf->inf_text_buffer = zzinf_text_buffer; /* MR6 */ - buf->inf_line = zzinf_line; /* MR6 */ - -#endif -#ifdef DEMAND_LOOK - buf->dirty = zzdirty; -#endif -#ifdef LL_K - for (i=0; itokenLA[i] = zztokenLA[i]; - for (i=0; itextLA[i], zztextLA[i]); - buf->lap = zzlap; - buf->labase = zzlabase; -#else - buf->token = zztoken; - strcpy(buf->text, zzlextext); -#endif -#ifdef zzTRACE_RULES - - /* MR10 */ - - buf->traceOptionValue=zzTraceOptionValue; - buf->traceGuessOptionValue=zzTraceGuessOptionValue; - buf->traceCurrentRuleName=zzTraceCurrentRuleName; - buf->traceDepth=zzTraceDepth; -#endif -} - -void -#ifdef __USE_PROTOS -zzrestore_antlr_state(zzantlr_state *buf) -#else -zzrestore_antlr_state(buf) -zzantlr_state *buf; -#endif -{ - -#ifdef zzTRACE_RULES - int prevTraceOptionValue; -#endif - -#ifdef LL_K - int i; -#endif - -#ifdef ZZCAN_GUESS - zzguess_start = buf->guess_start; - zzguessing = buf->guessing; -#endif - zzasp = buf->asp; -#ifdef GENAST - zzast_sp = buf->ast_sp; -#endif -#ifdef ZZINF_LOOK - zzinf_labase = buf->inf_labase; - zzinf_last = buf->inf_last; - -/* MR6 Gunnar Rxnning (gunnar@candleweb.no) */ -/* MR6 Additional state needs to be saved/restored */ - - zzinf_tokens = buf->inf_tokens; /* MR6 */ - zzinf_text = buf->inf_text; /* MR6 */ - zzinf_text_buffer = buf->inf_text_buffer; /* MR6 */ - zzinf_line = buf->inf_line; /* MR6 */ -#endif -#ifdef DEMAND_LOOK - zzdirty = buf->dirty; -#endif -#ifdef LL_K - for (i=0; itokenLA[i]; - for (i=0; itextLA[i]); - zzlap = buf->lap; - zzlabase = buf->labase; -#else - zztoken = buf->token; - strcpy(zzlextext, buf->text); -#endif -#ifdef zzTRACE_RULES - - prevTraceOptionValue=zzTraceOptionValue; - zzTraceOptionValue=buf->traceOptionValue; - if ( (prevTraceOptionValue > 0) != - (zzTraceOptionValue > 0)) { - if (zzTraceOptionValue > 0) { - fprintf(stderr,"trace enable restored in rule %s depth %d\n", - zzTraceCurrentRuleName,zzTraceDepth); - }; - if (zzTraceOptionValue <= 0) { - fprintf(stderr,"trace disable restored in rule %s depth %d\n", - zzTraceCurrentRuleName,zzTraceDepth); - }; - }; - - zzTraceOptionValue=buf->traceOptionValue; /* MR10 */ - zzTraceGuessOptionValue=buf->traceGuessOptionValue; /* MR10 */ - zzTraceCurrentRuleName=buf->traceCurrentRuleName; /* MR10 */ - zzTraceDepth=buf->traceDepth; /* MR10 */ - zzTraceGuessDone(buf); /* MR10 */ -#endif -} - -void -#ifdef __USE_PROTOS -zzedecode(SetWordType *a) -#else -zzedecode(a) -SetWordType *a; -#endif -{ - register SetWordType *p = a; - register SetWordType *endp = &(p[zzSET_SIZE]); - register unsigned e = 0; - - if ( zzset_deg(a)>1 ) fprintf(stderr, " {"); - do { - register SetWordType t = *p; - register SetWordType *b = &(bitmask[0]); - do { - if ( t & *b ) fprintf(stderr, " %s", zztokens[e]); - e++; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); - } while (++p < endp); - if ( zzset_deg(a)>1 ) fprintf(stderr, " }"); -} - -#ifndef USER_ZZSYN -/* standard error reporting function */ -void -#ifdef __USE_PROTOS -zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text) -#else -zzsyn(text, tok, egroup, eset, etok, k, bad_text) -char *text, *egroup, *bad_text; -int tok; -int etok; -int k; -SetWordType *eset; -#endif -{ - - zzSyntaxErrCount++; /* MR11 */ - fprintf(stderr, "line %d: syntax error at \"%s\"", zzline, (tok==zzEOF_TOKEN)?"EOF":bad_text); - if ( !etok && !eset ) {fprintf(stderr, "\n"); return;} - if ( k==1 ) fprintf(stderr, " missing"); - else - { - fprintf(stderr, "; \"%s\" not", bad_text); - if ( zzset_deg(eset)>1 ) fprintf(stderr, " in"); - } - if ( zzset_deg(eset)>0 ) zzedecode(eset); - else fprintf(stderr, " %s", zztokens[etok]); - if ( strlen(egroup) > 0 ) fprintf(stderr, " in %s", egroup); - fprintf(stderr, "\n"); -} -#endif - -/* is b an element of set p? */ -int -#ifdef __USE_PROTOS -zzset_el(unsigned b, SetWordType *p) -#else -zzset_el(b,p) -unsigned b; -SetWordType *p; -#endif -{ - return( p[BSETDIVWORD(b)] & bitmask[BSETMODWORD(b)] ); -} - -int -#ifdef __USE_PROTOS -zzset_deg(SetWordType *a) -#else -zzset_deg(a) -SetWordType *a; -#endif -{ - /* Fast compute degree of a set... the number - of elements present in the set. Assumes - that all word bits are used in the set - */ - register SetWordType *p = a; - register SetWordType *endp = &(a[zzSET_SIZE]); - register int degree = 0; - - if ( a == NULL ) return 0; - while ( p < endp ) - { - register SetWordType t = *p; - register SetWordType *b = &(bitmask[0]); - do { - if (t & *b) ++degree; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); - p++; - } - - return(degree); -} - -#ifdef DEMAND_LOOK - -#ifdef LL_K -int -#ifdef __USE_PROTOS -_zzmatch(int _t, char **zzBadText, char **zzMissText, - int *zzMissTok, int *zzBadTok, - SetWordType **zzMissSet) -#else -_zzmatch(_t, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet) -int _t; -char **zzBadText; -char **zzMissText; -int *zzMissTok, *zzBadTok; -SetWordType **zzMissSet; -#endif -{ - if ( zzdirty==LL_K ) { - zzCONSUME; - } - if ( LA(1)!=_t ) { - *zzBadText = *zzMissText=LATEXT(1); - *zzMissTok= _t; *zzBadTok=LA(1); - *zzMissSet=NULL; - return 0; - } - zzMakeAttr - zzdirty++; - zzlabase++; - return 1; -} - -int -#ifdef __USE_PROTOS -_zzmatch_wsig(int _t) -#else -_zzmatch_wsig(_t) -int _t; -#endif -{ - if ( zzdirty==LL_K ) { - zzCONSUME; - } - if ( LA(1)!=_t ) { - return 0; - } - zzMakeAttr - zzdirty++; - zzlabase++; - return 1; -} - -#else - -int -#ifdef __USE_PROTOS -_zzmatch(int _t, char **zzBadText, char **zzMissText, - int *zzMissTok, int *zzBadTok, SetWordType **zzMissSet) -#else -_zzmatch(_t, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet) -int _t; -char **zzBadText; -char **zzMissText; -int *zzMissTok, *zzBadTok; -SetWordType **zzMissSet; -#endif -{ - if ( zzdirty ) {zzCONSUME;} - if ( LA(1)!=_t ) { - *zzBadText = *zzMissText=LATEXT(1); - *zzMissTok= _t; *zzBadTok=LA(1); - *zzMissSet=NULL; - return 0; - } - zzdirty = 1; - zzMakeAttr - return 1; -} - -int -#ifdef __USE_PROTOS -_zzmatch_wsig(int _t) -#else -_zzmatch_wsig(_t) -int _t; -#endif -{ - if ( zzdirty ) {zzCONSUME;} - if ( LA(1)!=_t ) { - return 0; - } - zzdirty = 1; - zzMakeAttr - return 1; -} - -#endif /*LL_K*/ - -#else - -int -#ifdef __USE_PROTOS -_zzmatch(int _t, char **zzBadText, char **zzMissText, - int *zzMissTok, int *zzBadTok, - SetWordType **zzMissSet) -#else -_zzmatch(_t, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet) -int _t; -char **zzBadText; -char **zzMissText; -int *zzMissTok, *zzBadTok; -SetWordType **zzMissSet; -#endif -{ - if ( LA(1)!=_t ) { - *zzBadText = *zzMissText=LATEXT(1); - *zzMissTok= _t; *zzBadTok=LA(1); - *zzMissSet=NULL; - return 0; - } - zzMakeAttr - return 1; -} - -int -#ifdef __USE_PROTOS -_zzmatch_wsig(int _t) -#else -_zzmatch_wsig(_t) -int _t; -#endif -{ - if ( LA(1)!=_t ) return 0; - zzMakeAttr - return 1; -} - -#endif /*DEMAND_LOOK*/ - -#ifdef ZZINF_LOOK -void -#ifdef __USE_PROTOS -_inf_zzgettok(void) -#else -_inf_zzgettok() -#endif -{ - if ( zzinf_labase >= zzinf_last ) - {NLA = zzEOF_TOKEN; strcpy(NLATEXT, "");} - else { - NLA = zzinf_tokens[zzinf_labase]; - zzline = zzinf_line[zzinf_labase]; /* wrong in 1.21 */ - strcpy(NLATEXT, zzinf_text[zzinf_labase]); - zzinf_labase++; - } -} -#endif - -#ifdef ZZINF_LOOK -/* allocate default size text,token and line arrays; - * then, read all of the input reallocing the arrays as needed. - * Once the number of total tokens is known, the LATEXT(i) array (zzinf_text) - * is allocated and it's pointers are set to the tokens in zzinf_text_buffer. - */ -void -#ifdef __USE_PROTOS -zzfill_inf_look(void) -#else -zzfill_inf_look() -#endif -{ - int tok, line; - int zzinf_token_buffer_size = ZZINF_DEF_TOKEN_BUFFER_SIZE; - int zzinf_text_buffer_size = ZZINF_DEF_TEXT_BUFFER_SIZE; - int zzinf_text_buffer_index = 0; - int zzinf_lap = 0; - - /* allocate text/token buffers */ - zzinf_text_buffer = (char *) malloc(zzinf_text_buffer_size); - if ( zzinf_text_buffer == NULL ) - { - fprintf(stderr, "cannot allocate lookahead text buffer (%d bytes)\n", - zzinf_text_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - zzinf_tokens = (int *) calloc(zzinf_token_buffer_size,sizeof(int)); - if ( zzinf_tokens == NULL ) - { - fprintf(stderr, "cannot allocate token buffer (%d tokens)\n", - zzinf_token_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - zzinf_line = (int *) calloc(zzinf_token_buffer_size,sizeof(int)); - if ( zzinf_line == NULL ) - { - fprintf(stderr, "cannot allocate line buffer (%d ints)\n", - zzinf_token_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - - /* get tokens, copying text to text buffer */ - zzinf_text_buffer_index = 0; - do { - zzgettok(); - line = zzreal_line; - while ( zzinf_lap>=zzinf_token_buffer_size ) - { - zzinf_token_buffer_size += ZZINF_BUFFER_TOKEN_CHUNK_SIZE; - zzinf_tokens = (int *) realloc(zzinf_tokens, - zzinf_token_buffer_size*sizeof(int)); - if ( zzinf_tokens == NULL ) - { - fprintf(stderr, "cannot allocate lookahead token buffer (%d tokens)\n", - zzinf_token_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - zzinf_line = (int *) realloc(zzinf_line, - zzinf_token_buffer_size*sizeof(int)); - if ( zzinf_line == NULL ) - { - fprintf(stderr, "cannot allocate lookahead line buffer (%d ints)\n", - zzinf_token_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - - } - while ( (zzinf_text_buffer_index+strlen(NLATEXT)+1) >= zzinf_text_buffer_size ) - { - zzinf_text_buffer_size += ZZINF_BUFFER_TEXT_CHUNK_SIZE; - zzinf_text_buffer = (char *) realloc(zzinf_text_buffer, - zzinf_text_buffer_size); - if ( zzinf_text_buffer == NULL ) - { - fprintf(stderr, "cannot allocate lookahead text buffer (%d bytes)\n", - zzinf_text_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - } - /* record token and text and line of input symbol */ - tok = zzinf_tokens[zzinf_lap] = NLA; - strcpy(&zzinf_text_buffer[zzinf_text_buffer_index], NLATEXT); - zzinf_text_buffer_index += strlen(NLATEXT)+1; - zzinf_line[zzinf_lap] = line; - zzinf_lap++; - } while (tok!=zzEOF_TOKEN); - zzinf_labase = 0; - zzinf_last = zzinf_lap-1; - - /* allocate ptrs to text of ith token */ - zzinf_text = (char **) calloc(zzinf_last+1,sizeof(char *)); - if ( zzinf_text == NULL ) - { - fprintf(stderr, "cannot allocate lookahead text buffer (%d)\n", - zzinf_text_buffer_size); - exit(PCCTS_EXIT_FAILURE); - } - zzinf_text_buffer_index = 0; - zzinf_lap = 0; - /* set ptrs so that zzinf_text[i] is the text of the ith token found on input */ - while (zzinf_lap<=zzinf_last) - { - zzinf_text[zzinf_lap++] = &zzinf_text_buffer[zzinf_text_buffer_index]; - zzinf_text_buffer_index += strlen(&zzinf_text_buffer[zzinf_text_buffer_index])+1; - } -} -#endif - -int -#ifdef __USE_PROTOS -_zzsetmatch(SetWordType *e, char **zzBadText, char **zzMissText, - int *zzMissTok, int *zzBadTok, - SetWordType **zzMissSet, - SetWordType *zzTokclassErrset /* MR23 */) -#else -_zzsetmatch(e, zzBadText, zzMissText, zzMissTok, zzBadTok, zzMissSet, zzTokclassErrset /* MR23 */) -SetWordType *e; -char **zzBadText; -char **zzMissText; -int *zzMissTok, *zzBadTok; -SetWordType **zzMissSet; -SetWordType *zzTokclassErrset; -#endif -{ -#ifdef DEMAND_LOOK -#ifdef LL_K - if ( zzdirty==LL_K ) {zzCONSUME;} -#else - if ( zzdirty ) {zzCONSUME;} -#endif -#endif - if ( !zzset_el((unsigned)LA(1), e) ) { - *zzBadText = LATEXT(1); *zzMissText=NULL; - *zzMissTok= 0; *zzBadTok=LA(1); - *zzMissSet=zzTokclassErrset; /* MR23 */ - return 0; - } - zzMakeAttr /* MR14 Ger Hobbelt (hobbelt@axa.nl) */ -#ifdef DEMAND_LOOK -#ifdef LL_K - zzdirty++; - zzlabase++; /* MR14 Ger Hobbelt (hobbelt@axa.nl) */ -#else - zzdirty = 1; -#endif -#endif - return 1; -} - -int -#ifdef __USE_PROTOS -_zzmatch_wdfltsig(int tokenWanted, SetWordType *whatFollows) -#else -_zzmatch_wdfltsig(tokenWanted, whatFollows) -int tokenWanted; -SetWordType *whatFollows; -#endif -{ -#ifdef DEMAND_LOOK -#ifdef LL_K - if ( zzdirty==LL_K ) { - zzCONSUME; - } -#else - if ( zzdirty ) {zzCONSUME;} -#endif -#endif - - if ( LA(1)!=tokenWanted ) - { - zzSyntaxErrCount++; /* MR11 */ - fprintf(stderr, - "line %d: syntax error at \"%s\" missing %s\n", - zzline, - (LA(1)==zzEOF_TOKEN)?"":(char *)LATEXT(1), - zztokens[tokenWanted]); - zzconsumeUntil( whatFollows ); - return 0; - } - else { - zzMakeAttr -#ifdef DEMAND_LOOK -#ifdef LL_K - zzdirty++; - zzlabase++; -#else - zzdirty = 1; -#endif -#else -/* zzCONSUME; consume if not demand lookahead */ -#endif - return 1; - } -} - -int -#ifdef __USE_PROTOS -_zzsetmatch_wdfltsig(SetWordType *tokensWanted, - int tokenTypeOfSet, - SetWordType *whatFollows) -#else -_zzsetmatch_wdfltsig(tokensWanted, tokenTypeOfSet, whatFollows) -SetWordType *tokensWanted; -int tokenTypeOfSet; -SetWordType *whatFollows; -#endif -{ -#ifdef DEMAND_LOOK -#ifdef LL_K - if ( zzdirty==LL_K ) {zzCONSUME;} -#else - if ( zzdirty ) {zzCONSUME;} -#endif -#endif - if ( !zzset_el((unsigned)LA(1), tokensWanted) ) - { - zzSyntaxErrCount++; /* MR11 */ - fprintf(stderr, - "line %d: syntax error at \"%s\" missing %s\n", - zzline, - (LA(1)==zzEOF_TOKEN)?"":(char *)LATEXT(1), - zztokens[tokenTypeOfSet]); - zzconsumeUntil( whatFollows ); - return 0; - } - else { - zzMakeAttr -#ifdef DEMAND_LOOK -#ifdef LL_K - zzdirty++; - zzlabase++; -#else - zzdirty = 1; -#endif -#else -/* zzCONSUME; consume if not demand lookahead */ -#endif - return 1; - } -} - -int -#ifdef __USE_PROTOS -_zzsetmatch_wsig(SetWordType *e) -#else -_zzsetmatch_wsig(e) -SetWordType *e; -#endif -{ -#ifdef DEMAND_LOOK -#ifdef LL_K - if ( zzdirty==LL_K ) {zzCONSUME;} -#else - if ( zzdirty ) {zzCONSUME;} -#endif -#endif - if ( !zzset_el((unsigned)LA(1), e) ) return 0; - zzMakeAttr /* MR14 Ger Hobbelt (hobbelt@axa.nl) */ -#ifdef DEMAND_LOOK -#ifdef LL_K - zzdirty++; - zzlabase++; /* MR14 Ger Hobbelt (hobbelt@axa.nl) */ -#else - zzdirty = 1; -#endif -#endif - return 1; -} - -#ifdef USER_ZZMODE_STACK -static int zzmstk[ZZMAXSTK] = { -1 }; -static int zzmdep = 0; -static char zzmbuf[70]; - -void -#ifdef __USE_PROTOS -zzmpush( int m ) -#else -zzmpush( m ) -int m; -#endif -{ - if(zzmdep == ZZMAXSTK - 1) { - sprintf(zzmbuf, "Mode stack overflow "); - zzerr(zzmbuf); - } else { - zzmstk[zzmdep++] = zzauto; - zzmode(m); - } -} - -void -#ifdef __USE_PROTOS -zzmpop( void ) -#else -zzmpop( ) -#endif -{ - if(zzmdep == 0) - { sprintf(zzmbuf, "Mode stack underflow "); - zzerr(zzmbuf); - } - else - { zzmdep--; - zzmode(zzmstk[zzmdep]); - } -} - -void -#ifdef __USE_PROTOS -zzsave_mode_stack( int modeStack[], int *modeLevel ) -#else -zzsave_mode_stack( modeStack, modeLevel ) -int modeStack[]; -int *modeLevel; -#endif -{ - int i; - memcpy(modeStack, zzmstk, sizeof(zzmstk)); - *modeLevel = zzmdep; - zzmdep = 0; - - return; -} - -void -#ifdef __USE_PROTOS -zzrestore_mode_stack( int modeStack[], int *modeLevel ) -#else -zzrestore_mode_stack( modeStack, modeLevel ) -int modeStack[]; -int *modeLevel; -#endif -{ - int i; - - memcpy(zzmstk, modeStack, sizeof(zzmstk)); - zzmdep = *modeLevel; - - return; -} -#endif /* USER_ZZMODE_STACK */ - -#ifdef __USE_PROTOS -void zzTraceReset(void) -#else -void zzTraceReset() -#endif -{ -#ifdef zzTRACE_RULES - zzTraceOptionValue=zzTraceOptionValueDefault; - zzTraceGuessOptionValue=1; - zzTraceCurrentRuleName=NULL; - zzTraceDepth=0; -#endif -} - -#ifdef __USE_PROTOS -void zzTraceGuessFail(void) -#else -void zzTraceGuessFail() -#endif -{ - -#ifdef zzTRACE_RULES -#ifdef ZZCAN_GUESS - - int doIt=0; - - if (zzTraceOptionValue <= 0) { - doIt=0; - } else if (zzguessing && zzTraceGuessOptionValue <= 0) { - doIt=0; - } else { - doIt=1; - }; - - if (doIt) { - fprintf(stderr,"guess failed\n"); - }; -#endif -#endif -} - -/* zzTraceOption: - zero value turns off trace -*/ - -#ifdef __USE_PROTOS -void zzTraceIn(char * rule) -#else -void zzTraceIn(rule) - char *rule; -#endif -{ -#ifdef zzTRACE_RULES - - int doIt=0; - - zzTraceDepth++; - zzTraceCurrentRuleName=rule; - - if (zzTraceOptionValue <= 0) { - doIt=0; -#ifdef ZZCAN_GUESS - } else if (zzguessing && zzTraceGuessOptionValue <= 0) { - doIt=0; -#endif - } else { - doIt=1; - }; - - if (doIt) { - fprintf(stderr,"enter rule %s {\"%s\"} depth %d", - rule, - LA(1)==1 ? "@" : (char *) LATEXT(1), /* MR19 */ - zzTraceDepth); -#ifdef ZZCAN_GUESS - if (zzguessing) fprintf(stderr," guessing"); -#endif - fprintf(stderr,"\n"); - }; -#endif - return; -} - -#ifdef __USE_PROTOS -void zzTraceOut(char * rule) -#else -void zzTraceOut(rule) - char *rule; -#endif -{ -#ifdef zzTRACE_RULES - int doIt=0; - - zzTraceDepth--; - - if (zzTraceOptionValue <= 0) { - doIt=0; -#ifdef ZZCAN_GUESS - } else if (zzguessing && zzTraceGuessOptionValue <= 0) { - doIt=0; -#endif - } else { - doIt=1; - }; - - if (doIt) { - fprintf(stderr,"exit rule %s {\"%s\"} depth %d", - rule, - LA(1)==1 ? "@" : (char *) LATEXT(1), /* MR19 */ - zzTraceDepth+1); -#ifdef ZZCAN_GUESS - if (zzguessing) fprintf(stderr," guessing"); -#endif - fprintf(stderr,"\n"); - }; -#endif -} - -#ifdef __USE_PROTOS -int zzTraceOption(int delta) -#else -int zzTraceOption(delta) - int delta; -#endif -{ -#ifdef zzTRACE_RULES - int prevValue=zzTraceOptionValue; - - zzTraceOptionValue=zzTraceOptionValue+delta; - - if (zzTraceCurrentRuleName != NULL) { - if (prevValue <= 0 && zzTraceOptionValue > 0) { - fprintf(stderr,"trace enabled in rule %s depth %d\n", - zzTraceCurrentRuleName,zzTraceDepth); - }; - if (prevValue > 0 && zzTraceOptionValue <= 0) { - fprintf(stderr,"trace disabled in rule %s depth %d\n", - zzTraceCurrentRuleName,zzTraceDepth); - }; - }; - return prevValue; -#else - return 0; -#endif -} - -#ifdef __USE_PROTOS -int zzTraceGuessOption(int delta) -#else -int zzTraceGuessOption(delta) - int delta; -#endif -{ -#ifdef zzTRACE_RULES -#ifdef ZZCAN_GUESS - int prevValue=zzTraceGuessOptionValue; - - zzTraceGuessOptionValue=zzTraceGuessOptionValue+delta; - - if (zzTraceCurrentRuleName != NULL) { - if (prevValue <= 0 && zzTraceGuessOptionValue > 0) { - fprintf(stderr,"guess trace enabled in rule %s depth %d\n", - zzTraceCurrentRuleName,zzTraceDepth); - }; - if (prevValue > 0 && zzTraceGuessOptionValue <= 0) { - fprintf(stderr,"guess trace disabled in rule %s depth %d\n", - zzTraceCurrentRuleName,zzTraceDepth); - }; - }; - return prevValue; -#else - return 0; -#endif -#else - return 0; -#endif -} - -#endif /* ERR_H */ diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/int.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/int.h deleted file mode 100644 index cebe16c51..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/int.h +++ /dev/null @@ -1,37 +0,0 @@ -/* ANTLR attribute definition -- long integers - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * ANTLR 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -#ifndef ZZINT_H -#define ZZINT_H - -typedef long Attrib; - -#define zzcr_attr(a,tok,t) *(a) = atol(t); - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_assert.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_assert.h deleted file mode 100644 index 13d133abd..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_assert.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_ASSERT_H__ -#define __PCCTS_ASSERT_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_iostream.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_iostream.h deleted file mode 100644 index 24aee39f2..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_iostream.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_IOSTREAM_H__ -#define __PCCTS_IOSTREAM_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_istream.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_istream.h deleted file mode 100644 index 54e1461dd..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_istream.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_ISTREAM_H__ -#define __PCCTS_ISTREAM_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_setjmp.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_setjmp.h deleted file mode 100644 index a6e925d12..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_setjmp.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_SETJMP_H__ -#define __PCCTS_SETJMP_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdarg.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdarg.h deleted file mode 100644 index 25b3f1c9c..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdarg.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_STDARG_H__ -#define __PCCTS_STDARG_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdio.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdio.h deleted file mode 100644 index 0e9fc5b4a..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdio.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_STDIO_H__ -#define __PCCTS_STDIO_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdlib.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdlib.h deleted file mode 100644 index d929e29c3..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_stdlib.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_STDLIB_H__ -#define __PCCTS_STDLIB_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_string.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_string.h deleted file mode 100644 index 5ebd368a0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pccts_string.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __PCCTS_STRING_H__ -#define __PCCTS_STRING_H__ - -#ifdef PCCTS_USE_NAMESPACE_STD -#include -#else -#include -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctscfg.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctscfg.h deleted file mode 100644 index 632c97934..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctscfg.h +++ /dev/null @@ -1,357 +0,0 @@ -#ifndef PCCTS_CONFIG_H -#define PCCTS_CONFIG_H -/* - * pcctscfg.h (formerly config.h) (for ANTLR, DLG, and SORCERER) - * - * This is a simple configuration file that doesn't have config stuff - * in it, but it's a start. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to the Purdue Compiler Construction Tool - * Set (PCCTS) -- PCCTS is in the public domain. An individual or - * company may do whatever they wish with source code distributed with - * PCCTS or the code generated by PCCTS, including the incorporation of - * PCCTS, or its output, into commerical software. - * - * We encourage users to develop software with PCCTS. However, we do ask - * that credit is given to us for developing PCCTS. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like PCCTS and have developed a nice tool with the - * output, please mention that you developed it using PCCTS. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * Used by PCCTS 1.33 (SORCERER 1.00B11 and up) - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1989-2000 - */ - -/* This file knows about the following ``environments'' - UNIX (default) - DOS (use #define PC) - MAC (use #define MPW; has a few things for THINK C, Metrowerks) - MS/C++ (MR14 Microsoft Visual C++ environment uses symbol _MSC_VER) - - */ - -/* should test __STDC__ for 1, but some compilers don't set value, just def */ - -#ifndef __USE_PROTOS -#ifdef __STDC__ -#define __USE_PROTOS -#endif -#ifdef __cplusplus -#define __USE_PROTOS -#endif -#endif - -#ifdef PCCTS_USE_NAMESPACE_STD -#define PCCTS_NAMESPACE_STD namespace std {}; using namespace std; -#else -#define PCCTS_NAMESPACE_STD -#endif - -#include "pccts_stdio.h" -#include "pccts_stdlib.h" - -/* largest file name size */ - -#ifdef _MAX_PATH -#define MaxFileName _MAX_PATH /* MR9 RJV: MAX_PATH defined in stdlib.h (MSVC++ 5.0) */ -#else -#define MaxFileName 300 -#endif - -/* -* Define PC32 if in a 32-bit PC environment (e.g. extended DOS or Win32). -* The macros tested here are defined by Watcom, Microsoft, Borland, -* and djgpp, respectively, when they are used as 32-bit compilers. -* Users of these compilers *must* be sure to define PC in their -* makefiles for this to work correctly. -*/ -#ifdef PC -# if (defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) || \ - defined(__GNUC__) || defined(__GNUG__)) -# ifndef PC32 -# define PC32 -# endif -# endif -#endif - -/* MR1 10-Apr-97 Default for PC is short file names */ -/* MR1 Default for non-PC is long file names */ -/* MR1 Can override via command line option LONGFILENAMES */ - -#ifndef LONGFILENAMES -#ifndef PC -#define LONGFILENAMES -#endif -#endif - -#ifndef LONGFILENAMES -#define ATOKEN_H "AToken.h" -#define ATOKPTR_H "ATokPtr.h" -#define ATOKPTR_IMPL_H "ATokPtrIm.h" -#define ATOKENBUFFER_H "ATokBuf.h" -#define ATOKENBUFFER_C "ATokBuf.cpp" -#define ATOKENSTREAM_H "ATokStr.h" -#define APARSER_H "AParser.h" -#define APARSER_C "AParser.cpp" -#define ASTBASE_H "ASTBase.h" -#define ASTBASE_C "ASTBase.cpp" -#define PCCTSAST_C "PCCTSAST.cpp" -#define LIST_C "List.cpp" -#define DLEXERBASE_H "DLexBase.h" -#define DLEXERBASE_C "DLexBase.cpp" -#define DLEXER_H "DLexer.h" -#define STREESUPPORT_C "STreeSup.C" -#else -#define ATOKEN_H "AToken.h" -#define ATOKPTR_H "ATokPtr.h" -#define ATOKPTR_IMPL_H "ATokPtrImpl.h" -#define ATOKENBUFFER_H "ATokenBuffer.h" -#define ATOKENBUFFER_C "ATokenBuffer.cpp" -#define ATOKENSTREAM_H "ATokenStream.h" -#define APARSER_H "AParser.h" -#define APARSER_C "AParser.cpp" -#define ASTBASE_H "ASTBase.h" -#define ASTBASE_C "ASTBase.cpp" -#define PCCTSAST_C "PCCTSAST.cpp" -#define LIST_C "List.cpp" -#define DLEXERBASE_H "DLexerBase.h" -#define DLEXERBASE_C "DLexerBase.cpp" -#define DLEXER_H "DLexer.h" -#define STREESUPPORT_C "STreeSupport.cpp" -#endif - -/* SORCERER Stuff */ - -/* MR8 6-Aug-97 Change from ifdef PC to ifndef LONGFILENAMES */ - -#ifndef LONGFILENAMES -#define STPARSER_H "STreePar.h" -#define STPARSER_C "STreePar.C" -#else -#define STPARSER_H "STreeParser.h" -#define STPARSER_C "STreeParser.cpp" -#endif - -#ifdef MPW -#define CPP_FILE_SUFFIX ".cp" -#define CPP_FILE_SUFFIX_NO_DOT "cp" -#define OBJ_FILE_SUFFIX ".o" -#else -#ifdef PC -#define CPP_FILE_SUFFIX ".cpp" -#define CPP_FILE_SUFFIX_NO_DOT "cpp" -#define OBJ_FILE_SUFFIX ".obj" -#else -#ifdef __VMS -#define CPP_FILE_SUFFIX ".cpp" -#define CPP_FILE_SUFFIX_NO_DOT "cpp" -#define OBJ_FILE_SUFFIX ".obj" -#else -#define CPP_FILE_SUFFIX ".cpp" -#define CPP_FILE_SUFFIX_NO_DOT "cpp" -#define OBJ_FILE_SUFFIX ".o" -#endif -#endif -#endif - -/* User may redefine how line information looks */ /* make it #line MR7 */ -/* MR21 Use #ifndef */ - -#ifndef LineInfoFormatStr -#define LineInfoFormatStr "#line %d \"%s\"\n" -#endif - -#ifdef MPW /* Macintosh Programmer's Workshop */ -#define ErrHdr "File \"%s\"; Line %d #" -#else -#ifdef _MSC_VER /* MR14 Microsoft Visual C++ environment */ -#define ErrHdr "%s(%d) :" -#else -#define ErrHdr "%s, line %d:" /* default */ -#endif -#endif - -/* must assume old K&R cpp here, can't use #if defined(..)... */ - -#ifdef MPW -#define TopDirectory ":" -#define DirectorySymbol ":" -#define OutputDirectoryOption "Directory where all output files should go (default=\":\")" -#else -#ifdef PC -#define TopDirectory "." -#define DirectorySymbol "\\" -#define OutputDirectoryOption "Directory where all output files should go (default=\".\")" -#else -#ifdef __VMS -#define TopDirectory "[000000]" -#define DirectorySymbol "]" -#define OutputDirectoryOption "Directory where all output files should go (default=\"[]\")" -#else -#define TopDirectory "." -#define DirectorySymbol "/" -#define OutputDirectoryOption "Directory where all output files should go (default=\".\")" -#endif -#endif -#endif - -#ifdef MPW - -/* Make sure we have prototypes for all functions under MPW */ - -#include "pccts_string.h" -#include "pccts_stdlib.h" - -#ifdef __cplusplus -extern "C" { -#endif -extern void fsetfileinfo (const char *filename, unsigned long newcreator, unsigned long newtype); -#ifdef __cplusplus -} -#endif - -/* File creators for various popular development environments */ - -#define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */ -#if 0 -#define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */ -#endif -#if 0 -#define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */ -#endif - -#endif - -#ifdef MPW -#define DAWDLE SpinCursor(1) -#else -#define DAWDLE -#endif - -#ifdef MPW -#define SPECIAL_INITS -#define SPECIAL_FOPEN -#endif - -#ifdef MPW -#ifdef __cplusplus -inline -#else -static -#endif -void special_inits() { - InitCursorCtl((acurHandle) 0); -} -#endif - -#ifdef MPW -#ifdef __cplusplus -inline -#else -static -#endif -void special_fopen_actions(char * s) { - fsetfileinfo (s, MAC_FILE_CREATOR, 'TEXT'); -} -#endif - -/* Define usable bits for set.c stuff */ -#define BytesPerWord sizeof(unsigned) -#ifndef WORDSIZE -#define WORDSIZE (sizeof(unsigned) * 8) -#endif -#ifndef LogWordSize -#define LogWordSize (WORDSIZE == 16 ? 4 : 5) -#endif - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#if defined(VAXC) || defined(__VMS) -#include -#define PCCTS_EXIT_SUCCESS 1 -#define PCCTS_EXIT_FAILURE SS$_ABORT -#define zzDIE return SS$_ABORT; -#define zzDONE return 1; - -#else /* !VAXC and !__VMS */ - -#define PCCTS_EXIT_SUCCESS 0 -#define PCCTS_EXIT_FAILURE 1 -#define zzDIE return 1; -#define zzDONE return 0; - -#endif - -#ifdef USER_ZZMODE_STACK -# ifndef ZZSTACK_MAX_MODE -# define ZZSTACK_MAX_MODE 32 -# endif -# define ZZMAXSTK (ZZSTACK_MAX_MODE * 2) -#endif - -#ifndef DllExportPCCTS -#define DllExportPCCTS -#endif - -#ifdef PC -#ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME -#define PCCTS_CASE_INSENSITIVE_FILE_NAME -#endif -#endif - -#ifdef PC32 -#ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME -#define PCCTS_CASE_INSENSITIVE_FILE_NAME -#endif -#endif - -#ifdef __VMS -#ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME -#define PCCTS_CASE_INSENSITIVE_FILE_NAME -#endif -#endif - -#ifdef __USE_PROTOS -#ifndef PCCTS_USE_STDARG -#define PCCTS_USE_STDARG -#endif -#endif - -#ifdef __STDC__ -#ifndef PCCTS_USE_STDARG -#define PCCTS_USE_STDARG -#endif -#endif - -#ifdef __cplusplus -#ifndef PCCTS_USE_STDARG -#define PCCTS_USE_STDARG -#endif -#endif - -#ifdef _MSC_VER -/*Turn off the warnings for: - unreferenced inline/local function has been removed -*/ -#pragma warning(disable : 4514) -/* function not expanded */ -#pragma warning(disable : 4710) -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsp deleted file mode 100644 index 610d06942..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsp +++ /dev/null @@ -1,118 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pcctslib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=pcctslib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pcctslib50.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pcctslib50.mak" CFG="pcctslib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pcctslib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "pcctslib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe - -!IF "$(CFG)" == "pcctslib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"pccts_release.lib" -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Copy to ..\lib -PostBuild_Cmds=mkdir ..\lib copy pccts_release.lib ..\lib\pccts_release.lib -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pcctslib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /Z7 /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"pccts_debug.lib" -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Copy to ..\lib -PostBuild_Cmds=mkdir ..\lib copy pccts_debug.lib ..\lib\pccts_debug.lib -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "pcctslib - Win32 Release" -# Name "pcctslib - Win32 Debug" -# Begin Source File - -SOURCE=.\AParser.cpp -# End Source File -# Begin Source File - -SOURCE=.\ASTBase.cpp -# End Source File -# Begin Source File - -SOURCE=.\ATokenBuffer.cpp -# End Source File -# Begin Source File - -SOURCE=.\BufFileInput.cpp -# End Source File -# Begin Source File - -SOURCE=.\DLexerBase.cpp -# End Source File -# Begin Source File - -SOURCE=.\PCCTSAST.cpp -# End Source File -# Begin Source File - -SOURCE=.\SList.cpp -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsw deleted file mode 100644 index b13f921b0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib50.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "pcctslib"=.\pcctslib50.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsp deleted file mode 100644 index 80eb2776a..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsp +++ /dev/null @@ -1,193 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pcctslib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=pcctslib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pcctslib60.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pcctslib60.mak" CFG="pcctslib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pcctslib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "pcctslib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "pcctslib60" -# PROP Scc_LocalPath ".." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pcctslib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W4 /WX /GX /O2 /I "$(PCCTS)\sorcerer\h" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"pccts_release.lib" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy to ..\lib -PostBuild_Cmds=mkdir ..\lib copy pccts_release.lib ..\lib\pccts_release.lib -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pcctslib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W4 /WX /GX /ZI /Od /I "$(PCCTS)\sorcerer\h" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"pccts_debug.lib" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Copy to ..\lib -PostBuild_Cmds=mkdir ..\lib copy pccts_debug.lib ..\lib\pccts_debug.lib -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "pcctslib - Win32 Release" -# Name "pcctslib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\AParser.cpp -# End Source File -# Begin Source File - -SOURCE=.\ASTBase.cpp -# End Source File -# Begin Source File - -SOURCE=.\ATokenBuffer.cpp -# End Source File -# Begin Source File - -SOURCE=.\BufFileInput.cpp -# End Source File -# Begin Source File - -SOURCE=.\DLexerBase.cpp -# End Source File -# Begin Source File - -SOURCE=.\PCCTSAST.cpp -# End Source File -# Begin Source File - -SOURCE=.\SList.cpp -# End Source File -# Begin Source File - -SOURCE=..\sorcerer\lib\STreeParser.cpp -# ADD CPP /I "$(PCCTS)\h" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\AParser.h -# End Source File -# Begin Source File - -SOURCE=.\ASTBase.h -# End Source File -# Begin Source File - -SOURCE=.\AToken.h -# End Source File -# Begin Source File - -SOURCE=.\ATokenBuffer.h -# End Source File -# Begin Source File - -SOURCE=.\ATokenStream.h -# End Source File -# Begin Source File - -SOURCE=.\ATokPtr.h -# End Source File -# Begin Source File - -SOURCE=.\BufFileInput.h -# End Source File -# Begin Source File - -SOURCE=.\DLexerBase.h -# End Source File -# Begin Source File - -SOURCE=.\PBlackBox.h -# End Source File -# Begin Source File - -SOURCE=.\PCCTSAST.h -# End Source File -# Begin Source File - -SOURCE=..\sorcerer\h\SASTBase.h -# End Source File -# Begin Source File - -SOURCE=..\sorcerer\h\SCommonAST.h -# End Source File -# Begin Source File - -SOURCE=.\SList.h -# End Source File -# Begin Source File - -SOURCE=..\sorcerer\h\STreeParser.h -# End Source File -# End Group -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsw deleted file mode 100644 index d6d38fe0b..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcctslib60.dsw +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "pcctslib"=.\pcctslib60.dsp - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - pcctslib60 - .. - end source code control -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcnames.bat b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcnames.bat deleted file mode 100644 index 718fb3903..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/pcnames.bat +++ /dev/null @@ -1,11 +0,0 @@ -ren aparser.c aparser.cpp -ren astbase.c astbase.cpp -ren atokenbu.c atokbuf.cpp -ren atokenbu.h atokbuf.h -ren atokenst.h atokstr.h -ren dlexerba.c dlexbase.cpp -ren dlexerba.h dlexbase.h -ren dlexer.c dlexer.cpp -ren list.c list.cpp -ren pblackbo.h pblckbox.h -ren pcctsast.c pcctsast.cpp diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/slist.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/slist.cpp deleted file mode 100644 index eceacc47a..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/h/slist.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * SList.C - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * PCCTS 1.33 - * Terence Parr - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1992-2000 - */ - -#define ANTLR_SUPPORT_CODE - -#include "SList.h" -#include "pccts_stdarg.h" // MR23 - -/* Iterate over a list of elements; returns ptr to a new element - * in list upon every call and NULL when no more are left. - * Very useful like this: - * - * cursor = mylist; - * while ( (p=mylist->iterate(&cursor)) ) { - * // place with element p - * } - * - * The cursor must be initialized to point to the list to iterate over. - */ -void *SList:: -iterate(SListNode **cursor) -{ - void *e; - - if ( cursor == NULL || *cursor==NULL ) return NULL; - if ( head == *cursor ) { *cursor = (*cursor)->next(); } - e = (*cursor)->elem(); - (*cursor) = (*cursor)->next(); - return e; -} - -/* add an element to end of list. */ -void SList:: -add(void *e) -{ - SListNode *p, *tail=NULL; - require(e!=NULL, "slist_add: attempting to add NULL list element"); - - p = new SListNode; - require(p!=NULL, "add: cannot alloc new list node"); - p->setElem(e); - if ( head == NULL ) - { - head = tail = p; - } - else /* find end of list */ - { - tail->setNext(p); - tail = p; - } -} - -void SList:: -lfree() -{ - SListNode *p,*q; - - if ( head==NULL ) return; /* empty list */ - for (p = head; p!=NULL; p=q) - { - q = p->next(); - free(p); - } -} - -PCCTS_AST *SList:: -to_ast(SList list) -{ - PCCTS_AST *t=NULL, *last=NULL; - SListNode *p; - - for (p = head; p!=NULL; p=p->next()) - { - PCCTS_AST *u = (PCCTS_AST *)p->elem(); - if ( last==NULL ) last = t = u; - else { last->setRight(u); last = u; } - } - return t; -} - -// MR23 -int SList::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - int iRet = vfprintf(pFile, pFormat, marker); - va_end( marker ); - return iRet; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/history.ps b/c/makeotf/makeotf_lib/build/hotpccts/pccts/history.ps deleted file mode 100644 index e2600d512922d4155ce1f11171d7a3d89989e171..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20308 zcmb`PYjfLHmaabwzha*cDT5V>Ab4lG>YR~f$#%DF>*mRHx4SwJ2}y`af&ocON-F>T zJnz~7NL`$GYNo0?B7uEbd)?Q&HvQfIIXU0kpX8V6UZ>d#zWeT=NRw4w{NS#O{OZbm zNsDEc&t2SX^?Ca$AFpTWeDyv}C+XxYUFPdzoGyQGSNVM9F0xs=+&jx>$(*s@Z$Esy zN~YO(^Ynm;Sz2r@dA?pOrrCo<7ezi^rYn)MSQ-gVB%UPK+OkuA{7_6%=-pqA)A@vF zA6R(4N>-5lgFDHKRgq*Xo*&L92l-6YFZuQ|z0T$*MLx~1t8dkDesIrj97NEvNXDPD z`L(;fNsH9|7VIqYMX)no7X|Br>h{kM-oAC?e3H8S%B^^^WX;r#Z;~PzuhOC!MCS*t({__o3+}sUd6VC|X`W2% zQS{RN=2}i;++OTB-qhV@lhut4``uk;^K#&U4NULGH!gYd^3~?0E!J~wzgF`6Vuv=q znB`y6RqmcFcl6-(H<9=H(Uh+c`sTS|-$e3Tn`z5_mF~Yj9rI1Z|LwVXUpc|?SI2(S zG2Su#tMtF$dihO+e|RwAD-@qR9rR74o-*%w4RJwqwt4wYl%8*o{|ccOPsV%;otWZ0 znPGX^uc`N7=SOZ2W8)9@euV{@v(u)*&Oe=PE>mv#kL90vdd-uT`%X;;ZrN)^RpQ2O;>mjF$>PrzS)!=2)?lZF8z{ZNckVLS`QIig znx(fed& zgR&W;lFMo85~7l02;pdzjg#s0-r?Q3kV99CN6)v&V&Zvc-C3f-TcYDy{JdOx9Urx)X z*;P7S@;;V>_p`T&iw=#bQZV(YKV14dcjxZi`Flih_rl%3V5=fu6MPc4$d{Rdvm;c@QzW}w zxp0x)rBnC43!ClUF8^;dWN|n!1yfFcl@~J??C{1d*Oy){+h2kmzr3E+f_wTX*vabU zwppo|GD?4zw>|Y-K%5H{hhl_%M(c17`8x~t7R3ZCGB0e%)Rn12-njo2fE3N z>{o0*nX*E{@hb&(ny@4`6QGmD0ya2IY0jb9jzgcn4|cq>^q)0cq4haVe?^9`4!pdG z^c#8M5&A96X^aiz%T)Tm%?I|sc!$SY71^E7F}`y?fp9lzc73yYqA;%x{Vt>c!47lF zRH$6SvZGpky}H&`D8JF{@t>z8X(epPukwJv?_}&t^9Z=Xf&|Gp3E^i4E-KjGa*$0% zbau?+l6{+}=NF_-#>}nc=^YQt2(=k`!2Ft5o59HQO2U&iOcPYtSScyb(DRi$lGX$f zf8a~Wljv%cqmAw`X3g{DJ%`=J^OVOYXem_F1fD zu)z+)a7hHm^v*>`Z(p$+;TL!4aAes0!v3#B*t@UaB|VG;|9Mza;#p%JRFN_|g4Xv6 z#XiK!vzAP-^cfq}`WS}A&&OUmdUbfT6?$%PJMN4AbNKS`^;;Yh94tRVdu3}j$sg&V zS3P|H%0=38i`fV7FRCbK{x&YZp#{_F9sj=<&yj;nNFT8u{>KNswm5@r76GtZX+J(!-@0(L5-)lZvH%6PKA5Yhlw0iPvQT|6`>Kgs|K~>4_t61Zbx3Rb^XR-B-`9$mA znypssX6xziRYEInSdvH%gu0QN1%r|QNdDvHuIGpE4_g0>lI1wd#u+Ys=0C5p=_HNL z$4QaTqks56XuZDuYJY<0?-M|UbeSz9w0@G#lHzmp%Q|22NXbmpoaZa;@F#zRKO69^ z@Bh~piVO${B20Ul%>0=qm(yszo?Qx}xt>Q8iv6UB7Ac6#d=(`#J}t>P{NO^-J0dYj z=hO6R75I<-Dd8(EvgPM!F<--}iHR&zh~~Hi7MmiTWjf3Jrzr(Ml>V|#rl29%L|Q-|86f#! zl&qrt=w)<34ip_mN73u(P4qVUYxKA1IC>Yok3K{v(P?xRokthZ$LK$!AEW<@{vQ1! zx&#~fOw8k0(Ip>^*r0mskLdO2YMS0fWT7x-OtSAeWAl>eG8#vdh!aKE(M^;^KS!UV zX*7%GQ64R#UxKKJ(5h%1eTiCFCIT_F%wh_3X9 zzY}e>TxQjWpW!`$CAwM9uajaunFuXROhlljFGo2sJM>uYouOU68qVa?Nog6 zWanu#E%{!(&|#wwhtaWDo{Ae@gD3gzJhIKCdqj`x$jA2aeRPisU8 zw8#14zTCB#T%lT~Y2u?n53v+YD#Zoq}I!| zX?)?;yZ)Ap*Q+#|t<7u_3!bHE_~e^K$LR#ICbExuT3$?MxUsdOqlw)JG};3V#10CX z03UCX>6PEKe7LL)!+5ptMYiuL+27LVebY9;z?wn(Cba#-=%6C%(9b^fvk$jsAJ((p z`Y~^9Oc1@@8uYdvbhx^S-h1`_;KzUPYkt@o{-GRD%?jY$bd@cp_t6Kh3?Kd6kACjQ zt+^koNzvc^%L{6#d4$4)Dx+>lQv63h6aPNhnhfZx5J3%FMuEgQk)X^KCy==&r#2aX zx-}aCmeVpnDDyj%LCBm(R*y;H#N6+f+i)c6$LCvX=H-Zb8u?lViMi*)+HbV>6W5!G zLA0)?-21oKKa9Aq9{)>mtc=P3(Q=BJ)mH$9$Yb$7r2j`Nu-DtqHe(F0uU6QC@EPG# zj2b0B0YLZxKq;;eb3HguSL;Ra@}wMFKZ%Z7F7A|cRC}Bsg%?yaZ?MF?xL5Ifa&T~Q z-e|Xn%{H+1u5z8h;p(WiRRUYYhwdCfg%#C~DNz!O{y3Ik46?=Vm9u|coMI&tldOygE z1!a(2e1pNP6~4>npdyQWnk{#oeOcm|S!2}fj9koNPeUxB(H^#%15Q3{@!;b;^CMUz zhSF2pI|#p|VnPqf$q`n@@XeCthWo|r9*JDvxRbOH&XVYqV)1%~U*00t5Vr<9HakPt zZXqiNGsAy=Tug}M6F1x&?2WqrYP5UpW+!$CRU=~8Yz@06cN4a{D?j7Y>3uXt1J~}2 zntgW$!L42|2(J?;j{A`8+Rb678_tu4-jv@v;WAmEF0E#-Tg^R36eRDBcDL0W4*KPa zrvck`!oBNsp2A@&+-hIJ1__8?GFd~miUFoOFvn86VCJ6K)^<_~Xb~F+?VvsALFu^~ zQNv!zP?|R?&ySEEG#}Z!eh^aFO1a|^8n;T;0!}Vrax(wyUS;X(*H7)ZUBi00^ytC# zz1sqa4BjvA30bpcvm!@Z_mMUkj4$KX*<`QLZ}x_LHgERZ1NN5qWLY%ui25AXw%oM| zB!IBW)lA`Bu04uP0v+^v5bo}?8LIzU%W;(V7sqGrQ%E{Or^+L*!nP*v?;j5iJ~ejX z-yB-kJV~wyW+-N_8KWQNs;FNl2*o5`5@$`>E7+{!Jynue>^iMMsSG9C5yL>TXO(Uc z&Q~OkRMnSMqTm8rlrqbdi349$LeSt4SMIHKuQ?dFBbn=qlFx^ZUT2H-mhX7dZ^=F^ z2Y%7$c6(Brl8{qBFkH%c_;G+w8S>~3MzSkU?`aUybS&9p$7pvr#;NNzTlkdSDYFMy zCcw0*Q+n5k+x=#@)u)xGkcur{`PNaQ5ZjXsWfma7PIlj1pypO^qA9Tn=P`MG@c?EP{ z>$il13zDVk?Usg*(2iF}THGvvx4m$GPuU+}iTuwnX7#|H-|2vRc0h`WEj6rWql4XE zxGN{%bx^BK!BvwvI@9R%2k6!?*dnDDUIA|Bt4gIRyJiKc&QVz5AA+2{zI|#mO-eo4 zGk#)-+AAz2)5T5VzQ`+eu=Tdis&{1%92MI)YcOv6!|FB6Ug4spm;{QTl!RPSC_7%I zlEYFN5EczXG2+%sGilKWjE}2{!~aaN;|}f%WoK$22Lr`682Q>Dsj;Mls1JG5WAlOn z#8@qbfJwk2X#rLYykuv@3OPsM2j4C!-htLWg%o*yE;M1T7(nLV*S&j)BxB!X2@VY)-vvnFd{q zHC-K;hzCVg=wKA6=W1Qd(fqi@f`sm_EsXjPMngq2O7y?DiA3jZ>UJ(0&}WTZgXs;Z)D2#=4UtJxKQ*R}=71vN zwcOrlM1}G>xk+&q+1wIvb3pifBt2+#%9Z7TG?;KR$-uAbNK@%f$?$4Xd0_;)zrGgA zjyp47Zjk#WEfaKAD&S4O*$7O}9!8@cZrUmbsuLf7P$f$W6_vJ~ikvKqCDUv2#MRBr z)E%cIJlZ?peL8Nll#5LBY&qL4U2Cs1l#T^jwDhc{b?tgfrAukXwp%L`N5{$0b>zdv^;R-W5VR8Q#k^t^k34&Bbq@{3-tK>4X?`Fg|R6_&|u>>{m z5fwUN^DQ)(m$1Oq3Fk+R&InV)k@-C>0AdjjqGwxDYc;xYOCDsKx;VVG=-C^{(9UJ> z{cx#WW4Z7a7W*i+0~Td893<8Ax35o*_usqs01RBfYc`;yOV;fd!*Of+i5$FpmE25s zOH&_n+)TyVt{r?+BD^CoHF`}9?kN25;%{baLvL&CW@|t;n5I{F)9^B0Lr+Ixg|GVCy{Zbp8|yz-BnyKm3S)7q;_@Zd403uy1Sz`uNIJ)+ zna)@V$uc`{dor#=K=oozrP zp&_`mWgf?`B*!fkuLchv0qh$FQEZrx~ zG*{=80=S5!(oaDj%8G0kRCF%5hu~+2#4I>u&~3(?X;;$pW@Ni4K-c@bpBkOvfC?aX zeLpMwX^|~bm6EFV4yk-&^3)f%VzHj6z;1L$xMsqhpQ9)q58IR?fOekYS2RD$;%tC{ zh~+jW2+!8!Tx21q>m1usr@4$P6{u6DF6U|tUzgDih=szD6u5j@=}9B#6y4YR`$JXca z8DMR67~n1EsdE;rp$o(IXQBk@LiyhN+b*M$2f_38kupgBr}i%yBIP z&_;2t$q=*jtvHP1ri;8JJ?5+n+D0UA8JZ*gTdn~TC=&>zQhuq5S4q7jbtOkAeZZl> zUSYpKa4)$1&0z2&OjnqzCAoX;y+(V0k3%(jsv|cpjpKlz2_EUjU4l1Wr$Ks0y^QeC zv3@tajZr!!(#m@@s!B~}H2gD*>N?>ge}L|ri$y_W+niQ}tzj z&%e1+y1Q~$MLuIJWxP~tna|{?YJ3nD{LV)%txEGfHEHV zViNQ+U+cuX^2Qw#%~ttFGP@y(`Qe&SgC5+80#q9A=xIuQoQPZIvS1dOXJ;7RS~XcR z%f>x$;(MgsBUYB1amfT!cTuHNkk$sJ z@8b~%fgdkWEsiNF=G;TO)O|eUx^XQz7?;7d1kk#|u1yrcku-(vIBD4^IPgCupo2j= z{)t)z5a(0l|6Qh_=IBrCQ65J-qEAVMeq1yT;JpEgN?NNxM!pTY)CJY^QzRf8ggT7# zJ?|SZZwvjK%;}+L!s>B36_jj%fK(L(0m0)6k@p4H_>3^B!#>43&`gJr%+DW4L(wNm zb1v%yQr4h8;S|GoQN(RkKqWIv-zeQ zQwfXYfKF!MpD0L>s}djl}x9zo$E5Rs=#bcR{&x%1(Mw22;Q(hXS3ZJ zg>O_5LNjp89AOPwLOR;2S;Kq$o7YG|x{Sqi<|`$m&NsS+Mwqboh%jIg>St7xj5=T{ zitc1#SY7G?VCH8Q>P47kEbMO9*KUzwm?P9gm4me!ZAuXf75umb{s|Q@7=1*`2mWn1 z#RD=A5>cyW5O4`&DR&6BkPtO6%2wyrW`YM*Y~JK*Ku`W+5qP89!p|*HYR476$})FW zvYFh=6krQ=1bKr#)3ur5X_BY$)pvY+aw4T0g_ESL?clgjBJN}G^A(D;Mz@cy47n}t z_ce^Z=8)%L#}HB=9-;4V=k5_S*xhyKAI=UA&kofhNCaMyoYB}w(>*m&{pi)QuT81w0-ZHy1 zKuyFfg?}#>G<&b^EqJT@BOrkL&ZI-iiO?uHR`0}dfuoT71iBxI?GX{z1|Q;ILxo@* z?IGEsk%M-Y{Wjky@@psXmps*^2{E_?Tli|9+3zYlbR3m7U7RM z3>c262yyHhSbXN7rKxKL6_MLpVy(pl-Qa>T_hRs@)Fxtq?>6BDR5O!t={CLHgb_`s zPnZ}g2Sr=81?s_i`?_M~&dr;4u&Fj_(e0!PEo!E8NEq)$N2Pdru)1i(bW?i3iGCJk ziLHkrs&b5bLn?sk<%8tfhjT_hS3g$WAJokQMj!#S#&ytI8Lbl~J1ZGZX9br^PF9sY zrrsSCU$Rr*Ec`&|#jj1B54@-PB$O;R!mv~oS^5P^6-}792V9zB#v=o^c*Gm*C%A=uZ{XW)t@cs8LU$5|j{%j=- zVsC{+o42S_K@3%(2Z|}8?f|68r7U{%`(%w+41n8)k`n8$1gu3>+naqtCFO=%k+zIfsC#;dSQH!vwHTr4B4`%eaUYE~k1=tUAmTT^y*|oh=Q_OL~*+-hfLj6)tWC1@Bi`2|N3V*V; zocvK;G=`f`g4DMS+EltrqOLm!WYUVqGFXpo4l7>Q78`pucf0s1KmJ)RYbAUP)-g*m z^_X;>SCu98k;vWHl(JvA-ls%4!k3i5X5#$)OOZ-bhh7mb>-14dj_P_Xks5>6$Nlg~ z^@BFRx$yfekHo0rvIyB7l&Kd(RZjq3Xsk#i1+n&uuh)FW$ll7#{Mi*UDR$J{HF(=@ zGL!{Oj}$y4=m8^Ps}@YVBcCFX2=po~AP$|>rf)AqM6q=bWOHeyyrJT+tGIXX_x5P+ zlEc;Ww-rKYGEuB2@IU+2-vi+Os3ldp|6+{umukcuv8pD*FL@0z4W{GcyoF)E7pXVb@<^=zLXoInno$}v)q05f6Mm`s zUJB|)oQiysUwCN4WIkjHem^iug^V^G3&es->H5(!zgk&w-fJtPveJSf+RP+YhY*_z za%2oX!)|o$5}9j)@*U7)Yw+hni9Ly70ssC4k*Ah?a6DQWWZ)9toxl zkg)M6PXQ+Md5ZSGS_?>2kwaFdUnLNxmD81p$)03clxVOMJ?hNCGoi(0KT0~Q0<_)iQ7%>M zvp>rj5~!BMRCl;NguFQ-nAAi#KUZrgFAM|~5yNrWmmIF#cbn-}*PhD-2swtT7Zzt8>=F%31$7IgN60&5+tbrMr66vxwO8CVq zKj)+IPfMAWOc6#2n>g#a=Eim`MDJp zbtenP*=4Aok&%qvJ>g74(tYbeIb+qu42_uNTOz!EThqA@r*vIOBXUGMj+rnT;I ze7MqUF1+~wy3)VOunE|5F=ZJf+SP6rP+@CBv+kK<_0ksIWFZamDUQ9T|FK!Q}VjJ@8OhWkpUWj73u-?De5OSrRH%(gU8fxldaZ1;4){XZsamC*K`Slx@pE0Ig9NIG!^YmGYeUA8) z_&g+`u?ve0o4sKsIAM>A@aE-tm*kV_um^4dInuU@1V zn!n;~^Y+h}XZ|_paPOM#YC26W$v&0s{0PuNdmro5jI$>PeQ=|FyDsJOh-t`3x0Zn! zPN`A1FOS4qmq%Lu0G}G%hxT_z*t6Rma6#JN7QJAtF3Q6Vajo^=RE1JTzT+dIY;;$y z;i)F*>9d;fM0dGKsyol$q6r(;(+JX@-R`y?aIxGG2meG7Y}7-m+9*O5aCa+3KyjaF zf>t=)SVezBmagA#G_O=o;+Dv&Ebp-$D^c-AT;I9fbr0GGyIWVoy?*jT0NoZt5L=t; z*AY*7!qY#qji7CV9uW8kEP0M2+8Zd)?!S^ZwrZAii2YAlqNiWij*=q*rF13BM;s}+ zP;c1Y+K_8`&umDo{HGfdpuc&;cw+z^E>%9WBTv7+V=3QC^g(Ey>&g{+*=}>O>lN#v zzLVTNFIy6DqDblZ{HU)Aw^XEU4g&RU6e*~@Y=_5xrb+x;4I1>-%__BR#~TIFFI1k` zOoyj`xX$_0OC6gfxli}Zl01F1B)>pXs$nkakwi=&zf=M_f7)tX*4uUYvBqY*nqPYS z?0$c`T@co=oX-=gh|{&7%sfsL^z_k2+t&MNwM_``5@k1ZS7O%FN2_hK$$Js!Ghd)NotLum2j5D^>%_e6{*oj%PrfZ9Yt&Hv=rSzu=#j;|_g5bCBfz@WWB? F{{d?V)JgyV diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/history.txt b/c/makeotf/makeotf_lib/build/hotpccts/pccts/history.txt deleted file mode 100644 index 96d66d3cf..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/history.txt +++ /dev/null @@ -1,186 +0,0 @@ - - - - The History of PCCTS - - The Purdue Compiler-Construction Tool Set - - - Terence Parr - Parr Research Corporation - Minneapolis, Minnesota - and - University of Minnesota - Army High Performance Computing Research Center - - [Updated 8-7-94] - - - The PCCTS project began as a parser-generator project for a gra- -duate course at Purdue University in the Fall of 1988 taught by Hank -Dietz- translator-writing systems. Under the guidance of Professor -Dietz, the parser generator, ANTLR (originally called YUCC), continued -after the termination of the course and eventually became the subject -of Terence Parr's Master's thesis. Originally, lexical analysis was -performed via ALX which was soon replaced by Will Cohen's DLG in the -Fall of 1989 (DFA-based lexical-analyzer generator, also an offshoot -of the graduate translation course). - - The alpha version of ANTLR was totally rewritten resulting in -1.00B. Version 1.00B was released via an internet newsgroup -(comp.compilers) posting in February of 1990 and quickly gathered a -large following. 1.00B generated only LL(1) parsers, but allowed the -merged description of lexical and syntactic analysis. It had rudimen- -tary attribute handling similar to that of YACC and did not incor- -porate rule parameters or return values; downward inheritance was very -awkward. 1.00B-generated parsers terminated upon the first syntax -error. Lexical classes (modes) were not allowed and DLG did not have -an interactive mode. - - Upon starting his Ph.D. at Purdue in the Fall of 1990, Terence -Parr began the second total rewrite of ANTLR. The method by which -grammars may be practically analyzed to generate LL(k) lookahead -information was discovered in August of 1990 just before his return. -Version 1.00 incorporated this algorithm and included the AST mechan- -ism, lexical classes, error classes, and automatic error recovery; -code quality and portability were higher. In February of 1992 1.00 -was released via an article in SIGPLAN Notices. Peter Dahl, Ph.D. -candidate, and Professor Matt O'Keefe (both at the University of Min- -nesota) tested this version extensively. Dana Hoggatt (Micro Data -Base Systems, Inc.) came up with the idea of error grouping (strings -attached to non-terminals) and tested 1.00 heavily. - - Version 1.06 was released in December 1992 and represented a -large feature enhancement over 1.00. For example, rudimentary seman- -tic predicates were introduced, error messages were significantly -improved for k>1 lookahead and ANTLR parsers could indicate that loo- -kahead fetches were to occur only when necessary for the parse - - - - Page 1 - - PCCTS - - -(normally, the lookahead "pipe" was constantly full). Russell Quong -joined the project in the Spring of 1992 to aid in the semantic predi- -cate design. Beginning and advanced tutorials were created and -released as well. A makefile generator was included that sets up -dependencies and such correctly for ANTLR and DLG. Very few 1.00 -incompatibilities were introduced (1.00 was quite different from 1.00B -in some areas). - - 1.10 was released on August 31, 1993 and incorporated bug fixes, -a few feature enhancements and a major new capability - an arbitrary -lookahead operator (syntactic predicate), (alpha)?beta. This feature -was co-designed with Professor Russell Quong also at Purdue. To sup- -port infinite lookahead, a preprocessor flag, ZZINF_LOOK, was created -that forced the ANTLR() macro to tokenize all input prior to parsing. -Hence, at any moment, an action or predicate can see the entire input -sentence. The predicate mechanism of 1.06 was extended to allow mul- -tiple predicates to be hoisted; the syntactic context of a predicate -was also moved along with the predicate. - - In February of 1994, SORCERER (a simple tree-parser generator) -was released. This tool allows the user to parse child-sibling trees -by specifying a grammar rather than building a recursive-descent tree -walker by hand. Work towards a library of tree transformations is -underway. Aaron Sawdey at The University of Minnesota became a second -author of SORCERER after the initial release. - - On April 1, 1994, PCCTS 1.20 was released. This was the first -version to actively support C++ output. It also included important -fixes regarding semantic predicates and (..)+ subrules. This version -also introduced token classes, the "not" operator, and token ranges. - - On June 19, 1994, SORCERER 1.00B9 was released. Gary Funck of -Intrepid Technology joined the SORCERER team and provided very valu- -able suggestions regarding the "transform" mode of SORCERER. - - On August 8, 1994, PCCTS 1.21 was released. It mainly cleaned up -the C++ output and included a number of bug fixes. - - From the 1.21 release forward, the maintenance and support of all -PCCTS tools will be primarily provided by Parr Research Corporation, -Minneapolis MN---an organization founded on the principles of excel- -lence in research and integrity in business; we are devoted to provid- -ing really cool software tools. Please see file PCCTS.FUTURE for more -information. All PCCTS tools currently in the public domain will con- -tinue to be in the public domain. - - Looking towards the future, a graphical user-interface is in the -design phase. This would allow users to view the syntax diagram -representation of their grammars and would highlight nondeterministic -productions. Parsing can be traced graphically as well. This system -will be built using a multiplatform window library. We also antici- -pate the introduction of a sophisticated error handling mechanism -called "parser exception handling" in a near future release. - - - - - Page 2 - - PCCTS - - - Currently, PCCTS is used at over 1000 known academic, government, -and commercial sites in 37 countries. Of course, the true number of -users is unknown due to the large number of ftp sites. - Credits - -_____________________________________________________________________________ -_____________________________________________________________________________ -|ANTLR 1.00A Terence Parr Hank Dietz | -|ALX Terence Parr Hank Dietz | -|ANTLR 1.00B Terence Parr Hank Dietz, Will Cohen | -|DLG 1.00B Will Cohen Terence Parr, Hank Dietz | -|NFA Relabelling Will Cohen | -|LL(k) analysis Terence Parr Hank Dietz | -|ANTLR 1.00 Terence Parr Hank Dietz, Will Cohen | -|DLG 1.00 Will Cohen Terence Parr, Hank Dietz | -|ANTLR 1.06 Terence Parr Will Cohen, Russell Quong, Hank Dietz| -|DLG 1.06 Will Cohen Terence Parr, Hank Dietz | -|ANTLR 1.10 Terence Parr Will Cohen, Russell Quong | -|ANTLR 1.20 Terence Parr Will Cohen, Russell Quong | -|ANTLR 1.21 Terence Parr Russell Quong | -|DLG 1.10 Will Cohen Terence Parr | -|DLG 1.20 Will Cohen Terence Parr | -|DLG 1.21 Terence Parr | -|Semantic predicates Terence Parr Russell Quonq | -|Syntactic predicates Terence Parr Russell Quonq | -|SORCERER 1.00A Terence Parr | -|SORCERER 1.00B Terence Parr Aaron Sawdey | -|SORCERER 1.00B9 Terence Parr Aaron Sawdey, Gary Funck | -|___________________________________________________________________________| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 3 - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/install68K.mpw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/install68K.mpw deleted file mode 100644 index 545eb53b5..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/install68K.mpw +++ /dev/null @@ -1,90 +0,0 @@ -# -# File name install68K.mpw -# -# Description This script builds 68K version of antlr, dlg and sor. -# and install them into Tools folder in your MPW. -# They have commando interfaces. -# -# Installation Set Directory to the directory containing this file. -# Enter "install68K.mpw" and press enter key. -# -# Requirements SC compiler -# http://developer.apple.com/dev/tools/mpw-tools/compilers/index.html -# -# Author Kenji Tanaka (kentar@osa.att.ne.jp) -# http://www.geocities.com/SiliconValley/Platform/5502/pccts -# Created 06/16/98 -# Modified 12/14/98 -# - -Echo "# `Date -t` ----- Building 68K version of PCCTS tools." - -# Make 'Macintosh' folders to hold object files. - -Echo "# `Date -t` ----- Making Object File Folders." -If (!`exists :dlg:Obj:`) - NewFolder :dlg:Obj: -End -If (!`exists :antlr:Obj:`) - NewFolder :antlr:Obj: -End -If (!`exists :sorcerer:Obj:`) - NewFolder :sorcerer:Obj: -End - -Echo "# `Date -t` ----- Done." -Echo "#" - -# DLG build commands - -Echo "# `Date -t` ----- Building DLG." -Echo "# `Date -t` ----- Analyzing dependencies." -Directory :dlg: -Begin - Echo "Set Echo 1" - Make Install -f dlg68K.make -End > dlg.makeout -Echo "# `Date -t` ----- Executing build commands." -dlg.makeout -Delete dlg.makeout -Delete -y Obj - -Echo "# `Date -t` ----- Done." -Echo "#" -Directory :: - -# ANTLR build commands - -Echo "# `Date -t` ----- Building ANTLR." -Echo "# `Date -t` ----- Analyzing dependencies." -Directory :antlr: -Begin - Echo "Set Echo 1" - Make Install -f antlr68K.make -End > antlr.makeout -antlr.makeout -Delete antlr.makeout -Delete -y Obj -Echo "# `Date -t` ----- Done." -Echo "#" -Directory :: - -# SORCERER build commands - -Echo "# `Date -t` ----- Building SORCERER." -Echo "# `Date -t` ----- Analyzing dependencies." -Directory :sorcerer: -Begin - Echo "Set Echo 1" - Make Install -f sor68K.make -End > sorcerer.makeout -sorcerer.makeout -Delete sorcerer.makeout -Delete -y Obj -Echo "# `Date -t` ----- Done." -Echo "#" -Directory :: - -# Done - -Echo "# `Date -t` ----- Done Building 68K version of PCCTS tools." diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/installPPC.mpw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/installPPC.mpw deleted file mode 100644 index e34143f3f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/installPPC.mpw +++ /dev/null @@ -1,89 +0,0 @@ -# File name installPPC.mpw -# -# Description This script builds PPC version of antlr, dlg and sor. -# and install them into Tools folder in your MPW. -# They have commando interfaces. -# -# Installation Set Directory to the directory containing this file. -# Enter "installPPC.mpw" and press enter key. -# -# Requirements MrC(for PPC) compiler -# http://developer.apple.com/dev/tools/mpw-tools/compilers/index.html -# -# Author Kenji Tanaka (kentar@osa.att.ne.jp) -# http://www.geocities.com/SiliconValley/Platform/5502/pccts -# Created 06/16/98 -# Modified 12/14/98 - -Echo "# `Date -t` ----- Building PPC version of PCCTS tools." - -# Make 'Macintosh' folders to hold object files. - -Echo "# `Date -t` ----- Making Object File Folders." -If (!`exists :dlg:Obj:`) - NewFolder :dlg:Obj: -End -If (!`exists :antlr:Obj:`) - NewFolder :antlr:Obj: -End -If (!`exists :sorcerer:Obj:`) - NewFolder :sorcerer:Obj: -End - -Echo "# `Date -t` ----- Done." -Echo "#" - -# DLG build commands - -Echo "# `Date -t` ----- Building DLG." -Echo "# `Date -t` ----- Analyzing dependencies." -Directory :dlg: -Begin - Echo "Set Echo 1" - Make Install -f dlgPPC.make -End > dlg.makeout -Echo "# `Date -t` ----- Executing build commands." -dlg.makeout -Delete dlg.makeout -Delete -y Obj - -Echo "# `Date -t` ----- Done." -Echo "#" -Directory :: - -# ANTLR build commands - -Echo "# `Date -t` ----- Building ANTLR." -Echo "# `Date -t` ----- Analyzing dependencies." -Directory :antlr: -Begin - Echo "Set Echo 1" - Make Install -f antlrPPC.make -End > antlr.makeout -antlr.makeout -Delete antlr.makeout -Delete -y Obj -Echo "# `Date -t` ----- Done." -Echo "#" -Directory :: - -# SORCERER build commands - -Echo "# `Date -t` ----- Building SORCERER." -Echo "# `Date -t` ----- Analyzing dependencies." -Directory :sorcerer: -Begin - Echo "Set Echo 1" - Make Install -f sorPPC.make -End > sorcerer.makeout -sorcerer.makeout -Delete sorcerer.makeout -Delete -y Obj -Echo "# `Date -t` ----- Done." -Echo "#" -Directory :: - - -# Done - -Echo "# `Date -t` ----- Done Building PPC version of PCCTS tools." diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile b/c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile deleted file mode 100755 index 1c1f3d559..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile +++ /dev/null @@ -1,73 +0,0 @@ -# -# Main makefile for PCCTS 1.33MR33 /* MRXXX */ -# -# Terence Parr -# Parr Research Corporation -# -# verbosity versus silence... -PSss= -# -# this can be set to /user/local/bin etc... -BINDIR=bin -# This part added by Thomas Herter, M"unchen, Germany. See also manpages -# target. -MANDIR=$(HOME)/man -MANEXT=1 -MANFILES=dlg/dlg.1 antlr/antlr.1 - -CC=cc -#CC=gcc -COPT=-O2 -DPCCTS_USE_STDARG=1 - -pccts: - @echo " " - @echo " Welcome to PCCTS 1.33MR33 installation" - @echo " " - @echo " (Version 1.33 Maintenance Release #33)" # mrxxx - @echo " " - @echo " Released 19 April 2002" - @echo " " - @echo " Featuring" - @echo " ANTLR -- ANother Tool for Language Recognition" - @echo " DLG -- DFA-based Lexical Analyzer Generator" - @echo " SORCERER -- Source-to-source translator (tree walker)" - @echo " " - @echo " http://www.antlr.org" - @echo " " - @echo " Trouble reports to tmoog@polhode.com" - @echo " Additional PCCTS 1.33 information at" - @echo " http://www.polhode.com" - @echo - @echo - @echo "To substitute gcc for CC to invoke compiler: make CC=gcc" - @echo "If there are problems with cr and lf try: unzip -a ..." - @echo -# - @if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi - @echo Making executables... - (cd ./antlr; $(MAKE) CC="$(CC)" COPT="$(COPT)") - @echo antlr executable now in $(BINDIR) - (cd ./dlg; $(MAKE) CC="$(CC)" COPT="$(COPT)") - @echo dlg executable now in $(BINDIR) - (cd ./sorcerer; $(MAKE) CC="$(CC)" COPT="$(COPT)") - @echo sorcerer executable now in $(BINDIR) - (cd ./support/genmk; $(MAKE) CC="$(CC)" COPT="$(COPT)"; mv genmk ../../$(BINDIR)) - @echo genmk executable now in $(BINDIR) - @echo - @echo " PCCTS 1.33MR33 installation complete" # MRXXX - -clean: - (cd ./antlr; $(MAKE) -s clean) - (cd ./dlg; $(MAKE) -s clean) - (cd ./sorcerer; $(MAKE) -s clean) - (cd ./sorcerer/lib; $(MAKE) -s clean) - (cd ./support/genmk; $(MAKE) -s clean) - - -manpages: - # mkdir -p $(MANDIR)/man$(MANEXT) - if [ ! -d $(MANDIR) ] ; then \ - mkdir $(MANDIR) ; fi - if [ ! -d $(MANDIR)/man$(MANEXT) ] ; then \ - mkdir $(MANDIR)/man$(MANEXT); fi - cp -p $(MANFILES) $(MANDIR)/man$(MANEXT) diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile.vms b/c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile.vms deleted file mode 100644 index d353df795..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/makefile.vms +++ /dev/null @@ -1,13 +0,0 @@ -$ set def [.antlr] -$ @makefile.vms -$ rename *.exe [-.bin] -$ set def [-.dlg] -$ @makefile.vms -$ rename *.exe [-.bin] -$ set def [-.sorcerer] -$ @makefile.vms -$ rename *.exe [-.bin] -$ set def [-.support.decmms] -$ @makefile.vms -$ rename *.exe [--.bin] -$ set def [--] diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/README b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/README deleted file mode 100644 index e7a7c0d98..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/README +++ /dev/null @@ -1,77 +0,0 @@ - - Welcome to SORCERER 1.00B15 - - September 1995 - - - Terence John Parr, Aaron Sawdey, and Gary Funck - parrt@parr-research.com - sawdey@everest.ee.umn.edu - gary@intrepid.com - -SORCERER is a simple tree-parser generator that automates the process -of tree walking that is so common in many large programs. E.g., in the -case of source-to-source translators, a programmer typically has a -front-end that constructs intermediate form trees and simply wants to -traverse the trees and execute a few actions. In this case, the -optimal tree walks of code-generator generators and the powerful -attribute evaluation schemes of source-to-source translator systems -are overkill; programmers would rather avoid the overhead and -complexity. - -SORCERER is more suitable for the class of translation problems lying -between those solved by code-generator generators and by full -source-to-source translator generators. SORCERER generates simple, -flexible, top-down, tree parsers that, in contrast to code-generators, -may execute actions at any point during a tree walk. SORCERER accepts -extended BNF notation, allows predicates to direct the tree walk with -semantic and syntactic context information, and does not rely on any -particular intermediate form, parser generator, or other pre-existing -application. - -This is the 1.00B14 release and, therefore, may be less robust than -ANTLR and DLG; the source has not been heavily tested for portability; -especially outside the UNIX, PC, and MacIntosh world. This initial -release contains the full public-domain source code, a manual, and two -simple examples. Naturally, as the system matures, more goodies will -become available. Though not included in the actual release (to cut -down on net traffic), an overview paper is also available. - -We anticipate SORCERER's inclusion with PCCTS release very soon. - -We hope to have the book done very soon now also. - - - INSTALLATION - -[Mac users: see NOTES.Mac also] - -Simply copy the tar file over (or the compressed tar) and untar it will - - tar xvf sor.tar - -Then, 'cd' into the 'sorcerer' directory that was created by 'tar', -type 'make'--the executable 'sor' will appear in the 'sorcerer' -directory. Subdirectory 'test' contains two simple test programs and -'support' contains a necessary include file and a C file containing -default error reporting routines that you can use. - - - WORD SIZE AND PC USERS - -SORCERER makefiles assume 32-bit integers. If you have 16-bit -integers, you must turn on preprocessor symbol PC to change wordsize -definitions; see PC32 definition also in config.h. You can add -another "#ifdef" for your machine or specific wordsize (see set.h and -config.h) if your machine is really weird. [SORCERER has not been -adequately tested for portability to non-32-bit machines.] - - BUG REPORTS & QUESTIONS - -Please send bug reports to parrt@parr-research.com. - -If you are interested in sharing your experiences/problems/ -successes/suggestions regarding SORCERER or PCCTS, subscribe to -newsgroup - - comp.compilers.tools.pccts \ No newline at end of file diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsp deleted file mode 100644 index 4466ace4c..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsp +++ /dev/null @@ -1,207 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Sorcerer" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=Sorcerer - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SorcererMSVC50.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SorcererMSVC50.mak" CFG="Sorcerer - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Sorcerer - Win32 Release" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "Sorcerer - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /O2 /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "NDEBUG" /D "LONGFILENAMES" /D "PC" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"./Sorcerer.exe" -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Update executables in BIN directory -PostBuild_Cmds=rename ..\bin\Sorcerer.exe Sorcerer_old.exe \ - copy ..\Sorcerer\Sorcerer.exe ..\bin\ -# End Special Build Tool - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /Zi /Od /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "LONGFILENAMES" /D "PC" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"./Sorcerer.exe" /pdbtype:sept -# Begin Special Build Tool -SOURCE=$(InputPath) -PostBuild_Desc=Update executables in BIN directory -PostBuild_Cmds=rename ..\bin\Sorcerer.exe Sorcerer_old.exe \ - copy ..\Sorcerer\Sorcerer.exe ..\bin\ -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "Sorcerer - Win32 Release" -# Name "Sorcerer - Win32 Debug" -# Begin Source File - -SOURCE=.\cpp.c -# End Source File -# Begin Source File - -SOURCE=.\err.c -# End Source File -# Begin Source File - -SOURCE=.\gen.c -# End Source File -# Begin Source File - -SOURCE=.\globals.c -# End Source File -# Begin Source File - -SOURCE=.\hash.c -# End Source File -# Begin Source File - -SOURCE=.\look.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\scan.c -# End Source File -# Begin Source File - -SOURCE=..\support\set\set.c -# End Source File -# Begin Source File - -SOURCE=.\sor.c -# End Source File -# Begin Source File - -SOURCE=.\sor.g - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -# Begin Custom Build - Generating Parser -InputPath=.\sor.g -InputName=sor - -BuildCmds= \ - ..\bin\antlr -gh -k 2 -gt $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"sor.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -# Begin Custom Build - Generating Parser -InputPath=.\sor.g -InputName=sor - -BuildCmds= \ - ..\bin\antlr -gh -k 2 -gt $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"sor.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsw deleted file mode 100644 index d672b0d5c..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Sorcerer"=.\SorcererMSVC50.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.mak b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.mak deleted file mode 100644 index baf98c9fb..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC50.mak +++ /dev/null @@ -1,725 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Based on SorcererMSVC50.dsp -!IF "$(CFG)" == "" -CFG=Sorcerer - Win32 Debug -!MESSAGE No configuration specified. Defaulting to Sorcerer - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "Sorcerer - Win32 Release" && "$(CFG)" !=\ - "Sorcerer - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SorcererMSVC50.mak" CFG="Sorcerer - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Sorcerer - Win32 Release" (based on\ - "Win32 (x86) Console Application") -!MESSAGE "Sorcerer - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -OUTDIR=.\. -INTDIR=.\. -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "stdpccts.h" "sor.c" "scan.c" "parser.dlg" "mode.h" "err.c"\ - "$(OUTDIR)\Sorcerer.exe" - -!ELSE - -ALL : "DLG - Win32 Release" "ANTLR - Win32 Release" "stdpccts.h" "sor.c"\ - "scan.c" "parser.dlg" "mode.h" "err.c" "$(OUTDIR)\Sorcerer.exe" - -!ENDIF - -!IF "$(RECURSE)" == "1" -CLEAN :"ANTLR - Win32 ReleaseCLEAN" "DLG - Win32 ReleaseCLEAN" -!ELSE -CLEAN : -!ENDIF - -@erase "$(INTDIR)\cpp.obj" - -@erase "$(INTDIR)\err.obj" - -@erase "$(INTDIR)\gen.obj" - -@erase "$(INTDIR)\globals.obj" - -@erase "$(INTDIR)\hash.obj" - -@erase "$(INTDIR)\look.obj" - -@erase "$(INTDIR)\main.obj" - -@erase "$(INTDIR)\scan.obj" - -@erase "$(INTDIR)\set.obj" - -@erase "$(INTDIR)\sor.obj" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(OUTDIR)\Sorcerer.exe" - -@erase "err.c" - -@erase "mode.h" - -@erase "parser.dlg" - -@erase "scan.c" - -@erase "sor.c" - -@erase "stdpccts.h" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "." /I "..\h" /I "..\support\set" /D\ - "NDEBUG" /D "LONGFILENAMES" /D "PC" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D\ - "WIN32" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\SorcererMSVC50.pch" /YX\ - /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=./ -CPP_SBRS=. - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -RSC=rc.exe -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\SorcererMSVC50.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib /nologo /subsystem:console /incremental:no\ - /pdb:"$(OUTDIR)\Sorcerer.pdb" /machine:I386 /out:"$(OUTDIR)\Sorcerer.exe" -LINK32_OBJS= \ - "$(INTDIR)\cpp.obj" \ - "$(INTDIR)\err.obj" \ - "$(INTDIR)\gen.obj" \ - "$(INTDIR)\globals.obj" \ - "$(INTDIR)\hash.obj" \ - "$(INTDIR)\look.obj" \ - "$(INTDIR)\main.obj" \ - "$(INTDIR)\scan.obj" \ - "$(INTDIR)\set.obj" \ - "$(INTDIR)\sor.obj" - -"$(OUTDIR)\Sorcerer.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -SOURCE=$(InputPath) -PostBuild_Desc=Update executables in BIN directory and remove intermediate\ - files -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "DLG - Win32 Release" "ANTLR - Win32 Release"\ - "stdpccts.h" "sor.c" "scan.c" "parser.dlg" "mode.h" "err.c"\ - "$(OUTDIR)\Sorcerer.exe" - del ..\bin\Win32\Antlr.old - rename ..\bin\Win32\Antlr.exe Antlr.old - copy ..\Antlr\Antlr.exe ..\bin\Win32 - del ..\bin\Win32\Dlg.old - rename ..\bin\Win32\Dlg.exe Dlg.old - copy ..\Dlg\dlg.exe ..\bin\Win32 - del ..\bin\Win32\Sorcerer.old - rename ..\bin\Win32\Sorcerer.exe Sorcerer.old - copy ..\Sorcerer\Sorcerer.exe ..\bin\Win32 - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -OUTDIR=.\. -INTDIR=.\. -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -!IF "$(RECURSE)" == "0" - -ALL : "stdpccts.h" "sor.c" "scan.c" "parser.dlg" "mode.h" "err.c"\ - "$(OUTDIR)\Sorcerer.exe" "$(OUTDIR)\SorcererMSVC50.bsc" - -!ELSE - -ALL : "DLG - Win32 Debug" "ANTLR - Win32 Debug" "stdpccts.h" "sor.c" "scan.c"\ - "parser.dlg" "mode.h" "err.c" "$(OUTDIR)\Sorcerer.exe"\ - "$(OUTDIR)\SorcererMSVC50.bsc" - -!ENDIF - -!IF "$(RECURSE)" == "1" -CLEAN :"ANTLR - Win32 DebugCLEAN" "DLG - Win32 DebugCLEAN" -!ELSE -CLEAN : -!ENDIF - -@erase "$(INTDIR)\cpp.obj" - -@erase "$(INTDIR)\cpp.sbr" - -@erase "$(INTDIR)\err.obj" - -@erase "$(INTDIR)\err.sbr" - -@erase "$(INTDIR)\gen.obj" - -@erase "$(INTDIR)\gen.sbr" - -@erase "$(INTDIR)\globals.obj" - -@erase "$(INTDIR)\globals.sbr" - -@erase "$(INTDIR)\hash.obj" - -@erase "$(INTDIR)\hash.sbr" - -@erase "$(INTDIR)\look.obj" - -@erase "$(INTDIR)\look.sbr" - -@erase "$(INTDIR)\main.obj" - -@erase "$(INTDIR)\main.sbr" - -@erase "$(INTDIR)\scan.obj" - -@erase "$(INTDIR)\scan.sbr" - -@erase "$(INTDIR)\set.obj" - -@erase "$(INTDIR)\set.sbr" - -@erase "$(INTDIR)\sor.obj" - -@erase "$(INTDIR)\sor.sbr" - -@erase "$(INTDIR)\vc50.idb" - -@erase "$(INTDIR)\vc50.pdb" - -@erase "$(OUTDIR)\Sorcerer.exe" - -@erase "$(OUTDIR)\Sorcerer.ilk" - -@erase "$(OUTDIR)\Sorcerer.pdb" - -@erase "$(OUTDIR)\SorcererMSVC50.bsc" - -@erase "err.c" - -@erase "mode.h" - -@erase "parser.dlg" - -@erase "scan.c" - -@erase "sor.c" - -@erase "stdpccts.h" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -CPP=cl.exe -CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "." /I "..\h" /I "..\support\set"\ - /D "LONGFILENAMES" /D "PC" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D\ - "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\SorcererMSVC50.pch" /YX\ - /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c -CPP_OBJS=./ -CPP_SBRS=./ - -.c{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_OBJS)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(CPP_SBRS)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -RSC=rc.exe -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(OUTDIR)\SorcererMSVC50.bsc" -BSC32_SBRS= \ - "$(INTDIR)\cpp.sbr" \ - "$(INTDIR)\err.sbr" \ - "$(INTDIR)\gen.sbr" \ - "$(INTDIR)\globals.sbr" \ - "$(INTDIR)\hash.sbr" \ - "$(INTDIR)\look.sbr" \ - "$(INTDIR)\main.sbr" \ - "$(INTDIR)\scan.sbr" \ - "$(INTDIR)\set.sbr" \ - "$(INTDIR)\sor.sbr" - -"$(OUTDIR)\SorcererMSVC50.bsc" : "$(OUTDIR)" $(BSC32_SBRS) - $(BSC32) @<< - $(BSC32_FLAGS) $(BSC32_SBRS) -<< - -LINK32=link.exe -LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ - advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ - odbccp32.lib /nologo /subsystem:console /incremental:yes\ - /pdb:"$(OUTDIR)\Sorcerer.pdb" /debug /machine:I386\ - /out:"$(OUTDIR)\Sorcerer.exe" /pdbtype:sept -LINK32_OBJS= \ - "$(INTDIR)\cpp.obj" \ - "$(INTDIR)\err.obj" \ - "$(INTDIR)\gen.obj" \ - "$(INTDIR)\globals.obj" \ - "$(INTDIR)\hash.obj" \ - "$(INTDIR)\look.obj" \ - "$(INTDIR)\main.obj" \ - "$(INTDIR)\scan.obj" \ - "$(INTDIR)\set.obj" \ - "$(INTDIR)\sor.obj" - -"$(OUTDIR)\Sorcerer.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -SOURCE=$(InputPath) -PostBuild_Desc=Update executables in BIN directory and remove intermediate\ - files -DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep - -ALL : $(DS_POSTBUILD_DEP) - -# Begin Custom Macros -OutDir=.\. -# End Custom Macros - -$(DS_POSTBUILD_DEP) : "DLG - Win32 Debug" "ANTLR - Win32 Debug" "stdpccts.h"\ - "sor.c" "scan.c" "parser.dlg" "mode.h" "err.c" "$(OUTDIR)\Sorcerer.exe"\ - "$(OUTDIR)\SorcererMSVC50.bsc" - del ..\bin\Win32\Antlr.old - rename ..\bin\Win32\Antlr.exe Antlr.old - copy ..\Antlr\Antlr.exe ..\bin\Win32 - del ..\bin\Win32\Dlg.old - rename ..\bin\Win32\Dlg.exe Dlg.old - copy ..\Dlg\dlg.exe ..\bin\Win32 - del ..\bin\Win32\Sorcerer.old - rename ..\bin\Win32\Sorcerer.exe Sorcerer.old - copy ..\Sorcerer\Sorcerer.exe ..\bin\Win32 - echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)" - -!ENDIF - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" || "$(CFG)" ==\ - "Sorcerer - Win32 Debug" - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -"ANTLR - Win32 Release" : - cd "\SDK\pccts\antlr" - $(MAKE) /$(MAKEFLAGS) /F .\AntlrMSVC50.mak CFG="ANTLR - Win32 Release" - cd "..\sorcerer" - -"ANTLR - Win32 ReleaseCLEAN" : - cd "\SDK\pccts\antlr" - $(MAKE) /$(MAKEFLAGS) CLEAN /F .\AntlrMSVC50.mak CFG="ANTLR - Win32 Release"\ - RECURSE=1 - cd "..\sorcerer" - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -"ANTLR - Win32 Debug" : - cd "\SDK\pccts\antlr" - $(MAKE) /$(MAKEFLAGS) /F .\AntlrMSVC50.mak CFG="ANTLR - Win32 Debug" - cd "..\sorcerer" - -"ANTLR - Win32 DebugCLEAN" : - cd "\SDK\pccts\antlr" - $(MAKE) /$(MAKEFLAGS) CLEAN /F .\AntlrMSVC50.mak CFG="ANTLR - Win32 Debug"\ - RECURSE=1 - cd "..\sorcerer" - -!ENDIF - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -"DLG - Win32 Release" : - cd "\SDK\pccts\dlg" - $(MAKE) /$(MAKEFLAGS) /F .\DlgMSVC50.mak CFG="DLG - Win32 Release" - cd "..\sorcerer" - -"DLG - Win32 ReleaseCLEAN" : - cd "\SDK\pccts\dlg" - $(MAKE) /$(MAKEFLAGS) CLEAN /F .\DlgMSVC50.mak CFG="DLG - Win32 Release"\ - RECURSE=1 - cd "..\sorcerer" - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -"DLG - Win32 Debug" : - cd "\SDK\pccts\dlg" - $(MAKE) /$(MAKEFLAGS) /F .\DlgMSVC50.mak CFG="DLG - Win32 Debug" - cd "..\sorcerer" - -"DLG - Win32 DebugCLEAN" : - cd "\SDK\pccts\dlg" - $(MAKE) /$(MAKEFLAGS) CLEAN /F .\DlgMSVC50.mak CFG="DLG - Win32 Debug"\ - RECURSE=1 - cd "..\sorcerer" - -!ENDIF - -SOURCE=.\cpp.c -DEP_CPP_CPP_C=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\sor.h"\ - ".\stdpccts.h"\ - ".\sym.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\cpp.obj" : $(SOURCE) $(DEP_CPP_CPP_C) "$(INTDIR)"\ - "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\cpp.obj" "$(INTDIR)\cpp.sbr" : $(SOURCE) $(DEP_CPP_CPP_C)\ - "$(INTDIR)" "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=.\err.c -DEP_CPP_ERR_C=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\h\err.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\sor.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\err.obj" : $(SOURCE) $(DEP_CPP_ERR_C) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\err.obj" "$(INTDIR)\err.sbr" : $(SOURCE) $(DEP_CPP_ERR_C)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\gen.c -DEP_CPP_GEN_C=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\sor.h"\ - ".\stdpccts.h"\ - ".\sym.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\gen.obj" : $(SOURCE) $(DEP_CPP_GEN_C) "$(INTDIR)"\ - "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\gen.obj" "$(INTDIR)\gen.sbr" : $(SOURCE) $(DEP_CPP_GEN_C)\ - "$(INTDIR)" "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=.\globals.c -DEP_CPP_GLOBA=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\sor.h"\ - ".\stdpccts.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\globals.obj" : $(SOURCE) $(DEP_CPP_GLOBA) "$(INTDIR)"\ - "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\globals.obj" "$(INTDIR)\globals.sbr" : $(SOURCE) $(DEP_CPP_GLOBA)\ - "$(INTDIR)" "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=.\hash.c -DEP_CPP_HASH_=\ - ".\hash.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\hash.obj" : $(SOURCE) $(DEP_CPP_HASH_) "$(INTDIR)" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\hash.obj" "$(INTDIR)\hash.sbr" : $(SOURCE) $(DEP_CPP_HASH_)\ - "$(INTDIR)" - - -!ENDIF - -SOURCE=.\look.c -DEP_CPP_LOOK_=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\sor.h"\ - ".\stdpccts.h"\ - ".\sym.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\look.obj" : $(SOURCE) $(DEP_CPP_LOOK_) "$(INTDIR)"\ - "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\look.obj" "$(INTDIR)\look.sbr" : $(SOURCE) $(DEP_CPP_LOOK_)\ - "$(INTDIR)" "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=.\main.c -DEP_CPP_MAIN_=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\sor.h"\ - ".\stdpccts.h"\ - ".\sym.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"\ - "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" : $(SOURCE) $(DEP_CPP_MAIN_)\ - "$(INTDIR)" "$(INTDIR)\stdpccts.h" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=.\scan.c -DEP_CPP_SCAN_=\ - "..\h\antlr.h"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgauto.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\sor.h"\ - ".\sym.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\scan.obj" : $(SOURCE) $(DEP_CPP_SCAN_) "$(INTDIR)"\ - "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\scan.obj" "$(INTDIR)\scan.sbr" : $(SOURCE) $(DEP_CPP_SCAN_)\ - "$(INTDIR)" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=..\support\set\set.c -DEP_CPP_SET_C=\ - "..\h\pcctscfg.h"\ - "..\support\set\set.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\set.obj" : $(SOURCE) $(DEP_CPP_SET_C) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\set.obj" "$(INTDIR)\set.sbr" : $(SOURCE) $(DEP_CPP_SET_C)\ - "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - -SOURCE=.\sor.c -DEP_CPP_SOR_C=\ - "..\h\antlr.h"\ - "..\h\ast.c"\ - "..\h\ast.h"\ - "..\h\charbuf.h"\ - "..\h\pcctscfg.h"\ - "..\h\dlgdef.h"\ - "..\support\set\set.h"\ - ".\hash.h"\ - ".\mode.h"\ - ".\proto.h"\ - ".\sor.h"\ - ".\sym.h"\ - ".\tokens.h"\ - - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - - -"$(INTDIR)\sor.obj" : $(SOURCE) $(DEP_CPP_SOR_C) "$(INTDIR)" "$(INTDIR)\mode.h" - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - - -"$(INTDIR)\sor.obj" "$(INTDIR)\sor.sbr" : $(SOURCE) $(DEP_CPP_SOR_C)\ - "$(INTDIR)" "$(INTDIR)\mode.h" - - -!ENDIF - -SOURCE=.\sor.g - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -InputPath=.\sor.g -InputName=sor - -"parser.dlg" "mode.h" "stdpccts.h" "sor.c" "scan.c" "err.c" : $(SOURCE)\ - "$(INTDIR)" "$(OUTDIR)" - ..\bin\Win32\antlr -gh -k 2 -gt $(InputName).g - ..\bin\Win32\dlg -C2 parser.dlg scan.c - - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -InputPath=.\sor.g -InputName=sor - -"parser.dlg" "mode.h" "stdpccts.h" "sor.c" "scan.c" "err.c" : $(SOURCE)\ - "$(INTDIR)" "$(OUTDIR)" - ..\bin\Win32\antlr -gh -k 2 -gt $(InputName).g - ..\bin\Win32\dlg -C2 parser.dlg scan.c - - -!ENDIF - - -!ENDIF - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsp deleted file mode 100644 index ab2ce6afc..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsp +++ /dev/null @@ -1,205 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Sorcerer" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=Sorcerer - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SorcererMSVC60.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SorcererMSVC60.mak" CFG="Sorcerer - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Sorcerer - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "Sorcerer - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "SorcererMSVC60" -# PROP Scc_LocalPath ".." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /O2 /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "NDEBUG" /D "LONGFILENAMES" /D "PC" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"./Sorcerer.exe" -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Update executables in BIN directory -PostBuild_Cmds=rename ..\bin\Sorcerer.exe Sorcerer_old.exe copy ..\Sorcerer\Sorcerer.exe ..\bin\ -# End Special Build Tool - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "." -# PROP Intermediate_Dir "." -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /Gm /ZI /Od /I "." /I "..\h" /I "..\support\set" /D "__STDC__" /D "LONGFILENAMES" /D "PC" /D ZZLEXBUFSIZE=65536 /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"./Sorcerer.exe" /pdbtype:sept -# Begin Special Build Tool -SOURCE="$(InputPath)" -PostBuild_Desc=Update executables in BIN directory -PostBuild_Cmds=rename ..\bin\Sorcerer.exe Sorcerer_old.exe copy ..\Sorcerer\Sorcerer.exe ..\bin\ -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "Sorcerer - Win32 Release" -# Name "Sorcerer - Win32 Debug" -# Begin Source File - -SOURCE=.\cpp.c -# End Source File -# Begin Source File - -SOURCE=.\err.c -# End Source File -# Begin Source File - -SOURCE=.\gen.c -# End Source File -# Begin Source File - -SOURCE=.\globals.c -# End Source File -# Begin Source File - -SOURCE=.\hash.c -# End Source File -# Begin Source File - -SOURCE=.\look.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\scan.c -# End Source File -# Begin Source File - -SOURCE=..\support\set\set.c -# End Source File -# Begin Source File - -SOURCE=.\sor.c -# End Source File -# Begin Source File - -SOURCE=.\sor.g - -!IF "$(CFG)" == "Sorcerer - Win32 Release" - -# Begin Custom Build - Generating Parser -InputPath=.\sor.g -InputName=sor - -BuildCmds= \ - ..\bin\antlr -gh -k 2 -gt $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"sor.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ELSEIF "$(CFG)" == "Sorcerer - Win32 Debug" - -# Begin Custom Build - Generating Parser -InputPath=.\sor.g -InputName=sor - -BuildCmds= \ - ..\bin\antlr -gh -k 2 -gt $(InputName).g \ - ..\bin\dlg -C2 parser.dlg scan.c \ - - -"parser.dlg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"mode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"stdpccts.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"sor.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"scan.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"err.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsw deleted file mode 100644 index 432d7aacb..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/SorcererMSVC60.dsw +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Sorcerer"=.\SorcererMSVC60.dsp - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - SorcererMSVC60 - .. - end source code control -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/UPDATES b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/UPDATES deleted file mode 100644 index b1db53ce4..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/UPDATES +++ /dev/null @@ -1,153 +0,0 @@ -1.00B1 Fixes: -Missing includes from antlr.h - -1.00B2 Fixes: -Didn't save _t during (...)? - -1.00B3 Fixes: -Fixed bug that wouldn't allow labels on wildcard nodes -Would dump argument list to some labelled rule refs -Fixed code gen bug with #(. B) as last element of production - -1.00B4 Fixes: -Another teeny-weeny little code gen fix related to "rule > [result]" - -1.00B5 Fixes: -Made tar file create a root directory called sorcerer -Line 465 in gen.c had an 'stdout' where an 'output' was needed. - -1.00B6 Fixes: -K&R function headers were missing a ',' in the argument list -Made the default prototype style the same as how you compiled SORCERER itself. - -1.00B7 -Rik Faith : - [...] patch fixes a bug in sorcerer where the "actions" in the - input file which appeared between the second set of << >>'s (i.e., - the user's main routine) would format poorly in the output file. - -1.00B8: -changed the STreeTry() macro (it's much better now) -added -transform option (double pointers now needed in tree structure) -added ``!'' operator to indicate what is not to be included in tree copy - from input to output tree in transform mode. -Added _result parameter for transform mode -Changed sorcerer.c to errsupport.c; sorcerer.c is now regular support code. -function sorcerer_panic() was added -Added all of the libraries for tree rewrite support - (ast.c slist.c sint.c hash.c sstack.c) - Added a very cool function ast_scan(); check it out -Added @-variables; e.g., @(int i = 3) ... @i = 4; -Added __USE_PROTOS definition in sorcerer.h -SORCERER now reads the config.h file used by ANTLR/DLG. -Uses ast_right(rw) and ast_down(rw) so C/C++ compatible -- also means - C/C++ can have different tree layout and use these as functions to - simulate child-sibling trees. -Fixed: Bad error messages: - a : A | (b)? b; - b : B; - error: infinite recursion from rule a to rule b -Fixed a bug: - Sorcerer a simple tree-parser generator Version 1.00B3 1992-1994 - warning: missing #header statement - test.t, line 3: warning: (...)? predicate in block with one alternative; will genera! - bash$ more test.t - expr: ; - - variable: - #( VARIABLE - ID - ( DOT ID - | UPARROW - | LBRACK - expr - ( COMMA expr - )* - RBRACK - | COLON_COLON ID - )* - ) - ; - -1.00B9: -Fixed support/ast.c so K&R C would compile it. - -1.00B13: -Totally new, cool, simple tree rewriting mechanism. Not many bug fixes - -Made enum def ignore #ifdef #else #endif etc... in #tokdefs - -Added C++ support - -Made h and lib directory - -Changed name: AST_NONTRANSFORM_FIELDS -> AST_REQD_FIELDS - --def-tokens and -proto-file are not valid in C++ mode. - -Changed name: AST -> SORAST in C and C++. - -When you -def-tokens, it generates them ast consts inside class def. - Ref with classname::def. - -All #[] constructor calls must be done in class A { ... } def of grammar - so it knows which to call. Else, put Classname:: on front manually. - -1.00B14 - -[Not completed yet] - -#label -> label; #label is no longer valid. Just use label to access -output node in transform mode. label_in is the input node (for token -references only). - -ast_node, ast_dup -> shallowCopy() (user must define for transform -mode), deepCopy(). - -Fixed the C support functions for ASTs - -#[] -> new SORAST - -token() -> type() (sorry, but had to make more consistent) -setToken() -> setType() (you can just add type() { token(); } if you want). - -Remove guessing gate on actions if no (...)? - -Wildcard as root of tree made SOR bomb - -All the token field refs in PCCTSAST.C -> type() - -ASTBase::double_link didn't check for NULL pointers. - -#if in action caused trouble. - -made action buffer bigger (8k bytes) - -SORCERER had a bug in that it did not update the tree result before -returning sometimes. - -PCCTS_AST::ast_scan() is now non-virtual - -C++ support functions like tail(), bottom(), etc... now use 'this' -pointer rather a passed argument. - -Sorcerer spun when it found identifier+ instead of (identifier)+ in a -tree rule. - -This version corresponds pretty to the state of the book. - -1.00B15 - -All .C files are changed to .cpp. - -ASTBase::dup() and ASTDoublyLinkedBase::dup() now call shallowCopy() -to actually duplicate a node. shallowCopy() can either call a copy -constructor or can just duplicate things right there. - -C++ keyword "template" was used as a variable in some SORCERER files. - -1.00b20 (2-Oct-1998) - -Minor changes as reported in CHANGES_FROM_1.33 of the main pccts -distribution kit. Main reason for change in version number is to -indicate that it matches the new release of pccts 1.33MR15. diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/cpp.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/cpp.c deleted file mode 100644 index 4b232a59a..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/cpp.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * cpp.c -- support for generating C++ output - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - */ -#include "stdpccts.h" -#include "sym.h" -#include "pcctscfg.h" -#include "proto.h" - -void GenCPPClassHeader() -{ - FILE *Parser_h; - char CPPParser_h_Name[MaxFileName+1]; - - strcpy(CPPParser_h_Name, CurClassName); - strcat(CPPParser_h_Name, ".h"); - Parser_h = fopen(OutMetaName(CPPParser_h_Name), "w"); - require(Parser_h != NULL, "can't open parser.h file"); -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(CPPParser_h_Name)); -#endif - - /* Put a gate on the header file */ - fprintf(Parser_h, "#ifndef %s_h\n", CurClassName); - fprintf(Parser_h, "#define %s_h\n", CurClassName); - - gen_info_hdr(Parser_h); - - fprintf(Parser_h, "#include \"%s\"\n", STPARSER_H); - - if ( header_action!=NULL ) - dumpAction(header_action, Parser_h, 0, -1, 0, 1); - - fprintf(Parser_h, "\n"); - fprintf(Parser_h, "class %s : public STreeParser {\n", CurClassName); - fprintf(Parser_h, "protected:\n"); - /* Define @-vars in class */ - if ( AllRefVars!=NULL ) - { - ListNode *p; - for (p = AllRefVars->next; p!=NULL; p=p->next) - { - RefVarRec *r = (RefVarRec *)p->elem; - fprintf(Parser_h, "\t%s;\n", r->decl); - } - } - /* Generate list of tokens if demanded */ - if ( def_tokens ) - { - ListNode *p; - fprintf(Parser_h, "public:\n"); - fprintf(Parser_h, "\tenum STokenType {\n"); - for (p = token_list->next; p!=NULL; p=p->next) - { - SymEntry *t = (SymEntry *) p->elem; - fprintf(Parser_h, - "\t\t%s=%d", t->str, t->token_type); - if ( p->next!=NULL ) fprintf(Parser_h, ",\n"); - else fprintf(Parser_h, "\n"); - } - fprintf(Parser_h, "\t};\n"); - } - fprintf(Parser_h, "public:\n"); - if (NoCtor) { /* MR23 */ - fprintf(Parser_h, "#if 0\n"); - fprintf(Parser_h, "\t// The default ctor has been suppressed\n\t// by the -noctor option.\n\n"); - } - fprintf(Parser_h, " %s();\n", CurClassName); - if (NoCtor) { /* MR23 */ - fprintf(Parser_h, "#endif\n"); - } -/* fprintf(Parser_h, " virtual AST *ast_node(int, char *) {return NULL;}\n");*/ - fprintf(Parser_h, "\n"); - GenRulePrototypes( Parser_h, 1 ); - - if ( class_actions != NULL ) - { - ListNode *p; - for (p = class_actions->next; p!=NULL; p=p->next) - dumpAction( (char *)p->elem, output, 1, -1, 0, 1); - } - - fprintf(Parser_h, "};\n"); - - fprintf(Parser_h, "\n#endif /* %s_h */\n", CurClassName); - fclose(Parser_h); -} - -void GenCPPClassCode() -{ - FILE *Parser_c; - char CPPParser_C_Name[MaxFileName+1]; - - strcpy(CPPParser_C_Name, CurClassName); - strcat(CPPParser_C_Name, CPP_FILE_SUFFIX); - ensure_no_C_file_collisions(CPPParser_C_Name); - Parser_c = fopen(OutMetaName(CPPParser_C_Name), "w"); - require(Parser_c != NULL, "can't open class Parserx.c file"); -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(CPPParser_C_Name)); -#endif - - gen_info_hdr(Parser_c); - fprintf(Parser_c, "#include \"%s.h\"\n\n", CurClassName); - - if (NoCtor) { /* MR23 */ - fprintf(Parser_c, "#if 0\n\n"); - fprintf(Parser_c, "\t// The default ctor has been suppressed\n\t// by the -noctor option.\n\n"); - } - - /* Build constructor (init @-vars) */ - fprintf(Parser_c, "%s::%s()\n{\n", CurClassName, CurClassName); - if ( AllRefVars!=NULL ) - { - ListNode *p; - for (p = AllRefVars->next; p!=NULL; p=p->next) - { - RefVarRec *r = (RefVarRec *)p->elem; - if ( r->init[0]!='\0' ) - fprintf(Parser_c, "\t%s=%s;\n", r->var, r->init); - } - } - fprintf(Parser_c, "}\n\n"); - - if (NoCtor) { /* MR23 */ - fprintf(Parser_c, "#endif\n\n"); - } - fclose(Parser_c); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/err.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/err.c deleted file mode 100644 index 61dfb93fc..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/err.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - * A n t l r S e t s / E r r o r F i l e H e a d e r - * - * Generated from: sor.g - * - * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001 - * Parr Research Corporation - * with Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -/* 23-Sep-97 thm Accomodate user who needs to redefine ZZLEXBUFSIZE */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 8000 -#endif -#include "pcctscfg.h" /* MR20 G. Hobbelt __USE_PROTOS #define */ -#include "charbuf.h" -#include "hash.h" -#include "set.h" -#include "sor.h" -#define AST_FIELDS \ -int token; char text[MaxAtom+1], label[MaxRuleName+1]; \ -char *action; /* if action node, here is ptr to it */ \ -char in,out; \ -char init_action; /* set if Action and 1st action of alt */ \ -int file; int line; /* set for BLOCK, ALT, nonterm nodes */ \ -int upper_range; /* only if T1..T2 found */ \ -GLA *start_state; /* ptr into GLA for this block */ \ -int no_copy; /* copy input ptr to output ptr? */ \ -ListNode *refvars; /* any ref vars defined for this rule */ \ -unsigned char is_root; /* this token is a root #( A ... ) */ -#define zzcr_ast(node, cur, _tok, _text) \ -{(node)->token=_tok; strncpy((node)->text, _text,MaxAtom);} -#define USER_ZZSYN -#define zzAST_DOUBLE -extern int define_num; -#define LL_K 2 -#define zzSET_SIZE 16 -#include "antlr.h" -#include "ast.h" -#include "tokens.h" -#include "dlgdef.h" -#include "err.h" - -ANTLRChar *zztokens[118]={ - /* 00 */ "Invalid", - /* 01 */ "Eof", - /* 02 */ "RExpr", - /* 03 */ "\\n|\\r|\\r\\n", - /* 04 */ "\\~[]", - /* 05 */ "~[\\n\\r\"\\]+", - /* 06 */ "\"", - /* 07 */ "\\n|\\r|\\r\\n", - /* 08 */ "\\~[]", - /* 09 */ "~[\\n\\r\"\\]+", - /* 10 */ "'", - /* 11 */ "\\n|\\r|\\r\\n", - /* 12 */ "\\~[]", - /* 13 */ "~[\\n\\r'\\]+", - /* 14 */ "\\*/", - /* 15 */ "\\*", - /* 16 */ "\\n|\\r|\\r\\n", - /* 17 */ "~[\\n\\r\\*]+", - /* 18 */ "\\n|\\r|\\r\\n", - /* 19 */ "~[\\n\\r]+", - /* 20 */ "\\n|\\r|\\r\\n", - /* 21 */ "~[\\n\\r]+", - /* 22 */ "\\*/", - /* 23 */ "\\*", - /* 24 */ "\\n|\\r|\\r\\n", - /* 25 */ "~[\\n\\r\\*]+", - /* 26 */ "~[\\)]+ \\)", - /* 27 */ "Action", - /* 28 */ "PassAction", - /* 29 */ "\\n|\\r|\\r\\n", - /* 30 */ "\\>", - /* 31 */ "#[_a-zA-Z][_a-zA-Z0-9]*", - /* 32 */ "#\\[\\]", - /* 33 */ "#\\(\\)", - /* 34 */ "#\\[", - /* 35 */ "#\\(", - /* 36 */ "#", - /* 37 */ "\\)", - /* 38 */ "\\[", - /* 39 */ "\\(", - /* 40 */ "\\\\]", - /* 41 */ "\\\\)", - /* 42 */ "\\>", - /* 43 */ "'", - /* 44 */ "\"", - /* 45 */ "\\#", - /* 46 */ "\\~[\\]\\)>#]", - /* 47 */ "/", - /* 48 */ "/\\*", - /* 49 */ "\\*/", - /* 50 */ "//", - /* 51 */ "\\@\\(", - /* 52 */ "\\@", - /* 53 */ "[a-zA-Z_]+\\(", - /* 54 */ "[a-zA-Z_]+", - /* 55 */ "~[a-zA-Z_\\n\\r\\)\\(\\#\\>\\]\\[\"'/\\@]+", - /* 56 */ "[\\t\\ ]+", - /* 57 */ "\\n|\\r|\\n\\r", - /* 58 */ "\\[", - /* 59 */ "\\<\\<", - /* 60 */ "\"", - /* 61 */ "/\\*", - /* 62 */ "\\*/", - /* 63 */ "//", - /* 64 */ "\\>\\>", - /* 65 */ "Header", - /* 66 */ "Tokdef", - /* 67 */ "BLOCK", - /* 68 */ "ALT", - /* 69 */ "LABEL", - /* 70 */ "OPT", - /* 71 */ "POS_CLOSURE", - /* 72 */ "CLOSURE", - /* 73 */ "WILD", - /* 74 */ "PRED_OP", - /* 75 */ "BT", - /* 76 */ "RULE", - /* 77 */ "REFVAR", - /* 78 */ "atomic-element", - /* 79 */ "rule-header", - /* 80 */ "\\}", - /* 81 */ "class", - /* 82 */ "NonTerm", - /* 83 */ "Token", - /* 84 */ "!", - /* 85 */ "\\<", - /* 86 */ "\\>", - /* 87 */ ";", - /* 88 */ "\\|", - /* 89 */ "\\(", - /* 90 */ "\\)", - /* 91 */ "..", - /* 92 */ "#[A-Za-z0-9_]*", - /* 93 */ "\\*/", - /* 94 */ "\\*", - /* 95 */ "\\n|\\r|\\r\\n", - /* 96 */ "~[\\n\\r\\*]+", - /* 97 */ "\\n|\\r|\\r\\n", - /* 98 */ "~[\\n\\r]+", - /* 99 */ "[\\t\\ ]+", - /* 100 */ "\\n|\\r|\\r\\n", - /* 101 */ "//", - /* 102 */ "/\\*", - /* 103 */ "#ifndef", - /* 104 */ "#ifdef", - /* 105 */ "#else", - /* 106 */ "#define", - /* 107 */ "#endif", - /* 108 */ "ID", - /* 109 */ "INT", - /* 110 */ "enum", - /* 111 */ "\\{", - /* 112 */ "=", - /* 113 */ ",", - /* 114 */ "DLGminToken", - /* 115 */ "DLGmaxToken", - /* 116 */ "\\}", - /* 117 */ ";" -}; -SetWordType zzerr1[16] = {0x2,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x0,0x0,0x7,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr2[16] = {0x2,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x0,0x0,0x1,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType setwd1[118] = {0x0,0xfe,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xbe,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x81,0x81,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x9e,0x82,0x8e,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr3[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0xc,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr4[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x80,0x10,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr5[16] = {0x0,0x0,0x0,0x10, 0x0,0x0,0x0,0x0, 0x0,0x0,0x20,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr6[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x80,0x0,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr7[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x20,0x0,0x40,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr8[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x91,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType setwd2[118] = {0x0,0x23,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xa3,0xc,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x1,0x1,0x0,0x0,0x14,0x80, - 0x0,0x0,0x80,0x0,0x80,0x0,0x0,0x0, - 0x0,0xe3,0x1,0xa3,0x80,0x0,0xc,0x14, - 0xc0,0x80,0x80,0xc0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr9[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x81,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr10[16] = {0x2,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0xc0,0xcd,0x91,0xf, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr11[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x81,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr12[16] = {0x0,0x0,0x0,0x18, 0x0,0x0,0x0,0x0, 0x40,0x48,0xf1,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr13[16] = {0x0,0x0,0x0,0x10, 0x0,0x0,0x0,0x0, 0x0,0x0,0x20,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType setwd3[118] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x4d,0xc8,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4d, - 0x0,0x0,0x4d,0x8,0x49,0x0,0x0,0x0, - 0x0,0x78,0x0,0x4f,0x4f,0x8,0xc8,0x48, - 0x78,0x78,0x4d,0x78,0x8,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr14[16] = {0x0,0x0,0x0,0x18, 0x0,0x0,0x0,0x0, 0x40,0x48,0xe1,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr15[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0xc1,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr16[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x4c,0x81,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr17[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0xc0,0x4d,0x81,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr18[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x91,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr19[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x40,0x0,0x2, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr20[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0xc,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr21[16] = {0x0,0x0,0x0,0x18, 0x0,0x0,0x0,0x0, 0x40,0x48,0xf1,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr22[16] = {0x0,0x0,0x0,0x10, 0x0,0x0,0x0,0x0, 0x0,0x0,0x20,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType setwd4[118] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x7f,0xc0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f, - 0x0,0x0,0x7f,0x0,0x7f,0x0,0x0,0x0, - 0x0,0x7f,0x0,0x7f,0x7f,0x0,0xc0,0x41, - 0x7f,0x7f,0x7f,0x7f,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr23[16] = {0x0,0x0,0x0,0x18, 0x0,0x0,0x0,0x0, 0x40,0x48,0xe1,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr24[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0xc1,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr25[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x91,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr26[16] = {0x2,0x0,0x0,0x18, 0x0,0x0,0x0,0x0, 0x40,0x8,0x81,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr27[16] = {0x2,0x0,0x0,0x18, 0x0,0x0,0x0,0x0, 0x40,0x48,0x81,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr28[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x91,0x7, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr29[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x91,0xf, - 0x0,0x0,0x0,0x0}; -SetWordType setwd5[118] = {0x0,0x8,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xff,0x8,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff, - 0x0,0x0,0xf7,0x0,0xff,0x0,0x0,0x0, - 0x0,0xff,0x0,0xf7,0xf7,0x0,0x0,0x1, - 0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr30[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x10,0x6, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr31[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x10,0xe, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr32[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x10,0x6, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr33[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0xc,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr34[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x10,0x6, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr35[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x10,0xe, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr36[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x40,0x48,0x10,0x6, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr37[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x2,0x8,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr38[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x40,0x0,0x0, - 0x0,0x0,0x0,0x0}; -SetWordType zzerr39[16] = {0x0,0x0,0x0,0x8, 0x0,0x0,0x0,0x0, 0x60,0x48,0x10,0xe, - 0x0,0x0,0x0,0x0}; -SetWordType setwd6[118] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xef,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xef, - 0x0,0x0,0xef,0x0,0xef,0x0,0x0,0x0, - 0x0,0x0,0x0,0xff,0xff,0x1,0x0,0x0, - 0x0,0x0,0xef,0xef,0x1,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr40[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x44,0x0,0x0}; -SetWordType zzerr41[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x80,0x40,0x0,0x0}; -SetWordType zzerr42[16] = {0x2,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x80,0x44,0x0,0x0}; -SetWordType zzerr43[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x90,0x0,0x0}; -SetWordType setwd7[118] = {0x0,0xc0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x1d,0x8,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1d, - 0x0,0x0,0x1d,0x8,0x19,0x0,0x0,0x0, - 0x0,0x18,0x0,0x1f,0x1f,0x8,0x8,0x8, - 0x10,0x18,0x1d,0x18,0x8,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x20, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -SetWordType zzerr44[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x13,0x0}; -SetWordType zzerr45[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x13,0x0}; -SetWordType zzerr46[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x13,0x0}; -SetWordType zzerr47[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x0,0x13,0x0}; -SetWordType zzerr48[16] = {0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0, - 0x0,0x10,0x1e,0x0}; -SetWordType setwd8[118] = {0x0,0x20,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x20, - 0x0,0x0,0x1f,0x0,0x0,0x1f,0x0}; diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/gen.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/gen.c deleted file mode 100644 index 4a67a1ecb..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/gen.c +++ /dev/null @@ -1,1278 +0,0 @@ -/* Code generator for SORCERER - * - * Translate sorcerer rules (in intermediate trees) to C / C++ - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - * - * The latest (October 1994) transformation mode works as follows: - * - * o All elements set _tresult, a function-scoped var - * o All rules are passed the address of a SORAST ptr - * called '_result' that is set at the end of each - * alternative. The return tree is guaranteed to - * be complete only at this point. - * o Each alt AND #(...) tree have their own root (_r), - * sibling (_s) and tail/end pointers (_e). #(...) trees - * set _tresult just before exiting their scope. Hence, - * #(...) are just like elements--they set _tresult. - * o At the end of a rule, *_result is set to _tresult. - * o After each root node ref, a _mkroot(&_r,&_s,&_e,_tresult) - * is generated to set the pointers. - * o After each child node ref, a _mkchild(&_r,&_s,&_e,_tresult) - * is generated to set the pointers. - * o After each rule ref, a _mkroot(&_r,&_s,&_e,_tresult) - * is generated to set the pointers. - * o After each #(...) ref, a _mkroot(&_r,&_s,&_e,_tresult) - * is generated to set the pointers. - * o token references: gen a _tresult=ast_dup(_t); - * (only if labeled, however). - * o rules or alts with nocopy set don't construct trees. - */ -#include "pcctscfg.h" -#include "stdpccts.h" -#include "sym.h" -#include "proto.h" - -static outfile = -1; -static char *current_rule; -static ListNode *labels_for_func = NULL; -static AST *whichRule; -static int tabs=0; -#define TAB {int i=1; for (;i<=tabs;i++) {putc('\t', output);}} - -#define PastWhiteSpace(s) while (*(s) == ' ' || *(s) == '\t') {s++;} - - -static void -#ifdef __USE_PROTOS -go_down(int nl) -#else -go_down(nl) -int nl; -#endif -{ - fprintf(output, "_DOWN;"); - if ( nl ) fprintf(output, "\n"); -} - -static void -#ifdef __USE_PROTOS -go_right(int nl) -#else -go_right(nl) -int nl; -#endif -{ - fprintf(output, "_RIGHT;"); - if ( nl ) fprintf(output, "\n"); -} - -void -#ifdef __USE_PROTOS -gen_info_hdr( FILE *f ) -#else -gen_info_hdr( f ) -FILE *f; -#endif -{ - fprintf(f, "/*\n"); - fprintf(f, " * S O R C E R E R T r a n s l a t i o n H e a d e r\n"); - fprintf(f, " *\n"); - fprintf(f, " * SORCERER Developed by Terence Parr, Aaron Sawdey, & Gary Funck\n"); - fprintf(f, " * Parr Research Corporation, Intrepid Technology, University of Minnesota\n"); - fprintf(f, " * 1992-1994\n"); - fprintf(f, " * SORCERER Version %s\n", VersionText); - fprintf(f, " */\n"); -} - -void -#ifdef __USE_PROTOS -gen_hdr_CPP( void ) -#else -gen_hdr_CPP( ) -#endif -{ - char CPPParser_h_Name[MaxFileName+1]; - - gen_info_hdr(output); - fprintf(output, "#define SORCERER_VERSION\t%s\n", VersionNumber); - if ( transform ) fprintf(output, "#define SORCERER_TRANSFORM\n"); - else fprintf(output, "#define SORCERER_NONTRANSFORM\n"); -/* Don't gen header action here as it's in the ClassName.h - if ( header_action!=NULL ) - dumpAction(header_action, output, 0, -1, 0, 1); */ - fprintf(output, "#include \"%s\"\n", STPARSER_H); - - if ( UserDefdTokens ) fprintf(output, "#include \"%s\"\n", tokdefs_file); - strcpy(CPPParser_h_Name, CurClassName); - strcat(CPPParser_h_Name, ".h"); - fprintf(output, "#include \"%s\"\n", CPPParser_h_Name); -} - -void -#ifdef __USE_PROTOS -gen_hdr_C( void ) -#else -gen_hdr_C( ) -#endif -{ - if ( Inline ) return; - gen_info_hdr(output); - fprintf(output, "#define SORCERER_VERSION\t%s\n", VersionNumber); - if ( transform ) fprintf(output, "#define SORCERER_TRANSFORM\n"); - else fprintf(output, "#define SORCERER_NONTRANSFORM\n"); - fprintf(output, "#include \"pcctscfg.h\"\n"); - fprintf(output, "#include \n"); - fprintf(output, "#include \n"); - if ( Prefix[0]!='\0' ) - { - fprintf(output, "/* rename error routines; used in macros, must use /lib/cpp */\n"); - fprintf(output, "#define mismatched_token %smismatched_token\n", Prefix); - fprintf(output, "#define mismatched_range %smismatched_range\n", Prefix); - fprintf(output, "#define missing_wildcard %smissing_wildcard\n", Prefix); - fprintf(output, "#define no_viable_alt %sno_viable_alt\n", Prefix); - fprintf(output, "#define sorcerer_panic %ssorcerer_panic\n", Prefix); - } - if ( header_action!=NULL ) - dumpAction(header_action, output, 0, -1, 0, 1); - - /* make a #define for the STreeParser containing the ref vars */ - if ( AllRefVars!=NULL ) - { - ListNode *p; - fprintf(output, "#define _REFVARS \\\n"); - for (p = AllRefVars->next; p!=NULL; p=p->next) - { - RefVarRec *r = (RefVarRec *)p->elem; - fprintf(output, "\t%s; \\\n", r->decl); - } - fprintf(output, "\n\n"); - } - - fprintf(output, "#include \"sorcerer.h\"\n"); - if ( UserDefdTokens ) fprintf(output, "#include \"%s\"\n", tokdefs_file); - if ( GenProtoFile!=NULL ) fprintf(output, "#include \"%s\"\n", GenProtoFile); - else GenRulePrototypes( output, 0 ); - if ( transform ) fprintf(output, "#include \"sorcerer.c\"\n"); -} - -void -#ifdef __USE_PROTOS -gen_hdr( void ) -#else -gen_hdr( ) -#endif -{ - if ( GenCPP ) gen_hdr_CPP(); - else gen_hdr_C(); -} - -void -#ifdef __USE_PROTOS -gen_hdr1( void ) -#else -gen_hdr1( ) -#endif -{ - if ( !Inline ) - { - gen_hdr(); - } - - if ( GenCPP ) - { -/* fprintf(output, "#include \"%s\"\n", STREESUPPORT_C); */ - } - else { - /* make a func to init the ref vars with inits */ - fprintf(output, "\nvoid\n"); - fprintf(output, "#ifdef __USE_PROTOS\n"); - fprintf(output, "_refvar_inits(STreeParser *p)\n"); - fprintf(output, "#else\n"); - fprintf(output, "_refvar_inits(p)\n"); - fprintf(output, "STreeParser *p;\n"); - fprintf(output, "#endif\n"); - fprintf(output, "{\n"); - if ( AllRefVars!=NULL ) - { - ListNode *p; - for (p = AllRefVars->next; p!=NULL; p=p->next) - { - RefVarRec *r = (RefVarRec *)p->elem; - if ( r->init[0]!='\0' ) - fprintf(output, "\tp->%s=%s;\n", r->var, r->init); - } - } - fprintf(output, "}\n\n"); - } - - if ( before_actions != NULL ) - { - ListNode *p; - for (p = before_actions->next; p!=NULL; p=p->next) - dumpAction( (char *)p->elem, output, 0, -1, 0, 1); - } -} - -void -#ifdef __USE_PROTOS -gen( AST *t ) -#else -gen( t ) -AST *t; -#endif -{ - if ( t==NULL ) return; - while ( t!=NULL && t->token == NonTerm ) - { - if ( labels_for_func != NULL ) - { - /* reset 'defined' flag for previously defined labels and free list */ - ListNode *p, *q; - for (p = labels_for_func->next; p!=NULL; p=q) - { - SymEntry *s = (SymEntry *)p->elem; - s->defined = 0; - q = p->next; - free(p); - } - free(labels_for_func); - labels_for_func = NULL; - } - gen_rule(t); - t = t->right; - } - - if ( after_actions != NULL ) - { - ListNode *p; - for (p = after_actions->next; p!=NULL; p=p->next) - dumpAction( (char *)p->elem, output, 0, -1, 0, 1); - } - fclose(output); -} - -void -#ifdef __USE_PROTOS -gen_rule( AST *t ) -#else -gen_rule( t ) -AST *t; -#endif -{ - SymEntry *s; - - if ( t==NULL ) return; - whichRule=t; - s = (SymEntry *) hash_get(symbols, t->text); - require(s!=NULL, "gen_rule: sym tab broken"); - - if ( t->file != outfile ) /* open new output file if need to */ - { - if (strcmp(FileStr[t->file], "stdin")==0) output = stdout; - else { - if ( output != NULL ) fclose( output ); - output = fopen(OutMetaName(outname(FileStr[t->file])), "w"); - require(output != NULL, "gen_rule: can't open output file"); -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(outname(FileStr[t->file]))); -#endif - } - if ( outfile == -1 ) gen_hdr1(); - else gen_hdr(); - outfile = t->file; - } - - fprintf(output, "\n"); - current_rule = t->text; - GenRulePrototype(output, t, s, 0); - - /* What locals do we need? */ - tabs=1; - if ( GenCPP ) fprintf(output, "{\n\tSORASTBase *_t = *_root;\n"); - else fprintf(output, "{\n\tSORAST *_t = *_root;\n"); - if ( s->rt!=NULL ) fprintf(output, "\t%s;\n", s->rt); - if ( transform ) - { - if ( GenCPP ) fprintf(output, "\tSORASTBase *_tresult=NULL;\n"); - else fprintf(output, "\tSORAST *_tresult=NULL;\n"); - fprintf(output, "\tTREE_CONSTR_PTRS;\n"); - } - - if ( t->refvars!=NULL ) - { - ListNode *p; - for (p = t->refvars->next; p!=NULL; p=p->next) - { - RefVarRec *r = (RefVarRec *)p->elem; - if ( !r->global ) { - TAB; - dump_prefixed_decl("_save_", r->decl, output); - if ( GenCPP ) fprintf(output, "=%s;\n", r->var); - else fprintf(output, "=_parser->%s;\n", r->var); - } - } - } - - define_labels_in_block(t->down); - if ( found_guess_block ) fprintf(output, "\t_GUESS_BLOCK;\n"); - if ( transform ) fprintf(output, " *_result = NULL;\n"); - gen_block(t->down, BLOCK); - TAB; - fprintf(output, "*_root = _t;\n"); - - /* reset any ref vars defined in this routine */ - if ( t->refvars!=NULL ) - { - ListNode *p; - for (p = t->refvars->next; p!=NULL; p=p->next) - { - RefVarRec *r = (RefVarRec *)p->elem; - if ( !r->global ) - { - if ( GenCPP ) fprintf(output, "\t%s = _save_%s;\n", r->var, r->var); - else fprintf(output, "\t_parser->%s = _save_%s;\n", r->var, r->var); - } - } - } - - /* set result of tree copying efforts if no ! on rule */ - if ( transform&&!t->no_copy ) { - TAB; - /* The 'if' check in front of the *_result assignment ensures - * that if someone sets the result before here, don't mess with - * it. This assignment is the default. - */ - fprintf(output, "if ( (*_result) == NULL ) *_result = _r;\n"); - } - - /* send back and return value */ - if ( s->rt!=NULL ) - { - char *str = s->rt; - TAB; - fprintf(output, "return "); - DumpNextNameInDef(&str, output); - fprintf(output, ";\n"); - } - - tabs=0; - fprintf(output, "}\n"); -} - -/* - * The lookahead is stored in the 1st node of each alt of the block. - * The Lookahead of what follows (for CLOSURE and OPT) blocks, is stored - * in the node which branches over the enclosed, optional block. - */ -void -#ifdef __USE_PROTOS -gen_block( AST *q, int block_type ) -#else -gen_block( q, block_type ) -AST *q; -int block_type; -#endif -{ - AST *t = q, *u, *g; - GLA *start_state, *follow=NULL; - int need_right_curly=0, guess_block_in_prev_alt=0, num_alts=0; - require(q!=NULL, "gen_block: NULL block"); - require(q->start_state!=NULL, "gen_block: NULL start state"); - - start_state = t->start_state->p1; - require(start_state!=NULL, "gen_block: no GLA start state for AST block"); - - switch ( block_type ) { - case PRED_OP : - TAB; - fprintf(output, "{_SAVE; TREE_CONSTR_PTRS;\n"); - break; - case CLOSURE : - TAB; - fprintf(output, "{int _done=0;\n"); - TAB; - fprintf(output, "while ( !_done ) {\n"); - tabs++; - break; - case POS_CLOSURE : - TAB; - fprintf(output, "{int _done=0;\n"); - TAB; - fprintf(output, "do {\n"); - tabs++; - } - - /* Error if (...)? with only one alt */ - for (u = q->down; u!=NULL; u=u->right ) {num_alts++;} - g = first_guess_block(q->down); - if ( num_alts==1 && g!=NULL ) - { - warnFL("(...)? predicate in block with one alternative; will generate bad code", - FileStr[g->file], g->line); - } - - t = t->down; /* move down to first alt */ - while ( t!=NULL && t->token == ALT ) - { - require(start_state!=NULL, "gen_block: invalid GLA for block"); - if ( t!=q->down ) { - TAB; - fprintf(output, "else {\n"); - need_right_curly++; - } - code_for_guess_block(t, &guess_block_in_prev_alt); - TAB; - fprintf(output, "if ("); - /* To prevent/detect infinite recursion, ensure 'visited' flag is set - * on node starting this alt - */ - start_state->visited = 1; - start_state->lookahead = gen_prediction_expr(t, start_state->p1); - start_state->visited = 0; - fprintf(output, " ) {\n"); - tabs++; - gen_alt(t); - tabs--; TAB; - fprintf(output, "}\n"); - t = t->right; /* move to next alt in AST */ - start_state = start_state->p2; /* move to next alt in GLA */ - } - - switch ( block_type ) { - case OPT : - case CLOSURE : - follow = q->start_state->p2; - break; - case POS_CLOSURE : - follow = q->start_state->next; - } - - if ( block_type == OPT || block_type == CLOSURE || block_type == POS_CLOSURE ) - { - TAB; - fprintf(output, "else {\n"); - need_right_curly++; - TAB; - fprintf(output, "if ("); - /* what follows the block? */ - q->start_state->visited = 1; - q->start_state->lookahead = gen_prediction_expr(NULL, follow); - q->start_state->visited = 0; - fprintf(output, " ) {\n"); - if ( block_type != OPT ) - { - tabs++; TAB; - fprintf(output, "_done = 1;\n"); - tabs--; - } - TAB; - fprintf(output, "}\n"); - } - - /* Generate error clause */ - TAB; - fprintf(output, "else {\n"); - /* generate the _GUESS_FAIL even if no (..)? found because calling - * routine may be using STreeTest() - */ - tabs++; - TAB; - if ( GenCPP ) fprintf(output, "if ( guessing ) _GUESS_FAIL;\n"); - else fprintf(output, "if ( _parser->guessing ) _GUESS_FAIL;\n"); - TAB; - if ( GenCPP ) fprintf(output, "no_viable_alt(\"%s\", _t);\n", current_rule); - else fprintf(output, "no_viable_alt(_parser, \"%s\", _t);\n", current_rule); - tabs--; - TAB; - fprintf(output, "}\n"); - if ( transform ) { TAB; fprintf(output, " _tresult = _r;\n"); } - - for (;need_right_curly>0; need_right_curly--) - { - TAB; - fprintf(output, "}\n"); - } - - switch ( block_type ) { - case BLOCK : - break; - case CLOSURE : - tabs--; - TAB; fprintf(output, "}\n"); -/* if ( transform ) fprintf(output, " _tresult = _r;\n"); */ - TAB; fprintf(output, "}\n"); - break; - case POS_CLOSURE : - tabs--; - TAB; - fprintf(output, "} while ( !_done );\n"); -/* if ( transform ) { TAB; fprintf(output, " _tresult = _r;\n"); } */ - TAB; - fprintf(output, "}\n"); - break; - case PRED_OP : - TAB; - fprintf(output, "_RESTORE;\n"); -/* if ( transform ) { TAB; fprintf(output, " _tresult = _r;\n"); } */ - TAB; fprintf(output, "}\n"); - TAB; fprintf(output, "_GUESS_DONE;\n"); - break; - } - - test_block_consistency(q, block_type); -} - -void -#ifdef __USE_PROTOS -gen_alt( AST *t ) -#else -gen_alt( t ) -AST *t; -#endif -{ - require(t!=NULL && t->token==ALT, "gen_alt: invalid alt"); - - t = t->down; - if ( t==NULL ) return; - if ( t->token==Action ) t->init_action = 1; - gen_tree_pattern(t); - - /* find last element of alternative to see if it's a simple token */ - while ( t->right!=NULL ) { t = t->right; } - if ( t->down==NULL && (t->token == Token || t->token == WILD) ) - { TAB; go_right(1); } -} - -void -#ifdef __USE_PROTOS -gen_tree_pattern( AST *t ) -#else -gen_tree_pattern( t ) -AST *t; -#endif -{ - while ( t != NULL ) - { - /* could be root of a tree, check it */ - if ( t->down != NULL && (t->token==Token||t->token==WILD) ) { - TAB; - fprintf(output, "{_SAVE; TREE_CONSTR_PTRS;\n"); - } - gen_element(t); - if ( t->down != NULL ) { - if ( t->token == Token || t->token==WILD ) - { - gen_tree_pattern(t->down); /* only token/wildcard can be root of tree */ - TAB; - fprintf(output, "_RESTORE;"); - if ( transform ) fprintf(output, " _tresult = _r;"); - fprintf(output, "\n"); - TAB; fprintf(output, "}\n"); - /* link in result of #(...) */ - if ( transform && !whichRule->no_copy ) { - TAB; fprintf(output, "_mkchild(&_r,&_s,&_e,_tresult);\n"); - } - TAB; go_right(1); - } - } - t = t->right; - } -} - -void -#ifdef __USE_PROTOS -gen_element( AST *t ) -#else -gen_element( t ) -AST *t; -#endif -{ - char *res; - require(t!=NULL, "gen_element: NULL tree pointer"); - - switch ( t->token ) - { - case Token : - TAB; - if ( t->upper_range!=0 ) - fprintf(output, "_MATCHRANGE(%s,%s);", - t->text, token_dict[t->upper_range]); - else fprintf(output, "_MATCH(%s);", t->text); - fprintf(output, "\n"); - /* Make copy of token if transform && (copy or (labeled&&!copy)) */ - if ( transform && (t->label[0]!='\0'||!t->no_copy) ) { - TAB; - if ( GenCPP ) - fprintf(output, "_tresult=_t->shallowCopy();\n"); - else - fprintf(output, "_tresult=ast_dup_node(_t);\n"); - } - if ( transform && !t->no_copy ) { - if ( t->is_root ) - fprintf(output, " _mkroot(&_r,&_s,&_e,_tresult);\n"); - else - fprintf(output, " _mkchild(&_r,&_s,&_e,_tresult);\n"); - } - /* Do Label if any */ - if ( transform ) { /* label is output, label_in is input */ - if ( t->label[0]!='\0' ) - { - TAB; - fprintf(output, - "%s=(SORAST *)_tresult; %s_in=(SORAST *)_t;\n", - t->label,t->label); - } - } else { - if ( t->label[0]!='\0' ) - { TAB; fprintf(output, "%s=(SORAST *)_t;\n", t->label); } - } - /* Move tree parser pointer */ - if ( t->down != NULL ) { TAB; go_down(1); } - else if ( t->right != NULL ) { TAB; go_right(1); } - break; - case WILD : - TAB; - fprintf(output, "_WILDCARD;"); - /* Make copy of token or tree if transform */ - if ( transform ) { - TAB; - if ( GenCPP ) - fprintf(output, "_tresult=_t->deepCopy();"); - else - fprintf(output, "_tresult=ast_dup(_t);"); - /* wildcard can't be root, must be child */ - if ( !t->no_copy ) { - if ( t->is_root ) - fprintf(output, " _mkroot(&_r,&_s,&_e,_tresult);"); - else - fprintf(output, " _mkchild(&_r,&_s,&_e,_tresult);"); - } - } - fprintf(output, "\n"); - if ( transform ) { - if ( t->label[0]!='\0' ) - { - TAB; - fprintf(output, - "%s=(SORAST *)_tresult; %s_in=(SORAST *)_t;\n", - t->label,t->label); - } - } else { - if ( t->label[0]!='\0' ) - { TAB; fprintf(output, "%s=(SORAST *)_t;\n", t->label); } - } - if ( t->down != NULL ) { TAB; go_down(1); } - else if ( t->right != NULL ) { TAB; go_right(1); } - break; - case NonTerm : - TAB; - /* For nontransform mode, do labels first */ - if (t->label[0]!='\0') - fprintf(output, "%s=(SORAST *)_t; ", t->label); - if ( t->out ) { - if ( t->in ) fprintf(output, "%s=", t->down->right->text); - else fprintf(output, "%s=", t->down->text); - } - fprintf(output, "%s%s", Prefix, t->text); - if ( transform ) res = ", &_tresult"; else res = ""; - if ( GenCPP ) { - if ( t->in ) fprintf(output, "(&_t%s, %s);", - res, t->down->text); - else fprintf(output, "(&_t%s);", res); - } - else { - if ( t->in ) fprintf(output, "(_parser, &_t%s, %s);", - res, t->down->text); - else fprintf(output, "(_parser, &_t%s);", res); - } - fprintf(output, "\n"); - if (transform && t->label[0]!='\0') - { - TAB; - fprintf(output, "%s=(SORAST *)_tresult;\n", t->label); - } - /* Link in result of rule */ - if ( transform&&!t->no_copy ) { - TAB; - fprintf(output, "_mkchild(&_r,&_s,&_e,_tresult);\n"); - } - break; - case Action : - if ( !t->init_action && found_guess_block ) { - TAB; - if ( GenCPP ) fprintf(output, "if ( !guessing ) {\n"); - else fprintf(output, "if ( !_parser->guessing ) {\n"); - } - dumpAction(t->action, output, tabs, 0, 0, 1); - if ( !t->init_action && found_guess_block ) {TAB; fprintf(output, "}\n");} - break; - case CLOSURE : - gen_block(t->down, CLOSURE); - break; - case POS_CLOSURE : - gen_block(t->down, POS_CLOSURE); - break; - case OPT : - gen_block(t->down, OPT); - break; - case BLOCK : - gen_block(t, BLOCK); - break; - case PRED_OP : - require(t->up!=NULL, "define_labels_in_element: GLA is broken"); - if ( t->up->down==t ) { - if ( t->down->token == BLOCK ) gen_block(t->down, PRED_OP); - } - else if ( t->up->down->token==Action && t->up->down->right==t ) { - if ( t->down->token == BLOCK ) gen_block(t->down, PRED_OP); - } - else { - warnFL("predicate not at beginning of alternative; ignored", - FileStr[t->file], t->line); - } - break; - default : - fatal(eMsgd("invalid elemental node type: %d", t->token)); - } -} - -/* walk the block of a rule and define all labels to be "SORAST *label_i" */ -void -#ifdef __USE_PROTOS -define_labels_in_block( AST *t ) -#else -define_labels_in_block( t ) -AST *t; -#endif -{ - require(t!=NULL, "define_labels_in_block: NULL tree pointer"); - require(t->token==BLOCK, "define_labels_in_block: invalid block"); - t = t->down; - while ( t!=NULL ) - { - define_labels_in_alt(t); - t = t->right; - } -} - -void -#ifdef __USE_PROTOS -define_labels_in_alt( AST *t ) -#else -define_labels_in_alt( t ) -AST *t; -#endif -{ - require(t!=NULL, "define_labels_in_alt: NULL tree pointer"); - require(t->token==ALT, "gen_alt: invalid alt"); - - define_labels_in_tree(t->down); -} - -void -#ifdef __USE_PROTOS -define_labels_in_tree( AST *t ) -#else -define_labels_in_tree( t ) -AST *t; -#endif -{ - while ( t != NULL ) - { - define_labels_in_element(t); - /* could be root of a tree, check it */ - if ( t->down != NULL ) { - if ( t->token == Token || t->token==WILD ) - { - define_labels_in_tree(t->down); - } - } - t = t->right; - } -} - -void -#ifdef __USE_PROTOS -define_labels_in_element( AST *t ) -#else -define_labels_in_element( t ) -AST *t; -#endif -{ - require(t!=NULL, "define_labels_in_element: NULL tree pointer"); - switch ( t->token ) - { - case Token : - case WILD : - case NonTerm : - if ( t->label[0]!='\0' ) { - SymEntry *s; - s = (SymEntry *) hash_get(symbols, t->label); - require(s!=NULL, "define_labels_in_element: sym tab broken"); - if ( s->token==LABEL && !s->defined ) { - s->defined = 1; - TAB; - fprintf(output, "SORAST *%s=NULL", t->label); - if ( transform ) fprintf(output, ",*%s_in=NULL", t->label); - fprintf(output, ";\n"); - /* track which ones we define so that we can undefine - * them for the next rule - */ - list_add(&labels_for_func, (void *)s); - } - } - break; - case Action : - break; - case CLOSURE : - case POS_CLOSURE : - define_labels_in_block(t->down); - break; - case PRED_OP : - if ( t->down->token != Action ) - { - define_labels_in_block(t->down); - } - break; - case OPT : - define_labels_in_block(t->down); - break; - case BLOCK : - define_labels_in_block(t); - break; - } -} - -/* dump action 's' to file 'output' starting at "local" tab 'tabs' - Dump line information in front of action if GenLineInfo is set - If file == -1 then GenLineInfo is ignored. - The user may redefine the LineInfoFormatStr to his/her liking - most compilers will like the default, however. - - June '93; changed so that empty lines are left alone so that - line information is correct for the compiler/debuggers. -*/ -void -#ifdef __USE_PROTOS -dumpAction( char *s, FILE *output, int tabs, int file, int line, int final_newline ) -#else -dumpAction( s, output, tabs, file, line, final_newline ) -char *s; -FILE *output; -int tabs; -int file; -int line; -int final_newline; -#endif -{ - int inDQuote, inSQuote; - require(s!=NULL, "dumpAction: NULL action"); - require(output!=NULL, eMsg1("dumpAction: output FILE is NULL for %s",s)); - -/* if ( GenLineInfo && file != -1 ) - { - fprintf(output, LineInfoFormatStr, line, FileStr[file]); - }*/ - PastWhiteSpace( s ); - /* don't print a tab if first non-white char is a # (preprocessor command) */ - if ( *s!='#' ) {TAB;} - inDQuote = inSQuote = 0; - while ( *s != '\0' ) - { - if ( *s == '\\' ) - { - putc( *s++, output ); /* Avoid '"' Case */ - if ( *s == '\0' ) return; - if ( *s == '\'' ) putc( *s++, output ); - if ( *s == '\"' ) putc( *s++, output ); - } - if ( *s == '\'' ) - { - if ( !inDQuote ) inSQuote = !inSQuote; - } - if ( *s == '"' ) - { - if ( !inSQuote ) inDQuote = !inDQuote; - } - if ( *s == '\n' ) - { - putc('\n', output); - s++; - while (*s == '\n') { - putc('\n', output); - s++; - } - PastWhiteSpace( s ); - if ( *s == '}' ) - { - --tabs; - TAB; - putc( *s++, output ); - continue; - } - if ( *s == '\0' ) return; - if ( *s != '#' ) /* #define, #endif etc.. start at col 1 */ - { - TAB; - } - } - if ( *s == '}' && !(inSQuote || inDQuote) ) - { - --tabs; /* Indent one fewer */ - } - if ( *s == '{' && !(inSQuote || inDQuote) ) - { - tabs++; /* Indent one more */ - } - putc( *s, output ); - s++; - } - if ( final_newline ) putc('\n', output); -} - -char * -#ifdef __USE_PROTOS -find_predicate( AST *t ) -#else -find_predicate( t ) -AST *t; -#endif -{ - if ( t==NULL ) return NULL; - if ( t->token == Action ) - { - if ( t->right!=NULL && t->right->token==PRED_OP && t->right->down->token!=BLOCK ) - { - return t->right->down->action; - } - } - else if ( t->token == PRED_OP && t->down->token!=BLOCK ) - { - return t->down->action; - } - return NULL; -} - -/* Given a pointer to a tree pattern element (Token, BLOCK, etc...), - * generate an expression that predicts when that path would match. - */ -set -#ifdef __USE_PROTOS -gen_prediction_expr( AST *alt, GLA *t ) -#else -gen_prediction_expr( alt, t ) -AST *alt; -GLA *t; -#endif -{ - char *sempred; - set a, rs; - int tok, first=1, num_on_line=0; - require(alt==NULL||alt->token==ALT, - "gen_prediction_expr: AST node is invalid"); - - a = Lookahead(t); - rs = set_dup(a); - - /* if this production is a guess block, then test return value of setjmp() */ - - /* MR21 Problem reported by Peter Keller - THM: Sor doesn't see predicate because of intervening action. - - */ - - if (alt != NULL) { - AST* cursor; - for (cursor = alt->down; - cursor != NULL && Action == cursor->token; - cursor = cursor->right) { - /* nothing */ - } - if (cursor != NULL && - cursor->token == PRED_OP && - cursor->down->token == BLOCK) { - fprintf(output," !_gv &&"); - } - } - -#if 0 - /* The old code which was replaced */ - - if ( alt!=NULL && alt->down!=NULL && alt->down->token==PRED_OP && - alt->down->down->token==BLOCK ) fprintf(output, " !_gv &&"); - -#endif - - /* handle end of input first */ - if ( set_el(end_of_input, a) ) - { - fprintf(output, " _t==NULL"); - set_rm(end_of_input, a); - if ( !set_nil(a) ) fprintf(output, " ||"); - } - else if ( set_el(wild_card, a) ) - { - fprintf(output, " _t!=NULL"); - if ( alt!=NULL ) { - sempred = find_predicate(alt->down); - if ( sempred!=NULL ) fprintf(output, " && (%s)", sempred); - } - set_free(a); - return rs; - } - else - { - fprintf(output, " _t!=NULL"); - if ( !set_nil(a) ) fprintf(output, " &&"); - } - - if ( set_nil(a) ) { set_free(a); return rs; } - - fprintf(output, " ("); - while ( !set_nil(a) ) - { - tok = set_int(a); - set_rm(tok, a); - if ( first ) first = 0; - else fprintf(output, "||"); - if ( num_on_line>=2 ) {num_on_line=0; fprintf(output,"\n"); TAB;} - else num_on_line++; - if ( tok==wild_card ) fprintf(output, "_t!=NULL"); - else if ( token_dict[tok]==0 ) - { - if ( GenCPP ) - fprintf(output, "_t->type()==UNDEFINED_TOKEN"); - else - fprintf(output, "_t->token==UNDEFINED_TOKEN"); - } - else - { - if ( GenCPP ) - fprintf(output, "_t->type()==%s", token_dict[tok]); - else - fprintf(output, "_t->token==%s", token_dict[tok]); - } - } - fprintf(output, ")"); - - if ( alt!=NULL ) { - sempred = find_predicate(alt->down); - if ( sempred!=NULL ) fprintf(output, " && (%s)", sempred); - } - set_free(a); - return rs; -} - -/* Find all return types/parameters that require structs and def - * all rules with ret types. - */ -void -#ifdef __USE_PROTOS -GenRulePrototypes( FILE *f, int tabs ) -#else -GenRulePrototypes( f, tabs ) -FILE *f; -int tabs; -#endif -{ - AST *p; - SymEntry *s; - - for (p=rules; p!=NULL; p=p->right) - { - int i; - s = (SymEntry *) hash_get(symbols, p->text); - require(s!=NULL, "GenRulePrototypes: sym tab broken"); - - for (i=1; i<=tabs; i++) fprintf(f, "\t"); - GenRulePrototype(f, p, s, 1); - } -} - -void -#ifdef __USE_PROTOS -GenRulePrototype(FILE *f, AST *p, SymEntry *s, int decl_not_def) -#else -GenRulePrototype(f, p, s, decl_not_def) -FILE *f; -SymEntry *s; -AST *p; -int decl_not_def; -#endif -{ - require(s!=NULL&&s->definition!=NULL, "GenRulePrototype: no def for rule"); - - if ( GenCPP ) - { - if ( s->rt != NULL ) - DumpType(s->rt, f, FileStr[s->definition->file], s->definition->line); - else fprintf(f, "void"); - if ( decl_not_def ) - fprintf(f, " %s(SORASTBase **_root%s", - p->text, - transform?", SORASTBase **_result":""); - else - fprintf(f, " %s::%s(SORASTBase **_root%s", - CurClassName, - p->text, - transform?", SORASTBase **_result":""); - if ( s->args != NULL ) fprintf(f, ",%s", s->args); - fprintf(f, ")"); - if ( decl_not_def ) fprintf(f, ";"); - fprintf(f, "\n"); - return; - } - - if ( decl_not_def ) fprintf(f, "extern "); - if ( GenAnsiProtos && GenKRProtos ) fprintf(f, "\n#ifdef __USE_PROTOS\n"); - if ( GenAnsiProtos ) - { - if ( s->rt != NULL ) - DumpType(s->rt, f, FileStr[s->definition->file], s->definition->line); - else fprintf(f, "void"); - fprintf(f, " %s%s(STreeParser *_parser, SORAST **_root%s", - Prefix, - p->text, - transform?", SORAST **_result":""); - if ( s->args != NULL ) fprintf(f, ",%s", s->args); - fprintf(f, ")"); - if ( decl_not_def ) fprintf(f, ";"); - fprintf(f, "\n"); - } - if ( GenAnsiProtos && GenKRProtos ) fprintf(f, "#else\n"); - if ( GenKRProtos ) - { - if ( s->rt != NULL ) - DumpType(s->rt, f, FileStr[s->definition->file], s->definition->line); - else fprintf(f, "void"); - if ( decl_not_def) fprintf(f, " %s%s();\n", Prefix, p->text); - else - { - fprintf(f, " %s%s(_parser, _root%s", - Prefix, p->text,transform?", _result":""); - if ( s->args!=NULL ) fprintf(f, ","); - DumpListOfParmNames(s->args, f); - fprintf(f, ")\n"); - fprintf(f, "STreeParser *_parser;\n"); - fprintf(f, "SORAST **_root%s;\n", transform?", **_result":""); - DumpOldStyleParms(s->args, f); - } - } - if ( GenAnsiProtos && GenKRProtos ) fprintf(f, "#endif\n"); -} - -/* - * For each referenced token, generate a #define in a file defined in - * 'def_token_file'. - */ -void -#ifdef __USE_PROTOS -gen_tokens_file( void ) -#else -gen_tokens_file( ) -#endif -{ - FILE *f; - ListNode *p; - - if ( def_token_file==NULL ) return; - - f = fopen(def_token_file, "w"); - if ( f==NULL ) - { - errNoFL(eMsg1("cannot write token definition file %s", def_token_file)); - return; - } -#ifdef SPECIAL_FOPEN - special_fopen_actions(def_token_file); -#endif - - gen_info_hdr(f); - fprintf(f, "\n"); - for (p = token_list->next; p!=NULL; p=p->next) - { - SymEntry *t = (SymEntry *) p->elem; - fprintf(f, "#define %s %d\n", t->str, t->token_type); - } - fclose(f); -} - -AST * -#ifdef __USE_PROTOS -first_guess_block(AST *q) -#else -first_guess_block(q) -AST *q; -#endif -{ - require(q!=NULL&&q->token==ALT, "first_guess_block: non-ALT ptr"); - - if ( q->down!=NULL ) - { - if ( (q->down->token==PRED_OP && q->down->down!=NULL && - q->down->down->token==BLOCK) ) - { - return q->down; - } - else if (q->down->token==Action && q->down->right!=NULL && - q->down->right->token==PRED_OP && q->down->right->down!=NULL && - q->down->right->down->token==BLOCK) - { - return q->down->right; - } - else return NULL; - } - return NULL; -} - -void -#ifdef __USE_PROTOS -code_for_guess_block( AST *t, int *guess_block_in_prev_alt ) -#else -code_for_guess_block( t, guess_block_in_prev_alt ) -AST *t; -int *guess_block_in_prev_alt; -#endif -{ - if ( found_guess_block ) - { - /* if previous alt had a guess block, check to turn it off */ - if ( *guess_block_in_prev_alt ) - { - TAB; - if ( GenCPP ) fprintf(output, "if ( guessing ) _GUESS_DONE;\n"); - else fprintf(output, "if ( _parser->guessing ) _GUESS_DONE;\n"); - } - /* if current alt has a guess block... */ - if ( first_guess_block(t)!=NULL ) - { - TAB; - fprintf(output, "_GUESS;\n"); - *guess_block_in_prev_alt = 1; - } - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/globals.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/globals.c deleted file mode 100644 index c8def4ba9..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/globals.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * globals.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B24 - * Terence Parr - * Parr Research Corporation - * With AHPCRC, University of Minnesota - * 1992-2001 - */ -#include "stdpccts.h" - -char *VersionNumber = "13333"; /* mrxxx */ -char *VersionText = "13333"; /* mrxxx */ -char *FileStr[MaxNumFiles];/* Ptr to array of file names on command-line */ -int NumFiles=0; /* current grammar file number */ -int action_file; /* used to track start of action */ -int action_line; -int CurFile= -1; /* Index into FileStr table */ -char *CurRule=NULL; /* Pointer to current rule name */ -char *CurRetDef=NULL; /* Pointer to current return type definition */ -char *CurParmDef=NULL; /* Pointer to current parameter definition */ -FILE *output=NULL; /* current parser output file */ -FILE *input=NULL; /* current grammar input file */ -Entry **symbols; /* both tokens and nonterminals */ -int token_table_size = 1000; -char **token_dict=NULL; -int token_type = 1; /* used only if #tokdefs it not used */ -int end_of_input = 0; -int epsilon = 0; -int last_valid_token = 0; -int DumpIR = 0; -char *OutputDirectory = TopDirectory; -ListNode *before_actions = NULL, - *after_actions = NULL, - *class_actions = NULL; -char translator[MaxFileName+1]; -char tokdefs_file[MaxFileName+1]; -char *header_action = NULL; -AST *rules=NULL; -int print_guts = 0; -int transform = 0; /* Don't assume a transformation */ -int found_guess_block = 0; -char *def_token_file=NULL; -int def_tokens=0; -ListNode *token_list = NULL; -int found_error=0; -set referenced_tokens = set_init; -int wild_card = 0; -int UserDefdTokens=0; -int Inline = 0; -char *Prefix=""; -FILE *ProtoFILE = NULL; -char *GenProtoFile = NULL; -ListNode *RefVars = NULL; -ListNode *AllRefVars = NULL; -char CurRefVarType[MaxAtom+1]; -char CurRefVarLabel[MaxAtom+1]; -char CurClassName[MaxAtom+1]=""; -int GenCPP = 0; -int NoCtor = 0; /* MR23 */ - -#if defined(__STDC__) || defined(__cplusplus) || defined(__USE_PROTOS) -int GenAnsiProtos=1; /* Gen both if both Protos are on */ -int GenKRProtos=0; -#else -int GenAnsiProtos=0; -int GenKRProtos=1; -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SASTBase.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SASTBase.h deleted file mode 100644 index 91e5b4b03..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SASTBase.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SASTBase_h -#define SASTBase_h - -#include "PCCTSAST.h" - -typedef PCCTS_AST SORASTBase; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SCommonAST.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SCommonAST.h deleted file mode 100644 index b3861080f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/SCommonAST.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef SCommonAST_h -#define SCommonAST_h - -#include -#include "PCCTSAST.h" -#include "SASTBase.h" - -/* If you use SORCERER alone, you can subclass this to get a nice tree def */ - -class SORCommonAST : public SORASTBase { -protected: - SORCommonAST *_right, *_down; - int _type; - -public: - SORCommonAST() { _right = _down = NULL; } - PCCTS_AST *right() { return _right; } // define the SORCERER interface - PCCTS_AST *down() { return _down; } - int type() { return _type; } - void setRight(PCCTS_AST *t) { _right = (SORCommonAST *)t; } - void setDown(PCCTS_AST *t) { _down = (SORCommonAST *)t; } - void setType(int t) { _type = t; } - virtual PCCTS_AST *shallowCopy() {return NULL;} -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/STreeParser.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/STreeParser.h deleted file mode 100644 index 597f7810e..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/STreeParser.h +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef STreeParser_h -#define STreeParser_h - -/* - * STreeParser.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Parr Research Corporation - * with Purdue University and AHPCRC, University of Minnesota - * 1992-1994 - */ - -/* The programmer should derive a class from SORASTBase; SORASTBase defines - * the minimum public interface that a tree node must follow for SORCERER to - * be able to walk the trees. - */ - -/* The @-vars are added by the subclass created by SORCERER; the constructor - * is used to init the @-vars. - */ - -#include -#include -#include -#include "SASTBase.h" - -#define _DOWN _t=(SORASTBase *)_t->down() -#define _RIGHT _t=(SORASTBase *)_t->right() - -#define _SAVE SORASTBase *_save=_t -#define _RESTORE _t = _save -#define _GUESS_BLOCK STreeParser _st; int _gv; SORASTBase *_savet=NULL; -#define _GUESS {save_state(&_st); \ - _savet = _t; \ - guessing = 1; \ - _gv = setjmp(startofguess.state);} -#define _GUESS_FAIL longjmp(startofguess.state, 1) -#define _GUESS_DONE {restore_state(&_st); _t = _savet;} -#define _MATCH(tok) MATCH(_t,tok) -#define _MATCHRANGE(t1,t2) MATCHRANGE(_t,t1,t2) -#define _WILDCARD WILDCARD(_t) - -#define ast_return(t) *_result = (SORASTBase *)t; - -#define STreeTry(r,p,t) \ - (p)->try_result = NULL; \ - (p)->sjrv = setjmp((p)->startofguess); \ - if ( !(p)->sjrv ) { \ - rule(p,t,&try_result); \ - (p)->try_ok = 1; \ - } \ - else { \ - (p)->try_ok = 0; \ - } \ - if ( (p)->try_ok ) - - -/* Used only during TRANSFORM mode */ -#define TREE_CONSTR_PTRS SORASTBase *_r=NULL,*_s=NULL,*_e=NULL - -typedef struct _Sjmp_buf { - jmp_buf state; - } Sjmp_buf; - -class STreeParser { -protected: - int try_ok, sjrv; /* used by STreeTry macro */ - SORASTBase *try_result; /* tree coming back from try */ - int guessing; - Sjmp_buf startofguess; -// SORASTBase *t; - - void _mkroot(SORASTBase **, SORASTBase **, SORASTBase **, SORASTBase *); - void _mkchild(SORASTBase **, SORASTBase **, SORASTBase **, SORASTBase *); - virtual void mismatched_range(int looking_for, int upper_token, SORASTBase *found); - virtual void missing_wildcard(); - virtual void mismatched_token(int looking_for, SORASTBase *found); - virtual void no_viable_alt(char *rulename, SORASTBase *root); - virtual void MATCH(SORASTBase *_t, int tok); - virtual void MATCHRANGE(SORASTBase *_t, int tok, int tok2); - virtual void WILDCARD(SORASTBase *_t); - -public: - STreeParser() { guessing = 0; } - virtual void panic(char *err); - void save_state(STreeParser *); - void restore_state(STreeParser *); - - virtual int printMessage(FILE* pFile, const char* pFormat, ...); // MR23 -}; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/astlib.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/astlib.h deleted file mode 100644 index 53a69a476..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/astlib.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef astlib_h -#define astlib_h - -/* - * astlib.h -- C ast_* library header - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ -#include -#include "sorcerer.h" -#include "sorlist.h" - -#define MaxTreeStackDepth 400 - -/* MR26 */ - -#ifdef PCCTS_USE_STDARG -extern SORAST *ast_make(SORAST *rt, ...); -extern int ast_scan(char *_template /* MR32 */, SORAST *tree, ...); -#else -extern SORAST *ast_make(); -extern int ast_scan(); -#endif - -#ifdef __USE_PROTOS - -extern SORAST *ast_find_all(SORAST *t, SORAST *u, SORAST **cursor); -extern int ast_match(SORAST *t, SORAST *u); -extern void ast_insert_after(SORAST *a, SORAST *b); -extern void ast_append(SORAST *a, SORAST *b); -extern SORAST *ast_tail(SORAST *a); -extern SORAST *ast_bottom(SORAST *a); -extern SORAST *ast_cut_between(SORAST *a, SORAST *b); -extern SList *ast_to_slist(SORAST *t); -extern SORAST *slist_to_ast(SList *list); -extern void ast_free(SORAST *t); -extern int ast_nsiblings(SORAST *t); -extern SORAST *ast_sibling_index(SORAST *t, int i); -extern int ast_match_partial(SORAST *t, SORAST *u); -#else -extern SORAST *ast_find_all(); -extern int ast_match(); -extern void ast_insert_after(); -extern void ast_append(); -extern SORAST *ast_tail(); -extern SORAST *ast_bottom(); -extern SORAST *ast_cut_between(); -extern SList *ast_to_slist(); -extern SORAST *slist_to_ast(); -extern void ast_free(); -extern int ast_nsiblings(); -extern SORAST *ast_sibling_index(); -extern int ast_match_partial(); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sintstack.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sintstack.h deleted file mode 100644 index 7faf6ca53..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sintstack.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef SINTSTACK_H -#define SINTSTACK_H - -/* - * SIntStack.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ - -#include "sorcerer.h" - -typedef struct _istack { - int *data; - int sp; - int size; - } SIntStack; - -#ifdef __USE_PROTOS -extern SIntStack *sint_newstack(int size); -extern void sint_freestack(SIntStack *st); -extern void sint_push(SIntStack *st, int i); -extern int sint_pop(SIntStack *st); -extern int sint_stacksize(SIntStack *st); -extern void sint_stackreset(SIntStack *st); -extern int sint_stackempty(SIntStack *st); -extern int sint_top(SIntStack *st); -#else -extern SIntStack *sint_newstack(); -extern void sint_freestack(); -extern void sint_push(); -extern int sint_pop(); -extern int sint_stacksize(); -extern void sint_stackreset(); -extern int sint_stackempty(); -extern int sint_top(); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorcerer.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorcerer.h deleted file mode 100644 index 04d2e2f1c..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorcerer.h +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef sorcerer_h -#define sorcerer_h - -/* - * sorcerer.h -- header for all sorcerer files - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ - -#include "pcctscfg.h" - -#ifdef __USE_PROTOS -#include -#else -#include -#endif - -#include - -/* SUPERCLASS SORAST (your tree must look at minimum like this) -typedef struct _node { - struct _node *right, *down; - int token; - -- user-defined stuff goes here - } SORAST; -*/ - -/* Can be used sort of like inheritance to get the desired struct def */ -#define AST_REQD_FIELDS \ - struct _node *right, *down; \ - int token; - -/* C MATCH */ /* MR21 Short circuit on null pointer */ -#define _MATCH(tok) if (! _t || _t->token!=tok ) if ( _parser->guessing ) _GUESS_FAIL; else mismatched_token(_parser, tok, _t) -#define _MATCHRANGE(tok,tok2) \ - if (! _t || _t->tokentoken>tok2 ) if ( _parser->guessing ) _GUESS_FAIL; else mismatched_range(_parser, tok, tok2, _t) - -/* C++ MATCH */ -#define _CPPMATCH(tok) if ( _t->token()!=tok ) if ( _parser->guessing ) _GUESS_FAIL; else mismatched_token(_parser, tok, _t) -#define _CPPMATCHRANGE(tok,tok2) \ - if ( _t->token()token()>tok2 ) if ( _parser->guessing ) _GUESS_FAIL; else mismatched_range(_parser, tok, tok2, _t) - -/* Normal DOWN and RIGHT */ -#define _DOWN _t=_t->down -#define _RIGHT _t=_t->right - -/* C++ DOWN and RIGHT */ -#define _CPPDOWN _t=(SORAST *) _t->down() -#define _CPPRIGHT _t=(SORAST *) _t->right() - -#define _SAVE SORAST *_save=_t -#define _RESTORE _t = _save -#define _SETLABEL(u) u=_t -#define _WILDCARD if ( _t==NULL ) if ( _parser->guessing ) _GUESS_FAIL; else missing_wildcard(_parser) -#define _GUESS_BLOCK STreeParser _st; int _gv; SORAST *_savet=NULL; -#define _GUESS {_st = *_parser; \ - _savet = _t; \ - _parser->guessing = 1; \ - _gv = setjmp(_parser->startofguess.state);} -#define _GUESS_FAIL longjmp(_parser->startofguess.state, 1) -#define _GUESS_DONE {*_parser = _st; _t = _savet;} - -/* These are used mainly by the C output */ -#ifndef ast_down -#define ast_down down -#endif -#ifndef ast_right -#define ast_right right -#endif - -#define STreeTry(r,p,t) \ - (p)->try_result = NULL; \ - (p)->sjrv = setjmp((p)->startofguess); \ - if ( !(p)->sjrv ) { \ - rule(p,t,&try_result); \ - (p)->try_ok = 1; \ - } \ - else { \ - (p)->try_ok = 0; \ - } \ - if ( (p)->try_ok ) - - -/* Used only during TRANSFORM mode */ -#define TREE_CONSTR_PTRS SORAST *_r=NULL,*_s=NULL,*_e=NULL - -typedef struct _Sjmp_buf { - jmp_buf state; - } Sjmp_buf; - -#ifndef _PARSER_VARS -#define _PARSER_VARS -#endif - -#ifndef _REFVARS -#define _REFVARS -#endif - -typedef struct _STreeParser { - int try_ok, sjrv; /* used by STreeTry macro */ - SORAST *try_result; /* tree coming back from try */ - int guessing; - Sjmp_buf startofguess; - SORAST *t; - _REFVARS - _PARSER_VARS - } STreeParser; - -#define STreeParserInit(_p) { (_p)->guessing = 0; _refvar_inits(_p); } - - - /* S a n i t y C h e c k i n g */ - -#ifndef require -#define require(expr, err) {if ( !(expr) ) sorcerer_panic(err);} -#endif - - - /* T r a n s f o r m M a c r o s */ -#define ast_return(_t) *_result = _t - - -#ifdef __USE_PROTOS -extern void mismatched_range(STreeParser *_parser, int looking_for, int upper_token, SORAST *found); -extern void missing_wildcard(STreeParser *_parser); -extern void mismatched_token(STreeParser *_parser, int looking_for, SORAST *found); -extern void no_viable_alt(STreeParser *_parser, char *rulename, SORAST *root); -extern void sorcerer_panic(char *err); -extern void _refvar_inits(STreeParser *); /* MR15 Kevin J. Cummings */ -extern void _mkroot(SORAST **, SORAST **, SORAST **, SORAST *); -extern void _mkchild(SORAST **, SORAST **, SORAST **, SORAST *); -extern SORAST *ast_alloc(void); -extern SORAST *ast_dup(SORAST *t); -extern SORAST *ast_dup_node(SORAST *t); -#else -extern void mismatched_range(); -extern void missing_wildcard(); -extern void mismatched_token(); -extern void no_viable_alt(); -extern void sorcerer_panic(); -extern void _refvar_inits(); /* MR15 Kevin J. Cummings */ -extern void _mkroot(); -extern void _mkchild(); -extern SORAST *ast_alloc(); -extern SORAST *ast_dup(); -extern SORAST *ast_dup_node(); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorlist.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorlist.h deleted file mode 100644 index 30e0ef67a..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sorlist.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef SLIST_H -#define SLIST_H - -/* - * SList.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ - -#include "sorcerer.h" - -typedef struct _SList { - void *elem; /* pointer to any kind of element */ - struct _SList *next; - } SList; - -#define newSList (SList *) calloc(1, sizeof(SList)); - -#ifdef __USE_PROTOS -extern void *slist_iterate(SList *list, SList **); -extern void slist_add( SList **list, void *e ); -extern void slist_free(SList *list); -#else -extern void *slist_iterate(); -extern void slist_add(); -extern void slist_free(); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sstack.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sstack.h deleted file mode 100644 index 8c5dd62be..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/h/sstack.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef SSTACK_H -#define SSTACK_H - -/* - * SStack.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ -#include "sorlist.h" - -typedef SList SStack; - -#define newSStack (SStack *) calloc(1, sizeof(SStack)); - -#ifdef __USE_PROTOS -extern void sstack_push( SStack **st, void *e ); -extern void *sstack_pop( SStack **st ); -#else -extern void sstack_push(); -extern void *sstack_pop(); -#endif - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.c deleted file mode 100644 index 9be75e007..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * hash.c -- Manage hash tables. - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - */ -#include - -#include "pcctscfg.h" -#include "hash.h" - -#ifdef __USE_PROTOS -#include -#else -#ifdef VAXC -#include -#else -#include -#endif -#endif -#include - - -#define StrSame 0 -#define fatal(err) \ - {fprintf(stderr, "%s(%d):", __FILE__, __LINE__); \ - fprintf(stderr, " %s\n", err); exit(1);} -#define require(expr, err) {if ( !(expr) ) fatal(err);} - -static unsigned size = HashTableSize; -static char *strings = NULL; -static char *strp; -static unsigned strsize = StrTableSize; - -/* create the hash table and string table for terminals (string table only once) */ -Entry ** -#ifdef __USE_PROTOS -newHashTable( void ) -#else -newHashTable( ) -#endif -{ - Entry **table; - - table = (Entry **) calloc(size, sizeof(Entry *)); - require( table != NULL, "cannot allocate hash table"); - if ( strings == NULL ) - { - strings = (char *) calloc(strsize, sizeof(char)); - require( strings != NULL, "cannot allocate string table"); - strp = strings; - } - return table; -} - -/* Given a table, add 'rec' with key 'key' (add to front of list). return ptr to entry */ -Entry * -#ifdef __USE_PROTOS -hash_add( Entry **table, char *key, Entry *rec ) -#else -hash_add( table, key, rec ) -Entry **table; -char *key; -Entry *rec; -#endif -{ - unsigned h=0; - char *p=key; -/* extern Entry *Globals; MR20 G. Hobbelt unused reference */ - require(table!=NULL && key!=NULL && rec!=NULL, "add: invalid addition"); - - Hash(p,h,size); - rec->next = table[h]; /* Add to singly-linked list */ - table[h] = rec; - return rec; -} - -/* Return ptr to 1st entry found in table under key (return NULL if none found) */ -Entry * -#ifdef __USE_PROTOS -hash_get( Entry **table, char *key ) -#else -hash_get( table, key ) -Entry **table; -char *key; -#endif -{ - unsigned h=0; - char *p=key; - Entry *q; - require(table!=NULL && key!=NULL, "get: invalid table and/or key"); - - Hash(p,h,size); - for (q = table[h]; q != NULL; q = q->next) - { - if ( strcmp(key, q->str) == StrSame ) return( q ); - } - return( NULL ); -} - -void -#ifdef __USE_PROTOS -hashStat( Entry **table ) -#else -hashStat( table ) -Entry **table; -#endif -{ - static unsigned short count[20]; - int i,n=0,low=0, hi=0; - Entry **p; - float avg=0.0; - - for (i=0; i<20; i++) count[i] = 0; - for (p=table; p<&(table[size]); p++) - { - Entry *q = *p; - int len; - - if ( q != NULL && low==0 ) low = p-table; - len = 0; - if ( q != NULL ) fprintf(stderr, "[%d]", p-table); - while ( q != NULL ) - { - len++; - n++; - fprintf(stderr, " %s", q->str); - q = q->next; - if ( q == NULL ) fprintf(stderr, "\n"); - } - count[len]++; - if ( *p != NULL ) hi = p-table; - } - - fprintf(stderr, "Storing %d recs used %d hash positions out of %d\n", - n, size-count[0], size); - fprintf(stderr, "%f %% utilization\n", - ((float)(size-count[0]))/((float)size)); - for (i=0; i<20; i++) - { - if ( count[i] != 0 ) - { - avg += (((float)(i*count[i]))/((float)n)) * i; - fprintf(stderr, "Bucket len %d == %d (%f %% of recs)\n", - i, count[i], ((float)(i*count[i]))/((float)n)); - } - } - fprintf(stderr, "Avg bucket length %f\n", avg); - fprintf(stderr, "Range of hash function: %d..%d\n", low, hi); -} - -/* Add a string to the string table and return a pointer to it. - * Bump the pointer into the string table to next avail position. - */ -char * -#ifdef __USE_PROTOS -mystrdup( char *s ) -#else -mystrdup( s ) -char *s; -#endif -{ - char *start=strp; - require(s!=NULL, "mystrdup: NULL string"); - - while ( *s != '\0' ) - { - require( strp <= &(strings[strsize-2]), - "string table overflow\nIncrease StrTableSize in hash.h and recompile hash.c\n"); - *strp++ = *s++; - } - *strp++ = '\0'; - - return( start ); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.h deleted file mode 100644 index 6206f65d4..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/hash.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * hash.h -- define hash table entries, sizes, hash function... - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - */ - - /* H a s h T a b l e S t u f f */ -#ifndef __sorcerer_hash_h__ -#define __sorcerer_hash_h__ - -#include "pcctscfg.h" /* MR20 G. Hobbelt - Use __USE_PROTOS */ - -#ifndef HashTableSize -#define HashTableSize 553 -#endif -#ifndef StrTableSize -#define StrTableSize 40000 -#endif - -typedef struct _entry { /* Minimum hash table entry -- superclass */ - char *str; - struct _entry *next; - } Entry; - -/* Hash 's' using 'size', place into h (s is modified) */ -#define Hash(s,h,size) \ - {while ( *s != '\0' ) h = (h<<1) + *s++; \ - h %= size;} - -#ifdef __USE_PROTOS -Entry *hash_get(Entry **, char *), - **newHashTable(void), - *hash_add(Entry **, char *, Entry *); -char *mystrdup(char *); -void hashStat( Entry ** ); -#else -Entry *hash_get(), **newHashTable(), *hash_add(); -char *mystrdup(); -void hashStat(); -#endif - -#endif - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/CASTBase.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/CASTBase.h deleted file mode 100644 index c8efd4492..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/CASTBase.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef CASTBase_h -#define CASTBase_h - -/* - * CASTBase.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ - -/* ONLY USED TO C COMPILE LIBRARY FUNCTIONS; YOU CAN FORCE THEM TO COMPILE WITH - * YOUR SORAST DEF IF YOU WANT (THAT WAY, ORDER OF FIELD DEFINITION IS IRRELEVANT) - */ - -/* Typically, this file is not used / seen by the programmer */ - -/* Used as "super-class" for compiling C library routines */ -typedef struct _nodebase { - struct _nodebase *right, *down; - int token; - } SORAST; - -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/STreeParser.cpp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/STreeParser.cpp deleted file mode 100644 index bac0e3ada..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/STreeParser.cpp +++ /dev/null @@ -1,161 +0,0 @@ -#include "pccts_stdio.h" //MR23 -#include "pccts_stdarg.h" //MR23 -#include "STreeParser.h" - -void STreeParser:: -MATCH(SORASTBase *_t,int tok) -{ - if ( _t->type()!=tok ) - { - if ( guessing ) _GUESS_FAIL; - else mismatched_token(tok, _t); - } -} - -void STreeParser:: -MATCHRANGE(SORASTBase *_t,int tok,int tok2) -{ - if ( _t->type()type()>tok2 ) - { - if ( guessing ) _GUESS_FAIL; - else mismatched_range(tok, tok2, _t); - } -} - -void STreeParser:: -WILDCARD(SORASTBase *_t) -{ - if ( _t==NULL ) - { - if ( guessing ) _GUESS_FAIL; - else missing_wildcard(); - } -} - -void STreeParser:: -mismatched_range(int looking_for, int upper_token, SORASTBase *found) -{ - if ( found!=NULL ) { - /* MR23 */ printMessage(stderr, - "parse error: expected token range %d..%d found token %d\n", - looking_for, upper_token, - found->type()); - } - else { - /* MR23 */ printMessage(stderr, - "parse error: expected token range %d..%d found NULL tree\n", - looking_for, upper_token); - } -} - -void STreeParser:: -missing_wildcard() -{ - /* MR23 */ printMessage(stderr, "parse error: expected any token/tree found found NULL tree\n"); -} - -void STreeParser:: -mismatched_token(int looking_for, SORASTBase *found) -{ - if ( found!=NULL ) { - /* MR23 */ printMessage(stderr, - "parse error: expected token %d found token %d\n", - looking_for, - found->type()); - } - else { - /* MR23 */ printMessage(stderr, - "parse error: expected token %d found NULL tree\n", - looking_for); - } -} - -void STreeParser:: -no_viable_alt(char *rulename, SORASTBase *root) -{ - if ( root==NULL ) - /* MR23 */ printMessage(stderr, - "parse error: in rule %s, no viable alternative for NULL tree\n", - rulename); - else - /* MR23 */ printMessage(stderr, - "parse error: in rule %s, no viable alternative for tree\n", - rulename); -} - -void STreeParser:: -panic(char *err) -{ - /* MR23 */ printMessage(stderr, "panic: %s\n", err); - exit(-1); -} - -void STreeParser:: -save_state(STreeParser *buf) -{ - buf->try_ok = this->try_ok; - buf->sjrv = this->sjrv; - buf->guessing = this->guessing; - buf->startofguess = this->startofguess; -} - -void STreeParser:: -restore_state(STreeParser *buf) -{ - this->try_ok = buf->try_ok; - this->sjrv = buf->sjrv; - this->guessing = buf->guessing; - this->startofguess = buf->startofguess; -} - -void STreeParser:: -_mkroot(SORASTBase **r, SORASTBase ** /*s*/, SORASTBase ** /*e*/, SORASTBase *t) -{ - *r = t; -} - -void STreeParser:: -_mkchild(SORASTBase **r, SORASTBase **s, SORASTBase **e, SORASTBase *t) -{ -#ifdef BEFORE_GARYS_FIX - /* if no sibling list, must attach to any existing root */ - if ( *s==NULL ) - { - *s = *e = t; - /* If r is NULL, then there was no root defined--must be sibling list */ - if ( *r==NULL ) *r = *s; - else (*r)->setDown(t); - } - else { (*e)->setRight(t); *e = t; } -#endif -/* - should do nothing if asked to add a NULL argument. NULL's come up - when a rule wants to return "nothing". -*/ - /* if no sibling list, must attach to any existing root */ - if (*s == NULL) - { - *s = *e = t; - // If r is NULL then there was no root defined--must be sibling list - if (*r == NULL) *r = *s; - else (*r)->setDown(t); - } - else if (*e != NULL) - { - (*e)->setRight(t); - *e = t; - } - if (*e != NULL) { - while ((*e)->right() != NULL) *e = (SORASTBase *)(*e)->right(); - } -} - -//MR23 -int STreeParser::printMessage(FILE* pFile, const char* pFormat, ...) -{ - va_list marker; - va_start( marker, pFormat ); - int iRet = vfprintf(pFile, pFormat, marker); - va_end( marker ); - return iRet; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/astlib.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/astlib.c deleted file mode 100644 index 23b12b27b..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/astlib.c +++ /dev/null @@ -1,834 +0,0 @@ -/* - * astlib.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ - -#include -#include "pcctscfg.h" -#include - -#define SORCERER_TRANSFORM - -#include "CASTBase.h" -#include "astlib.h" - -#ifdef PCCTS_USE_STDARG -#include -#else -#include -#endif - - /* String Scanning/Parsing Stuff */ - -#define StringScanMaxText 50 - -typedef struct stringlexer { -#ifdef __USE_PROTOS - signed int c; -#else - int c; -#endif - char *input; - char *p; - char text[StringScanMaxText]; - } StringLexer; - -#define LPAREN 1 -#define RPAREN 2 -#define PERCENT 3 -#define INT 4 -#define COLON 5 -#define POUND 6 -#define PERIOD 7 -#define StringScanEOF -1 -#define VALID_SCAN_TOKEN(t) (t>=LPAREN && t<=PERIOD) - -static char *scan_token_tbl[] = { - "invalid", /* 0 */ - "LPAREN", /* 1 */ - "RPAREN", /* 2 */ - "PERCENT", /* 3 */ - "INT", /* 4 */ - "COLON", /* 5 */ - "POUND", /* 6 */ - "PERIOD", /* 7 */ -}; - -char * -#ifdef __USE_PROTOS -scan_token_str(int t) -#else -scan_token_str(t) -int t; -#endif -{ - if ( VALID_SCAN_TOKEN(t) ) return scan_token_tbl[t]; - else if ( t==StringScanEOF ) return ""; - else return ""; -} - -typedef struct stringparser { - int token; - StringLexer *lexer; - int num_labels; - } StringParser; - - /* This type ONLY USED by ast_scan() */ - -typedef struct _scanast { - struct _scanast *right, *down; - int token; - int label_num; - } ScanAST; - -#ifdef __USE_PROTOS -static void stringlexer_init(StringLexer *scanner, char *input); -static void stringparser_init(StringParser *, StringLexer *); -static ScanAST *stringparser_parse_scanast(char *templ, int *n); -static ScanAST *stringparser_parse_tree(StringParser *parser); -static ScanAST *stringparser_parse_element(StringParser *parser); -static void stringscan_advance(StringLexer *scanner); -static int stringscan_gettok(StringLexer *scanner); -#else -static void stringlexer_init(); -static void stringparser_init(); -static ScanAST *stringparser_parse_scanast(); -static ScanAST *stringparser_parse_tree(); -static ScanAST *stringparser_parse_element(); -static void stringscan_advance(); -static int stringscan_gettok(); -#endif - -/* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the children siblings and return ptr - * to 1st sibling (child1). If root is not single node, return NULL. - * - * Siblings that are actually sibling lists themselves are handled - * correctly. For example #( NULL, #( NULL, A, B, C), D) results - * in the tree ( NULL A B C D ). - * - * Requires at least two parameters with the last one being NULL. If - * both are NULL, return NULL. - * - * The ast_down and ast_right down/right pointers are used to make the tree. - */ -SORAST * -#ifdef PCCTS_USE_STDARG -ast_make(SORAST *rt, ...) -#else -ast_make(va_alist) -va_dcl -#endif -{ - va_list ap; - register SORAST *child, *sibling=NULL, *tail = NULL, *w; - SORAST *root; - -#ifdef PCCTS_USE_STDARG - va_start(ap, rt); - root = rt; -#else - va_start(ap); - root = va_arg(ap, SORAST *); -#endif - - if ( root != NULL ) - if ( root->ast_down != NULL ) return NULL; - child = va_arg(ap, SORAST *); - while ( child != NULL ) - { - /* find end of child */ - for (w=child; w->ast_right!=NULL; w=w->ast_right) {;} - if ( sibling == NULL ) {sibling = child; tail = w;} - else {tail->ast_right = child; tail = w;} - child = va_arg(ap, SORAST *); - } - if ( root==NULL ) root = sibling; - else root->ast_down = sibling; - va_end(ap); - return root; -} - -/* The following push and pop routines are only used by ast_find_all() */ - -static void -#ifdef __USE_PROTOS -_push(SORAST **st, int *sp, SORAST *e) -#else -_push(st, sp, e) -SORAST **st; -int *sp; -SORAST *e; -#endif -{ - (*sp)--; - require((*sp)>=0, "stack overflow"); - st[(*sp)] = e; -} - -static SORAST * -#ifdef __USE_PROTOS -_pop(SORAST **st, int *sp) -#else -_pop(st, sp) -SORAST **st; -int *sp; -#endif -{ - SORAST *e = st[*sp]; - (*sp)++; - require((*sp)<=MaxTreeStackDepth, "stack underflow"); - return e; -} - -/* Is 'u' a subtree of 't' beginning at the root? */ -int -#ifdef __USE_PROTOS -ast_match_partial(SORAST *t, SORAST *u) -#else -ast_match_partial(t, u) -SORAST *t, *u; -#endif -{ - SORAST *sib; - - if ( u==NULL ) return 1; - if ( t==NULL ) if ( u!=NULL ) return 0; else return 1; - - for (sib=t; sib!=NULL&&u!=NULL; sib=sib->ast_right, u=u->ast_right) - { - if ( sib->token != u->token ) return 0; - if ( sib->ast_down!=NULL ) - if ( !ast_match_partial(sib->ast_down, u->ast_down) ) return 0; - } - return 1; -} - -/* Find all occurrences of u in t. - * 'cursor' must be initialized to 't'. It eventually - * returns NULL when no more occurrences of 'u' are found. - */ -SORAST * -#ifdef __USE_PROTOS -ast_find_all(SORAST *t, SORAST *u, SORAST **cursor) -#else -ast_find_all(t, u, cursor) -SORAST *t, *u, **cursor; -#endif -{ - SORAST *sib; - static SORAST *template_stack[MaxTreeStackDepth]; - static int tsp = MaxTreeStackDepth; - - if ( *cursor == NULL ) return NULL; - if ( *cursor!=t ) sib = *cursor; - else { - /* else, first time--start at top of template 't' */ - tsp = MaxTreeStackDepth; - sib = t; - /* bottom of stack is always a NULL--"cookie" indicates "done" */ - _push(template_stack, &tsp, NULL); - } - -keep_looking: - if ( sib==NULL ) /* hit end of sibling list */ - { - sib = _pop(template_stack, &tsp); - if ( sib == NULL ) { *cursor = NULL; return NULL; } - } - - if ( sib->token != u->token ) - { - /* look for another match */ - if ( sib->ast_down!=NULL ) - { - if ( sib->ast_right!=NULL ) _push(template_stack, &tsp, sib->ast_right); - sib=sib->ast_down; - goto keep_looking; - } - /* nothing below to try, try next sibling */ - sib=sib->ast_right; - goto keep_looking; - } - - /* found a matching root node, try to match what's below */ - if ( ast_match_partial(sib, u) ) - { - /* record sibling cursor so we can pick up next from there */ - if ( sib->ast_down!=NULL ) - { - if ( sib->ast_right!=NULL ) _push(template_stack, &tsp, sib->ast_right); - *cursor = sib->ast_down; - } - else if ( sib->ast_right!=NULL ) *cursor = sib->ast_right; - else *cursor = _pop(template_stack, &tsp); - return sib; - } - - /* no match, keep searching */ - if ( sib->ast_down!=NULL ) - { - if ( sib->ast_right!=NULL ) _push(template_stack, &tsp, sib->ast_right); - sib=sib->ast_down; - } - else sib = sib->ast_right; /* else, try to right if zip below */ - goto keep_looking; -} - -/* are two trees exactly alike? */ -int -#ifdef __USE_PROTOS -ast_match(SORAST *t, SORAST *u) -#else -ast_match(t, u) -SORAST *t, *u; -#endif -{ - SORAST *sib; - - if ( t==NULL ) if ( u!=NULL ) return 0; else return 1; - if ( u==NULL ) return 0; - - for (sib=t; sib!=NULL&&u!=NULL; sib=sib->ast_right, u=u->ast_right) - { - if ( sib->token != u->token ) return 0; - if ( sib->ast_down!=NULL ) - if ( !ast_match(sib->ast_down, u->ast_down) ) return 0; - } - return 1; -} - -static int -#ifdef __USE_PROTOS -ast_scanmatch(ScanAST *t, SORAST *u, SORAST **labels[], int *n) -#else -ast_scanmatch(t, u, labels, n) -ScanAST *t; -SORAST *u; -SORAST **labels[]; -int *n; -#endif -{ - ScanAST *sib; - - if ( t==NULL ) if ( u!=NULL ) return 0; else return 1; - if ( u==NULL ) return 0; - - for (sib=t; sib!=NULL&&u!=NULL; sib=sib->right, u=u->ast_right) - { - /* make sure tokens match; token of '0' means wildcard match */ - if ( sib->token != u->token && sib->token!=0 ) return 0; - /* we have a matched token here; set label pointers if exists */ - if ( sib->label_num>0 ) - { - require(labels!=NULL, "label found in template, but no array of labels"); - (*n)++; - *(labels[sib->label_num-1]) = u; - } - /* match what's below if something there and current node is not wildcard */ - if ( sib->down!=NULL && sib->token!=0 ) - if ( !ast_scanmatch(sib->down, u->ast_down, labels, n) ) return 0; - } - return 1; -} - -void -#ifdef __USE_PROTOS -ast_insert_after(SORAST *a, SORAST *b) -#else -ast_insert_after(a, b) -SORAST *a,*b; -#endif -{ - SORAST *end; - require(a!=NULL, "ast_insert_after: NULL input tree"); - if ( b==NULL ) return; - /* find end of b's child list */ - for (end=b; end->ast_right!=NULL; end=end->ast_right) {;} - end->ast_right = a->ast_right; - a->ast_right = b; -} - -void -#ifdef __USE_PROTOS -ast_append(SORAST *a, SORAST *b) -#else -ast_append(a, b) -SORAST *a,*b; -#endif -{ - SORAST *end; - require(a!=NULL&&b!=NULL, "ast_append: NULL input tree"); - /* find end of child list */ - for (end=a; end->ast_right!=NULL; end=end->ast_right) {;} - end->ast_right = b; -} - -SORAST * -#ifdef __USE_PROTOS -ast_tail(SORAST *a) -#else -ast_tail(a) -SORAST *a; -#endif -{ - SORAST *end; - require(a!=NULL, "ast_tail: NULL input tree"); - /* find end of child list */ - for (end=a; end->ast_right!=NULL; end=end->ast_right) {;} - return end; -} - -SORAST * -#ifdef __USE_PROTOS -ast_bottom(SORAST *a) -#else -ast_bottom(a) -SORAST *a; -#endif -{ - SORAST *end; - require(a!=NULL, "ast_bottom: NULL input tree"); - /* find end of child list */ - for (end=a; end->ast_down!=NULL; end=end->ast_down) {;} - return end; -} - -SORAST * -#ifdef __USE_PROTOS -ast_cut_between(SORAST *a, SORAST *b) -#else -ast_cut_between(a, b) -SORAST *a,*b; -#endif -{ - SORAST *end, *ret; - require(a!=NULL&&b!=NULL, "ast_cut_between: NULL input tree"); - /* find node pointing to b */ - for (end=a; end->ast_right!=NULL&&end->ast_right!=b; end=end->ast_right) - {;} - require(end->ast_right!=NULL, "ast_cut_between: a,b not connected"); - end->ast_right = NULL; /* don't want it point to 'b' anymore */ - ret = a->ast_right; - a->ast_right = b; - return ret; -} - -SList * -#ifdef __USE_PROTOS -ast_to_slist(SORAST *t) -#else -ast_to_slist(t) -SORAST *t; -#endif -{ - SList *list=NULL; - SORAST *p; - - for (p=t; p!=NULL; p=p->ast_right) - { - slist_add(&list, p); - } - return list; -} - -SORAST * -#ifdef __USE_PROTOS -slist_to_ast(SList *list) -#else -slist_to_ast(list) -SList *list; -#endif -{ - SORAST *t=NULL, *last=NULL; - SList *p; - - for (p = list->next; p!=NULL; p=p->next) - { - SORAST *u = (SORAST *)p->elem; - if ( last==NULL ) last = t = u; - else { last->ast_right = u; last = u; } - } - return t; -} - -void -#ifdef __USE_PROTOS -ast_free(SORAST *t) -#else -ast_free(t) -SORAST *t; -#endif -{ - if ( t == NULL ) return; - ast_free( t->ast_down ); - ast_free( t->ast_right ); - free( t ); -} - -int -#ifdef __USE_PROTOS -ast_nsiblings(SORAST *t) -#else -ast_nsiblings(t) -SORAST *t; -#endif -{ - int n=0; - - while ( t!=NULL ) - { - n++; - t = t->ast_right; - } - return n; -} - -SORAST * -#ifdef __USE_PROTOS -ast_sibling_index(SORAST *t, int i) -#else -ast_sibling_index(t,i) -SORAST *t; -int i; -#endif -{ - int j=1; - require(i>0, "ast_sibling_index: i<=0"); - - while ( t!=NULL ) - { - if ( j==i ) return t; - j++; - t = t->ast_right; - } - return NULL; -} - -static void -#ifdef __USE_PROTOS -scanast_free(ScanAST *t) -#else -scanast_free(t) -ScanAST *t; -#endif -{ - if ( t == NULL ) return; - scanast_free( t->down ); - scanast_free( t->right ); - free( t ); -} - -/* - * ast_scan - * - * This function is like scanf(): it attempts to match a template - * against an input tree. A variable number of tree pointers - * may be set according to the '%i' labels in the template string. - * For example: - * - * ast_scan("#( 6 #(5 %1:4 %2:3) #(1 %3:3 %4:3) )", - * t, &w, &x, &y, &z); - * - * Naturally, you'd want this converted from - * - * ast_scan("#( RangeOp #(Minus %1:IConst %2:Var) #(Plus %3:Var %4Var) )", - * t, &w, &x, &y, &z); - * - * by SORCERER. - * - * This function call must be done withing a SORCERER file because SORCERER - * must convert the token references to the associated token number. - * - * This functions parses the template and creates trees which are then - * matched against the input tree. The labels are set as they are - * encountered; hence, partial matches may leave some pointers set - * and some NULL. This routines initializes all argument pointers to NULL - * at the beginning. - * - * This function returns the number of labels matched. - */ -int -#ifdef PCCTS_USE_STDARG -ast_scan(char *templ, SORAST *tree, ...) -#else -ast_scan(va_alist) -va_dcl -#endif -{ - va_list ap; - ScanAST *t; - int n, i, found=0; - SORAST ***label_ptrs=NULL; - -#ifdef PCCTS_USE_STDARG - va_start(ap, tree); -#else - char *templ; - SORAST *tree; - - va_start(ap); - templ = va_arg(ap, char *); - tree = va_arg(ap, SORAST *); -#endif - - /* make a ScanAST tree out of the template */ - t = stringparser_parse_scanast(templ, &n); - - /* make an array out of the labels */ - if ( n>0 ) - { - label_ptrs = (SORAST ***) calloc(n, sizeof(SORAST **)); - require(label_ptrs!=NULL, "ast_scan: out of memory"); - for (i=1; i<=n; i++) - { - label_ptrs[i-1] = va_arg(ap, SORAST **); - *(label_ptrs[i-1]) = NULL; - } - } - - /* match the input tree against the template */ - ast_scanmatch(t, tree, label_ptrs, &found); - - scanast_free(t); - free(label_ptrs); - - return found; -} - -static ScanAST * -#ifdef __USE_PROTOS -new_scanast(int tok) -#else -new_scanast(tok) -int tok; -#endif -{ - ScanAST *p = (ScanAST *) calloc(1, sizeof(ScanAST)); - if ( p == NULL ) {fprintf(stderr, "out of mem\n"); exit(-1);} - p->token = tok; - return p; -} - -static ScanAST * -#ifdef __USE_PROTOS -stringparser_parse_scanast(char *templ, int *num_labels) -#else -stringparser_parse_scanast(templ, num_labels) -char *templ; -int *num_labels; -#endif -{ - StringLexer lex; - StringParser parser; - ScanAST *t; - - stringlexer_init(&lex, templ); - stringparser_init(&parser, &lex); - t = stringparser_parse_tree(&parser); - *num_labels = parser.num_labels; - return t; -} - -static void -#ifdef __USE_PROTOS -stringparser_match(StringParser *parser, int token) -#else -stringparser_match(parser, token) -StringParser *parser; -int token; -#endif -{ - if ( parser->token != token ) sorcerer_panic("bad tree in ast_scan()"); -} - -/* - * Match a tree of the form: - * (root child1 child2 ... childn) - * or, - * node - * - * where the elements are integers or labeled integers. - */ -static ScanAST * -#ifdef __USE_PROTOS -stringparser_parse_tree(StringParser *parser) -#else -stringparser_parse_tree(parser) -StringParser *parser; -#endif -{ - ScanAST *t=NULL, *root, *child, *last = NULL; - - if ( parser->token != POUND ) - { - return stringparser_parse_element(parser); - } - stringparser_match(parser,POUND); - parser->token = stringscan_gettok(parser->lexer); - stringparser_match(parser,LPAREN); - parser->token = stringscan_gettok(parser->lexer); - root = stringparser_parse_element(parser); - while ( parser->token != RPAREN ) - { - child = stringparser_parse_element(parser); - if ( t==NULL ) { t = child; last = t; } - else { last->right = child; last = child; } - } - stringparser_match(parser,RPAREN); - parser->token = stringscan_gettok(parser->lexer); - root->down = t; - return root; -} - -static ScanAST * -#ifdef __USE_PROTOS -stringparser_parse_element(StringParser *parser) -#else -stringparser_parse_element(parser) -StringParser *parser; -#endif -{ - static char ebuf[100]; - int label = 0; - - if ( parser->token == POUND ) - { - return stringparser_parse_tree(parser); - } - if ( parser->token == PERCENT ) - { - parser->token = stringscan_gettok(parser->lexer); - stringparser_match(parser,INT); - label = atoi(parser->lexer->text); - parser->num_labels++; - if ( label==0 ) sorcerer_panic("%%0 is an invalid label"); - parser->token = stringscan_gettok(parser->lexer); - stringparser_match(parser,COLON); - parser->token = stringscan_gettok(parser->lexer); - /* can label tokens and wildcards */ - if ( parser->token != INT && parser->token != PERIOD ) - sorcerer_panic("can only label tokens"); - } - if ( parser->token == INT ) - { - ScanAST *p = new_scanast(atoi(parser->lexer->text)); - parser->token = stringscan_gettok(parser->lexer); - p->label_num = label; - return p; - } - if ( parser->token == PERIOD ) - { - ScanAST *p = new_scanast(0); /* token of 0 is wildcard */ - parser->token = stringscan_gettok(parser->lexer); - p->label_num = label; - return p; - } - sprintf(ebuf, "mismatch token in ast_scan(): %s", scan_token_str(parser->token)); - sorcerer_panic(ebuf); - return NULL; /* MR20 make -Wall happy */ -} - -static void -#ifdef __USE_PROTOS -stringparser_init(StringParser *parser, StringLexer *input) -#else -stringparser_init(parser, input) -StringParser *parser; -StringLexer *input; -#endif -{ - parser->lexer = input; - parser->token = stringscan_gettok(parser->lexer); - parser->num_labels = 0; -} - -static void -#ifdef __USE_PROTOS -stringlexer_init(StringLexer *scanner, char *input) -#else -stringlexer_init(scanner, input) -StringLexer *scanner; -char *input; -#endif -{ - scanner->text[0]='\0'; - scanner->input = input; - scanner->p = input; - stringscan_advance(scanner); -} - -static void -#ifdef __USE_PROTOS -stringscan_advance(StringLexer *scanner) -#else -stringscan_advance(scanner) -StringLexer *scanner; -#endif -{ - if ( *(scanner->p) == '\0' ) scanner->c = StringScanEOF; - scanner->c = *(scanner->p)++; -} - -static int -#ifdef __USE_PROTOS -stringscan_gettok(StringLexer *scanner) -#else -stringscan_gettok(scanner) -StringLexer *scanner; -#endif -{ - char *index = &scanner->text[0]; - static char ebuf[100]; - - while ( isspace(scanner->c) ) { stringscan_advance(scanner); } - if ( isdigit(scanner->c) ) - { - int tok = INT; - while ( isdigit(scanner->c) ) { - *index++ = scanner->c; - stringscan_advance(scanner); - } - *index = '\0'; - return tok; - } - switch ( scanner->c ) - { - case '#' : stringscan_advance(scanner); return POUND; - case '(' : stringscan_advance(scanner); return LPAREN; - case ')' : stringscan_advance(scanner); return RPAREN; - case '%' : stringscan_advance(scanner); return PERCENT; - case ':' : stringscan_advance(scanner); return COLON; - case '.' : stringscan_advance(scanner); return PERIOD; - case '\0' : return StringScanEOF; - case StringScanEOF : return StringScanEOF; - default : - sprintf(ebuf, "invalid char in ast_scan: '%c'", scanner->c); - sorcerer_panic(ebuf); - return 0; /* MR20 Make -Wall happy */ - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/errsupport.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/errsupport.c deleted file mode 100644 index 5086f7338..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/errsupport.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * errsupport.c -- error support code for SORCERER output - * - * Define your own or compile and link this in. - * - * Terence Parr - * U of MN, AHPCRC - * February 1994 - */ -#include "sorcerer.h" - -void -#ifdef __USE_PROTOS -mismatched_range( STreeParser *_parser, int looking_for, int upper_token, SORAST *found ) -#else -mismatched_range( _parser, looking_for, upper_token, found ) -int looking_for; -int upper_token; -SORAST *found; -STreeParser *_parser; -#endif -{ - if ( found!=NULL ) { - fprintf(stderr, - "parse error: expected token range %d..%d found token %d\n", - looking_for, upper_token, - found->token); - } - else { - fprintf(stderr, - "parse error: expected token range %d..%d found NULL tree\n", - looking_for, upper_token); - } -} - -void -#ifdef __USE_PROTOS -missing_wildcard(STreeParser *_parser) -#else -missing_wildcard(_parser) -STreeParser *_parser; -#endif -{ - fprintf(stderr, "parse error: expected any token/tree found found NULL tree\n"); -} - -void -#ifdef __USE_PROTOS -mismatched_token( STreeParser *_parser, int looking_for, SORAST *found ) -#else -mismatched_token( _parser, looking_for, found ) -int looking_for; -SORAST *found; -STreeParser *_parser; -#endif -{ - if ( found!=NULL ) { - fprintf(stderr, - "parse error: expected token %d found token %d\n", - looking_for, - found->token); - } - else { - fprintf(stderr, - "parse error: expected token %d found NULL tree\n", - looking_for); - } -} - -void -#ifdef __USE_PROTOS -no_viable_alt( STreeParser *_parser, char *rulename, SORAST *root ) -#else -no_viable_alt( _parser, rulename, root ) -char *rulename; -SORAST *root; -STreeParser *_parser; -#endif -{ - if ( root==NULL ) - fprintf(stderr, - "parse error: in rule %s, no viable alternative for NULL tree\n", - rulename); - else - fprintf(stderr, - "parse error: in rule %s, no viable alternative for tree\n", - rulename); -} - -void -#ifdef __USE_PROTOS -sorcerer_panic(char *err) -#else -sorcerer_panic(err) -char *err; -#endif -{ - fprintf(stderr, "panic: %s\n", err); - exit(-1); -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/makefile b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/makefile deleted file mode 100755 index fc0d303ff..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/makefile +++ /dev/null @@ -1,22 +0,0 @@ -# -# Makefile for SORCERER libraries -# -SRC = astlib.c sstack.c sorlist.c sintstack.c -OBJ = astlib.o sstack.o sorlist.o sintstack.o -CC=cc -COPT=-g -CFLAGS=$(COPT) -I../../h -I../h - -libs : $(OBJ) $(SRC) - -clean: - rm -f *.o core - -scrub: - rm -f *.o core - -ci: - ci -u $(SRC) *.h makefile - -co: - co -l $(SRC) *.h makefile diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/msvc.dsp b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/msvc.dsp deleted file mode 100644 index 8e154d091..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/msvc.dsp +++ /dev/null @@ -1,130 +0,0 @@ -# Microsoft Developer Studio Project File - Name="lib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=lib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "lib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "lib.mak" CFG="lib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "lib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "lib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName ""$/pccts/Sorcerer/lib", EPABAAAA" -# PROP Scc_LocalPath "." -CPP=cl.exe - -!IF "$(CFG)" == "lib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "h" /I "..\h" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PC" /YX /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "lib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /Z7 /Od /I "h" /I "..\h" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "PC" /YX /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "lib - Win32 Release" -# Name "lib - Win32 Debug" -# Begin Group "Header files" - -# PROP Default_Filter "h" -# Begin Source File - -SOURCE=.\CASTBase.h -# End Source File -# End Group -# Begin Group "Source files" - -# PROP Default_Filter "c,cpp" -# Begin Source File - -SOURCE=.\astlib.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\errsupport.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\PCCTSAST.cpp -# End Source File -# Begin Source File - -SOURCE=.\sintstack.c -# End Source File -# Begin Source File - -SOURCE=.\SList.cpp -# End Source File -# Begin Source File - -SOURCE=.\sorcerer.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\sorlist.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - -SOURCE=.\sstack.c -# End Source File -# Begin Source File - -SOURCE=.\STreeParser.cpp -# End Source File -# End Group -# End Target -# End Project diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sintstack.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sintstack.c deleted file mode 100644 index 6e37d1231..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sintstack.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * sint.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ -#include -#include - -#ifdef PCCTS_USE_STDARG -#include -#else -#include -#endif - -#include "CASTBase.h" -#include "sintstack.h" - -SIntStack * -#ifdef __USE_PROTOS -sint_newstack(int size) -#else -sint_newstack(size) -int size; -#endif -{ - SIntStack *p = (SIntStack *) calloc(1, sizeof(SIntStack)); - require(p!=NULL, "sint_newstack: out of memory"); - p->data = (int *) calloc(size, sizeof(int)); - require(p!=NULL, "sint_newstack: out of memory"); - p->size = size; - p->sp = size; - return p; -} - -void -#ifdef __USE_PROTOS -sint_freestack(SIntStack *st) -#else -sint_freestack(st) -SIntStack *st; -#endif -{ - if ( st==NULL ) return; - if ( st->data==NULL ) return; - free(st->data); - free(st); -} - -void -#ifdef __USE_PROTOS -sint_push(SIntStack *st,int i) -#else -sint_push(st,i) -SIntStack *st; -int i; -#endif -{ - require(st->sp>0, "sint_push: stack overflow"); - st->data[--(st->sp)] = i; -} - -int -#ifdef __USE_PROTOS -sint_pop(SIntStack *st) -#else -sint_pop(st) -SIntStack *st; -#endif -{ - require(st->spsize, "sint_pop: stack underflow"); - return st->data[st->sp++]; -} - -int -#ifdef __USE_PROTOS -sint_stacksize(SIntStack *st) -#else -sint_stacksize(st) -SIntStack *st; -#endif -{ - return st->size - st->sp; -} - -void -#ifdef __USE_PROTOS -sint_stackreset(SIntStack *st) -#else -sint_stackreset(st) -SIntStack *st; -#endif -{ - st->sp = st->size; -} - -int -#ifdef __USE_PROTOS -sint_stackempty(SIntStack *st) -#else -sint_stackempty(st) -SIntStack *st; -#endif -{ - return st->sp==st->size; -} - -int -#ifdef __USE_PROTOS -sint_top(SIntStack *st) -#else -sint_top(st) -SIntStack *st; -#endif -{ - require(st->spsize, "sint_top: stack underflow"); - return st->data[st->sp]; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorcerer.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorcerer.c deleted file mode 100644 index 0d07849b0..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorcerer.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * sorcerer.c -- support code for SORCERER output - * - * Define your own or compile and link this in. - * - * Terence Parr - * U of MN, AHPCRC - * February 1994 - */ - -/*********************************************************************** - 2-Oct-97 The routine ast_dup() appeared to have a bug in it. Instead - of providing a deep copy of its argument it made a bushy copy - of its argument - by duplicating the nodes pointed to by - its right link. This is certainly not deliberate and does - not match code in PCCTSAST.cpp (which had its own bug). This - has been changed to do a deep copy in the traditional sense. -***********************************************************************/ - -#ifdef OLD -/* Given a result pointer, return the same one if *t is NULL, - * else find the end of the sibling list and return the address - * the 'next[write]' field in that last node. - */ -AST ** -#ifdef __USE_PROTOS -_nextresult(STreeParser *_parser, AST **t) -#else -_nextresult(_parser, t) -AST **t; -STreeParser *_parser; -#endif -{ - AST *p = *t; - - if ( p==NULL ) return t; - while ( p->ast_right(_parser->write) != NULL ) - { - p = p->ast_right(_parser->write); - } - return &(p->ast_right(_parser->write)); -} - -/* - * Copy the read pointers to the write pointers for a node or entire subtree - */ -void -#ifdef __USE_PROTOS -_copy_wildcard(STreeParser *_parser, AST *t, int root) -#else -_copy_wildcard(_parser, t, root) -STreeParser *_parser; -AST *t; -int root; -#endif -{ - while ( t!=NULL ) - { - if ( !root ) t->ast_right(_parser->write) = t->ast_right(_parser->read); - t->ast_down(_parser->write) = t->ast_down(_parser->read); - if ( t->ast_down(_parser->read)!=NULL ) - _copy_wildcard(_parser, t->ast_down(_parser->read), 0); - if ( root ) return; - else root=0; - t = t->ast_right(_parser->read); - } -} -#endif - -void -#ifdef __USE_PROTOS -_mkroot(SORAST **r, SORAST **s, SORAST **e, SORAST *t) -#else -_mkroot(r,s,e,t) -SORAST **r, **s, **e, *t; -#endif -{ - *r = t; -} - -void -#ifdef __USE_PROTOS -_mkchild(SORAST **r, SORAST **s, SORAST **e, SORAST *t) -#else -_mkchild(r,s,e,t) -SORAST **r, **s, **e, *t; -#endif -{ - /* if no sibling list, must attach to any existing root */ - if ( *s==NULL ) - { - *s = *e = t; - /* If r is NULL, then there was no root defined--must be sibling list */ - if ( *r==NULL ) *r = *s; - else (*r)->ast_down = t; - } - else { (*e)->ast_right = t; *e = t; } -} - -/* THESE FUNCS HAVE TO GO HERE BECAUSE THEY ARE SENSITIVE TO USER'S SORAST DEF */ -SORAST * -#ifdef __USE_PROTOS -ast_alloc(void) -#else -ast_alloc() -#endif -{ - SORAST *t = (SORAST *)calloc(1, sizeof(SORAST)); - if ( t==NULL ) sorcerer_panic("out of memory"); - return t; -} - -SORAST * -#ifdef __USE_PROTOS -ast_dup_bushy(SORAST *t) -#else -ast_dup_bushy(t) -SORAST *t; -#endif -{ - SORAST *u; - - if ( t == NULL ) return NULL; - u = ast_alloc(); - *u = *t; /* copy contents */ - u->ast_down = ast_dup_bushy(t->ast_down); /* copy the rest of the tree */ - u->ast_right = ast_dup_bushy(t->ast_right); - return u; -} - - -/* Assume t is a root node of a tree--duplicate that node and what's below */ - -SORAST * -#ifdef __USE_PROTOS -ast_dup(SORAST *t) -#else -ast_dup(t) -SORAST *t; -#endif -{ - SORAST *u; - - if ( t == NULL ) return NULL; - u = ast_alloc(); - *u = *t; /* copy contents */ - u->ast_down = ast_dup_bushy(t->ast_down); /* copy the rest of the tree */ - u->ast_right = NULL; - return u; -} - -/* Assume t is a root node of a tree--duplicate that node and what's below */ -SORAST * -#ifdef __USE_PROTOS -ast_dup_node(SORAST *t) -#else -ast_dup_node(t) -SORAST *t; -#endif -{ - SORAST *u; - - if ( t == NULL ) return NULL; - u = ast_alloc(); - *u = *t; /* copy contents */ - u->down = NULL; - u->right = NULL; - return u; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorlist.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorlist.c deleted file mode 100644 index d5a220136..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sorlist.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * slist.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ -#include -#include - -#ifdef PCCTS_USE_STDARG -#include -#else -#include -#endif - -#include "CASTBase.h" -#include "sorlist.h" - -/* Iterate over a list of elements; returns ptr to a new element - * in list upon every call and NULL when no more are left. - * Very useful like this: - * - * cursor = mylist; - * while ( (p=slist_iterate(mylist,&cursor)) ) { - * / * place with element p * / - * } - * - * The cursor must be initialized to point to the list to iterate over. - */ -void * -#ifdef __USE_PROTOS -slist_iterate(SList *list, SList **cursor) -#else -slist_iterate(list, cursor) -SList *list, **cursor; -#endif -{ - void *e; - - if ( list==NULL || cursor == NULL || *cursor==NULL ) return NULL; - if ( list== *cursor ) { *cursor = (*cursor)->next; } - e = (*cursor)->elem; - (*cursor) = (*cursor)->next; - return e; -} - -/* - * add an element to a list. - * - * Any non-empty list has a sentinel node whose 'elem' pointer is really - * a pointer to the last element. (i.e. length(list) = #elemIn(list)+1). - * Elements are appended to the list. - */ -void -#ifdef __USE_PROTOS -slist_add( SList **list, void *e ) -#else -slist_add( list, e ) -SList **list; -void *e; -#endif -{ - SList *p, *tail; - require(e!=NULL, "slist_add: attempting to add NULL list element"); - - p = newSList; - require(p!=NULL, "slist_add: cannot alloc new list node"); - p->elem = e; - if ( *list == NULL ) - { - SList *sentinel = newSList; - require(sentinel!=NULL, "slist_add: cannot alloc sentinel node"); - *list=sentinel; - sentinel->next = p; - sentinel->elem = (char *)p; /* set tail pointer */ - } - else /* find end of list */ - { - tail = (SList *) (*list)->elem; /* get tail pointer */ - tail->next = p; - (*list)->elem = (char *) p; /* reset tail */ - } -} - -void -#ifdef __USE_PROTOS -slist_free(SList *list) -#else -slist_free(list) -SList *list; -#endif -{ - SList *p,*q; - - if ( list==NULL ) return; /* empty list */ - for (p = list->next; p!=NULL; p=q) - { - q = p->next; - free(p); - } -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sstack.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sstack.c deleted file mode 100644 index aa938c5de..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/lib/sstack.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * sstack.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-1994 - */ - -#include "pcctscfg.h" -#include -#include - -#ifdef PCCTS_USE_STDARG -#include -#else -#include -#endif - -#include "CASTBase.h" -#include "sstack.h" - -void -#ifdef __USE_PROTOS -sstack_push( SStack **st, void *e ) -#else -sstack_push( st, e ) -SStack **st; -void *e; -#endif -{ - SStack *p; - require(e!=NULL, "sstack_push: attempting to add NULL list element"); - - p = newSStack; - require(p!=NULL, "sstack_push: cannot alloc new list node"); - p->elem = e; - p->next = *st; - *st = p; -} - -void * -#ifdef __USE_PROTOS -sstack_pop( SStack **st ) -#else -sstack_pop( st ) -SStack **st; -#endif -{ - SStack *p = *st; - void *r; - - *st = (*st)->next; - r = p->elem; - free(p); - return r; -} - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/look.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/look.c deleted file mode 100644 index 510f5b965..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/look.c +++ /dev/null @@ -1,686 +0,0 @@ -/* - * look.c - * - * Compute LL(1) lookahead sets for SORCERER code-generator - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - */ -#include "stdpccts.h" -#include "sym.h" -#include "proto.h" - -static GLA *end_node; - -static GLA * -#ifdef __USE_PROTOS -newGLANode(void); -#else -newGLANode(); -#endif - -set -#ifdef __USE_PROTOS -Lookahead( GLA *p ) -#else -Lookahead( p ) -GLA *p; -#endif -{ - set r, rv; - - if ( p == NULL ) return empty; - r = rv = empty; - - /* have we been here before for this k? Detect cycles */ - if ( p->visited ) - { - return empty; - } - p->visited = 1; - - /* Does edge 1 have a token label? */ - if ( p->label1 <= last_valid_token ) - { - rv = set_of(p->label1); - if ( p->upper_range!=0 ) - { - int i; - /* put all elements of range into lookahead set */ - for (i=p->label1+1; i<=p->upper_range; i++) - { - set_orel(i, &rv); - } - } - } - else if ( p->label1 == wild_card || p->label1 == end_of_input ) - { - rv = set_of(p->label1); - } - else /* must be an epsilon transfer */ - { - int trouble = 0; - if ( p->p1!=NULL ) - { - /* check for infinite-recursion */ - /* o->o->o->o-A->o.. Rule def (p->p1 points to far left node) - * | for 'a : A | B;' - * o->o-B->o.. - * - * the visited flag is set on the start of the alts. - */ - if ( p->is_rule_ref && p->p1->is_rule_entry ) - { - require(p->p1->p1!=NULL, "Lookahead: invalid GLA"); - require(p->p1->p1->p1!=NULL, "Lookahead: invalid GLA"); - if ( p->p1->p1->p1->visited ) { - errNoFL(eMsg2("infinite recursion from rule %s to rule %s", - p->in_rule,p->p1->in_rule)); - rv = set_of(wild_card); - trouble = 1; - } - } - if ( !trouble ) - { - r = Lookahead(p->p1); - rv = set_or(r, rv); - set_free(r); - } - } - } - - /* handle edge 2 */ - r = Lookahead(p->p2); /* tokens can't be on e2 edges */ - set_orin(&rv, r); - set_free(r); - - /* this node is no longer visited */ - p->visited = 0; - - return rv; -} - -/* - * Build a big, interwined, lookahead GLA from the lookahead GLA created - * for each rule. From this, lookahead computation is trivial. - * - * [1] Build the GLA start states for each nonterminal. Each nonterminal - * looks like "o-->o" where the 2nd 'o' is the start of the GLA list - * of alts for the grammar block. Alternatives are connected like this: - * - * o-->o-->alt1 -->o - * | ^ - * o-->alt2 ---| - * ... | - * | | - * o-->altn ---| - * - * The BLOCK building function actually makes the ALT list. This - * function only builds the first 'o' node (upper left). - * - * [2] Make GLA for block of each rule. - * - * [3] Make a set of links to the nodes following all references to - * this rule. - */ -void -#ifdef __USE_PROTOS -build_GLA( AST *rules ) -#else -build_GLA( rules ) -AST *rules; -#endif -{ - SymEntry *s; - AST *r; - GLA *end_of_rule, *blk_start; - require(rules!=NULL, "build_GLA: NULL rule list"); - - for (r=rules; r!=NULL; r=r->right) - { - s = (SymEntry *) hash_get(symbols, r->text); - require(s!=NULL, "build_GLA: sym tab broken"); - CurRule = s->str; - s->start_state = newGLANode(); - s->start_state->is_rule_entry = 1; - } - - end_node = newGLANode(); - for (r=rules; r!=NULL; r=r->right) - { - s = (SymEntry *) hash_get(symbols, r->text); - require(s!=NULL, "build_GLA: sym tab broken"); - CurRule = s->str; - blk_start = newGLANode(); - blk_start->p1 = build_GLA_for_block(r->down, &end_of_rule); - blk_start->label1 = epsilon; - s->start_state->p1 = blk_start; - s->start_state->label1 = epsilon; - s->end_rule = end_of_rule; - /* make this BLOCK correspond to the GLA for this rule */ - r->down->start_state = s->start_state->p1; - } - - for (r=rules; r!=NULL; r=r->right) - { - s = (SymEntry *) hash_get(symbols, r->text); - require(s!=NULL, "build_GLA: sym tab broken"); - build_follow_links(s->end_rule, s->refs); - } - -} - -/* - * Tree looks like ( BLOCK ( ALT alpha ) ... ( AST beta ) ). - * - * For each ALT of BLOCK, build a new alternative into the GLA. - * - * Build a block that looks like: - * - * o-->alt1 -->o - * | ^ - * o-->alt2 ---| - * ... | - * | | - * o-->altn ---| - */ -GLA * -#ifdef __USE_PROTOS -build_GLA_for_block( AST *block, GLA **tail ) -#else -build_GLA_for_block( block, tail ) -AST *block; -GLA **tail; -#endif -{ - GLA *p, *alt_tail, *blk_tail, *prev=NULL, *first=NULL; - AST *alt; - require(block!=NULL, "build_GLA_for_block: NULL tree pointer"); - - blk_tail = newGLANode(); - for (alt=block->down; alt!=NULL; alt=alt->right) - { - p = newGLANode(); - p->p1 = build_GLA_for_ALT(alt, &alt_tail); - p->label1 = epsilon; - /* connect new alt into downward link */ - if ( prev!=NULL ) - { - prev->p2 = p; - prev->label2 = epsilon; - } - else - { - first = p; - } - prev = p; - /* link alt to block tail node */ - alt_tail->p1 = blk_tail; - alt_tail->label1 = epsilon; - } - *tail = blk_tail; - return first; -} - -/* - * Tree looks like ( ALT elem1 ... elemn ). Generate a GLA for each - * element with build_GLA_for_element; make a tail node and return - * pointer to GLA element built for first element. - * - * Tree patterns such as #(A b C) must be included because they may - * invoke other rules or have subrules in them for which lookahead - * must be computed. The '#(' and ')' are basically ignored and #(A b C) - * turns into 'A b C' for GLA construction purposes. Note that this would - * NOT work for LL(k>1). - */ -GLA * -#ifdef __USE_PROTOS -build_GLA_for_ALT( AST *alt, GLA **alt_tail ) -#else -build_GLA_for_ALT( alt, alt_tail ) -AST *alt; -GLA **alt_tail; -#endif -{ - GLA *elem_tail, *first; - require(alt!=NULL, "build_GLA_for_alt: NULL tree pointer"); - - first = build_GLA_for_tree(alt->down, &elem_tail); - *alt_tail = elem_tail; - return first; -} - -GLA * -#ifdef __USE_PROTOS -build_GLA_for_tree( AST *q, GLA **tree_tail ) -#else -build_GLA_for_tree( q, tree_tail ) -AST *q; -GLA **tree_tail; -#endif -{ - AST *t; - GLA *elem_tail, *alt_tail=NULL, *start=NULL, *elem; - - for (t=q; t!=NULL; t = t->right) - { - elem = build_GLA_for_element(t, &elem_tail); - if ( elem!=NULL ) - { - if ( start==NULL ) { start = elem; alt_tail = elem_tail; } - else { - alt_tail->p1 = elem; - alt_tail->label1 = epsilon; - alt_tail = elem_tail; - } - } - - if ( t->down != NULL && (t->token == Token||t->token == WILD) ) - { - elem = build_GLA_for_tree(t->down, &elem_tail); - if ( elem==NULL ) continue; - alt_tail->p1 = elem; - alt_tail->label1 = epsilon; - - /* put an end-of-input node at the end of each sibling list so - * that lookahead computation don't take '#(A b) D' to be same - * as 'A b D'; i.e., 'D' CANNOT follow a reference to a 'b' in - * this context as the 'b' is at a lower level. Only a NULL ptr - * can follow a ref to 'b'. For example, - * - * a : #(A b) D; - * b : E - * | - * ; - * - * The lookahead for 'b' is {E} for alt1 and {end_of_input} of - * alt2 because for the second alt to match, the input subtree - * must be NULL. - */ - elem_tail->p1 = newGLANode(); - elem_tail->label1 = end_of_input; - elem_tail = elem_tail->p1; - alt_tail = elem_tail; - } - } - if ( start==NULL ) - { - start = newGLANode(); - *tree_tail = start; - } - else *tree_tail = alt_tail; - return start; -} - -GLA * -#ifdef __USE_PROTOS -build_GLA_for_element( AST *elem, GLA **elem_tail ) -#else -build_GLA_for_element( elem, elem_tail ) -AST *elem; -GLA **elem_tail; -#endif -{ - SymEntry *p; - GLA *blkstart, *blkend, *blkloopback, *start=NULL; - require(elem!=NULL, "build_GLA_for_element: NULL tree pointer"); - - if ( elem == NULL ) return NULL; - switch ( elem->token ) - { - case Token : - p = (SymEntry *) hash_get(symbols, elem->text); - require(p!=NULL, "build_GLA_for_element: token not in sym tab"); - start = newGLANode(); - start->p1 = newGLANode(); - start->label1 = p->token_type; - start->upper_range = elem->upper_range; - *elem_tail = start->p1; - break; - case NonTerm : - /* edge 1 points to the start of the GLA for the referenced rule. - * Make a new node as if it - * were connected, however, so that this node can be connected to the end - * of block node by the build BLOCK routine. - */ - p = (SymEntry *) hash_get(symbols, elem->text); - if ( p==NULL || !p->defined ) { - errNoFL(eMsg1("rule not defined: '%s'", elem->text)); - start = newGLANode(); - start->p1 = newGLANode(); - start->label1 = wild_card; - *elem_tail = start->p1; - break; - } - start = newGLANode(); - start->is_rule_ref = 1; - start->p1 = p->start_state; - start->label1 = epsilon; - start->next = newGLANode(); - *elem_tail = start->next; - /* maintain reference list for this nonterminal */ - list_add(&p->refs, start->next); - break; - case WILD : - start = newGLANode(); - start->p1 = newGLANode(); - start->label1 = wild_card; - *elem_tail = start->p1; - break; - case Action : - *elem_tail = NULL; - break; - case PRED_OP : - /* return o->blk */ - start = newGLANode(); - start->p1 = build_GLA_for_block(elem->down, elem_tail); - start->label1 = epsilon; - elem->down->start_state = start; - /* DO NOT RETURN the block ptr because we don't want the lookahead - * analysis to see it. However, the AST BLOCK node will pt to it. - */ - start = NULL; - *elem_tail = NULL; - break; - case CLOSURE : - /* Make a blk like this: - * v---------| - * o-->o-->blk-->o-->o - * |-------------^ - * where the farthest left node is the start node passed in, - * the 2nd from the right is created here, and the 2nd from the left - * is a node created here. The farthest right node is created - * here as the end_blk node for the CLOSURE block. The 'p2' ptr - * of the blkloopback node goes back to the blkstart node. - */ - blkstart = newGLANode(); - blkloopback = newGLANode(); - blkend = newGLANode(); - blkstart->p1 = build_GLA_for_block(elem->down, elem_tail); - blkstart->label1 = epsilon; - blkstart->p2 = blkend; - blkstart->label2 = epsilon; - blkloopback->p1 = blkend; - blkloopback->label1 = epsilon; - blkloopback->p2 = blkstart; - blkloopback->label2 = epsilon; - (*elem_tail)->p1 = blkloopback; - (*elem_tail)->label1 = epsilon; - *elem_tail = blkend; - elem->down->start_state = blkstart; - start = newGLANode(); - start->p1 = blkstart; - start->label1 = epsilon; - break; - case POS_CLOSURE : - /* Make a blk like this: - * o-->o-->blk-->o-->o - * ^---------| - * where the farthest left node is the start node passed in. - * The 'next' ptr of the blkstart node points to the endblk node. - */ - blkstart = newGLANode(); - blkloopback = newGLANode(); - blkend = newGLANode(); - blkstart->p1 = build_GLA_for_block(elem->down, elem_tail); - blkstart->label1 = epsilon; - /* record the end of loop for "follow" computation */ - blkstart->next = blkend; - blkloopback->p1 = blkend; - blkloopback->label1 = epsilon; - blkloopback->p2 = blkstart; - blkloopback->label2 = epsilon; - (*elem_tail)->p1 = blkloopback; - (*elem_tail)->label1 = epsilon; - *elem_tail = blkend; - elem->down->start_state = blkstart; - start = newGLANode(); - start->p1 = blkstart; - start->label1 = epsilon; - break; - case OPT : - /* Make a blk like this: - * o-->o-->blk-->o - * |---------^ - * where the farthest left node is the start node passed in. - */ - blkstart = newGLANode(); - blkend = newGLANode(); - blkstart->p1 = build_GLA_for_block(elem->down, elem_tail); - blkstart->label1 = epsilon; - blkstart->p2 = blkend; - blkstart->label2 = epsilon; - (*elem_tail)->p1 = blkend; - (*elem_tail)->label1 = epsilon; - *elem_tail = (*elem_tail)->p1; - elem->down->start_state = blkstart; - start = newGLANode(); - start->p1 = blkstart; - start->label1 = epsilon; - break; - case BLOCK : - /* return o->blk */ - start = newGLANode(); - start->p1 = build_GLA_for_block(elem, elem_tail); - start->label1 = epsilon; - elem->start_state = start; - break; - } - return start; -} - -void -#ifdef __USE_PROTOS -build_follow_links( GLA *end_of_rule, ListNode *refs ) -#else -build_follow_links( end_of_rule, refs ) -GLA *end_of_rule; -ListNode *refs; -#endif -{ - ListNode *p; - GLA *f, *prev, *first=NULL; - require(end_of_rule!=NULL, "build_follow_links: NULL tree pointer"); - - if ( refs == NULL ) /* no ref list, must be start symbol */ - { - /* append a '$' link to the end_input node */ - end_of_rule->p1 = end_node; - end_of_rule->label1 = end_of_input; - return; - } - - /* the refs list is a list of GLA nodes that follow references to - * the rule associated with 'end_of_rule'. - */ - prev = NULL; - for (p = refs->next; p!=NULL; p=p->next) - { - f = newGLANode(); - f->p1 = (GLA *)p->elem; - f->label1 = epsilon; - /* connect new follow link into downward list */ - if ( prev!=NULL ) - { - prev->p2 = f; - prev->label2 = epsilon; - } - else - { - first = f; - } - prev = f; - } - - /* connect end of rule to follow list */ - end_of_rule->p1 = first; - end_of_rule->label1 = epsilon; -} - -void -#ifdef __USE_PROTOS -dump_GLAs( AST *rules ) -#else -dump_GLAs( rules ) -AST *rules; -#endif -{ - AST *r; - SymEntry *s; - require(rules!=NULL, "dump_GLAs: NULL rules pointer"); - - fprintf(stderr,"\n"); - for (r=rules; r!=NULL; r=r->right) - { - s = (SymEntry *) hash_get(symbols, r->text); - require(s!=NULL, "build_GLA: sym tab broken"); - dump_GLA( s->start_state ); - fprintf(stderr,"\n"); - } -} - -/* Can only dump GLA's for BNF for the moment */ -void -#ifdef __USE_PROTOS -dump_GLA( GLA *q ) -#else -dump_GLA( q ) -GLA *q; -#endif -{ - GLA *prod, *p; - - fprintf(stderr,"o-->"); - for (prod=q->p1; prod!=NULL; prod=prod->p2) - { - fprintf(stderr,"o"); - - for (p = prod; p->p1!=NULL;) - { - if ( p->visited ) break; - p->visited = 1; - - if ( p->label1 > 0 && p->label1!=epsilon ) - { - fprintf(stderr,"--%s-->o", token_dict[p->label1]); - p = p->p1; - if ( p->label1 == end_of_input ) break; - } - else if ( p->next!=NULL ) - { - /*fprintf(stderr,"-%d-^ o", p->context); */ - fprintf(stderr,"---^ o"); - p = p->next; - } - else - { - fprintf(stderr,"----->o"); - p = p->p1; - } - } - fprintf(stderr,"\n"); - if ( prod->p2!=NULL ) fprintf(stderr," |\n "); - } -} - -/* - * Compare each alt of a BLOCK against every other to determine - * whether or not any tokens predict more than one alt. - */ -void -#ifdef __USE_PROTOS -test_block_consistency( AST *blk, int block_type ) -#else -test_block_consistency( blk, block_type ) -AST *blk; -int block_type; -#endif -{ - AST *t; - set in_common; - GLA *alt1, *alt2, *start; - int i1, i2; - require(blk!=NULL&&blk->token==BLOCK, - "test_BLOCK_consistency: NULL or invalid block"); - - t = blk->down; - require(t!=NULL&&t->token==ALT, - "test_BLOCK_consistency: invalid AST structure"); - require(blk->start_state!=NULL, - "test_BLOCK_consistency: no GLA structure for block"); - - start = blk->start_state->p1; - for (alt1=start,i1=1; alt1!=NULL; alt1=alt1->p2,i1++, t=t->right) - { - require(!set_nil(alt1->lookahead), "test_BLOCK_consistency: invalid lookahead set"); - for (alt2=alt1->p2,i2=i1+1; alt2!=NULL; alt2=alt2->p2,i2++) - { - in_common = set_and(alt1->lookahead, alt2->lookahead); - if ( !set_nil(in_common) ) - { - fprintf(stderr, ErrHdr, FileStr[t->file], t->line); - fprintf(stderr, " warning: alts %d and %d of (...) nondeterministic upon ", - i1, i2); - set_fprint(stderr, in_common); - fprintf(stderr, "\n"); - } - set_free(in_common); - } - } - - if ( block_type == OPT || block_type == CLOSURE ) - { - /* test optional alt against all regular alts */ - t = blk->down; - for (alt1=blk->start_state->p1,i1=1; alt1!=NULL; alt1=alt1->p2,i1++, t=t->right) - { - in_common = set_and(alt1->lookahead, blk->start_state->lookahead); - if ( !set_nil(in_common) ) - { - fprintf(stderr, ErrHdr, FileStr[t->file], t->line); - fprintf(stderr, " warning: alt %d and optional branch of %s nondeterministic upon ", - i1, block_type==OPT?"{...}":"(...)*"); - set_fprint(stderr, in_common); - fprintf(stderr, "\n"); - } - set_free(in_common); - } - } -} - -static GLA * -#ifdef __USE_PROTOS -newGLANode(void) -#else -newGLANode() -#endif -{ - GLA *p; - - p = (GLA *) calloc(1, sizeof(GLA)); - require(p!=NULL, "newGLANode: can't alloc memory"); - p->in_rule = CurRule; - return p; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/main.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/main.c deleted file mode 100644 index 32c025af7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/main.c +++ /dev/null @@ -1,1114 +0,0 @@ -/* - * main.c - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - */ -#include "pcctscfg.h" -#include "stdpccts.h" -#include "sym.h" -#include "proto.h" -#include - -#define MAX_INT_STACK 50 -static int istack[MAX_INT_STACK]; /* Int stack */ -static int isp = MAX_INT_STACK; - -static int DontAcceptStdin = 0; -static int DontAcceptFiles = 0; - -typedef struct _Opt { - char *option; - int arg; -#ifdef __cplusplus - void (*process)(...); -#else - void (*process)(); -#endif - char *descr; - } Opt; - -#ifdef __USE_PROTOS -static int cistrequ(char *a,char *b) -#else -static int cistrequ(a,b) - char *a; - char *b; -#endif -{ - for ( ;*a != 0 && *b != 0; a++, b++) { - if (toupper(*a) != toupper(*b)) return 0; - } - return (*a == *b); -} - -#ifdef __USE_PROTOS -static void ProcessArgs(int, char **, Opt *); -#else -static void ProcessArgs(); -#endif - -static void -#ifdef __USE_PROTOS -pOut( char *s, char *t ) -#else -pOut( s, t ) -char *s; -char *t; -#endif -{ - OutputDirectory = t; -} - -static void -#ifdef __USE_PROTOS -pFile( char *s ) -#else -pFile( s ) -char *s; -#endif -{ - if ( *s=='-' ) { warnNoFL( eMsg1("invalid option: '%s'",s) ); return; } - if ( DontAcceptFiles ) - { - warnNoFL(eMsg1("file '%s' ignored as '-' (stdin option) was specified first",s)); - return; - } - - require(NumFiles - argc = ccommand (&argv); -#endif - - fprintf(stderr, - "Sorcerer - A simple tree-parser generator Version %s 1992-2001\n", - VersionText); - - if ( argc == 1 ) { help(); zzDONE; } - ProcessArgs(argc-1, &(argv[1]), options); - - symbols = newHashTable(); - token_dict = (char **) calloc(token_table_size, sizeof(char *)); - require(token_dict != NULL, "main: can't create token_dict"); - - output = stdout; - input = NextFile(); - require(input!=NULL, "No grammar description found (exiting...)"); - root = read_sor_desc(input); - - if ( root!=NULL ) gen(root); - - if ( found_error ) - { - fprintf(stderr, "no parser generated due to parsing errors; exiting...\n"); - zzDIE; - } - - if ( GenCPP ) { - GenCPPClassHeader(); - GenCPPClassCode(); - } - - if ( !UserDefdTokens ) gen_tokens_file(); - else if ( def_token_file!=NULL ) { - warnNoFL("tokens file not generated; it conflicts with use of #tokdefs"); - } - - if ( GenProtoFile!=NULL ) - { - FILE *ProtoFILE; - ProtoFILE = fopen(OutMetaName(GenProtoFile), "w"); - if ( ProtoFILE==NULL ) {warnNoFL(eMsg1("Can't open prototype file '%s'; ignored",GenProtoFile));} - else { -#ifdef SPECIAL_FOPEN - special_fopen_actions(OutMetaName(GenProtoFile)); -#endif - gen_info_hdr( ProtoFILE ); - if ( header_action!=NULL ) - dumpAction(header_action, ProtoFILE, 0, -1, 0, 1); - GenRulePrototypes( ProtoFILE, 0 ); - fclose(ProtoFILE); - } - } - if ( found_error ) {zzDIE;} - else zzDONE; -} - -void -#ifdef __USE_PROTOS -help(void) -#else -help() -#endif -{ - Opt *p = options; - static char buf[MaxRuleName+1]; - - fprintf(stderr, "sor [options] f1.sor ... fn.sor\n"); - while ( p->option!=NULL && *(p->option) != '*' ) - { - buf[0]='\0'; - if ( p->arg ) sprintf(buf, "%s ___", p->option); - else strcpy(buf, p->option); - fprintf(stderr, " %-20s %s\n", buf, p->descr); - p++; - } -} - -FILE * -#ifdef __USE_PROTOS -NextFile( void ) -#else -NextFile( ) -#endif -{ - FILE *f; - - for (;;) - { - if ( CurFile+1 >= NumFiles ) return(NULL); - CurFile++; - if ( cistrequ(FileStr[CurFile],"stdin")) return stdin; - f = fopen(FileStr[CurFile], "r"); - if ( f == NULL ) - { - warnNoFL( eMsg1("file %s doesn't exist; ignored", FileStr[CurFile]) ); - } - else - { - return(f); - } - } -} - -void -#ifdef __USE_PROTOS -pushint( int i ) -#else -pushint( i ) -int i; -#endif -{ - require(isp>0, "pushint: stack overflow"); - istack[--isp] = i; -} - -int -#ifdef __USE_PROTOS -popint( void ) -#else -popint( ) -#endif -{ - require(ispelem = e; - if ( *list == NULL ) - { - ListNode *sentinel = newListNode; - require(sentinel!=NULL, "list_add: cannot alloc sentinel node"); - *list=sentinel; - sentinel->next = p; - sentinel->elem = (char *)p; /* set tail pointer */ - } - else /* find end of list */ - { - tail = (ListNode *) (*list)->elem; /* get tail pointer */ - tail->next = p; - (*list)->elem = (char *) p; /* reset tail */ - } -} - -static void -#ifdef __USE_PROTOS -ProcessArgs( int argc, char **argv, Opt *options ) -#else -ProcessArgs( argc, argv, options ) -int argc; -char **argv; -Opt *options; -#endif -{ - Opt *p; - require(argv!=NULL, "ProcessArgs: command line NULL"); - - while ( argc-- > 0 ) - { - p = options; - while ( p->option != NULL ) - { - if ( strcmp(p->option, "*") == 0 || - cistrequ(p->option, *argv)) - { - if ( p->arg ) - { - (*p->process)( *argv, *(argv+1) ); - argv++; - argc--; - } - else - (*p->process)( *argv ); - break; - } - p++; - } - argv++; - } -} - -/* - * Given a string, this function allocates and returns a pointer to a - * hash table record of size 'sz' whose "str" pointer is reset to a position - * in the string table. - */ -Entry * -#ifdef __USE_PROTOS -newEntry( char *text, int sz ) -#else -newEntry( text, sz ) -char *text; -int sz; -#endif -{ - Entry *p; - require(text!=NULL, "new: NULL terminal"); - - if ( (p = (Entry *) calloc(1,sz)) == 0 ) - { - fatal("newEntry: out of memory for terminals\n"); - exit(1); - } - p->str = mystrdup(text); - - return(p); -} - -void -#ifdef __USE_PROTOS -token_association(int token_type, char *text) -#else -token_association( token_type, text ) -int token_type; -char *text; -#endif -{ - if ( token_type >= token_table_size ) /* overflow? */ - { - char **p; - int i, more; - - more = 100; - token_table_size += more; - token_dict = (char **) realloc(token_dict, token_table_size*sizeof(char *)); - require(token_dict != NULL, "token_association: can't extend token_dict"); - for (p= &token_dict[token_table_size-more],i=1; i<=more; i++) *p++ = NULL; - } - token_dict[token_type] = text; -} - -/* - * Return a string corresponding to the output file name associated - * with the input file name passed in. - * - * Observe the following rules: - * - * f.e --> f".c" - * f --> f".c" - * f. --> f".c" - * f.e.t --> f.e".c" - * - * Where f,e,t are arbitrarily long sequences of characters in a file - * name. - * - * In other words, if a ".x" appears on the end of a file name, make it - * ".c". If no ".x" appears, append ".c" to the end of the file name. - * - * Use malloc() for new string. - */ -char * -#ifdef __USE_PROTOS -outname( char *fs ) -#else -outname( fs ) -char *fs; -#endif -{ - static char buf[MaxFileName+1]; - char *p; - - p = buf; - strcpy(buf, fs); - while ( *p != '\0' ) {p++;} /* Stop on '\0' */ - while ( *p != '.' && p != buf ) {--p;} /* Find '.' */ - if ( p != buf ) *p = '\0'; /* Found '.' */ - require(strlen(buf) + 2 < (size_t)MaxFileName, "outname: filename too big"); - if ( GenCPP ) strcat(buf, CPP_FILE_SUFFIX); - else strcat(buf, ".c"); - return( buf ); -} - -void -#ifdef __USE_PROTOS -ensure_no_C_file_collisions(char *class_c_file) -#else -ensure_no_C_file_collisions(class_c_file) -char *class_c_file; -#endif -{ - int i; - - for (i=0; itoken = REFVAR; - q->defined = 1; - } - else err(eMsg2("Reference variable clashes with %s: '%s'", zztokens[q->token], lab)); - - p = (RefVarRec *) calloc(1, sizeof(RefVarRec)); - require(p!=NULL, "newRefVarRec: no memory"); - strcpy(p->type, t); - strcpy(p->label, lab); - strcpy(p->init, init); - return p; -} -#endif - -/* From one of the following ref var defs, create a record to track - * the info: - * - * @(int *p); - * @(int *p=NULL); -- initialized - * @(static int *p); -- global - * - * The 'def' pointer should point to the first char after the '(' - */ -RefVarRec * -#ifdef __USE_PROTOS -refVarRec(char *def) -#else -refVarRec(def) -char *def; -#endif -{ - RefVarRec *p; - char *s,*decl; - - p = (RefVarRec *) calloc(1, sizeof(RefVarRec)); - require(p!=NULL, "newRefVarRec: no memory"); - - /* find first word; must be type or "static" */ - s = def; - while ( isalpha(*s) ) s++; - if ( strncmp(def, "static", s-def)==0 ) p->global = 1; - else s = def; - - /* now get type from s position until '=' or ')' */ - decl = s; - while ( *s!='=' && *s!='\0' ) s++; - if ( *s=='=' ) { - /* there is an initializer */ - strcpy(p->init, s+1); - *s='\0'; - } - strcpy(p->decl, decl); - strcpy(p->var, id_in_decl(decl)); - return p; -} - -/* given a decl (type + id) return a ptr to the id; nondestructive to 'decl'. - * Just scan backwards from the end looking for the start of the first id. - */ -char * -#ifdef __USE_PROTOS -id_in_decl( char *decl ) -#else -id_in_decl( decl ) -char *decl; -#endif -{ - static char id[MaxAtom+1]; - char *p = &(decl[strlen(decl)-1]); - char *end, *start; - require(decl!=NULL, "id_in_decl: NULL decl"); - require(strlen(decl)>(size_t)0, "id_in_decl: empty decl"); - - /* scan back until valid var character */ - while ( !isalnum(*p) || *p=='_' ) --p; - end = p+1; - /* scan back until beginning of variable */ - while ( isalnum(*p) || *p=='_' ) --p; - p++; /* move to start of variable */ - start = p; - strncpy(id, start, end-start); - id[end-start] = '\0'; - return id; -} - -/* Take in a decl (type + id) and print it out with a prefix on id */ -void -#ifdef __USE_PROTOS -dump_prefixed_decl( char *prefix, char *s, FILE *f ) -#else -dump_prefixed_decl( prefix, s, f ) -char *prefix; -char *s; -FILE *f; -#endif -{ - char *p, *id; - require(s!=NULL, "invalid type string"); - - p = &s[strlen(s)-1]; /* start at end of string and work back */ - /* scan back until valid variable character */ - while ( !isalnum(*p) && *p!='_' ) --p; - /* scan back until beginning of variable */ - while ( isalnum(*p) || *p=='_' ) --p; - require(p>s, "invalid decl"); - p++; - id = p; /* here is where id is */ - p = s; - while ( p!=id ) {fputc(*p, f); p++;} /* dump until just before variable */ - fprintf(f, prefix); - while ( isspace(*p) ) p++; - while ( *p!='\0' ) /* dump rest */ - { - fputc(*p, f); - p++; - } -} - -/* - * Convert - * - * 0, "#( RangeOp #(Minus %1:IConst %2:Var) #(Plus %3:Var %4:Var) )", - * t, &w, &x, &y, &z); - * - * to - * - * 0, "#( 6 #(5 %1:4 %2:3) #(1 %3:3 %4:3) )", - * t, &w, &x, &y, &z); - */ -char * -#ifdef __USE_PROTOS -cvt_token_str(char *prefix, char *s) -#else -cvt_token_str(prefix, s) -char *prefix, *s; -#endif -{ - SymEntry *q; - char *b, *e, *p; - char tname[MaxRuleName+1]; - char duh[MaxRuleName+1]; - static char call[MaxAtom+1]; - require(prefix!=NULL&&s!=NULL, "cvt_token_str: NULL string"); - require(s[0]!='\0', "cvt_token_str: empty string"); - -/* printf("cvt incoming: '%s'\n", s);*/ - - strcpy(call, prefix); - p = &call[strlen(prefix)]; - - while ( *s!='"' ) *p++ = *s++; /* ignore until string start */ - *p++ = *s++; - - do - { - while ( !isalpha(*s) ) - { - if ( *s=='"' ) { *p='\0'; goto done; } - *p++ = *s++; /* ignore until a token name */ - } - *p='\0'; - b = s; - while ( isalpha(*s) ) s++; /* ignore until end of token name */ - e = s-1; - strncpy(tname, b, e-b+1); - tname[e-b+1] = '\0'; - -/* printf("looking up %s\n", tname);*/ - q = (SymEntry *) hash_get(symbols, tname); - if ( q==NULL ) - { - warnNoFL(eMsg1("call to ast_scan() has reference to unknown token: '%s'",tname)); - } - else - { - sprintf(duh, "%d", q->token_type); - strcpy(p, duh); - p += strlen(duh); - *p='\0'; - } - } while ( *s!='\0' && *s!='"' ); -done: - strcat(call, s); -/* printf("cvt: result is '%s'\n", call);*/ - return call; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile deleted file mode 100755 index b1cb191c7..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile +++ /dev/null @@ -1,54 +0,0 @@ -# -# PCCTS makefile for: SORCERER 1.00B17 -# Uses PCCTS release 1.33MR23 -# -PCCTS=.. -BIN = $(PCCTS)/bin -ANTLR = $(BIN)/antlr -DLG = $(BIN)/dlg -PCCTS_H = $(PCCTS)/h -SET = $(PCCTS)/support/set - -CC=cc -COPT=-g -CFLAGS = $(COPT) -Ih -I. -I$(PCCTS_H) -I$(SET) -DZZLEXBUFSIZE=32000 -AFLAGS = -gh -k 2 -gt -DFLAGS = -C2 -GRM = sor.g -SRC = sor.c scan.c err.c main.c globals.c gen.c $(SET)/set.c hash.c look.c cpp.c -OBJ = sor.o scan.o err.o main.o globals.o gen.o set.o hash.o look.o cpp.o -GENHFILES = tokens.h mode.h stdpccts.h -SHELL=/bin/sh - -all: - $(MAKE) sor - (cd ./lib; $(MAKE) CC="$(CC)" COPT="$(COPT)") - -sor: $(OBJ) $(SRC) - $(CC) -o sor $(CFLAGS) $(OBJ) - mv sor $(BIN)/. - -sor.o : sor.c mode.h tokens.h - -sor.c stdpccts.h parser.dlg tokens.h err.c : sor.g - $(ANTLR) $(AFLAGS) sor.g - -set.o : $(SET)/set.c - $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c - -scan.c mode.h : parser.dlg - $(DLG) $(DFLAGS) parser.dlg scan.c - -scan.o : scan.c mode.h tokens.h - -clean: - rm -f *.o core sor - -scrub: - rm -f *.o core $(GENHFILES) parser.dlg scan.c err.c sor.c sor - -ci: - ci -u sor.g Makefile main.c globals.c gen.c set.c hash.c look.c cpp.c - -co: - co -l sor.g Makefile main.c globals.c gen.c set.c hash.c look.c cpp.c diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile.VMS b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile.VMS deleted file mode 100644 index fd16d649e..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile.VMS +++ /dev/null @@ -1,33 +0,0 @@ -$! File: MAKE.COM - Makefile for SORCERER on OpenVMS, DECC -$! -$! History: -$! --------- -$! 27-Jan-1998 J.F. Pieronne Initial Version -$! -$ set noon !Don't stop on errors. -$! -$ if P1 .eqs. "LINK" then goto relink -$! -$ define/nolog pccts_h "[-.h]" -$ define/nolog support_set "[-.support.set]" -$! -$ delete/nolog *.obj;* !Get rid of existing .OBJ files. -$! -$ options = "/INCLUDE=(pccts_h,support_set)" -$ CC 'options' sor -$ CC 'options' scan -$ CC 'options' err -$ CC 'options' main -$ CC 'options' globals -$ CC 'options' gen -$ CC 'options' hash -$ CC 'options' look -$ CC 'options' cpp -$ CC 'options' [-.support.set]set -$! -$relink: -$ LINK/EXE=SOR.EXE sor,scan,err,main,globals, - - gen,hash,look,cpp,set, - - sys$input:/options -! sys$share:vaxcrtl.exe/share -$ EXIT diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile1 b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile1 deleted file mode 100644 index 08d4a218f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/makefile1 +++ /dev/null @@ -1,53 +0,0 @@ -# -# PCCTS makefile for: SORCERER 1.00B -# Uses PCCTS release 1.20 -# -PCCTS=.. -BIN = $(PCCTS)/bin -ANTLR = $(BIN)/antlr -DLG = $(BIN)/dlg -PCCTS_H = $(PCCTS)/h -SET = $(PCCTS)/support/set - -CFLAGS = -Ih -I. -I$(PCCTS_H) -I$(SET) -g -O $(ANSI) $(COTHER) -DZZLEXBUFSIZE=32000 -AFLAGS = -gh -k 2 -gt -DFLAGS = -C2 -GRM = sor.g -SRC = sor.c scan.c err.c main.c globals.c gen.c $(SET)/set.c hash.c look.c cpp.c -OBJ = sor.o scan.o err.o main.o globals.o gen.o set.o hash.o look.o cpp.o -GENHFILES = tokens.h mode.h stdpccts.h -CC=cc -SHELL=/bin/sh - -all: - make sor - (cd lib; make) - -sor: $(OBJ) $(SRC) - $(CC) -o sor $(CFLAGS) $(OBJ) -O - -sor.o : sor.c mode.h tokens.h - $(CC) $(CFLAGS) -c -o sor.o sor.c - -sor.c stdpccts.h parser.dlg tokens.h err.c : sor.g - $(ANTLR) $(AFLAGS) sor.g - -set.o : $(SET)/set.c - $(CC) $(CFLAGS) -c -o set.o $(SET)/set.c - -scan.c mode.h : parser.dlg - $(DLG) $(DFLAGS) parser.dlg scan.c - -scan.o : scan.c mode.h tokens.h - -clean: - rm -f *.o core sor - -scrub: - rm -f *.o core $(GENHFILES) parser.dlg scan.c err.c sor.c sor - -ci: - ci -u sor.g Makefile main.c globals.c gen.c set.c hash.c look.c cpp.c - -co: - co -l sor.g Makefile main.c globals.c gen.c set.c hash.c look.c cpp.c diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/mode.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/mode.h deleted file mode 100644 index 3367157d4..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/mode.h +++ /dev/null @@ -1,13 +0,0 @@ -#define START 0 -#define STRINGS 1 -#define ACTION_STRINGS 2 -#define ACTION_CHARS 3 -#define ACTION_COMMENTS 4 -#define ACTION_CPP_COMMENTS 5 -#define CPP_COMMENTS 6 -#define COMMENTS 7 -#define REFVAR_SCARF 8 -#define ACTIONS 9 -#define TOK_DEF_COMMENTS 10 -#define TOK_DEF_CPP_COMMENTS 11 -#define PARSE_ENUM_FILE 12 diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/msvc.dsw b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/msvc.dsw deleted file mode 100644 index eb67bcfca..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/msvc.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Sorcerer"=.\Sorcerer.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/parser.dlg b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/parser.dlg deleted file mode 100644 index d03b4c73f..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/parser.dlg +++ /dev/null @@ -1,957 +0,0 @@ -<< -/* parser.dlg -- DLG Description of scanner - * - * Generated from: sor.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -/* 23-Sep-97 thm Accomodate user who needs to redefine ZZLEXBUFSIZE */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 8000 -#endif -#include "pcctscfg.h" /* MR20 G. Hobbelt __USE_PROTOS #define */ -#include "charbuf.h" -#include "hash.h" -#include "set.h" -#include "sor.h" -#define AST_FIELDS \ -int token; char text[MaxAtom+1], label[MaxRuleName+1]; \ -char *action; /* if action node, here is ptr to it */ \ -char in,out; \ -char init_action; /* set if Action and 1st action of alt */ \ -int file; int line; /* set for BLOCK, ALT, nonterm nodes */ \ -int upper_range; /* only if T1..T2 found */ \ -GLA *start_state; /* ptr into GLA for this block */ \ -int no_copy; /* copy input ptr to output ptr? */ \ -ListNode *refvars; /* any ref vars defined for this rule */ \ -unsigned char is_root; /* this token is a root #( A ... ) */ -#define zzcr_ast(node, cur, _tok, _text) \ -{(node)->token=_tok; strncpy((node)->text, _text,MaxAtom);} -#define USER_ZZSYN -#define zzAST_DOUBLE -extern int define_num; -#define LL_K 2 -#include "antlr.h" -#include "ast.h" -#include "tokens.h" -#include "dlgdef.h" -LOOKAHEAD - -void -#ifdef __USE_PROTOS -zzerraction() -#else -zzerraction() -#endif -{ - (*zzerr)("invalid token"); - zzadvance(); - zzskip(); -} ->> - -<<%%lexaction - -#include "sym.h" -#include "proto.h" - -int define_num = 0; - -char * -#ifdef __USE_PROTOS -scarf_to_end_of_func_call(void) -#else -scarf_to_end_of_func_call() -#endif -{ - static char func_call_str[MaxAtom+1]; - char *p; - - p = &func_call_str[0]; - -more: - if ( zzchar==')' ) { *p++ = zzchar; *p++ = '\0'; zzadvance(); return func_call_str; } - if ( zzchar=='"' ) - { - *p++ = zzchar; zzadvance(); - while ( zzchar!='"' ) - { - if ( zzchar=='\\' ) { *p++ = zzchar; zzadvance(); } - *p++ = zzchar; zzadvance(); - } - } - *p++ = zzchar; zzadvance(); - goto more; -} ->> - - -%%START - -@ - << - NLA = Eof; - /* L o o k F o r A n o t h e r F i l e */ - { - FILE *new_input; - new_input = NextFile(); - if ( new_input != NULL ) { - fclose( input ); - input = new_input; - zzrdstream( input ); - /*zzadvance(); ** Get 1st char of this file */ - zzskip(); /* Skip the Eof (@) char i.e continue */ - } - } - >> - -[\t\ ]+ - << - NLA = 56; - zzskip(); - >> - -\n|\r|\n\r - << - NLA = 57; - zzline++; zzskip(); - >> - -\[ - << - NLA = 58; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint(']'); - >> - -\<\< - << - NLA = 59; - action_file=CurFile; action_line=zzline; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint('>'); - >> - -\" - << - NLA = 60; - zzmode(STRINGS); zzmore(); - >> - -/\* - << - NLA = 61; - zzmode(COMMENTS); zzskip(); - >> - -\*/ - << - NLA = 62; - err("Missing /*; found dangling */"); zzskip(); - >> - -// - << - NLA = 63; - zzmode(CPP_COMMENTS); zzskip(); - >> - -\>\> - << - NLA = 64; - err("Missing <<; found dangling \>\>"); zzskip(); - >> - -#header - << - NLA = Header; - >> - -#tokdefs - << - NLA = Tokdef; - >> - -: - << - NLA = LABEL; - >> - -\{ - << - NLA = OPT; - >> - -\+ - << - NLA = POS_CLOSURE; - >> - -\* - << - NLA = CLOSURE; - >> - -. - << - NLA = WILD; - >> - -? - << - NLA = PRED_OP; - >> - -#\( - << - NLA = BT; - >> - -\} - << - NLA = 80; - >> - -class - << - NLA = 81; - >> - -! - << - NLA = 84; - >> - -\< - << - NLA = 85; - >> - -\> - << - NLA = 86; - >> - -; - << - NLA = 87; - >> - -\| - << - NLA = 88; - >> - -\( - << - NLA = 89; - >> - -\) - << - NLA = 90; - >> - -.. - << - NLA = 91; - >> - -[a-z] [A-Za-z0-9_]* - << - NLA = NonTerm; - >> - -[A-Z] [A-Za-z0-9_]* - << - NLA = Token; - >> - -#[A-Za-z0-9_]* - << - NLA = 92; - warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip(); - >> - - -%%STRINGS - -@ - << - NLA = Eof; - >> - -\" - << - NLA = RExpr; - zzmode(START); - >> - -\n|\r|\r\n - << - NLA = 3; - /* MR16a */ - zzline++; - warn("eoln found in string"); - zzskip(); - >> - -\\~[] - << - NLA = 4; - zzmore(); - >> - -~[\n\r\"\\]+ - << - NLA = 5; - zzmore(); - >> - - -%%ACTION_STRINGS - -@ - << - NLA = Eof; - >> - -\" - << - NLA = 6; - zzmode(ACTIONS); zzmore(); - >> - -\n|\r|\r\n - << - NLA = 7; - /* MR16a */ - zzline++; - warn("eoln found in string (in user action)"); - zzskip(); - >> - -\\~[] - << - NLA = 8; - zzmore(); - >> - -~[\n\r\"\\]+ - << - NLA = 9; - zzmore(); - >> - - -%%ACTION_CHARS - -@ - << - NLA = Eof; - >> - -' - << - NLA = 10; - zzmode(ACTIONS); zzmore(); - >> - -\n|\r|\r\n - << - NLA = 11; - /* MR16a */ - zzline++; - warn("eoln found in char literal (in user action)"); - zzskip(); - >> - -\\~[] - << - NLA = 12; - zzmore(); - >> - -~[\n\r'\\]+ - << - NLA = 13; - zzmore(); - >> - - -%%ACTION_COMMENTS - -@ - << - NLA = Eof; - >> - -\*/ - << - NLA = 14; - zzmode(ACTIONS); zzmore(); - >> - -\* - << - NLA = 15; - zzmore(); - >> - -\n|\r|\r\n - << - NLA = 16; - zzline++; zzmore(); - >> - -~[\n\r\*]+ - << - NLA = 17; - zzmore(); - >> - - -%%ACTION_CPP_COMMENTS - -@ - << - NLA = Eof; - >> - -\n|\r|\r\n - << - NLA = 18; - zzline++; zzmode(ACTIONS); zzmore(); - >> - -~[\n\r]+ - << - NLA = 19; - zzmore(); - >> - - -%%CPP_COMMENTS - -@ - << - NLA = Eof; - >> - -\n|\r|\r\n - << - NLA = 20; - zzline++; zzmode(START); zzskip(); - >> - -~[\n\r]+ - << - NLA = 21; - zzskip(); - >> - - -%%COMMENTS - -@ - << - NLA = Eof; - >> - -\*/ - << - NLA = 22; - zzmode(START); zzskip(); - >> - -\* - << - NLA = 23; - zzskip(); - >> - -\n|\r|\r\n - << - NLA = 24; - zzline++; zzskip(); - >> - -~[\n\r\*]+ - << - NLA = 25; - zzskip(); - >> - - -%%REFVAR_SCARF - -@ - << - NLA = Eof; - >> - -~[\)]+ \) - << - NLA = 26; - { - RefVarRec *rf; - zzskip(); - zzbegexpr[strlen(zzbegexpr)-1] = '\0'; - rf=refVarRec(zzbegexpr); - list_add(&AllRefVars, rf); - list_add(&RefVars, rf); - zzmode(ACTIONS); zzmore(); zzreplstr(""); - } - >> - - -%%ACTIONS - -@ - << - NLA = Eof; - >> - -\>\> - << - NLA = Action; - /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = ' '; - zzbegexpr[1] = ' '; - if ( zzbufovf ) { - found_error = 1; - err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); - } - >> - -\] - << - NLA = PassAction; - if ( topint() == ']' ) { - popint(); - if ( istackempty() ) /* terminate action */ - { - zzmode(START); - NLATEXT[0] = ' '; - zzbegexpr[0] = ' '; - if ( zzbufovf ) { - found_error = 1; - err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - else { - /* terminate #[..] */ - zzreplstr(")"); - zzmore(); - } - } - else if ( topint() == '|' ) { /* end of simple [...] */ - popint(); - zzmore(); - } - else zzmore(); - >> - -\n|\r|\r\n - << - NLA = 29; - zzline++; zzmore(); - >> - -\> - << - NLA = 30; - zzmore(); - >> - -#[_a-zA-Z][_a-zA-Z0-9]* - << - NLA = 31; - - if ( !(strcmp(zzbegexpr, "#ifdef")==0 || - strcmp(zzbegexpr, "#else")==0 || - strcmp(zzbegexpr, "#endif")==0 || - strcmp(zzbegexpr, "#ifndef")==0 || - strcmp(zzbegexpr, "#if")==0 || - strcmp(zzbegexpr, "#define")==0 || - strcmp(zzbegexpr, "#pragma")==0 || - strcmp(zzbegexpr, "#undef")==0 || - strcmp(zzbegexpr, "#import")==0 || - strcmp(zzbegexpr, "#line")==0 || - strcmp(zzbegexpr, "#include")==0 || - strcmp(zzbegexpr, "#error")==0) ) - { - static char buf[100]; - if ( !transform ) { - warn("#id used in nontransform mode; # ignored"); - sprintf(buf, "%s", zzbegexpr+1); - } - else { - if ( CurRule==NULL ) - {warn("#id used in action outside of rule; ignored");} - else if ( strcmp(zzbegexpr+1,CurRule)==0 ) - strcpy(buf, "(*_result)"); - } - zzreplstr(buf); - } - zzmore(); - >> - -#\[\] - << - NLA = 32; - - if ( GenCPP ) zzreplstr("new SORAST"); - else zzreplstr("ast_empty_node()"); - zzmore(); - >> - -#\(\) - << - NLA = 33; - zzreplstr("NULL"); zzmore(); - >> - -#\[ - << - NLA = 34; - - pushint(']'); - if ( GenCPP ) zzreplstr("new SORAST("); - else zzreplstr("ast_node("); - zzmore(); - >> - -#\( - << - NLA = 35; - - pushint('}'); - if ( GenCPP ) zzreplstr("PCCTS_AST::make("); - else zzreplstr("ast_make("); - zzmore(); - >> - -# - << - NLA = 36; - zzmore(); - >> - -\) - << - NLA = 37; - - if ( istackempty() ) - zzmore(); - else if ( topint()==')' ) { - popint(); - } - else if ( topint()=='}' ) { - popint(); - /* terminate #(..) */ - zzreplstr(", NULL)"); - } - zzmore(); - >> - -\[ - << - NLA = 38; - - pushint('|'); /* look for '|' to terminate simple [...] */ - zzmore(); - >> - -\( - << - NLA = 39; - - pushint(')'); - zzmore(); - >> - -\\\] - << - NLA = 40; - zzreplstr("]"); zzmore(); - >> - -\\\) - << - NLA = 41; - zzreplstr(")"); zzmore(); - >> - -\\> - << - NLA = 42; - zzreplstr(">"); zzmore(); - >> - -' - << - NLA = 43; - zzmode(ACTION_CHARS); zzmore(); - >> - -\" - << - NLA = 44; - zzmode(ACTION_STRINGS); zzmore(); - >> - -\\# - << - NLA = 45; - zzreplstr("#"); zzmore(); - >> - -\\~[\]\)>#] - << - NLA = 46; - zzmore(); - >> - -/ - << - NLA = 47; - zzmore(); - >> - -/\* - << - NLA = 48; - zzmode(ACTION_COMMENTS); zzmore(); - >> - -\*/ - << - NLA = 49; - err("Missing /*; found dangling */ in action"); zzmore(); - >> - -// - << - NLA = 50; - zzmode(ACTION_CPP_COMMENTS); zzmore(); - >> - -\@\( - << - NLA = 51; - zzmode(REFVAR_SCARF); zzmore(); zzreplstr(""); - >> - -\@ - << - NLA = 52; - - zzmore(); if ( !GenCPP ) zzreplstr("_parser->"); - >> - -[a-zA-Z_]+\( - << - NLA = 53; - - if ( (GenCPP && strcmp(zzbegexpr,"ast_scan(")==0) || - (!GenCPP && strcmp(zzbegexpr,"ast_scan(")==0) ) { - char *args=scarf_to_end_of_func_call(); - zzreplstr(cvt_token_str(zzbegexpr, args)); - zzmore(); - } - else { pushint(')'); zzmore(); } - >> - -[a-zA-Z_]+ - << - NLA = 54; - zzmore(); - >> - -~[a-zA-Z_\n\r\)\(\\#\>\]\[\"'/\@]+ - << - NLA = 55; - zzmore(); - >> - - -%%TOK_DEF_COMMENTS - -@ - << - NLA = Eof; - >> - -\*/ - << - NLA = 93; - zzmode(PARSE_ENUM_FILE); zzmore(); - >> - -\* - << - NLA = 94; - zzmore(); - >> - -\n|\r|\r\n - << - NLA = 95; - zzline++; zzmore(); - >> - -~[\n\r\*]+ - << - NLA = 96; - zzmore(); - >> - - -%%TOK_DEF_CPP_COMMENTS - -@ - << - NLA = Eof; - >> - -\n|\r|\r\n - << - NLA = 97; - zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); - >> - -~[\n\r]+ - << - NLA = 98; - zzskip(); - >> - - -%%PARSE_ENUM_FILE - -@ - << - NLA = Eof; - /*zzmode(START); zzskip();*/ - >> - -[\t\ ]+ - << - NLA = 99; - zzskip(); - >> - -\n|\r|\r\n - << - NLA = 100; - zzline++; zzskip(); - >> - -// - << - NLA = 101; - zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); - >> - -/\* - << - NLA = 102; - zzmode(TOK_DEF_COMMENTS); zzmore(); - >> - -#ifndef - << - NLA = 103; - - >> - -#ifdef - << - NLA = 104; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#else - << - NLA = 105; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -#define - << - NLA = 106; - - >> - -#endif - << - NLA = 107; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - >> - -enum - << - NLA = 110; - >> - -\{ - << - NLA = 111; - >> - -= - << - NLA = 112; - >> - -, - << - NLA = 113; - >> - -DLGminToken - << - NLA = 114; - >> - -DLGmaxToken - << - NLA = 115; - >> - -\} - << - NLA = 116; - >> - -; - << - NLA = 117; - >> - -[0-9]+ - << - NLA = INT; - >> - -[a-zA-Z_][_a-zA-Z0-9]* - << - NLA = ID; - >> - -%% diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/proto.h b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/proto.h deleted file mode 100644 index 82ac6a2a3..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/proto.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * proto.h - * - * SOFTWARE RIGHTS - * - * We reserve no LEGAL rights to SORCERER -- SORCERER is in the public - * domain. An individual or company may do whatever they wish with - * source code distributed with SORCERER or the code generated by - * SORCERER, including the incorporation of SORCERER, or its output, into - * commerical software. - * - * We encourage users to develop software with SORCERER. However, we do - * ask that credit is given to us for developing SORCERER. By "credit", - * we mean that if you incorporate our source code into one of your - * programs (commercial product, research project, or otherwise) that you - * acknowledge this fact somewhere in the documentation, research report, - * etc... If you like SORCERER and have developed a nice tool with the - * output, please mention that you developed it using SORCERER. In - * addition, we ask that this header remain intact in our source code. - * As long as these guidelines are kept, we expect to continue enhancing - * this system and expect to make other tools available as they are - * completed. - * - * SORCERER 1.00B - * Terence Parr - * AHPCRC, University of Minnesota - * 1992-2001 - */ - - /* G l o b a l s */ - -extern char *VersionNumber; -extern char *VersionText; -extern char *FileStr[]; -extern int NumFiles; -extern int action_file; -extern int action_line; -extern int CurFile; -extern char *CurRule; -extern char *CurRetDef; -extern char *CurParmDef; -extern FILE *output; -extern FILE *input; -extern Entry **symbols; -extern int token_table_size; -extern char **token_dict; -extern int token_type; -extern int end_of_input; -extern int epsilon; -extern int last_valid_token; -extern char *OutputDirectory; -extern ListNode *before_actions, *after_actions, *class_actions; -extern char translator[]; -extern char tokdefs_file[]; -extern char *header_action; -extern struct _ast *rules; -extern int print_guts; -extern int transform; -extern int found_guess_block; -extern ListNode *token_list; -extern char *def_token_file; -extern int def_tokens; -extern int found_error; -extern set referenced_tokens; -extern int wild_card; -extern int UserDefdTokens; -extern int Inline; -extern char *Prefix; -extern int GenAnsiProtos; -extern int GenKRProtos; -extern FILE *ProtoFILE; -extern char *GenProtoFile; -extern ListNode *RefVars; -extern ListNode *AllRefVars; -extern ListNode *AllGlobVars; -extern char CurRefVarType[]; -extern char CurRefVarLabel[]; -extern char CurClassName[]; -extern int GenCPP; -extern int NoCtor; /* MR23 */ - -#ifdef __VMS -#define STRICMP strcasecmp -#else -#define STRICMP stricmp -#endif - /* F u n c t i o n s */ - -#ifdef __USE_PROTOS -extern int main( int, char *[] ); -extern int STRICMP(const char *, const char *); /* MR20 */ -extern void help( void ); -extern FILE * NextFile( void ); -extern void pushint( int ); -extern int popint( void ); -extern int istacksize( void ); -extern void istackreset( void ); -extern int istackempty( void ); -extern int topint( void ); -extern char * eMsg3( char *, char *, char *, char * ); -extern char * eMsgd( char *, int ); -extern void fatalFL( char *, char *, int ); -extern void list_add( ListNode **, void * ); -extern Entry * newEntry( char *, int ); -extern void token_association( int, char * ); -extern char * outname( char * ); -extern char * OutMetaName( char * ); -extern void set_fprint( FILE *, set ); -extern void gen_info_hdr( FILE * ); -extern void gen_hdr( void ); -extern void gen_hdr1( void ); -extern void gen( AST * ); -extern void gen_header( AST * ); -extern void gen_rule( AST * ); -extern void gen_block( AST *, int ); -extern void gen_alt( AST * ); -extern void gen_tree_pattern( AST * ); -extern void gen_element( AST * ); -extern void define_labels_in_block( AST * ); -extern void define_labels_in_alt( AST * ); -extern void define_labels_in_tree( AST * ); -extern void define_labels_in_element( AST * ); -extern void dumpAction( char *, FILE *, int, int, int, int ); -extern char * find_predicate( AST * ); -extern set gen_prediction_expr( AST *, GLA * ); -extern void GenRulePrototypes( FILE *, int ); -extern void gen_tokens_file( void ); -extern void code_for_guess_block( AST *, int * ); -extern set Lookahead( GLA * ); -extern void build_GLA( AST * ); -extern GLA * build_GLA_for_block( AST *, GLA ** ); -extern GLA * build_GLA_for_ALT( AST *, GLA ** ); -extern GLA * build_GLA_for_tree( AST *, GLA ** ); -extern GLA * build_GLA_for_element( AST *, GLA ** ); -extern void build_follow_links( GLA *, ListNode * ); -extern void dump_GLAs( AST * ); -extern void dump_GLA( GLA * ); -extern void test_block_consistency( AST *, int ); -extern void GenRulePrototype(FILE *f, AST *p, SymEntry *s, int decl_not_def); -extern void DumpOldStyleParms( char *pdecl, FILE *output ); -extern int DumpNextNameInDef( char **q, FILE *output ); -extern void DumpListOfParmNames( char *pdecl, FILE *output ); -extern SymEntry *define_token(char *text); -extern char *actiondup(char *s); -extern AST *read_sor_desc(FILE *f); -extern void DumpType( char *s, FILE *f, char *file, int line ); -extern AST *first_guess_block(AST *q); -extern RefVarRec *refVarRec(char *); -extern char *cvt_token_str(char *, char *); -extern char *id_in_decl( char *decl ); -extern void dump_prefixed_decl( char *prefix, char *s, FILE *f ); -extern void ensure_no_C_file_collisions(char *class_c_file); -extern void GenCPPClassHeader(void); -extern void GenCPPClassCode(void); -#else -extern int main( ); -extern int STRICMP(); /* MR20 */ -extern void help( ); -extern FILE * NextFile( ); -extern void pushint( ); -extern int popint( ); -extern int istacksize( ); -extern void istackreset( ); -extern int istackempty( ); -extern int topint( ); -extern char * eMsg3( ); -extern char * eMsgd( ); -extern void fatalFL( ); -extern void list_add( ); -extern Entry * newEntry( ); -extern void token_association( ); -extern char * outname( ); -extern char * OutMetaName( ); -extern void set_fprint( ); -extern void gen_info_hdr( ); -extern void gen_hdr( ); -extern void gen_hdr1( ); -extern void gen( ); -extern void gen_header( ); -extern void gen_rule( ); -extern void gen_block( ); -extern void gen_alt( ); -extern void gen_tree_pattern( ); -extern void gen_element( ); -extern void define_labels_in_block( ); -extern void define_labels_in_alt( ); -extern void define_labels_in_tree( ); -extern void define_labels_in_element( ); -extern void dumpAction( ); -extern char * find_predicate( ); -extern set gen_prediction_expr( ); -extern void GenRulePrototypes( ); -extern void gen_tokens_file( ); -extern void code_for_guess_block( ); -extern set Lookahead( ); -extern void build_GLA( ); -extern GLA * build_GLA_for_block( ); -extern GLA * build_GLA_for_ALT( ); -extern GLA * build_GLA_for_tree( ); -extern GLA * build_GLA_for_element( ); -extern void build_follow_links( ); -extern void dump_GLAs( ); -extern void dump_GLA( ); -extern void test_block_consistency( ); -extern void GenRulePrototype(); -extern void GenRulePrototype(); -extern void DumpOldStyleParms(); -extern int DumpNextNameInDef(); -extern void DumpListOfParmNames(); -extern SymEntry *define_token(); -extern char *actiondup(); -extern AST *read_sor_desc(); -extern void DumpType(); -extern AST *first_guess_block(); -extern RefVarRec *refVarRec(); -extern char *cvt_token_str(); -extern char *id_in_decl(); -extern void dump_prefixed_decl(); -extern void ensure_no_C_file_collisions(); -extern void GenCPPClassHeader(); -extern void GenCPPClassCode(); -#endif diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/scan.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/scan.c deleted file mode 100644 index ae693bca1..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/scan.c +++ /dev/null @@ -1,3141 +0,0 @@ - -/* parser.dlg -- DLG Description of scanner - * - * Generated from: sor.g - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -/* 23-Sep-97 thm Accomodate user who needs to redefine ZZLEXBUFSIZE */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 8000 -#endif -#include "pcctscfg.h" /* MR20 G. Hobbelt __USE_PROTOS #define */ -#include "charbuf.h" -#include "hash.h" -#include "set.h" -#include "sor.h" -#define AST_FIELDS \ -int token; char text[MaxAtom+1], label[MaxRuleName+1]; \ -char *action; /* if action node, here is ptr to it */ \ -char in,out; \ -char init_action; /* set if Action and 1st action of alt */ \ -int file; int line; /* set for BLOCK, ALT, nonterm nodes */ \ -int upper_range; /* only if T1..T2 found */ \ -GLA *start_state; /* ptr into GLA for this block */ \ -int no_copy; /* copy input ptr to output ptr? */ \ -ListNode *refvars; /* any ref vars defined for this rule */ \ -unsigned char is_root; /* this token is a root #( A ... ) */ -#define zzcr_ast(node, cur, _tok, _text) \ -{(node)->token=_tok; strncpy((node)->text, _text,MaxAtom);} -#define USER_ZZSYN -#define zzAST_DOUBLE -extern int define_num; -#define LL_K 2 -#include "antlr.h" -#include "ast.h" -#include "tokens.h" -#include "dlgdef.h" -LOOKAHEAD - -void -#ifdef __USE_PROTOS -zzerraction() -#else -zzerraction() -#endif -{ - (*zzerr)("invalid token"); - zzadvance(); - zzskip(); -} -/* - * D L G tables - * - * Generated from: parser.dlg - * - * 1989-2001 by Will Cohen, Terence Parr, and Hank Dietz - * Purdue University Electrical Engineering - * DLG Version 1.33MR33 - */ - -#include "mode.h" - - - - -#include "sym.h" -#include "proto.h" - -int define_num = 0; - -char * -#ifdef __USE_PROTOS -scarf_to_end_of_func_call(void) -#else -scarf_to_end_of_func_call() -#endif -{ - static char func_call_str[MaxAtom+1]; - char *p; - - p = &func_call_str[0]; - -more: - if ( zzchar==')' ) { *p++ = zzchar; *p++ = '\0'; zzadvance(); return func_call_str; } - if ( zzchar=='"' ) - { - *p++ = zzchar; zzadvance(); - while ( zzchar!='"' ) - { - if ( zzchar=='\\' ) { *p++ = zzchar; zzadvance(); } - *p++ = zzchar; zzadvance(); - } - } - *p++ = zzchar; zzadvance(); - goto more; -} - -static void act1() -{ - NLA = Eof; - /* L o o k F o r A n o t h e r F i l e */ - { - FILE *new_input; - new_input = NextFile(); - if ( new_input != NULL ) { - fclose( input ); - input = new_input; - zzrdstream( input ); - /*zzadvance(); ** Get 1st char of this file */ - zzskip(); /* Skip the Eof (@) char i.e continue */ - } - } - } - - -static void act2() -{ - NLA = 56; - zzskip(); - } - - -static void act3() -{ - NLA = 57; - zzline++; zzskip(); - } - - -static void act4() -{ - NLA = 58; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint(']'); - } - - -static void act5() -{ - NLA = 59; - action_file=CurFile; action_line=zzline; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint('>'); - } - - -static void act6() -{ - NLA = 60; - zzmode(STRINGS); zzmore(); - } - - -static void act7() -{ - NLA = 61; - zzmode(COMMENTS); zzskip(); - } - - -static void act8() -{ - NLA = 62; - err("Missing /*; found dangling */"); zzskip(); - } - - -static void act9() -{ - NLA = 63; - zzmode(CPP_COMMENTS); zzskip(); - } - - -static void act10() -{ - NLA = 64; - err("Missing <<; found dangling >>"); zzskip(); - } - - -static void act11() -{ - NLA = Header; - } - - -static void act12() -{ - NLA = Tokdef; - } - - -static void act13() -{ - NLA = LABEL; - } - - -static void act14() -{ - NLA = OPT; - } - - -static void act15() -{ - NLA = POS_CLOSURE; - } - - -static void act16() -{ - NLA = CLOSURE; - } - - -static void act17() -{ - NLA = WILD; - } - - -static void act18() -{ - NLA = PRED_OP; - } - - -static void act19() -{ - NLA = BT; - } - - -static void act20() -{ - NLA = 80; - } - - -static void act21() -{ - NLA = 81; - } - - -static void act22() -{ - NLA = 84; - } - - -static void act23() -{ - NLA = 85; - } - - -static void act24() -{ - NLA = 86; - } - - -static void act25() -{ - NLA = 87; - } - - -static void act26() -{ - NLA = 88; - } - - -static void act27() -{ - NLA = 89; - } - - -static void act28() -{ - NLA = 90; - } - - -static void act29() -{ - NLA = 91; - } - - -static void act30() -{ - NLA = NonTerm; - } - - -static void act31() -{ - NLA = Token; - } - - -static void act32() -{ - NLA = 92; - warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip(); - } - -static unsigned char shift0[257] = { - 0, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 1, 2, 37, 37, 3, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 1, 30, 6, 10, 37, 37, 37, - 37, 26, 33, 8, 23, 37, 37, 24, 7, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 21, - 31, 5, 37, 9, 25, 37, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 4, 37, 37, 37, 36, 37, 13, 34, - 28, 14, 12, 19, 34, 11, 34, 34, 18, 29, - 34, 34, 17, 34, 34, 15, 20, 16, 34, 34, - 34, 34, 34, 34, 22, 32, 27, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37 -}; - - -static void act33() -{ - NLA = Eof; - } - - -static void act34() -{ - NLA = RExpr; - zzmode(START); - } - - -static void act35() -{ - NLA = 3; - /* MR16a */ - zzline++; - warn("eoln found in string"); - zzskip(); - } - - -static void act36() -{ - NLA = 4; - zzmore(); - } - - -static void act37() -{ - NLA = 5; - zzmore(); - } - -static unsigned char shift1[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 2, 5, 5, 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act38() -{ - NLA = Eof; - } - - -static void act39() -{ - NLA = 6; - zzmode(ACTIONS); zzmore(); - } - - -static void act40() -{ - NLA = 7; - /* MR16a */ - zzline++; - warn("eoln found in string (in user action)"); - zzskip(); - } - - -static void act41() -{ - NLA = 8; - zzmore(); - } - - -static void act42() -{ - NLA = 9; - zzmore(); - } - -static unsigned char shift2[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 2, 5, 5, 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act43() -{ - NLA = Eof; - } - - -static void act44() -{ - NLA = 10; - zzmode(ACTIONS); zzmore(); - } - - -static void act45() -{ - NLA = 11; - /* MR16a */ - zzline++; - warn("eoln found in char literal (in user action)"); - zzskip(); - } - - -static void act46() -{ - NLA = 12; - zzmore(); - } - - -static void act47() -{ - NLA = 13; - zzmore(); - } - -static unsigned char shift3[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 2, 5, 5, 3, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 4, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act48() -{ - NLA = Eof; - } - - -static void act49() -{ - NLA = 14; - zzmode(ACTIONS); zzmore(); - } - - -static void act50() -{ - NLA = 15; - zzmore(); - } - - -static void act51() -{ - NLA = 16; - zzline++; zzmore(); - } - - -static void act52() -{ - NLA = 17; - zzmore(); - } - -static unsigned char shift4[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 3, 5, 5, 4, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 1, 5, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act53() -{ - NLA = Eof; - } - - -static void act54() -{ - NLA = 18; - zzline++; zzmode(ACTIONS); zzmore(); - } - - -static void act55() -{ - NLA = 19; - zzmore(); - } - -static unsigned char shift5[257] = { - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - - -static void act56() -{ - NLA = Eof; - } - - -static void act57() -{ - NLA = 20; - zzline++; zzmode(START); zzskip(); - } - - -static void act58() -{ - NLA = 21; - zzskip(); - } - -static unsigned char shift6[257] = { - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - - -static void act59() -{ - NLA = Eof; - } - - -static void act60() -{ - NLA = 22; - zzmode(START); zzskip(); - } - - -static void act61() -{ - NLA = 23; - zzskip(); - } - - -static void act62() -{ - NLA = 24; - zzline++; zzskip(); - } - - -static void act63() -{ - NLA = 25; - zzskip(); - } - -static unsigned char shift7[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 3, 5, 5, 4, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 1, 5, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act64() -{ - NLA = Eof; - } - - -static void act65() -{ - NLA = 26; - { - RefVarRec *rf; - zzskip(); - zzbegexpr[strlen(zzbegexpr)-1] = '\0'; - rf=refVarRec(zzbegexpr); - list_add(&AllRefVars, rf); - list_add(&RefVars, rf); - zzmode(ACTIONS); zzmore(); zzreplstr(""); - } - } - -static unsigned char shift8[257] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1 -}; - - -static void act66() -{ - NLA = Eof; - } - - -static void act67() -{ - NLA = Action; - /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = ' '; - zzbegexpr[1] = ' '; - if ( zzbufovf ) { - found_error = 1; - err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - - -static void act68() -{ - NLA = PassAction; - if ( topint() == ']' ) { - popint(); - if ( istackempty() ) /* terminate action */ - { - zzmode(START); - NLATEXT[0] = ' '; - zzbegexpr[0] = ' '; - if ( zzbufovf ) { - found_error = 1; - err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - else { - /* terminate #[..] */ - zzreplstr(")"); - zzmore(); - } - } - else if ( topint() == '|' ) { /* end of simple [...] */ - popint(); - zzmore(); - } - else zzmore(); - } - - -static void act69() -{ - NLA = 29; - zzline++; zzmore(); - } - - -static void act70() -{ - NLA = 30; - zzmore(); - } - - -static void act71() -{ - NLA = 31; - - if ( !(strcmp(zzbegexpr, "#ifdef")==0 || - strcmp(zzbegexpr, "#else")==0 || - strcmp(zzbegexpr, "#endif")==0 || - strcmp(zzbegexpr, "#ifndef")==0 || - strcmp(zzbegexpr, "#if")==0 || - strcmp(zzbegexpr, "#define")==0 || - strcmp(zzbegexpr, "#pragma")==0 || - strcmp(zzbegexpr, "#undef")==0 || - strcmp(zzbegexpr, "#import")==0 || - strcmp(zzbegexpr, "#line")==0 || - strcmp(zzbegexpr, "#include")==0 || - strcmp(zzbegexpr, "#error")==0) ) - { - static char buf[100]; - if ( !transform ) { - warn("#id used in nontransform mode; # ignored"); - sprintf(buf, "%s", zzbegexpr+1); - } - else { - if ( CurRule==NULL ) - {warn("#id used in action outside of rule; ignored");} - else if ( strcmp(zzbegexpr+1,CurRule)==0 ) - strcpy(buf, "(*_result)"); - } - zzreplstr(buf); - } - zzmore(); - } - - -static void act72() -{ - NLA = 32; - - if ( GenCPP ) zzreplstr("new SORAST"); - else zzreplstr("ast_empty_node()"); - zzmore(); - } - - -static void act73() -{ - NLA = 33; - zzreplstr("NULL"); zzmore(); - } - - -static void act74() -{ - NLA = 34; - - pushint(']'); - if ( GenCPP ) zzreplstr("new SORAST("); - else zzreplstr("ast_node("); - zzmore(); - } - - -static void act75() -{ - NLA = 35; - - pushint('}'); - if ( GenCPP ) zzreplstr("PCCTS_AST::make("); - else zzreplstr("ast_make("); - zzmore(); - } - - -static void act76() -{ - NLA = 36; - zzmore(); - } - - -static void act77() -{ - NLA = 37; - - if ( istackempty() ) - zzmore(); - else if ( topint()==')' ) { - popint(); - } - else if ( topint()=='}' ) { - popint(); - /* terminate #(..) */ - zzreplstr(", NULL)"); - } - zzmore(); - } - - -static void act78() -{ - NLA = 38; - - pushint('|'); /* look for '|' to terminate simple [...] */ - zzmore(); - } - - -static void act79() -{ - NLA = 39; - - pushint(')'); - zzmore(); - } - - -static void act80() -{ - NLA = 40; - zzreplstr("]"); zzmore(); - } - - -static void act81() -{ - NLA = 41; - zzreplstr(")"); zzmore(); - } - - -static void act82() -{ - NLA = 42; - zzreplstr(">"); zzmore(); - } - - -static void act83() -{ - NLA = 43; - zzmode(ACTION_CHARS); zzmore(); - } - - -static void act84() -{ - NLA = 44; - zzmode(ACTION_STRINGS); zzmore(); - } - - -static void act85() -{ - NLA = 45; - zzreplstr("#"); zzmore(); - } - - -static void act86() -{ - NLA = 46; - zzmore(); - } - - -static void act87() -{ - NLA = 47; - zzmore(); - } - - -static void act88() -{ - NLA = 48; - zzmode(ACTION_COMMENTS); zzmore(); - } - - -static void act89() -{ - NLA = 49; - err("Missing /*; found dangling */ in action"); zzmore(); - } - - -static void act90() -{ - NLA = 50; - zzmode(ACTION_CPP_COMMENTS); zzmore(); - } - - -static void act91() -{ - NLA = 51; - zzmode(REFVAR_SCARF); zzmore(); zzreplstr(""); - } - - -static void act92() -{ - NLA = 52; - - zzmore(); if ( !GenCPP ) zzreplstr("_parser->"); - } - - -static void act93() -{ - NLA = 53; - - if ( (GenCPP && strcmp(zzbegexpr,"ast_scan(")==0) || - (!GenCPP && strcmp(zzbegexpr,"ast_scan(")==0) ) { - char *args=scarf_to_end_of_func_call(); - zzreplstr(cvt_token_str(zzbegexpr, args)); - zzmore(); - } - else { pushint(')'); zzmore(); } - } - - -static void act94() -{ - NLA = 54; - zzmore(); - } - - -static void act95() -{ - NLA = 55; - zzmore(); - } - -static unsigned char shift9[257] = { - 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 3, 17, 17, 4, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 13, 5, 17, 17, 17, - 12, 9, 10, 15, 17, 17, 17, 17, 14, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 17, - 17, 17, 17, 1, 17, 16, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 8, 11, 2, 17, 6, 17, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17 -}; - - -static void act96() -{ - NLA = Eof; - } - - -static void act97() -{ - NLA = 93; - zzmode(PARSE_ENUM_FILE); zzmore(); - } - - -static void act98() -{ - NLA = 94; - zzmore(); - } - - -static void act99() -{ - NLA = 95; - zzline++; zzmore(); - } - - -static void act100() -{ - NLA = 96; - zzmore(); - } - -static unsigned char shift10[257] = { - 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 3, 5, 5, 4, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 1, 5, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 -}; - - -static void act101() -{ - NLA = Eof; - } - - -static void act102() -{ - NLA = 97; - zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); - } - - -static void act103() -{ - NLA = 98; - zzskip(); - } - -static unsigned char shift11[257] = { - 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3 -}; - - -static void act104() -{ - NLA = Eof; - /*zzmode(START); zzskip();*/ - } - - -static void act105() -{ - NLA = 99; - zzskip(); - } - - -static void act106() -{ - NLA = 100; - zzline++; zzskip(); - } - - -static void act107() -{ - NLA = 101; - zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); - } - - -static void act108() -{ - NLA = 102; - zzmode(TOK_DEF_COMMENTS); zzmore(); - } - - -static void act109() -{ - NLA = 103; - - } - - -static void act110() -{ - NLA = 104; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act111() -{ - NLA = 105; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act112() -{ - NLA = 106; - - } - - -static void act113() -{ - NLA = 107; - zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); - } - - -static void act114() -{ - NLA = 110; - } - - -static void act115() -{ - NLA = 111; - } - - -static void act116() -{ - NLA = 112; - } - - -static void act117() -{ - NLA = 113; - } - - -static void act118() -{ - NLA = 114; - } - - -static void act119() -{ - NLA = 115; - } - - -static void act120() -{ - NLA = 116; - } - - -static void act121() -{ - NLA = 117; - } - - -static void act122() -{ - NLA = INT; - } - - -static void act123() -{ - NLA = ID; - } - -static unsigned char shift12[257] = { - 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 1, 2, 31, 31, 3, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 1, 31, 31, 6, 31, 31, 31, - 31, 31, 31, 5, 31, 18, 31, 31, 4, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 31, - 28, 31, 17, 31, 31, 31, 30, 30, 30, 19, - 30, 30, 21, 30, 30, 30, 30, 20, 30, 30, - 30, 30, 30, 30, 30, 22, 30, 30, 30, 30, - 30, 30, 31, 31, 31, 31, 30, 31, 25, 30, - 30, 10, 11, 8, 30, 30, 7, 30, 24, 12, - 15, 9, 23, 30, 30, 30, 13, 30, 14, 30, - 30, 26, 30, 30, 16, 31, 27, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31 -}; - -#define DfaStates 226 -typedef unsigned short DfaState; - -static DfaState st0[38] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, - 21, 22, 23, 24, 12, 25, 226, 226 -}; - -static DfaState st1[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st2[38] = { - 226, 2, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st3[38] = { - 226, 226, 226, 26, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st4[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st5[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st6[38] = { - 226, 226, 226, 226, 226, 27, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st7[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st8[38] = { - 226, 226, 226, 226, 226, 226, 226, 28, 29, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st9[38] = { - 226, 226, 226, 226, 226, 226, 226, 30, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st10[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 31, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st11[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 32, 33, 33, 33, 33, 34, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 35, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st12[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 226, 226, 226, 226, 226, 226, 226, 36, 36, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st13[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st14[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st15[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st16[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 37, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st17[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st18[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st19[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st20[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 226, 226, 226, 226, 226, 226, 226, 36, 38, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st21[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st22[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st23[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st24[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st25[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 226, 226, 226, 226, 226, 226, 226, 39, 39, - 226, 226, 226, 226, 39, 39, 39, 226 -}; - -static DfaState st26[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st27[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st28[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st29[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st30[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st31[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st32[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 40, 33, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st33[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st34[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 41, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st35[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st36[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 226, 226, 226, 226, 226, 226, 226, 36, 36, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st37[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st38[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 42, 36, 36, 36, 36, 36, 36, - 36, 226, 226, 226, 226, 226, 226, 226, 36, 36, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st39[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 226, 226, 226, 226, 226, 226, 226, 39, 39, - 226, 226, 226, 226, 39, 39, 39, 226 -}; - -static DfaState st40[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 43, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st41[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 33, 44, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st42[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 45, 226, 226, 226, 226, 226, 226, 226, 36, 36, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st43[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 46, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st44[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 47, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st45[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 48, 226, 226, 226, 226, 226, 226, 226, 36, 36, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st46[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 49, 33, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st47[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 50, 33, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st48[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 226, 226, 226, 226, 226, 226, 226, 36, 36, - 226, 226, 226, 226, 36, 36, 36, 226 -}; - -static DfaState st49[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 51, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st50[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 33, 33, 52, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st51[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st52[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 53, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st53[38] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 226, 226, 226, 226, 226, 226, 226, 33, 33, - 226, 226, 226, 226, 33, 33, 33, 226 -}; - -static DfaState st54[7] = { - 55, 56, 57, 58, 59, 60, 226 -}; - -static DfaState st55[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st56[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st57[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st58[7] = { - 226, 226, 61, 226, 226, 226, 226 -}; - -static DfaState st59[7] = { - 226, 62, 62, 62, 62, 62, 226 -}; - -static DfaState st60[7] = { - 226, 226, 226, 226, 226, 60, 226 -}; - -static DfaState st61[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st62[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st63[7] = { - 64, 65, 66, 67, 68, 69, 226 -}; - -static DfaState st64[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st65[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st66[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st67[7] = { - 226, 226, 70, 226, 226, 226, 226 -}; - -static DfaState st68[7] = { - 226, 71, 71, 71, 71, 71, 226 -}; - -static DfaState st69[7] = { - 226, 226, 226, 226, 226, 69, 226 -}; - -static DfaState st70[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st71[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st72[7] = { - 73, 74, 75, 76, 77, 78, 226 -}; - -static DfaState st73[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st74[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st75[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st76[7] = { - 226, 226, 79, 226, 226, 226, 226 -}; - -static DfaState st77[7] = { - 226, 80, 80, 80, 80, 80, 226 -}; - -static DfaState st78[7] = { - 226, 226, 226, 226, 226, 78, 226 -}; - -static DfaState st79[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st80[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st81[7] = { - 82, 83, 84, 85, 86, 84, 226 -}; - -static DfaState st82[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st83[7] = { - 226, 226, 87, 226, 226, 226, 226 -}; - -static DfaState st84[7] = { - 226, 226, 84, 226, 226, 84, 226 -}; - -static DfaState st85[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st86[7] = { - 226, 226, 226, 88, 226, 226, 226 -}; - -static DfaState st87[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st88[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st89[5] = { - 90, 91, 92, 93, 226 -}; - -static DfaState st90[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st91[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st92[5] = { - 226, 94, 226, 226, 226 -}; - -static DfaState st93[5] = { - 226, 226, 226, 93, 226 -}; - -static DfaState st94[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st95[5] = { - 96, 97, 98, 99, 226 -}; - -static DfaState st96[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st97[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st98[5] = { - 226, 100, 226, 226, 226 -}; - -static DfaState st99[5] = { - 226, 226, 226, 99, 226 -}; - -static DfaState st100[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st101[7] = { - 102, 103, 104, 105, 106, 104, 226 -}; - -static DfaState st102[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st103[7] = { - 226, 226, 107, 226, 226, 226, 226 -}; - -static DfaState st104[7] = { - 226, 226, 104, 226, 226, 104, 226 -}; - -static DfaState st105[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st106[7] = { - 226, 226, 226, 108, 226, 226, 226 -}; - -static DfaState st107[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st108[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st109[4] = { - 110, 111, 226, 226 -}; - -static DfaState st110[4] = { - 226, 226, 226, 226 -}; - -static DfaState st111[4] = { - 226, 111, 112, 226 -}; - -static DfaState st112[4] = { - 226, 226, 226, 226 -}; - -static DfaState st113[19] = { - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 121, 226 -}; - -static DfaState st114[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st115[19] = { - 226, 131, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st116[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st117[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st118[19] = { - 226, 226, 226, 132, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st119[19] = { - 226, 226, 226, 226, 226, 226, 133, 226, 134, 135, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st120[19] = { - 226, 226, 226, 226, 226, 226, 120, 226, 226, 136, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st121[19] = { - 226, 226, 226, 226, 226, 226, 226, 121, 226, 226, - 226, 226, 226, 226, 226, 121, 226, 121, 226 -}; - -static DfaState st122[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st123[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st124[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st125[19] = { - 226, 137, 138, 139, 139, 140, 139, 139, 139, 139, - 141, 139, 139, 139, 139, 139, 139, 139, 226 -}; - -static DfaState st126[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st127[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st128[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 142, 143, 226, 226, 226 -}; - -static DfaState st129[19] = { - 226, 226, 226, 226, 226, 226, 226, 121, 226, 226, - 226, 226, 226, 226, 144, 121, 226, 121, 226 -}; - -static DfaState st130[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 145, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st131[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st132[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st133[19] = { - 226, 226, 226, 226, 226, 226, 146, 146, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st134[19] = { - 226, 226, 147, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st135[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 148, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st136[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st137[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st138[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st139[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st140[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st141[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st142[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st143[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st144[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st145[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st146[19] = { - 226, 226, 226, 226, 226, 226, 146, 146, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st147[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st148[19] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st149[7] = { - 150, 151, 152, 153, 154, 152, 226 -}; - -static DfaState st150[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st151[7] = { - 226, 226, 155, 226, 226, 226, 226 -}; - -static DfaState st152[7] = { - 226, 226, 152, 226, 226, 152, 226 -}; - -static DfaState st153[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st154[7] = { - 226, 226, 226, 156, 226, 226, 226 -}; - -static DfaState st155[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st156[7] = { - 226, 226, 226, 226, 226, 226, 226 -}; - -static DfaState st157[5] = { - 158, 159, 160, 161, 226 -}; - -static DfaState st158[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st159[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st160[5] = { - 226, 162, 226, 226, 226 -}; - -static DfaState st161[5] = { - 226, 226, 226, 161, 226 -}; - -static DfaState st162[5] = { - 226, 226, 226, 226, 226 -}; - -static DfaState st163[32] = { - 164, 165, 166, 167, 168, 226, 169, 170, 170, 170, - 170, 171, 170, 170, 170, 170, 172, 173, 174, 175, - 170, 170, 170, 170, 170, 170, 170, 176, 177, 178, - 170, 226 -}; - -static DfaState st164[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st165[32] = { - 226, 165, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st166[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st167[32] = { - 226, 226, 179, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st168[32] = { - 226, 226, 226, 226, 180, 181, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st169[32] = { - 226, 226, 226, 226, 226, 226, 226, 182, 226, 226, - 183, 184, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st170[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st171[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 186, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st172[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st173[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st174[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st175[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 187, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st176[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st177[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st178[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 178, - 226, 226 -}; - -static DfaState st179[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st180[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st181[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st182[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 188, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st183[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 189, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st184[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 190, - 226, 226, 191, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st185[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st186[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 192, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st187[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 193, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st188[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 194, - 195, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st189[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 196, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st190[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 197, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st191[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 198, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st192[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 199, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st193[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 200, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st194[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 201, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st195[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 202, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st196[32] = { - 226, 226, 226, 226, 226, 226, 226, 203, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st197[32] = { - 226, 226, 226, 226, 226, 226, 226, 204, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st198[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 205, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st199[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st200[32] = { - 226, 226, 226, 226, 226, 226, 226, 206, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 207, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st201[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 208, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st202[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 209, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st203[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 210, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st204[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 211, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st205[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st206[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 212, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st207[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 213, 226, 226, 185, - 185, 226 -}; - -static DfaState st208[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 214, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st209[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st210[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 215, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st211[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st212[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 216, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st213[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 217, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st214[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st215[32] = { - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226 -}; - -static DfaState st216[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 218, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st217[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 219, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st218[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 220, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st219[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 221, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st220[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 222, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st221[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 223, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st222[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 224, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st223[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 225, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st224[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - -static DfaState st225[32] = { - 226, 226, 226, 226, 226, 226, 226, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 226, 226, 226, 185, - 185, 185, 185, 185, 185, 185, 185, 226, 226, 185, - 185, 226 -}; - - -DfaState *dfa[226] = { - st0, - st1, - st2, - st3, - st4, - st5, - st6, - st7, - st8, - st9, - st10, - st11, - st12, - st13, - st14, - st15, - st16, - st17, - st18, - st19, - st20, - st21, - st22, - st23, - st24, - st25, - st26, - st27, - st28, - st29, - st30, - st31, - st32, - st33, - st34, - st35, - st36, - st37, - st38, - st39, - st40, - st41, - st42, - st43, - st44, - st45, - st46, - st47, - st48, - st49, - st50, - st51, - st52, - st53, - st54, - st55, - st56, - st57, - st58, - st59, - st60, - st61, - st62, - st63, - st64, - st65, - st66, - st67, - st68, - st69, - st70, - st71, - st72, - st73, - st74, - st75, - st76, - st77, - st78, - st79, - st80, - st81, - st82, - st83, - st84, - st85, - st86, - st87, - st88, - st89, - st90, - st91, - st92, - st93, - st94, - st95, - st96, - st97, - st98, - st99, - st100, - st101, - st102, - st103, - st104, - st105, - st106, - st107, - st108, - st109, - st110, - st111, - st112, - st113, - st114, - st115, - st116, - st117, - st118, - st119, - st120, - st121, - st122, - st123, - st124, - st125, - st126, - st127, - st128, - st129, - st130, - st131, - st132, - st133, - st134, - st135, - st136, - st137, - st138, - st139, - st140, - st141, - st142, - st143, - st144, - st145, - st146, - st147, - st148, - st149, - st150, - st151, - st152, - st153, - st154, - st155, - st156, - st157, - st158, - st159, - st160, - st161, - st162, - st163, - st164, - st165, - st166, - st167, - st168, - st169, - st170, - st171, - st172, - st173, - st174, - st175, - st176, - st177, - st178, - st179, - st180, - st181, - st182, - st183, - st184, - st185, - st186, - st187, - st188, - st189, - st190, - st191, - st192, - st193, - st194, - st195, - st196, - st197, - st198, - st199, - st200, - st201, - st202, - st203, - st204, - st205, - st206, - st207, - st208, - st209, - st210, - st211, - st212, - st213, - st214, - st215, - st216, - st217, - st218, - st219, - st220, - st221, - st222, - st223, - st224, - st225 -}; - - -DfaState accepts[227] = { - 0, 1, 2, 3, 3, 4, 23, 6, 0, 16, - 24, 32, 30, 13, 14, 15, 17, 18, 27, 20, - 30, 22, 25, 26, 28, 31, 3, 5, 9, 7, - 8, 10, 32, 32, 32, 19, 30, 29, 30, 31, - 32, 32, 30, 32, 32, 30, 32, 32, 21, 32, - 32, 11, 32, 12, 0, 33, 34, 35, 35, 0, - 37, 35, 36, 0, 38, 39, 40, 40, 0, 42, - 40, 41, 0, 43, 44, 45, 45, 0, 47, 45, - 46, 0, 48, 50, 52, 51, 51, 49, 51, 0, - 53, 54, 54, 55, 54, 0, 56, 57, 57, 58, - 57, 0, 59, 61, 63, 62, 62, 60, 62, 0, - 64, 0, 65, 0, 66, 70, 68, 69, 69, 76, - 94, 95, 78, 79, 77, 0, 83, 84, 87, 95, - 92, 67, 69, 71, 74, 75, 93, 82, 80, 86, - 85, 81, 90, 88, 89, 91, 71, 72, 73, 0, - 96, 98, 100, 99, 99, 97, 99, 0, 101, 102, - 102, 103, 102, 0, 104, 105, 106, 106, 0, 0, - 123, 123, 115, 116, 117, 123, 120, 121, 122, 106, - 107, 108, 0, 0, 0, 123, 123, 123, 0, 0, - 0, 0, 123, 123, 0, 0, 0, 0, 0, 114, - 123, 0, 0, 0, 0, 111, 123, 123, 0, 110, - 0, 113, 123, 123, 109, 112, 123, 123, 123, 123, - 123, 123, 123, 123, 118, 119, 0 -}; - -void (*actions[124])() = { - zzerraction, - act1, - act2, - act3, - act4, - act5, - act6, - act7, - act8, - act9, - act10, - act11, - act12, - act13, - act14, - act15, - act16, - act17, - act18, - act19, - act20, - act21, - act22, - act23, - act24, - act25, - act26, - act27, - act28, - act29, - act30, - act31, - act32, - act33, - act34, - act35, - act36, - act37, - act38, - act39, - act40, - act41, - act42, - act43, - act44, - act45, - act46, - act47, - act48, - act49, - act50, - act51, - act52, - act53, - act54, - act55, - act56, - act57, - act58, - act59, - act60, - act61, - act62, - act63, - act64, - act65, - act66, - act67, - act68, - act69, - act70, - act71, - act72, - act73, - act74, - act75, - act76, - act77, - act78, - act79, - act80, - act81, - act82, - act83, - act84, - act85, - act86, - act87, - act88, - act89, - act90, - act91, - act92, - act93, - act94, - act95, - act96, - act97, - act98, - act99, - act100, - act101, - act102, - act103, - act104, - act105, - act106, - act107, - act108, - act109, - act110, - act111, - act112, - act113, - act114, - act115, - act116, - act117, - act118, - act119, - act120, - act121, - act122, - act123 -}; - -static DfaState dfa_base[] = { - 0, - 54, - 63, - 72, - 81, - 89, - 95, - 101, - 109, - 113, - 149, - 157, - 163 -}; - -static unsigned char *b_class_no[] = { - shift0, - shift1, - shift2, - shift3, - shift4, - shift5, - shift6, - shift7, - shift8, - shift9, - shift10, - shift11, - shift12 -}; - - - -#define ZZSHIFT(c) (b_class_no[zzauto][1+c]) -#define MAX_MODE 13 -#include "dlgauto.h" diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.c b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.c deleted file mode 100644 index ad3704132..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.c +++ /dev/null @@ -1,1926 +0,0 @@ -/* - * A n t l r T r a n s l a t i o n H e a d e r - * - * Terence Parr, Will Cohen, and Hank Dietz: 1989-2001 - * Purdue University Electrical Engineering - * With AHPCRC, University of Minnesota - * ANTLR Version 1.33MR33 - * - * ../bin/antlr -gh -k 2 -gt sor.g - * - */ - -#define ANTLR_VERSION 13333 -#include "pcctscfg.h" -#include "pccts_stdio.h" - -/* 23-Sep-97 thm Accomodate user who needs to redefine ZZLEXBUFSIZE */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 8000 -#endif -#include "pcctscfg.h" /* MR20 G. Hobbelt __USE_PROTOS #define */ -#include "charbuf.h" -#include "hash.h" -#include "set.h" -#include "sor.h" -#define AST_FIELDS \ -int token; char text[MaxAtom+1], label[MaxRuleName+1]; \ -char *action; /* if action node, here is ptr to it */ \ -char in,out; \ -char init_action; /* set if Action and 1st action of alt */ \ -int file; int line; /* set for BLOCK, ALT, nonterm nodes */ \ -int upper_range; /* only if T1..T2 found */ \ -GLA *start_state; /* ptr into GLA for this block */ \ -int no_copy; /* copy input ptr to output ptr? */ \ -ListNode *refvars; /* any ref vars defined for this rule */ \ -unsigned char is_root; /* this token is a root #( A ... ) */ -#define zzcr_ast(node, cur, _tok, _text) \ -{(node)->token=_tok; strncpy((node)->text, _text,MaxAtom);} -#define USER_ZZSYN -#define zzAST_DOUBLE -extern int define_num; -#define LL_K 2 -#define GENAST - -#include "ast.h" - -#define zzSET_SIZE 16 -#include "antlr.h" -#include "tokens.h" -#include "dlgdef.h" -#include "mode.h" - -/* MR23 In order to remove calls to PURIFY use the antlr -nopurify option */ - -#ifndef PCCTS_PURIFY -#define PCCTS_PURIFY(r,s) memset((char *) &(r),'\0',(s)); -#endif - -#include "ast.c" -zzASTgvars - -ANTLR_INFO - -/* MR20 G. Hobbelt Fix for Borland C++ 4.x & 5.x compiling with ALL warnings enabled */ -#if defined(__TURBOC__) -#pragma warn -aus /* unused assignment of 'xxx' */ -#endif - - -#include "sym.h" -#include "proto.h" - -void /* MR9 23-Sep-97 Eliminate complaint about no return value */ -#ifdef __USE_PROTOS -lisp( AST *tree, FILE *output ) -#else -lisp( tree, output ) -AST *tree; -FILE *output; -#endif -{ - while ( tree != NULL ) - { - if ( tree->down != NULL ) fprintf(output," ("); - if ( tree->text[0]!='\0' ) { - fprintf(output, " \""); - if ( tree->label[0]!='\0' ) fprintf(output, "%s:", tree->label); - switch ( tree->token ) { - case OPT : - case POS_CLOSURE : - case CLOSURE : - case PRED_OP : - fprintf(output, "%s", tree->text); - break; - default : - fprintf(output, "%s[%s]", zztokens[tree->token], tree->text); - } - fprintf(output, "\""); - } - else { - fprintf(output, " %s", zztokens[tree->token]); - } - lisp(tree->down, output); - if ( tree->down != NULL ) fprintf(output," )"); - tree = tree->right; - } -} - -AST * -#ifdef __USE_PROTOS -zzmk_ast(AST *node, int token) -#else -zzmk_ast(node, token) -AST *node; -int token; -#endif -{ - node->token = token; - return node; -} - -AST * -#ifdef __USE_PROTOS -read_sor_desc(FILE *f) -#else -read_sor_desc(f) -FILE *f; -#endif -{ - AST *root = NULL; - - zzline = 1; - ANTLR(sordesc(&root), f); - - if ( found_error ) return NULL; - - if ( print_guts ) { - fprintf(stderr, "Internal Represenation of Tree Grammar:\n"); - lisp(root, stderr); - fprintf(stderr, "\n"); - } - - last_valid_token = token_type; - end_of_input = token_type++;/* end of input token type is 1 + last real token */ - epsilon = token_type++; /* epsilon token type is 2 + last real token */ - wild_card = token_type++; /* wild_card_token is 3 + last real token */ - token_association(end_of_input, "$"); - token_association(epsilon, "[Ep]"); - token_association(wild_card, "."); - - zzdouble_link(root, NULL, NULL); - rules = root; - if ( root!=NULL ) build_GLA(root); - - if ( print_guts ) { - fprintf(stderr, "Internal Represenation of Grammar Lookahead Automaton:\n"); - dump_GLAs(root); - fprintf(stderr, "\n"); - } - return root; -} - -void -#ifdef __USE_PROTOS -sordesc(AST**_root) -#else -sordesc(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int he=0,to=0; - { - zzBLOCK(zztasp2); - zzMake0; - { - for (;;) { - if ( !((setwd1[LA(1)]&0x1))) break; - if ( (LA(1)==Header) ) { - header(zzSTR); zzlink(_root, &_sibling, &_tail); - he++; - } - else { - if ( (LA(1)==Tokdef) ) { - tokdef(zzSTR); zzlink(_root, &_sibling, &_tail); - to++; - } - else break; /* MR6 code for exiting loop "for sure" */ - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - - if ( he==0 && !Inline && !GenCPP ) warnNoFL("missing #header statement"); - if ( he>1 ) warnNoFL("extra #header statement"); - if ( to>1 ) warnNoFL("extra #tokdef statement"); - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==Action) && (setwd1[LA(2)]&0x2) ) { - zzmatch(Action); - list_add(&before_actions, actiondup(LATEXT(1))); - zzCONSUME; - - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==81) - ) { - class_def(zzSTR); zzlink(_root, &_sibling, &_tail); - } - else { - if ( (setwd1[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==Action) && (setwd1[LA(2)]&0x8) ) { - zzmatch(Action); - - if ( CurClassName[0]!='\0' ) - list_add(&class_actions, actiondup(LATEXT(1))); - else - list_add(&before_actions, actiondup(LATEXT(1))); - zzCONSUME; - - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==NonTerm) ) { - rule(zzSTR); zzlink(_root, &_sibling, &_tail); - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==Action) && (setwd1[LA(2)]&0x10) ) { - zzmatch(Action); - - if ( CurClassName[0]!='\0' ) - list_add(&class_actions, actiondup(LATEXT(1))); - else - list_add(&before_actions, actiondup(LATEXT(1))); - zzCONSUME; - - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==80) - ) { - zzmatch(80); - - if ( CurClassName[0]=='\0' ) - err("missing class definition for trailing '}'"); - zzCONSUME; - - } - else { - if ( (setwd1[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr2,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==Action) ) { - zzmatch(Action); - list_add(&after_actions, actiondup(LATEXT(1))); - zzCONSUME; - - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(Eof); zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x40); - } -} - -void -#ifdef __USE_PROTOS -header(AST**_root) -#else -header(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - zzmatch(Header); zzCONSUME; - zzmatch(Action); - header_action = actiondup(LATEXT(1)); - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd1, 0x80); - } -} - -void -#ifdef __USE_PROTOS -tokdef(AST**_root) -#else -tokdef(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - zzmatch(Tokdef); zzCONSUME; - zzmatch(RExpr); - { - AST *dumb = NULL; - zzantlr_state st; FILE *f; struct zzdlg_state dst; - strcpy(tokdefs_file, LATEXT(1)); - strcpy(tokdefs_file, tokdefs_file+1); /* remove quotes */ - tokdefs_file[strlen(tokdefs_file)-1] = '\0'; - zzsave_antlr_state(&st); - zzsave_dlg_state(&dst); - define_num=0; - f = fopen(tokdefs_file, "r"); - if ( f==NULL ) {found_error=1; err(eMsg1("cannot open token defs file '%s'", tokdefs_file));} - else {ANTLRm(enum_file(&dumb), f, PARSE_ENUM_FILE);} - zzrestore_antlr_state(&st); - zzrestore_dlg_state(&dst); - UserDefdTokens = 1; - } - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x1); - } -} - -void -#ifdef __USE_PROTOS -class_def(AST**_root) -#else -class_def(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - zzmatch(81); zzastDPush; zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==NonTerm) ) { - zzmatch(NonTerm); zzastDPush; - strncpy(CurClassName,LATEXT(1),MaxAtom); - zzCONSUME; - - } - else { - if ( (LA(1)==Token) ) { - zzmatch(Token); zzastDPush; - strncpy(CurClassName,LATEXT(1),MaxAtom); - zzCONSUME; - - } - else {zzFAIL(1,zzerr3,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - if ( !GenCPP ) { err("class meta-op used without C++ option"); } - zzmatch(OPT); zzastDPush; zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x2); - } -} - -void -#ifdef __USE_PROTOS -rule(AST**_root) -#else -rule(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - SymEntry *p; int trouble=0, no_copy=0; - zzmatch(NonTerm); zzsubroot(_root, &_sibling, &_tail); - - (*_root)->file = CurFile; - (*_root)->line = zzline; - CurRule = zzaArg(zztasp1,1 ).text; - p = (SymEntry *) hash_get(symbols, zzaArg(zztasp1,1 ).text); - if ( p==NULL ) { - p = (SymEntry *) hash_add(symbols, zzaArg(zztasp1,1 ).text, (Entry *) newSymEntry(zzaArg(zztasp1,1 ).text)); - p->token = NonTerm; - p->defined = 1; - p->definition = (*_root); - } - else if ( p->token != NonTerm ) { - err(eMsg2("rule definition clashes with %s definition: '%s'", zztokens[p->token], p->str)); - trouble = 1; - } - else { - if ( p->defined ) { - trouble = 1; - err(eMsg1("rule multiply defined: '%s'", zzaArg(zztasp1,1 ).text)); - } - else { - p->defined = 1; - p->definition = (*_root); - } - } - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==84) - ) { - zzmatch(84); - if (!trouble) (*_root)->no_copy=no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (setwd2[LA(1)]&0x8) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==85) ) { - zzmatch(85); zzCONSUME; - } - else { - if ( (LA(1)==PassAction) ) { - } - else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - zzmatch(PassAction); - if (!trouble) p->args = actiondup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x10) - ) { - } - else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==86) ) { - zzmatch(86); zzCONSUME; - zzmatch(PassAction); - if (!trouble) p->rt = actiondup(LATEXT(1)); - zzCONSUME; - - } - else { - if ( (LA(1)==LABEL) ) { - } - else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzmatch(LABEL); zzCONSUME; - block(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - zzmatch(87); - - if ( !trouble ) (*_root)->refvars = RefVars; - RefVars=NULL; - zzCONSUME; - - - if ( trouble ) (*_root) = NULL; - CurRule = NULL; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x20); - } -} - -void -#ifdef __USE_PROTOS -block(AST**_root,int no_copy) -#else -block(_root,no_copy) -AST **_root; - int no_copy ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int line=zzline, file=CurFile; - alt(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==88) ) { - zzmatch(88); zzCONSUME; - alt(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - - (*_root) = zztmake( zzmk_ast(zzastnew(),BLOCK), (*_root) , NULL); - (*_root)->file = file; - (*_root)->line = line; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd2, 0x40); - } -} - -void -#ifdef __USE_PROTOS -alt(AST**_root,int no_copy) -#else -alt(_root,no_copy) -AST **_root; - int no_copy ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int line=zzline, file=CurFile; int local_no_copy=0; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd2[LA(1)]&0x80) - ) { - } - else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (setwd3[LA(1)]&0x1) ) { - { - zzBLOCK(zztasp3); - int zzcnt=1; - zzMake0; - { - do { - if ( (setwd3[LA(1)]&0x2) && (LA(2)==LABEL) ) { - labeled_element(zzSTR, no_copy||local_no_copy ); zzlink(_root, &_sibling, &_tail); - } - else { - if ( (setwd3[LA(1)]&0x4) && (setwd3[LA(2)]&0x8) ) { - element(zzSTR, no_copy||local_no_copy ); zzlink(_root, &_sibling, &_tail); - } - else { - if ( (LA(1)==BT) ) { - tree(zzSTR, no_copy||local_no_copy ); zzlink(_root, &_sibling, &_tail); - } - else { - if ( zzcnt > 1 ) break; - else {zzFAIL(2,zzerr9,zzerr10,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - zzcnt++; zzLOOP(zztasp3); - } while ( 1 ); - zzEXIT(zztasp3); - } - } - } - else { - if ( (setwd3[LA(1)]&0x10) - ) { - } - else {zzFAIL(1,zzerr11,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - (*_root) = zztmake( zzmk_ast(zzastnew(),ALT), (*_root) , NULL); - (*_root)->file = file; - (*_root)->line = line; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd3, 0x20); - } -} - -void -#ifdef __USE_PROTOS -element(AST**_root,int no_copy) -#else -element(_root,no_copy) -AST **_root; - int no_copy ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - /**** SymEntry *p; **** MR10 ****/ int file,line; int local_no_copy=0; - if ( (LA(1)==Token) ) { - token(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - } - else { - if ( (LA(1)==NonTerm) ) { - file = CurFile; line=zzline; - zzmatch(NonTerm); zzsubroot(_root, &_sibling, &_tail); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy = 1; - zzCONSUME; - - } - else { - if ( (setwd3[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr12,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (setwd3[LA(1)]&0x80) - ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==85) ) { - zzmatch(85); zzCONSUME; - } - else { - if ( (LA(1)==PassAction) ) { - } - else {zzFAIL(1,zzerr13,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail); - (*_root)->in = 1; - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr14,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==86) ) { - zzmatch(86); zzCONSUME; - zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail); - (*_root)->out = 1; - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x2) - ) { - } - else {zzFAIL(1,zzerr15,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - (*_root)->file = file; (*_root)->line=line; - (*_root)->no_copy = no_copy || local_no_copy; - } - else { - if ( (LA(1)==Action) ) { - file = CurFile; line=zzline; - zzmatch(Action); zzsubchild(_root, &_sibling, &_tail); - zzastArg(1)->action = actiondup(LATEXT(1)); - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==PRED_OP) ) { - zzmatch(PRED_OP); zzsubroot(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (setwd4[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr16,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - (*_root)->file = file; (*_root)->line=line; - } - else { - if ( (LA(1)==89) ) { - file = CurFile; line=zzline; - zzmatch(89); zzCONSUME; - block(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - zzmatch(90); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==CLOSURE) - ) { - zzmatch(CLOSURE); zzsubroot(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==POS_CLOSURE) ) { - zzmatch(POS_CLOSURE); zzsubroot(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==PRED_OP) ) { - zzmatch(PRED_OP); zzsubroot(_root, &_sibling, &_tail); - found_guess_block=1; - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr17,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - zzEXIT(zztasp2); - } - } - (*_root)->file = file; (*_root)->line=line; - } - else { - if ( (LA(1)==OPT) ) { - zzmatch(OPT); zzsubroot(_root, &_sibling, &_tail); zzCONSUME; - block(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - zzmatch(80); zzCONSUME; - } - else { - if ( (LA(1)==WILD) - ) { - file = CurFile; line=zzline; - zzmatch(WILD); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy = 1; - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x10) ) { - } - else {zzFAIL(1,zzerr18,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - (*_root)->no_copy = no_copy || local_no_copy; - (*_root)->file = file; (*_root)->line=line; - } - else {zzFAIL(1,zzerr19,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd4, 0x20); - } -} - -void -#ifdef __USE_PROTOS -labeled_element(AST**_root,int no_copy) -#else -labeled_element(_root,no_copy) -AST **_root; - int no_copy ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - Attrib label; int file,line; SymEntry *s; int local_no_copy=0; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==Token) ) { - zzmatch(Token); - label = zzaArg(zztasp2,1); - zzCONSUME; - - } - else { - if ( (LA(1)==NonTerm) ) { - zzmatch(NonTerm); - label = zzaArg(zztasp2,1); - zzCONSUME; - - } - else {zzFAIL(1,zzerr20,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - s = (SymEntry *) hash_get(symbols, label.text); - if ( s==NULL ) { - s = (SymEntry *) hash_add(symbols, label.text, (Entry *) newSymEntry(label.text)); - s->token = LABEL; - } - else if ( s->token!=LABEL ) { - err(eMsg2("label definition clashes with %s definition: '%s'", zztokens[s->token], label.text)); - } - zzmatch(LABEL); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - file = CurFile; line=zzline; - if ( (LA(1)==Token) - ) { - token(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - strcpy(zzastArg(1)->label, label.text); - (*_root)->file = file; (*_root)->line=line; - } - else { - if ( (LA(1)==NonTerm) ) { - file = CurFile; line=zzline; - zzmatch(NonTerm); zzsubroot(_root, &_sibling, &_tail); - strcpy(zzastArg(1)->label, label.text); - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy = 1; - zzCONSUME; - - } - else { - if ( (setwd4[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr21,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (setwd4[LA(1)]&0x80) ) { - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==85) - ) { - zzmatch(85); zzCONSUME; - } - else { - if ( (LA(1)==PassAction) ) { - } - else {zzFAIL(1,zzerr22,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail); - (*_root)->in = 1; - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x1) ) { - } - else {zzFAIL(1,zzerr23,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==86) ) { - zzmatch(86); zzCONSUME; - zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail); - (*_root)->out = 1; - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x2) ) { - } - else {zzFAIL(1,zzerr24,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - (*_root)->file = file; (*_root)->line=line; - (*_root)->no_copy = no_copy || local_no_copy; - } - else { - if ( (LA(1)==WILD) - ) { - file = CurFile; line=zzline; - zzmatch(WILD); zzsubchild(_root, &_sibling, &_tail); - strcpy(zzastArg(1)->label, label.text); - zzCONSUME; - - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy = 1; - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr25,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - (*_root)->no_copy = no_copy || local_no_copy; - (*_root)->file = file; (*_root)->line=line; - } - else { - if ( (setwd5[LA(1)]&0x8) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==88) ) { - zzmatch(88); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==87) - ) { - zzmatch(87); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==PassAction) ) { - zzmatch(PassAction); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==Action) ) { - zzmatch(Action); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==Eof) ) { - zzmatch(Eof); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==89) ) { - zzmatch(89); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==OPT) - ) { - zzmatch(OPT); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==90) ) { - zzmatch(90); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==80) ) { - zzmatch(80); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else { - if ( (LA(1)==BT) ) { - zzmatch(BT); zzsubchild(_root, &_sibling, &_tail); zzCONSUME; - } - else {zzFAIL(1,zzerr26,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - } - } - } - } - } - } - zzEXIT(zztasp3); - } - } - - err("cannot label this grammar construct"); - found_error = 1; - } - else {zzFAIL(1,zzerr27,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - zzEXIT(zztasp2); - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd5, 0x10); - } -} - -void -#ifdef __USE_PROTOS -token(AST**_root,int no_copy) -#else -token(_root,no_copy) -AST **_root; - int no_copy ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - SymEntry *p; int file, line; int local_no_copy=0; - file = CurFile; line=zzline; - zzmatch(Token); zzsubchild(_root, &_sibling, &_tail); - (*_root)->file = file; (*_root)->line=line; - zzCONSUME; - - define_token(zzaArg(zztasp1,1 ).text); - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==91) ) { - zzmatch(91); zzCONSUME; - zzmatch(Token); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==84) - ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr28,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - - if ( !UserDefdTokens ) { - err("range operator is illegal without #tokdefs directive"); - } - else { - p = define_token(zzaArg(zztasp2,2 ).text); - require(p!=NULL, "token: hash table is broken"); - (*_root)->upper_range = p->token_type; - } - } - else { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd5[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr29,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp2); - } - } - (*_root)->no_copy = no_copy||local_no_copy; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd5, 0x80); - } -} - -void -#ifdef __USE_PROTOS -tree(AST**_root,int no_copy) -#else -tree(_root,no_copy) -AST **_root; - int no_copy ; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - Attrib label; SymEntry *p, *s; int local_no_copy=0; AST *t=NULL; - zzmatch(BT); zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==Token) && (setwd6[LA(2)]&0x1) ) { - zzmatch(Token); zzsubroot(_root, &_sibling, &_tail); - t=zzastArg(1); - zzCONSUME; - - define_token(zzaArg(zztasp2,1 ).text); - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==91) - ) { - zzmatch(91); zzCONSUME; - zzmatch(Token); zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x2) ) { - } - else {zzFAIL(1,zzerr30,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - - if ( !UserDefdTokens ) { - err("range operator is illegal without #tokdefs directive"); - } - else { - p = define_token(zzaArg(zztasp3,2 ).text); - require(p!=NULL, "element: hash table is broken"); - t->upper_range = p->token_type; - } - } - else { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr31,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp3); - } - } - t->no_copy = no_copy||local_no_copy; t->is_root = 1; - } - else { - if ( (LA(1)==WILD) - ) { - zzmatch(WILD); zzsubroot(_root, &_sibling, &_tail); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy = 1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x8) ) { - } - else {zzFAIL(1,zzerr32,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - zzastArg(1)->no_copy = no_copy || local_no_copy; zzastArg(1)->is_root = 1; - } - else { - if ( (setwd6[LA(1)]&0x10) && (LA(2)==LABEL) ) { - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==Token) ) { - zzmatch(Token); - label = zzaArg(zztasp3,1); - zzCONSUME; - - } - else { - if ( (LA(1)==NonTerm) - ) { - zzmatch(NonTerm); - label = zzaArg(zztasp3,1); - zzCONSUME; - - } - else {zzFAIL(1,zzerr33,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - - s = (SymEntry *) hash_get(symbols, label.text); - if ( s==NULL ) { - s = (SymEntry *) hash_add(symbols, label.text, (Entry *) newSymEntry(label.text)); - s->token = LABEL; - } - else if ( s->token!=LABEL ) { - err(eMsg2("label definition clashes with %s definition: '%s'", zztokens[s->token], label.text)); - } - zzmatch(LABEL); zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==Token) ) { - zzmatch(Token); zzsubroot(_root, &_sibling, &_tail); - strcpy(zzastArg(1)->label, label.text); t = zzastArg(1); - zzCONSUME; - - define_token(zzaArg(zztasp3,1 ).text); - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==91) ) { - zzmatch(91); zzCONSUME; - zzmatch(Token); zzCONSUME; - { - zzBLOCK(zztasp5); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x20) ) { - } - else {zzFAIL(1,zzerr34,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp5); - } - } - - if ( !UserDefdTokens ) { - err("range operator is illegal without #tokdefs directive"); - } - else { - p = define_token(zzaArg(zztasp4,2 ).text); - require(p!=NULL, "element: hash table is broken"); - t->upper_range = p->token_type; - } - } - else { - if ( (LA(1)==84) - ) { - zzmatch(84); - local_no_copy=1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x40) ) { - } - else {zzFAIL(1,zzerr35,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp4); - } - } - t->no_copy = no_copy||local_no_copy; - } - else { - if ( (LA(1)==WILD) ) { - zzmatch(WILD); zzsubroot(_root, &_sibling, &_tail); - strcpy(zzastArg(1)->label, label.text); - zzCONSUME; - - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==84) ) { - zzmatch(84); - local_no_copy = 1; - zzCONSUME; - - } - else { - if ( (setwd6[LA(1)]&0x80) ) { - } - else {zzFAIL(1,zzerr36,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - zzastArg(1)->no_copy = no_copy || local_no_copy; - } - else {zzFAIL(1,zzerr37,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - t->is_root = 1; - } - else {zzFAIL(2,zzerr38,zzerr39,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - zzMake0; - { - for (;;) { - if ( !((setwd7[LA(1)]&0x1) -)) break; - if ( (setwd7[LA(1)]&0x2) && (LA(2)==LABEL) ) { - labeled_element(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - } - else { - if ( (setwd7[LA(1)]&0x4) && (setwd7[LA(2)]&0x8) ) { - element(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - } - else { - if ( (LA(1)==BT) ) { - tree(zzSTR, no_copy ); zzlink(_root, &_sibling, &_tail); - } - else break; /* MR6 code for exiting loop "for sure" */ - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(90); zzCONSUME; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - found_error=1; - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd7, 0x10); - } -} - -void -#ifdef __USE_PROTOS -enum_file(AST**_root) -#else -enum_file(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - SymEntry *p=NULL; - if ( (setwd7[LA(1)]&0x20) ) { - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==103) - ) { - zzmatch(103); zzastDPush; zzCONSUME; - zzmatch(ID); zzastDPush; zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==106) ) { - zzmatch(106); zzastDPush; zzCONSUME; - zzmatch(ID); zzastDPush; zzCONSUME; - } - else { - if ( (LA(1)==110) ) { - } - else {zzFAIL(1,zzerr40,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp3); - } - } - } - else { - if ( (LA(1)==110) ) { - } - else {zzFAIL(1,zzerr41,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - { - zzBLOCK(zztasp2); - int zzcnt=1; - zzMake0; - { - do { - _ast = NULL; enum_def(&_ast); - zzLOOP(zztasp2); - } while ( (LA(1)==110) ); - zzEXIT(zztasp2); - } - } - } - else { - if ( (LA(1)==106) - ) { - _ast = NULL; defines(&_ast); - } - else { - if ( (LA(1)==Eof) ) { - } - else {zzFAIL(1,zzerr42,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd7, 0x40); - } -} - -void -#ifdef __USE_PROTOS -defines(AST**_root) -#else -defines(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int maxt= -1; /**** char *t; **** MR10 ****/ SymEntry *p; int ignore=0; - { - zzBLOCK(zztasp2); - int zzcnt=1; - zzMake0; - { - do { - zzmatch(106); zzastDPush; zzCONSUME; - zzmatch(ID); zzastDPush; - - p = (SymEntry *) hash_get(symbols, zzaArg(zztasp2,2 ).text); - if ( p==NULL ) { - p = (SymEntry *) hash_add(symbols, zzaArg(zztasp2,2 ).text, - (Entry *) newSymEntry(zzaArg(zztasp2,2 ).text)); - require(p!=NULL, "can't add to sym tab"); - p->token = Token; - list_add(&token_list, (void *)p); - set_orel(p->token_type, &referenced_tokens); - } - else - { - err(eMsg1("redefinition of token %s; ignored",zzaArg(zztasp2,2 ).text)); - ignore = 1; - } - zzCONSUME; - - zzmatch(INT); zzastDPush; - - if ( !ignore ) { - p->token_type = atoi(zzaArg(zztasp2,3 ).text); - token_association(p->token_type, p->str); - /* fprintf(stderr, "#token %s=%d\n", p->str, p->token_type);*/ - if ( p->token_type>maxt ) maxt=p->token_type; - ignore = 0; - } - zzCONSUME; - - zzLOOP(zztasp2); - } while ( (LA(1)==106) ); - zzEXIT(zztasp2); - } - } - token_type = maxt + 1; - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd7, 0x80); - } -} - -void -#ifdef __USE_PROTOS -enum_def(AST**_root) -#else -enum_def(_root) -AST **_root; -#endif -{ - zzRULE; - zzBLOCK(zztasp1); - zzMake0; - { - int maxt = -1, v= -1; /**** char *t; **** MR10 ****/ SymEntry *p; int ignore=0; - zzmatch(110); zzastDPush; zzCONSUME; - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==ID) ) { - zzmatch(ID); zzastDPush; zzCONSUME; - } - else { - if ( (LA(1)==111) ) { - } - else {zzFAIL(1,zzerr43,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - zzmatch(111); zzastDPush; zzCONSUME; - zzmatch(ID); zzastDPush; - - p = (SymEntry *) hash_get(symbols, zzaArg(zztasp1,4 ).text); - if ( p==NULL ) { - p = (SymEntry *) hash_add(symbols, zzaArg(zztasp1,4 ).text, - (Entry *) newSymEntry(zzaArg(zztasp1,4 ).text)); - require(p!=NULL, "can't add to sym tab"); - p->token = Token; - list_add(&token_list, (void *)p); - set_orel(p->token_type, &referenced_tokens); - } - else - { - err(eMsg1("redefinition of token %s; ignored",zzaArg(zztasp1,4 ).text)); - ignore = 1; - } - zzCONSUME; - - { - zzBLOCK(zztasp2); - zzMake0; - { - if ( (LA(1)==112) - ) { - zzmatch(112); zzastDPush; zzCONSUME; - zzmatch(INT); zzastDPush; - v=atoi(zzaArg(zztasp2,2 ).text); - zzCONSUME; - - } - else { - if ( (setwd8[LA(1)]&0x1) ) { - v++; - } - else {zzFAIL(1,zzerr44,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp2); - } - } - - if ( !ignore ) { - /* fprintf(stderr, "#token %s=%d\n", p->str, v);*/ - if ( v>maxt ) maxt=v; - p->token_type = v; - token_association(p->token_type, p->str); - ignore = 0; - } - { - zzBLOCK(zztasp2); - zzMake0; - { - while ( (LA(1)==113) ) { - zzmatch(113); zzastDPush; zzCONSUME; - { - zzBLOCK(zztasp3); - zzMake0; - { - if ( (LA(1)==114) ) { - zzmatch(114); zzastDPush; zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==112) ) { - zzmatch(112); zzastDPush; zzCONSUME; - zzmatch(INT); zzastDPush; zzCONSUME; - } - else { - if ( (setwd8[LA(1)]&0x2) - ) { - } - else {zzFAIL(1,zzerr45,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (LA(1)==115) ) { - zzmatch(115); zzastDPush; zzCONSUME; - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==112) ) { - zzmatch(112); zzastDPush; zzCONSUME; - zzmatch(INT); zzastDPush; zzCONSUME; - } - else { - if ( (setwd8[LA(1)]&0x4) ) { - } - else {zzFAIL(1,zzerr46,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - } - else { - if ( (LA(1)==ID) ) { - zzmatch(ID); zzastDPush; - - p = (SymEntry *) hash_get(symbols, zzaArg(zztasp3,1 ).text); - if ( p==NULL ) { - p = (SymEntry *) hash_add(symbols, zzaArg(zztasp3,1 ).text, - (Entry *) newSymEntry(zzaArg(zztasp3,1 ).text)); - require(p!=NULL, "can't add to sym tab"); - p->token = Token; - list_add(&token_list, (void *)p); - set_orel(p->token_type, &referenced_tokens); - } - else - { - err(eMsg1("redefinition of token %s; ignored",zzaArg(zztasp3,1 ).text)); - ignore = 1; - } - zzCONSUME; - - { - zzBLOCK(zztasp4); - zzMake0; - { - if ( (LA(1)==112) - ) { - zzmatch(112); zzastDPush; zzCONSUME; - zzmatch(INT); zzastDPush; - v=atoi(zzaArg(zztasp4,2 ).text); - zzCONSUME; - - } - else { - if ( (setwd8[LA(1)]&0x8) ) { - v++; - } - else {zzFAIL(1,zzerr47,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - zzEXIT(zztasp4); - } - } - - if ( !ignore ) { - /* fprintf(stderr, "#token %s=%d\n", p->str, v);*/ - if ( v>maxt ) maxt=v; - p->token_type = v; - token_association(p->token_type, p->str); - ignore = 0; - } - } - else { - if ( (setwd8[LA(1)]&0x10) ) { - } - else {zzFAIL(1,zzerr48,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} - } - } - } - zzEXIT(zztasp3); - } - } - zzLOOP(zztasp2); - } - zzEXIT(zztasp2); - } - } - zzmatch(116); zzastDPush; zzCONSUME; - zzmatch(117); zzastDPush; - token_type = maxt + 1; - zzCONSUME; - - zzEXIT(zztasp1); - return; -fail: - zzEXIT(zztasp1); - zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); - zzresynch(setwd8, 0x20); - } -} - -/* SORCERER-specific syntax error message generator -* (define USER_ZZSYN when compiling so don't get 2 definitions) -*/ -void -#ifdef __USE_PROTOS -zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text) -#else -zzsyn(text, tok, egroup, eset, etok, k, bad_text) -char *text, *egroup, *bad_text; -int tok; -int etok; -int k; -SetWordType *eset; -#endif -{ -fprintf(stderr, ErrHdr, FileStr[CurFile]!=NULL?FileStr[CurFile]:"stdin", zzline); -fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text); -if ( !etok && !eset ) {fprintf(stderr, "\n"); return;} -if ( k==1 ) fprintf(stderr, " missing"); -else -{ -fprintf(stderr, "; \"%s\" not", bad_text); -if ( zzset_deg(eset)>1 ) fprintf(stderr, " in"); -} -if ( zzset_deg(eset)>0 ) zzedecode(eset); -else fprintf(stderr, " %s", zztokens[etok]); -if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup); -fprintf(stderr, "\n"); -} - -SymEntry * -#ifdef __USE_PROTOS -define_token(char *text) -#else -define_token(text) -char *text; -#endif -{ -SymEntry *p; - - p = (SymEntry *) hash_get(symbols, text); -if ( p==NULL ) { -if ( UserDefdTokens ) { -err(eMsg1("implicit token definition of '%s' not allowed with #tokdefs",text)); -} -p = (SymEntry *) hash_add(symbols, text, (Entry *) newSymEntry(text)); -p->token = Token; -p->token_type = token_type++; -token_association(p->token_type, p->str); -list_add(&token_list, (void *)p); -set_orel(p->token_type, &referenced_tokens); -} -else { -if ( p->token!=Token ) -err(eMsg2("token definition clashes with %s definition: '%s'", zztokens[p->token], text)); -} -return p; -} diff --git a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.g b/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.g deleted file mode 100644 index 6206cdf4d..000000000 --- a/c/makeotf/makeotf_lib/build/hotpccts/pccts/sorcerer/sor.g +++ /dev/null @@ -1,1030 +0,0 @@ -/* - * SORCERER Version 1.00B - * - * Terence Parr - * U of MN, AHPCRC - * April 1995 - */ - -#header << - /* 23-Sep-97 thm Accomodate user who needs to redefine ZZLEXBUFSIZE */ - -#ifndef ZZLEXBUFSIZE -#define ZZLEXBUFSIZE 8000 -#endif - #include "pcctscfg.h" /* MR20 G. Hobbelt __USE_PROTOS #define */ - #include "charbuf.h" - #include "hash.h" - #include "set.h" - #include "sor.h" - #define AST_FIELDS \ - int token; char text[MaxAtom+1], label[MaxRuleName+1]; \ - char *action; /* if action node, here is ptr to it */ \ - char in,out; \ - char init_action; /* set if Action and 1st action of alt */ \ - int file; int line; /* set for BLOCK, ALT, nonterm nodes */ \ - int upper_range; /* only if T1..T2 found */ \ - GLA *start_state; /* ptr into GLA for this block */ \ - int no_copy; /* copy input ptr to output ptr? */ \ - ListNode *refvars; /* any ref vars defined for this rule */ \ - unsigned char is_root; /* this token is a root #( A ... ) */ - #define zzcr_ast(node, cur, _tok, _text) \ - {(node)->token=_tok; strncpy((node)->text, _text,MaxAtom);} - #define USER_ZZSYN - #define zzAST_DOUBLE - extern int define_num; ->> - -<< -/* MR20 G. Hobbelt Fix for Borland C++ 4.x & 5.x compiling with ALL warnings enabled */ -#if defined(__TURBOC__) -#pragma warn -aus /* unused assignment of 'xxx' */ -#endif - - -#include "sym.h" -#include "proto.h" ->> - -#lexaction << -#include "sym.h" -#include "proto.h" - -int define_num = 0; - -char * -#ifdef __USE_PROTOS -scarf_to_end_of_func_call(void) -#else -scarf_to_end_of_func_call() -#endif -{ - static char func_call_str[MaxAtom+1]; - char *p; - - p = &func_call_str[0]; - -more: - if ( zzchar==')' ) { *p++ = zzchar; *p++ = '\0'; zzadvance(); return func_call_str; } - if ( zzchar=='"' ) - { - *p++ = zzchar; zzadvance(); - while ( zzchar!='"' ) - { - if ( zzchar=='\\' ) { *p++ = zzchar; zzadvance(); } - *p++ = zzchar; zzadvance(); - } - } - *p++ = zzchar; zzadvance(); - goto more; -} ->> - -<< -void /* MR9 23-Sep-97 Eliminate complaint about no return value */ -#ifdef __USE_PROTOS -lisp( AST *tree, FILE *output ) -#else -lisp( tree, output ) -AST *tree; -FILE *output; -#endif -{ - while ( tree != NULL ) - { - if ( tree->down != NULL ) fprintf(output," ("); - if ( tree->text[0]!='\0' ) { - fprintf(output, " \""); - if ( tree->label[0]!='\0' ) fprintf(output, "%s:", tree->label); - switch ( tree->token ) { - case OPT : - case POS_CLOSURE : - case CLOSURE : - case PRED_OP : - fprintf(output, "%s", tree->text); - break; - default : - fprintf(output, "%s[%s]", zztokens[tree->token], tree->text); - } - fprintf(output, "\""); - } - else { - fprintf(output, " %s", zztokens[tree->token]); - } - lisp(tree->down, output); - if ( tree->down != NULL ) fprintf(output," )"); - tree = tree->right; - } -} - -AST * -#ifdef __USE_PROTOS -zzmk_ast(AST *node, int token) -#else -zzmk_ast(node, token) -AST *node; -int token; -#endif -{ - node->token = token; - return node; -} - -AST * -#ifdef __USE_PROTOS -read_sor_desc(FILE *f) -#else -read_sor_desc(f) -FILE *f; -#endif -{ - AST *root = NULL; - - zzline = 1; - ANTLR(sordesc(&root), f); - - if ( found_error ) return NULL; - - if ( print_guts ) { - fprintf(stderr, "Internal Represenation of Tree Grammar:\n"); - lisp(root, stderr); - fprintf(stderr, "\n"); - } - - last_valid_token = token_type; - end_of_input = token_type++;/* end of input token type is 1 + last real token */ - epsilon = token_type++; /* epsilon token type is 2 + last real token */ - wild_card = token_type++; /* wild_card_token is 3 + last real token */ - token_association(end_of_input, "$"); - token_association(epsilon, "[Ep]"); - token_association(wild_card, "."); - - zzdouble_link(root, NULL, NULL); - rules = root; - if ( root!=NULL ) build_GLA(root); - - if ( print_guts ) { - fprintf(stderr, "Internal Represenation of Grammar Lookahead Automaton:\n"); - dump_GLAs(root); - fprintf(stderr, "\n"); - } - return root; -} ->> - -#lexclass STRINGS -#token RExpr "\"" << zzmode(START); >> -#token "\n|\r|\r\n" << /* MR16a */ - zzline++; - warn("eoln found in string"); - zzskip(); - >> -#token "\\~[]" << zzmore(); >> -#token "~[\n\r\"\\]+" << zzmore(); >> /* MR16a */ - -#lexclass ACTION_STRINGS -#token "\"" << zzmode(ACTIONS); zzmore(); >> -#token "\n|\r|\r\n" << /* MR16a */ - zzline++; - warn("eoln found in string (in user action)"); - zzskip(); - >> -#token "\\~[]" << zzmore(); >> -#token "~[\n\r\"\\]+" << zzmore(); >> /* MR16a */ - -#lexclass ACTION_CHARS -#token "'" << zzmode(ACTIONS); zzmore(); >> -#token "\n|\r|\r\n" << /* MR16a */ - zzline++; - warn("eoln found in char literal (in user action)"); - zzskip(); - >> -#token "\\~[]" << zzmore(); >> -#token "~[\n\r'\\]+" << zzmore(); >> /* MR16a */ - -#lexclass ACTION_COMMENTS -#token "\*/" << zzmode(ACTIONS); zzmore(); >> -#token "\*" << zzmore(); >> -#token "\n|\r|\r\n" << zzline++; zzmore(); >> /* MR16a */ -#token "~[\n\r\*]+" << zzmore(); >> /* MR16a */ - -#lexclass ACTION_CPP_COMMENTS -#token "\n|\r|\r\n" << zzline++; zzmode(ACTIONS); zzmore(); >> /* MR16a */ -#token "~[\n\r]+" << zzmore(); >> /* MR16a */ - -#lexclass CPP_COMMENTS -#token "\n|\r|\r\n" << zzline++; zzmode(START); zzskip(); >> /* MR16a */ -#token "~[\n\r]+" << zzskip(); >> /* MR16a */ - -#lexclass COMMENTS -#token "\*/" << zzmode(START); zzskip(); >> -#token "\*" << zzskip(); >> -#token "\n|\r|\r\n" << zzline++; zzskip(); >> /* MR16a */ -#token "~[\n\r\*]+" << zzskip(); >> /* MR16a */ - -#lexclass REFVAR_SCARF /* everything until a ')' */ -#token "~[\)]+ \)" <<{ - RefVarRec *rf; - zzskip(); - zzbegexpr[strlen(zzbegexpr)-1] = '\0'; - rf=refVarRec(zzbegexpr); - list_add(&AllRefVars, rf); - list_add(&RefVars, rf); - zzmode(ACTIONS); zzmore(); zzreplstr(""); - }>> - -/* - * This lexical class accepts actions of type [..] and <<..>> - * - * It translates the following special items: - * - * #[args] --> "ast_node(args)" add "classname::" for C++, however. - * #[] --> "ast_empty_node()" - * #( root, child1, ..., childn ) - --> "ast_make(root, child1, ...., childn, NULL)" - * #() --> "NULL" - * - * Things for reference variables are also recognized: - * blah blah - * - * To escape, - * - * \] --> ] - * \) --> ) - * \$ --> $ - * \# --> # - * - * A stack is used to nest action terminators because they can be nested - * like crazy: << #[#[..],..] >> - */ -#lexclass ACTIONS -#token Action "\>\>" << /* these do not nest */ - zzmode(START); - NLATEXT[0] = ' '; - NLATEXT[1] = ' '; - zzbegexpr[0] = ' '; - zzbegexpr[1] = ' '; - if ( zzbufovf ) { - found_error = 1; - err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); - } - >> -#token PassAction "\]" << if ( topint() == ']' ) { - popint(); - if ( istackempty() ) /* terminate action */ - { - zzmode(START); - NLATEXT[0] = ' '; - zzbegexpr[0] = ' '; - if ( zzbufovf ) { - found_error = 1; - err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); - } - } - else { - /* terminate #[..] */ - zzreplstr(")"); - zzmore(); - } - } - else if ( topint() == '|' ) { /* end of simple [...] */ - popint(); - zzmore(); - } - else zzmore(); - >> -#token "\n|\r|\r\n" << zzline++; zzmore(); >> /* MR16a */ -#token "\>" << zzmore(); >> -#token "#[_a-zA-Z][_a-zA-Z0-9]*" - << - if ( !(strcmp(zzbegexpr, "#ifdef")==0 || - strcmp(zzbegexpr, "#else")==0 || - strcmp(zzbegexpr, "#endif")==0 || - strcmp(zzbegexpr, "#ifndef")==0 || - strcmp(zzbegexpr, "#if")==0 || - strcmp(zzbegexpr, "#define")==0 || - strcmp(zzbegexpr, "#pragma")==0 || - strcmp(zzbegexpr, "#undef")==0 || - strcmp(zzbegexpr, "#import")==0 || - strcmp(zzbegexpr, "#line")==0 || - strcmp(zzbegexpr, "#include")==0 || - strcmp(zzbegexpr, "#error")==0) ) - { - static char buf[100]; - if ( !transform ) { - warn("#id used in nontransform mode; # ignored"); - sprintf(buf, "%s", zzbegexpr+1); - } - else { - if ( CurRule==NULL ) - {warn("#id used in action outside of rule; ignored");} - else if ( strcmp(zzbegexpr+1,CurRule)==0 ) - strcpy(buf, "(*_result)"); - } - zzreplstr(buf); - } - zzmore(); - >> -#token "#\[\]" << - if ( GenCPP ) zzreplstr("new SORAST"); - else zzreplstr("ast_empty_node()"); - zzmore(); - >> -#token "#\(\)" << zzreplstr("NULL"); zzmore(); >> -#token "#\[" << - pushint(']'); - if ( GenCPP ) zzreplstr("new SORAST("); - else zzreplstr("ast_node("); - zzmore(); - >> -#token "#\(" << - pushint('}'); - if ( GenCPP ) zzreplstr("PCCTS_AST::make("); - else zzreplstr("ast_make("); - zzmore(); - >> -#token "#" << zzmore(); >> -#token "\)" << - if ( istackempty() ) - zzmore(); - else if ( topint()==')' ) { - popint(); - } - else if ( topint()=='}' ) { - popint(); - /* terminate #(..) */ - zzreplstr(", NULL)"); - } - zzmore(); - >> -#token "\[" << - pushint('|'); /* look for '|' to terminate simple [...] */ - zzmore(); - >> -#token "\(" << - pushint(')'); - zzmore(); - >> - -#token "\\\]" << zzreplstr("]"); zzmore(); >> -#token "\\\)" << zzreplstr(")"); zzmore(); >> -#token "\\>" << zzreplstr(">"); zzmore(); >> - - -#token "'" << zzmode(ACTION_CHARS); zzmore();>> -#token "\"" << zzmode(ACTION_STRINGS); zzmore();>> -#token "\\#" << zzreplstr("#"); zzmore(); >> -/*#token "\\\\" << zzmore(); >> /* need this for some reason */ -#token "\\~[\]\)>#]" << zzmore(); >> /* escaped char, always ignore */ -#token "/" << zzmore(); >> -#token "/\*" << zzmode(ACTION_COMMENTS); zzmore(); >> -#token "\*/" << err("Missing /*; found dangling */ in action"); zzmore(); >> -#token "//" << zzmode(ACTION_CPP_COMMENTS); zzmore(); >> - -#token "\@\(" <> - -#token "\@" << - zzmore(); if ( !GenCPP ) zzreplstr("_parser->"); - >> - -#token "[a-zA-Z_]+\(" << - if ( (GenCPP && strcmp(zzbegexpr,"ast_scan(")==0) || - (!GenCPP && strcmp(zzbegexpr,"ast_scan(")==0) ) { - char *args=scarf_to_end_of_func_call(); - zzreplstr(cvt_token_str(zzbegexpr, args)); - zzmore(); - } - else { pushint(')'); zzmore(); } - >> -#token "[a-zA-Z_]+" << zzmore(); >> -#token "~[a-zA-Z_\n\r\)\(\\#\>\]\[\"'/\@]+" << zzmore(); >> /* MR16a */ - -#lexclass START -#token "[\t\ ]+" << zzskip(); >> /* Ignore White */ -#token "\n|\r|\n\r" << zzline++; zzskip(); >> /* Track Line # */ /* MR16a */ -#token "\[" << zzmode(ACTIONS); zzmore(); - istackreset(); - pushint(']'); >> -#token "\<\<" << action_file=CurFile; action_line=zzline; - zzmode(ACTIONS); zzmore(); - istackreset(); - pushint('>'); >> -#token "\"" << zzmode(STRINGS); zzmore(); >> -#token "/\*" << zzmode(COMMENTS); zzskip(); >> -#token "\*/" << err("Missing /*; found dangling */"); zzskip(); >> -#token "//" << zzmode(CPP_COMMENTS); zzskip(); >> -#token "\>\>" << err("Missing <<; found dangling \>\>"); zzskip(); >> -#token Eof "@" - << /* L o o k F o r A n o t h e r F i l e */ - { - FILE *new_input; - new_input = NextFile(); - if ( new_input != NULL ) { - fclose( input ); - input = new_input; - zzrdstream( input ); - /*zzadvance(); ** Get 1st char of this file */ - zzskip(); /* Skip the Eof (@) char i.e continue */ - } - } - >> - -#token Header "#header" -#token Tokdef "#tokdefs" -#token BLOCK /* used only as place-holder in intermediate tree */ -#token ALT /* used only as place-holder in intermediate tree */ -#token LABEL ":" /* used only as place-holder in intermediate tree */ -#token OPT "\{" /* These are labeled so we can ref them in trees */ -#token POS_CLOSURE "\+" -#token CLOSURE "\*" -#token WILD "." -#token PRED_OP "?" -#token BT "#\(" -#token RULE -#token REFVAR - -#errclass "atomic-element" { WILD NonTerm Token } -#errclass "rule-header" { PassAction LABEL "\<" "\>" } - -/* - * Build trees for a sorcerer description - */ -sordesc - : <> - ( header <> - | tokdef <> - )* - << - if ( he==0 && !Inline && !GenCPP ) warnNoFL("missing #header statement"); - if ( he>1 ) warnNoFL("extra #header statement"); - if ( to>1 ) warnNoFL("extra #tokdef statement"); - >> - ( Action! - <> - )* - { class_def } - ( Action! - << - if ( CurClassName[0]!='\0' ) - list_add(&class_actions, actiondup(LATEXT(1))); - else - list_add(&before_actions, actiondup(LATEXT(1))); - >> - )* - ( rule )* - ( Action! - << - if ( CurClassName[0]!='\0' ) - list_add(&class_actions, actiondup(LATEXT(1))); - else - list_add(&before_actions, actiondup(LATEXT(1))); - >> - )* - { "\}"! // end of class def - << - if ( CurClassName[0]=='\0' ) - err("missing class definition for trailing '}'"); - >> - } - ( Action! - <> - )* - "@"! - ; - <> - -header: "#header"! Action! <> - ; - <> - -tokdef: "#tokdefs"! RExpr! - <<{ - AST *dumb = NULL; - zzantlr_state st; FILE *f; struct zzdlg_state dst; - strcpy(tokdefs_file, LATEXT(1)); - strcpy(tokdefs_file, tokdefs_file+1); /* remove quotes */ - tokdefs_file[strlen(tokdefs_file)-1] = '\0'; - zzsave_antlr_state(&st); - zzsave_dlg_state(&dst); - define_num=0; - f = fopen(tokdefs_file, "r"); - if ( f==NULL ) {found_error=1; err(eMsg1("cannot open token defs file '%s'", tokdefs_file));} - else {ANTLRm(enum_file(&dumb), f, PARSE_ENUM_FILE);} - zzrestore_antlr_state(&st); - zzrestore_dlg_state(&dst); - UserDefdTokens = 1; - }>> - ; - <> - -class_def! - : "class" - ( NonTerm <> - | Token <> - ) - <> - "\{" - ; - -/* - * Create a rule tree: - * - * NonTerm[arg_action, ret_val_action] - * | - * v - * block - */ -rule: <> - NonTerm^ - << - #0->file = CurFile; - #0->line = zzline; - CurRule = $1.text; - p = (SymEntry *) hash_get(symbols, $1.text); - if ( p==NULL ) { - p = (SymEntry *) hash_add(symbols, $1.text, (Entry *) newSymEntry($1.text)); - p->token = NonTerm; - p->defined = 1; - p->definition = #0; - } - else if ( p->token != NonTerm ) { - err(eMsg2("rule definition clashes with %s definition: '%s'", zztokens[p->token], p->str)); - trouble = 1; - } - else { - if ( p->defined ) { - trouble = 1; - err(eMsg1("rule multiply defined: '%s'", $1.text)); - } - else { - p->defined = 1; - p->definition = #0; - } - } - >> - { "!"! <no_copy=no_copy=1;>> } - ( { "\<"! } PassAction! <args = actiondup(LATEXT(1));>> - | - ) - { "\>"! PassAction! <rt = actiondup(LATEXT(1));>> - } - ":"! - block[no_copy] - ";"! - << - if ( !trouble ) #0->refvars = RefVars; - RefVars=NULL; - >> - << - if ( trouble ) #0 = NULL; - CurRule = NULL; - >> - ; - <> - -/* Create a tree for a block: - * - * BLOCK - * | - * v - * alt1 ---> alt2 ---> ... ---> altn - */ -block[int no_copy] - : <> - alt[$no_copy] - ( "\|"! alt[$no_copy] - )* - << - #0 = #( #[BLOCK], #0 ); - #0->file = file; - #0->line = line; - >> - ; - <> - -/* Create a tree for an alternative: - * - * ALT - * | - * v - * e1 ---> e2 ---> ... ---> en - */ -alt[int no_copy] - : <> - { "!"! <> } - { - ( labeled_element[$no_copy||local_no_copy] - | element[$no_copy||local_no_copy] - | tree[$no_copy||local_no_copy] - )+ - } - << - #0 = #( #[ALT], #0 ); - #0->file = file; - #0->line = line; - >> - ; - <> - -/* a rule ref looks like: - * - * NonTerm - * | - * v - * arg_action ---> ret_val_action - * - * Blocks that have a suffix look like this: - * - * OP - * | - * v - * block - * - * Optional blocks look like: - * - * OPT - * | - * v - * block - * - * Predicates are like actions except they have a root: #( PRED_OP Action ) - */ -element[int no_copy] - : <> - token[$no_copy] - | <> - NonTerm^ - { "!"! <> } - { { "\<"! } PassAction <<#0->in = 1;>> } - { "\>"! PassAction <<#0->out = 1;>> } - <<#0->file = file; #0->line=line;>> - <<#0->no_copy = $no_copy || local_no_copy;>> - | <> - Action <<#1->action = actiondup(LATEXT(1));>> - { "?"^ } <<#0->file = file; #0->line=line;>> - | <> - "\("! block[$no_copy] "\)"! - ( "\*"^ - | "\+"^ - | "?"^ <> - | - ) - <<#0->file = file; #0->line=line;>> - | "\{"^ block[$no_copy] "\}"! - | <> - "." - { "!"! <> } - <<#0->no_copy = $no_copy || local_no_copy;>> - <<#0->file = file; #0->line=line;>> - ; - <> - -/* labels on an element look like: #( LABEL element ) */ -labeled_element[int no_copy] - : <> - ( Token! < ### 2.i. Lookup block labels -The same length and name restrictions that apply to a glyph name apply to a -lookup block label. +The same length and name restrictions that apply to a production glyph name +apply to a lookup block label. ## 3. Including files @@ -849,6 +873,12 @@ For example: include(../family.fea); ``` +An include directive is valid in any context that otherwise contains statements +ending in semicolons: "Top-level" statements; `feature`, `lookup`, `table`, +`cvParameter`, and `AxisValue` blocks; and `name` groups. (An implementation +that processes include statements at the token level is not required to enforce +these restrictions.) + The implementation software is responsible for handling the search paths for the location of the included files. @@ -1565,6 +1595,8 @@ has no replacement, removing the input glyph from the glyph sequence: substitute a by NULL; ``` +Omitting the `by` clause is equivalent to adding `by NULL`. + ### 5.b. [GSUB LookupType 2] Multiple substitution @@ -1937,6 +1969,10 @@ The rule is specified as follows: reversesub [a e n] d' by d.alt; ``` +As with `substitute`, if the replacement glyph is the reserved word `NULL` +then the reverse substitution has no replacement, removing the glyph from the +sequence. Omitting the `by` clause is equivalent to adding `by NULL`. + ## 6. Glyph positioning (GPOS) rules @@ -3960,6 +3996,12 @@ along with the tag `sbit`. ## 11. Document revisions +**v1.26 [1 June 2021]:** +* Clarified syntax of [keywords](#2.c), [glyph names](#2.f.i), + [named glyph classes](#2.g.iii), [tags](#2.h), + [lookup block labels](#2.i), and [include directives](#3), + in light of new makeotfexe parser implementation. + **v1.25.1 [5 July 2020]:** * Added information and examples to [STAT table](#9.e) diff --git a/docs/README.md b/docs/README.md index 8d6654ec4..c8658bc42 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,3 +8,4 @@ ##### • [Practical issues in weight setting and style linking (Windows only)](./WinWeights.md) --- ##### • [FDK Build Notes](./FDK_Build_Notes.md) +##### • [MakeOTFEXE Feature File Parser Notes](./Feature_Parser_Notes.md) diff --git a/pyproject.toml b/pyproject.toml index 6e50a1ce6..23d18ddb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,11 @@ requires = [ "setuptools", "wheel", - "setuptools_scm" + "setuptools_scm", + "scikit-build", + "cmake", + "ninja" ] +build-backend = "setuptools.build_meta" [tool.setuptools_scm] diff --git a/python/afdko/makeotf.py b/python/afdko/makeotf.py index 28c7d3f63..548ef9636 100644 --- a/python/afdko/makeotf.py +++ b/python/afdko/makeotf.py @@ -26,7 +26,7 @@ """ __version__ = """\ -makeotf.py v2.8.6 March 11 2021 +makeotf.py v2.9.0 June 1 2021 """ __methods__ = """ diff --git a/requirements-dev.txt b/requirements-dev.txt index a14dd5374..84e147526 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,13 @@ +cmake>=3.14 codecov>=2.0.15 cpplint>=1.4.3 cython>=0.29.5 flake8>=3.7.6 flake8-bugbear>=20.1.4 +ninja>=1.9.0 pip>=19.0.2 pytest-cov>=2.6.1 +scikit-build>=0.11.1 setuptools>=40.8.0 setuptools_scm>=3.2.0 wheel>=0.33.1 diff --git a/setup.py b/setup.py index 1ed2c3c18..50deb7811 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,15 @@ import io import os import platform -import subprocess import sys from distutils import log from distutils.dep_util import newer from distutils.util import convert_path from distutils.util import get_platform -import setuptools.command.build_py import setuptools.command.install -from setuptools import setup + +from skbuild import setup try: from wheel.bdist_wheel import bdist_wheel @@ -53,38 +52,6 @@ def finalize_options(self): self.install_lib = self.install_platlib -def compile_package(pkg_dir): - programs_dir = 'c' - platform_system = platform.system() - if platform_system == "Windows": - cmd = [os.path.abspath(os.path.join('c', 'buildall.cmd'))] - programs_dir = None - elif platform_system == "Linux": - cmd = ["sh", "buildalllinux.sh"] - elif platform_system == "Darwin": - cmd = ["sh", "buildall.sh"] - else: - # fallback to Linux - print(f'afdko: Unknown OS: {platform_system}') - cmd = ["sh", "buildalllinux.sh"] - cur_dir = os.getcwd() - try: - subprocess.run(cmd, cwd=programs_dir) - except subprocess.CalledProcessError: - print('afdko: Error executing build command.') - sys.exit(1) - os.chdir(cur_dir) - - -class CustomBuild(setuptools.command.build_py.build_py): - """Custom build command.""" - - def run(self): - pkg_dir = 'afdko' - compile_package(pkg_dir) - setuptools.command.build_py.build_py.run(self) - - class CustomBuildScripts(distutils.command.build_scripts.build_scripts): def copy_scripts(self): @@ -139,7 +106,7 @@ def _get_scripts(): else: extension = '' - scripts = [f'c/build_all/{script_name}{extension}' + scripts = [f'bin/{script_name}{extension}' for script_name in script_names] return scripts @@ -229,6 +196,9 @@ def main(): setup_requires=[ 'wheel', 'setuptools_scm', + 'scikit-build', + 'cmake', + 'ninja' ], tests_require=[ 'pytest', @@ -239,7 +209,6 @@ def main(): 'console_scripts': _get_console_scripts(), }, cmdclass={ - 'build_py': CustomBuild, 'build_scripts': CustomBuildScripts, 'bdist_wheel': CustomBDistWheel, 'install': InstallPlatlib, diff --git a/tests/makeotf_data/expected_output/bug751.txt b/tests/makeotf_data/expected_output/bug751.txt index 8d11ea23a..c90f98cca 100644 --- a/tests/makeotf_data/expected_output/bug751.txt +++ b/tests/makeotf_data/expected_output/bug751.txt @@ -2,5 +2,6 @@ tx: --- tests/makeotf_data/input/bug751.ufo tx: (ufr) Warning: Encountered empty for fontinfo key copyright. Skipping tx: (ufr) Warning: Encountered empty for fontinfo key trademark. Skipping makeotf [Warning] Could not find default features file. Font will be built without any layout features. -makeotfexe [WARNING] Negative internal leading: win.ascent + win.descent < unitsPerEm +makeotfexe processing font +WARNING: Negative internal leading: win.ascent + win.descent < unitsPerEm Built development mode font 'Exercise1-Regular.otf'. diff --git a/tests/makeotf_data/expected_output/clinum_output.txt b/tests/makeotf_data/expected_output/clinum_output.txt index a1a757c84..d12164599 100644 --- a/tests/makeotf_data/expected_output/clinum_output.txt +++ b/tests/makeotf_data/expected_output/clinum_output.txt @@ -3,5 +3,6 @@ makeotf [Warning] Could not find FontMenuNameDB file. Font will be built with me makeotf [Note] setting the USE_TYPO_METRICS OS/2 fsSelection bit 7 from fontinfo keyword. makeotf [Note] setting the WEIGHT_WIDTH_SLOPE_ONLY OS/2 fsSelection bit 8 from fontinfo keyword. makeotf [Note] setting the OBLIQUE OS/2 fsSelection bit 9 from fontinfo keyword. -makeotfexe [WARNING] FontMenuNameDB file was not specified or not found. [SourceCodePro-Black] +makeotfexe processing font +WARNING: FontMenuNameDB file was not specified or not found. [SourceCodePro-Black] Built development mode font 'out.otf'. diff --git a/tests/makeotf_data/expected_output/font_dev_output.txt b/tests/makeotf_data/expected_output/font_dev_output.txt index a0387c763..db7c77fb7 100644 --- a/tests/makeotf_data/expected_output/font_dev_output.txt +++ b/tests/makeotf_data/expected_output/font_dev_output.txt @@ -1,5 +1,6 @@ makeotf [Warning] Could not find default features file. Font will be built without any layout features. makeotf [Warning] Could not find FontMenuNameDB file. Font will be built with menu names derived from PostScript name. -makeotfexe [WARNING] FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] -makeotfexe [WARNING] Negative internal leading: win.ascent + win.descent < unitsPerEm -Built development mode font 'font.otf'. \ No newline at end of file +makeotfexe processing font +WARNING: FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] +WARNING: Negative internal leading: win.ascent + win.descent < unitsPerEm +Built development mode font 'font.otf'. diff --git a/tests/makeotf_data/expected_output/font_rel_output.txt b/tests/makeotf_data/expected_output/font_rel_output.txt index 3cd63396c..0c221dfd2 100644 --- a/tests/makeotf_data/expected_output/font_rel_output.txt +++ b/tests/makeotf_data/expected_output/font_rel_output.txt @@ -1,9 +1,10 @@ makeotf [Warning] Could not find default features file. Font will be built without any layout features. makeotf [Warning] Could not find FontMenuNameDB file. Font will be built with menu names derived from PostScript name. -makeotfexe [WARNING] unhinted <.notdef> -makeotfexe [WARNING] unhinted -makeotfexe [WARNING] unhinted -makeotfexe [WARNING] FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] -makeotfexe [WARNING] Glyph renaming was requested, but the GlyphOrderAndAliasDB file was not specified. -makeotfexe [WARNING] Negative internal leading: win.ascent + win.descent < unitsPerEm +WARNING: unhinted <.notdef> +WARNING: unhinted +WARNING: unhinted +makeotfexe processing font +WARNING: FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] +WARNING: Glyph renaming was requested, but the GlyphOrderAndAliasDB file was not specified. +WARNING: Negative internal leading: win.ascent + win.descent < unitsPerEm Built release mode font 'font.otf' Revision 1.000 diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index 8f2cb08e9..23f13e95a 100644 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -49,6 +49,8 @@ DATA_DIR = os.path.join(os.path.split(__file__)[0], TOOL + '_data') TEMP_DIR = os.path.join(DATA_DIR, 'temp_output') +allow_skip_console = os.getenv('AFDKO_TEST_SKIP_CONSOLE', + 'False').lower() in ('true', '1', 't') xfail_win = pytest.mark.xfail( sys.platform == 'win32', @@ -83,6 +85,8 @@ def test_exit_no_option(): # It's valid to run 'makeotf' without using any options, # but if a default-named font file is NOT found in the # current directory, the tool exits with an error + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") with pytest.raises(subprocess.CalledProcessError) as err: subprocess.check_call([TOOL]) assert err.value.returncode == 2 @@ -90,11 +94,15 @@ def test_exit_no_option(): @pytest.mark.parametrize('arg', ['-v', '-h', '-u']) def test_exit_known_option(arg): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-j', '--bogus']) def test_exit_unknown_option(arg): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, arg]) == 2 diff --git a/tests/makeotfexe_data/expected_output/bug1017.GSUB.txt b/tests/makeotfexe_data/expected_output/bug1017.GSUB.txt index 9f8665f06..a66ef542f 100644 --- a/tests/makeotfexe_data/expected_output/bug1017.GSUB.txt +++ b/tests/makeotfexe_data/expected_output/bug1017.GSUB.txt @@ -1,4 +1,4 @@ -### [GSUB] (00000544) +### [GSUB] (00000530) Version =1.0 (00010000) ScriptList =000a FeatureList=0042 diff --git a/tests/makeotfexe_data/expected_output/bug1349.ttx b/tests/makeotfexe_data/expected_output/bug1349.ttx index da160a687..c706057a0 100644 --- a/tests/makeotfexe_data/expected_output/bug1349.ttx +++ b/tests/makeotfexe_data/expected_output/bug1349.ttx @@ -18,7 +18,7 @@ Noto Sans Mono CJK JP VF - Version 2.004;hotconv 1.0.119;makeotfexe 2.5.65604 + Version 2.004;hotconv 1.1.0;makeotfexe 2.6.0 NotoSansMonoCJKjpVF-Regular diff --git a/tests/makeotfexe_data/expected_output/fealib/GPOS_3.ttx b/tests/makeotfexe_data/expected_output/fealib/GPOS_3.ttx index 16b2003a0..7c12a0122 100644 --- a/tests/makeotfexe_data/expected_output/fealib/GPOS_3.ttx +++ b/tests/makeotfexe_data/expected_output/fealib/GPOS_3.ttx @@ -52,7 +52,7 @@ - + diff --git a/tests/makeotfexe_data/expected_output/font_dev_output.txt b/tests/makeotfexe_data/expected_output/font_dev_output.txt index f766a040c..c79161105 100644 --- a/tests/makeotfexe_data/expected_output/font_dev_output.txt +++ b/tests/makeotfexe_data/expected_output/font_dev_output.txt @@ -1,5 +1,6 @@ -makeotfexe [WARNING] unhinted <.notdef> -makeotfexe [WARNING] unhinted -makeotfexe [WARNING] unhinted -makeotfexe [WARNING] FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] -makeotfexe [WARNING] Negative internal leading: win.ascent + win.descent < unitsPerEm +WARNING: unhinted <.notdef> +WARNING: unhinted +WARNING: unhinted +makeotfexe processing font +WARNING: FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] +WARNING: Negative internal leading: win.ascent + win.descent < unitsPerEm diff --git a/tests/makeotfexe_data/expected_output/font_rel_output.txt b/tests/makeotfexe_data/expected_output/font_rel_output.txt index edba3955a..5ff517f03 100644 --- a/tests/makeotfexe_data/expected_output/font_rel_output.txt +++ b/tests/makeotfexe_data/expected_output/font_rel_output.txt @@ -1,6 +1,7 @@ -makeotfexe [WARNING] unhinted <.notdef> -makeotfexe [WARNING] unhinted -makeotfexe [WARNING] unhinted -makeotfexe [WARNING] FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] -makeotfexe [WARNING] Glyph renaming was requested, but the GlyphOrderAndAliasDB file was not specified. -makeotfexe [WARNING] Negative internal leading: win.ascent + win.descent < unitsPerEm +WARNING: unhinted <.notdef> +WARNING: unhinted +WARNING: unhinted +makeotfexe processing font +WARNING: FontMenuNameDB file was not specified or not found. [SourceSerifPro-Regular] +WARNING: Glyph renaming was requested, but the GlyphOrderAndAliasDB file was not specified. +WARNING: Negative internal leading: win.ascent + win.descent < unitsPerEm diff --git a/tests/makeotfexe_data/expected_output/spec/8a-11.ttx b/tests/makeotfexe_data/expected_output/spec/8a-11.ttx new file mode 100644 index 000000000..5030194f6 --- /dev/null +++ b/tests/makeotfexe_data/expected_output/spec/8a-11.ttx @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/makeotfexe_data/input/bug993/feat.fea b/tests/makeotfexe_data/input/bug993/feat.fea index 36ac5d731..817572ca5 100644 --- a/tests/makeotfexe_data/input/bug993/feat.fea +++ b/tests/makeotfexe_data/input/bug993/feat.fea @@ -1,5 +1,5 @@ markClass [acute grave] @TOP_MARKS; -lookup mark { +lookup mrk { position base [a e o u]' mark @TOP_MARKS; -} mark; +} mrk; diff --git a/tests/makeotfexe_data/input/spec/2eii-1.bad.fea b/tests/makeotfexe_data/input/spec/2eii-1.bad.fea index a0357bac8..d038d8dbf 100644 --- a/tests/makeotfexe_data/input/spec/2eii-1.bad.fea +++ b/tests/makeotfexe_data/input/spec/2eii-1.bad.fea @@ -1,4 +1,4 @@ # Bad metric. lookup test { - pos A B -32768; + pos A B -32769; } test; diff --git a/tests/makeotfexe_data/input/spec/3-2.fea b/tests/makeotfexe_data/input/spec/3-2.fea index dc9b3e247..1380fa445 100644 --- a/tests/makeotfexe_data/input/spec/3-2.fea +++ b/tests/makeotfexe_data/input/spec/3-2.fea @@ -1 +1 @@ -include ( 2gi-1.fea ) +include ( 2gi-1.fea ) ; diff --git a/tests/makeotfexe_data/input/spec/6d-3.fea b/tests/makeotfexe_data/input/spec/6d-3.fea index 6fe9d5c1b..09b7abf74 100644 --- a/tests/makeotfexe_data/input/spec/6d-3.fea +++ b/tests/makeotfexe_data/input/spec/6d-3.fea @@ -1,6 +1,6 @@ # Contextual mark to base with backtrace and look ahead. markClass [acute grave] @TOP_MARKS; -lookup mark { +lookup mrk { position base [A B C] [a e o u]' [X Y Z] mark @TOP_MARKS; position base A a' X mark @TOP_MARKS; -} mark; +} mrk; diff --git a/tests/makeotfexe_data/input/spec/8a-11.fea b/tests/makeotfexe_data/input/spec/8a-11.fea new file mode 100644 index 000000000..de0b9e594 --- /dev/null +++ b/tests/makeotfexe_data/input/spec/8a-11.fea @@ -0,0 +1,13 @@ +# When the replacement glyph of a single substitution is the same as +# the target glyph of a multiple substitution, the former is encoded +# as an alternate rather than a single substitution. That should happen +# with A by A.sc and C by C.sc below. +feature aalt { + sub B by B.sc; + sub A by A.sc; + sub C by C.sc; + sub D by D.sc; + sub a from [a.alt2 a.alt1]; + sub C.sc from [C.alt1 C.alt2]; + sub A.sc from [A.alt1 A.alt2]; +} aalt; diff --git a/tests/makeotfexe_test.py b/tests/makeotfexe_test.py index 55ba135ed..6fdb454de 100644 --- a/tests/makeotfexe_test.py +++ b/tests/makeotfexe_test.py @@ -150,8 +150,7 @@ def test_glyph_not_in_font_bug492(): with open(stderr_path, 'rb') as f: output = f.read() - assert (b'[ERROR] Glyph "glyph_not_found" not in font. ' - b'[') in output + assert (b'Glyph "glyph_not_found" not in font.') in output assert (b'syntax error at "a" [') not in output @@ -174,159 +173,159 @@ def test_version_warning_bug610(): @pytest.mark.parametrize('feat_name, error_msg', [ ('test_named_lookup', - b"[FATAL] In feature 'last' positioning rules " + b"In feature 'last' positioning rules " b"cause an offset overflow (0x10020) to a lookup subtable"), ('test_singlepos_subtable_overflow', - b"[FATAL] In feature 'sps1' lookup 'lkup40' " + b"In feature 'sps1' lookup 'lkup40' " b"positioning rules cause an offset overflow (0x10188) to a " b"lookup subtable"), ('test_class_pair_subtable_overflow', - b"[FATAL] In feature 'last' positioning rules " + b"In feature 'last' positioning rules " b"cause an offset overflow (0x10020) to a lookup subtable"), ('test_class_pair_class_def_overflow', - b"[FATAL] In feature 'krn1' lookup 'l1' pair " + b"In feature 'krn1' lookup 'l1' pair " b"positioning rules cause an offset overflow (0x1001a) to a " b"class 2 definition table"), ('test_contextual_overflow', - b"[FATAL] In feature 'krn0' lookup 'lkup40' " + b"In feature 'krn0' lookup 'lkup40' " b"chain contextual positioning rules cause an offset overflow " b"(0x10002) to a lookup subtable"), ('test_cursive_subtable_overflow', - b"[FATAL] In feature 'curs' lookup 'lk20' " + b"In feature 'curs' lookup 'lk20' " b"cursive positioning rules cause an offset overflow " b"(0x1006e) to a cursive attach table"), ('test_mark_to_base_coverage_overflow', - b"[FATAL] In feature 'mrk1' mark to base " + b"In feature 'mrk1' mark to base " b"positioning rules cause an offset overflow (0x1002c) to a " b"base coverage table"), ('test_mark_to_base_subtable_overflow', - b"[FATAL] In feature 'mrk1' mark to base " + b"In feature 'mrk1' mark to base " b"positioning rules cause an offset overflow (0x10230) to a " b"lookup subtable"), ('test_mark_to_ligature_subtable_overflow', - b"[FATAL] In feature 'lig1' lookup 'lk0' mark " + b"In feature 'lig1' lookup 'lk0' mark " b"to ligature positioning rules cause an offset overflow (0x1053e) " b"to a lookup subtable"), ('test_singlesub1_subtable_overflow', - b"[FATAL] In feature 'tss2' lookup 'lkup258' " + b"In feature 'tss2' lookup 'lkup258' " b"substitution rules cause an offset overflow (0x10002) to a " b"lookup subtable"), ('test_singlesub2_subtable_overflow', - b"[FATAL] In feature 'tss1' lookup 'lkup237' " + b"In feature 'tss1' lookup 'lkup237' " b"substitution rules cause an offset overflow (0x10098) to a " b"lookup subtable"), ('test_multiplesub_subtable_overflow', - b"[FATAL] In feature 'mts1' lookup 'lkup238' " + b"In feature 'mts1' lookup 'lkup238' " b"substitution rules cause an offset overflow (0x10056) to a " b"lookup subtable"), ('test_alternatesub_subtable_overflow', - b"[FATAL] In feature 'ats1' lookup 'lkup238' " + b"In feature 'ats1' lookup 'lkup238' " b"substitution rules cause an offset overflow (0x1009c) to a " b"lookup subtable"), ('test_ligaturesub_subtable_overflow', - b"[FATAL] In feature 'lts1' lookup 'lkup238' " + b"In feature 'lts1' lookup 'lkup238' " b"substitution rules cause an offset overflow (0x10016) to a " b"lookup subtable"), ('test_chaincontextualsub_subtable_overflow', - b"[FATAL] In feature 'cts1' substitution rules " + b"In feature 'cts1' substitution rules " b"cause an offset overflow (0x100ac) to a lookup subtable"), ('test_reversechaincontextualsub_subtable_overflow', - b"[FATAL] In feature 'rts1' lookup 'lkup238' " + b"In feature 'rts1' lookup 'lkup238' " b"reverse chain contextual substitution rules cause an offset " b"overflow (0x100a0) to a lookup subtable"), ('test_duplicate_single_sub', - b"[NOTE] Removing duplicate single substitution " + b"Removing duplicate single substitution " b"in standalone lookup 'test2': glyph1, glyph1"), ('test_conflicting_single_sub', - b"[FATAL] Duplicate target glyph for single " + b"Duplicate target glyph for single " b"substitution in standalone lookup 'test2': glyph1"), ('test_duplicate_alternate_sub', - b"[FATAL] Duplicate target glyph for alternate " + b"Duplicate target glyph for alternate " b"substitution in standalone lookup 'test2': glyph1"), ('test_duplicate_multiple_sub', - b"[FATAL] Duplicate target glyph for multiple " + b"Duplicate target glyph for multiple " b"substitution in standalone lookup 'test2': glyph1"), ('test_duplicate_ligature_sub', - b"[NOTE] Removing duplicate ligature substitution " + b"Removing duplicate ligature substitution " b"in standalone lookup 'test2'"), ('test_conflicting_ligature_sub', - b"[FATAL] Duplicate target sequence but different " + b"Duplicate target sequence but different " b"replacement glyphs in ligature substitutions in standalone " b"lookup 'test2'"), ('test_duplicate_single_pos', - b"[NOTE] Removing duplicate single positioning " + b"Removing duplicate single positioning " b"in standalone lookup 'test2'"), ('test_conflicting_single_pos', - b"[FATAL] Duplicate single positioning glyph " + b"Duplicate single positioning glyph " b"with different values in standalone lookup 'test2'"), ('test_features_name_missing_win_dflt_sub', - b"[FATAL] Missing Windows default name for " + b"Missing Windows default name for " b"'featureNames' nameid 256 in feature 'ss01'"), ('test_cv_params_not_in_cvxx_sub', - b"[FATAL] A 'cvParameters' block is only allowed " + b"A 'cvParameters' block is only allowed " b"in Character Variant (cvXX) features; it is being used in " b"feature 'tst1'"), ('test_cv_params_missing_win_dflt_sub', - b"[FATAL] Missing Windows default name for " + b"Missing Windows default name for " b"'cvParameters' nameid 256 in feature 'cv01'"), ('test_size_withfamilyID_0_pos', - b"[FATAL] 'size' feature must have 4 parameters if " + b"'size' feature must have 4 parameters if " b"sub family ID code is non-zero!"), ('test_size_withfamilyID_3_pos', - b"[FATAL] 'size' feature must have 4 or 2 " + b"'size' feature must have 4 or 2 " b"parameters if sub family code is zero!"), ('test_sizemenuname_missing_win_dflt_pos', - b"[FATAL] Missing Windows default name for " + b"Missing Windows default name for " b"'sizemenuname' nameid 256 in 'size' feature"), ('test_kernpair_warnings_pos', - b"[WARNING] Single kern pair occurring after class " + b"Single kern pair occurring after class " b"kern pair in feature 'tst1'"), ('test_kernpair_warnings_pos', - b"[WARNING] Start of new pair positioning subtable " + b"Start of new pair positioning subtable " b"forced by overlapping glyph classes in feature 'tst1'; some pairs " b"may never be accessed"), ('test_kernpair_warnings_pos', - b"[NOTE] Removing duplicate pair positioning in " + b"Removing duplicate pair positioning in " b"feature 'tst1': glyph3 glyph3"), ('test_kernpair_warnings_pos', - b"[WARNING] Pair positioning has conflicting " + b"Pair positioning has conflicting " b"statements in feature 'tst1'"), ('test_base_glyph_conflict_pos', - b"[ERROR] MarkToBase or MarkToMark error in " + b"MarkToBase or MarkToMark error in " b"feature 'tst1'. Another statement has already defined the anchors " b"and marks on glyph 'glyph5'."), ('test_base_glyph_conflict_pos', - b"[WARNING] MarkToBase or MarkToMark error in " + b"MarkToBase or MarkToMark error in " b"feature 'tst1'. Glyph 'glyph5' does not have an anchor point " b"for a mark class that was used in a previous statement in the " b"same lookup table. Setting the anchor point offset to 0."), ('test_mark_ligature_conflict_pos', - b"[ERROR] MarkToLigature error in feature 'tst1'. " + b"MarkToLigature error in feature 'tst1'. " b"Two different statements referencing the ligature glyph 'glyph6' " b"have assigned the same mark class to the same ligature component."), ('test_mark_ligature_conflict_pos', - b"[ERROR] MarkToLigature statement error in feature " + b"MarkToLigature statement error in feature " b"'tst1'. Glyph 'glyph6' contains a duplicate mark class assignment " b"for one of the ligature components."), ('test_mark_class_glyph_conflict', - b"[ERROR] In feature 'tst1', glyph 'glyph2' " + b"In feature 'tst1', glyph 'glyph2' " b"is repeated in the current class definition. Mark class: " b"@TOP_MARKS."), ('test_mark_class_glyph_conflict', - b"[ERROR] In feature 'tst1', glyph 'glyph1' " + b"In feature 'tst1', glyph 'glyph1' " b"occurs in two different mark classes. Previous mark class: " b"@TOP_MARKS. Current mark class: @BOTTOM_MARKS."), ('test_base_anchor_errors_pos', - b"[ERROR] MarkToBase or MarkToMark error in " + b"MarkToBase or MarkToMark error in " b"feature 'tst1'. Another statement has already assigned the current " b"mark class to another anchor point on glyph 'glyph7'"), ('test_base_anchor_errors_pos', - b"[WARNING] MarkToBase or MarkToMark error in " + b"MarkToBase or MarkToMark error in " b"feature 'tst1'. Glyph 'glyph5' does not have an anchor point " b"for a mark class that was used in a previous statement in the " b"same lookup table"), ('test_cursive_duplicate_glyph_pos', - b"[ERROR] Cursive statement error in feature " + b"Cursive statement error in feature " b"'tst1'. A previous statement has already referenced glyph " b"'glyph1'."), ]) @@ -359,7 +358,7 @@ def test_feature_recursion_bug628(): with open(stderr_path, 'rb') as f: output = f.read() - assert(b"[FATAL] Can't include [feat.fea]; maximum " + assert(b"Can't include [feat.fea]; maximum " b"include levels <50> reached") in output @@ -422,7 +421,7 @@ def test_overflow_bug731(): with open(stderr_path, 'rb') as f: output = f.read() - assert(b"[FATAL] subtable offset too large (1003c) in " + assert(b"subtable offset too large (1003c) in " b"lookup 0 type 3") in output @@ -704,7 +703,7 @@ def test_negative_internal_leading_bug1227(): assert differ([expected_ttx, actual_ttx, '-s', ' Negative internal leading: ' + assert (b'Negative internal leading: ' b'win.ascent + win.descent < unitsPerEm') in output diff --git a/tests/otc2otf_test.py b/tests/otc2otf_test.py index cea82515b..44b63a913 100644 --- a/tests/otc2otf_test.py +++ b/tests/otc2otf_test.py @@ -24,6 +24,9 @@ DATA_DIR = os.path.join(os.path.split(__file__)[0], TOOL + '_data') TEMP_DIR = os.path.join(DATA_DIR, 'temp_output') +allow_skip_console = os.getenv('AFDKO_TEST_SKIP_CONSOLE', + 'False').lower() in ('true', '1', 't') + def setup_module(): """ @@ -46,23 +49,33 @@ def teardown_module(): @pytest.mark.parametrize('arg', ['-h']) def test_exit_known_option(arg): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-j', '--foobar']) def test_exit_unknown_option(arg): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, arg]) == 2 def test_exit_no_font_provided(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL]) == 2 def test_exit_invalid_path(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, 'foobar']) == 2 def test_exit_not_ttc_font(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") font_path = get_input_path('font.ttf') assert subprocess.call([TOOL, font_path]) == 2 diff --git a/tests/otf2otc_test.py b/tests/otf2otc_test.py index cc6e16174..e2cfddacf 100644 --- a/tests/otf2otc_test.py +++ b/tests/otf2otc_test.py @@ -21,6 +21,9 @@ FONT1 = 'font1.ttf' FONT2 = 'font2.ttf' +allow_skip_console = os.getenv('AFDKO_TEST_SKIP_CONSOLE', + 'False').lower() in ('true', '1', 't') + MSG_1 = ( "Shared tables: " f"['BASE', 'DSIG', 'GDEF', 'GSUB', 'cmap', 'maxp', 'post']{os.linesep}" @@ -55,27 +58,39 @@ @pytest.mark.parametrize('arg', ['-h']) def test_exit_known_option(arg): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-j', '--foobar']) def test_exit_unknown_option(arg): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, arg]) == 0 def test_exit_malformed_t_option(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, '-t', 'abc-2']) == 0 def test_exit_no_font_provided(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL]) == 0 def test_exit_invalid_path(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") assert subprocess.call([TOOL, 'foobar']) == 0 def test_exit_not_a_font(): + if allow_skip_console: + pytest.xfail("May not work if console_script wrapper is missing") font_path = get_input_path('file.txt') assert subprocess.call([TOOL, font_path]) == 0 diff --git a/tests/runner.py b/tests/runner.py index 6c0fea6f7..5876ea213 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -16,8 +16,31 @@ logger = logging.getLogger('runner') +console_scripts = { + 'buildcff2vf': 'buildcff2vf:main', + 'buildmasterotfs': 'buildmasterotfs:main', + 'comparefamily': 'comparefamily:main', + 'checkoutlinesufo': 'checkoutlinesufo:main', + 'makeotf': 'makeotf:main', + 'makeinstancesufo': 'makeinstancesufo:main', + 'otc2otf': 'otc2otf:main', + 'otf2otc': 'otf2otc:main', + 'otf2ttf': 'otf2ttf:main', + 'ttfcomponentizer': 'ttfcomponentizer:main', + 'ttfdecomponentizer': 'ttfdecomponentizer:main', + 'ttxn': 'ttxn:main', + 'charplot': 'proofpdf:charplot', + 'digiplot': 'proofpdf:digiplot', + 'fontplot': 'proofpdf:fontplot', + 'fontplot2': 'proofpdf:fontplot2', + 'fontsetplot': 'proofpdf:fontsetplot', + 'hintplot': 'proofpdf:hintplot', + 'waterfallplot': 'proofpdf:waterfallplot' +} TIMEOUT = 240 # seconds +allow_skip_console = os.getenv('AFDKO_TEST_SKIP_CONSOLE', + 'False').lower() in ('true', '1', 't') def _write_file(file_path, data): @@ -65,6 +88,13 @@ def run_tool(opts): if opts.std_error: stderr = subprocess.STDOUT + if allow_skip_console and console_scripts.get(opts.tool): + mod, fcn = console_scripts[opts.tool].split(':') + args[0] = sys.executable + args.insert(1, '-c') + args.insert(2, f'import sys; import afdko.{mod}; ' + + f'sys.exit(afdko.{mod}.{fcn}())') + logger.debug( f"About to run the command below\n==>{' '.join(args)}<==") try: @@ -90,8 +120,16 @@ def _check_tool(tool_name): or a tuple with the tool's name and the error if it's not. """ try: - subprocess.check_output([tool_name, '-h'], timeout=TIMEOUT) - return tool_name + if allow_skip_console and console_scripts.get(tool_name): + mod, fcn = console_scripts[tool_name].split(':') + subprocess.check_output([sys.executable, '-c', + f'import sys; import afdko.{mod}; ' + + f'sys.exit(afdko.{mod}.{fcn}())', '-h'], + timeout=TIMEOUT) + return tool_name + else: + subprocess.check_output([tool_name, '-h'], timeout=TIMEOUT) + return tool_name except (subprocess.CalledProcessError, OSError) as err: logger.error(err) return tool_name, err diff --git a/tests/runner_test.py b/tests/runner_test.py index b6f3ec5bb..77d3aa03a 100644 --- a/tests/runner_test.py +++ b/tests/runner_test.py @@ -40,7 +40,7 @@ def test_capture_error_message(): output_path = runner(['-t', 'makeotfexe', '-s', '-e']) with open(output_path, 'rb') as f: output = f.read() - assert b"[FATAL] Source font file not found: font.ps" in output + assert b"Source font file not found: font.ps" in output @pytest.mark.parametrize('v_arg', ['', 'v', 'vv', 'vvv']) From f8e3feaf8c40222be42bb7b7255d09d07e52edcf Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Mon, 7 Jun 2021 14:27:14 -0700 Subject: [PATCH 2/4] Fix hidden parameter and unsafe-localtime warnings --- c/makeotf/lib/hotconv/common.h | 6 ++++++ c/makeotf/lib/hotconv/hot.c | 5 +++-- c/makeotf/lib/typecomp/recode.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/c/makeotf/lib/hotconv/common.h b/c/makeotf/lib/hotconv/common.h index 9057d0faa..d3b744aec 100644 --- a/c/makeotf/lib/hotconv/common.h +++ b/c/makeotf/lib/hotconv/common.h @@ -30,6 +30,12 @@ extern "C" { #endif +#if WIN32 +#define SAFE_LOCALTIME(x, y) localtime_s(y, x) +#else +#define SAFE_LOCALTIME(x, y) localtime_r(x, y) +#endif + /* --------------------------------- Macros -------------------------------- */ /* Define to supply Microsoft-specific function calling info, e.g. __cdecl */ diff --git a/c/makeotf/lib/hotconv/hot.c b/c/makeotf/lib/hotconv/hot.c index 4ab6b25a8..f208a43f9 100644 --- a/c/makeotf/lib/hotconv/hot.c +++ b/c/makeotf/lib/hotconv/hot.c @@ -99,8 +99,9 @@ hotCtx hotNew(hotCallbacks *hotcb) { g->font.licenseID = NULL; /* Get current time */ - now = time(NULL); - g->time = *localtime(&now); + + time(&now); + SAFE_LOCALTIME(&now, &g->time); /* Initialize hot library callbacks */ g->cb = *hotcb; diff --git a/c/makeotf/lib/typecomp/recode.c b/c/makeotf/lib/typecomp/recode.c index fcddf9bc6..2314a8326 100644 --- a/c/makeotf/lib/typecomp/recode.c +++ b/c/makeotf/lib/typecomp/recode.c @@ -3385,8 +3385,8 @@ static void recodeAddChar(tcCtx g, unsigned length, char *cstr, unsigned id, #if TC_DEBUG if (h->debug.output) { long icstr = h->chars.array[h->chars.cnt - 1].icstr; - unsigned length = h->cstrs.cnt - icstr; - printf("==== recode[%d]: ", length); + unsigned len = h->cstrs.cnt - icstr; + printf("==== recode[%d]: ", len); csDump(length, (unsigned char *)&h->cstrs.array[icstr], g->nMasters, 0); } #endif /* TC_DEBUG */ From 35f29a2b385f9696ffd072530758d535070179a2 Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Mon, 7 Jun 2021 15:11:57 -0700 Subject: [PATCH 3/4] Allow "mark" to be a label for historical reasons --- c/makeotf/lib/hotconv/FeatParser.cpp | 210 +++++++++++--------- c/makeotf/lib/hotconv/FeatParser.g4 | 2 +- c/makeotf/lib/hotconv/FeatParser.h | 1 + c/makeotf/lib/hotconv/FeatParser.interp | 2 +- docs/OpenTypeFeatureFileSpecification.md | 12 +- tests/makeotfexe_data/input/bug993/feat.fea | 4 +- tests/makeotfexe_data/input/spec/6d-3.fea | 4 +- 7 files changed, 126 insertions(+), 109 deletions(-) diff --git a/c/makeotf/lib/hotconv/FeatParser.cpp b/c/makeotf/lib/hotconv/FeatParser.cpp index bb8a7fc00..65ceb7ce8 100644 --- a/c/makeotf/lib/hotconv/FeatParser.cpp +++ b/c/makeotf/lib/hotconv/FeatParser.cpp @@ -7503,6 +7503,7 @@ FeatParser::AnchorContext* FeatParser::anchor() { break; } + case FeatParser::MARK: case FeatParser::NAMELABEL: { setState(964); dynamic_cast(_localctx)->name = label(); @@ -8281,6 +8282,10 @@ tree::TerminalNode* FeatParser::LabelContext::NAMELABEL() { return getToken(FeatParser::NAMELABEL, 0); } +tree::TerminalNode* FeatParser::LabelContext::MARK() { + return getToken(FeatParser::MARK, 0); +} + size_t FeatParser::LabelContext::getRuleIndex() const { return FeatParser::RuleLabel; @@ -8297,6 +8302,7 @@ antlrcpp::Any FeatParser::LabelContext::accept(tree::ParseTreeVisitor *visitor) FeatParser::LabelContext* FeatParser::label() { LabelContext *_localctx = _tracker.createInstance(_ctx, getState()); enterRule(_localctx, 174, FeatParser::RuleLabel); + size_t _la = 0; #if __cplusplus > 201703L auto onExit = finally([=, this] { @@ -8308,7 +8314,14 @@ FeatParser::LabelContext* FeatParser::label() { try { enterOuterAlt(_localctx, 1); setState(1023); - match(FeatParser::NAMELABEL); + _la = _input->LA(1); + if (!(_la == FeatParser::MARK || _la == FeatParser::NAMELABEL)) { + _errHandler->recoverInline(this); + } + else { + _errHandler->reportMatch(this); + consume(); + } } catch (RecognitionException &e) { @@ -10268,97 +10281,98 @@ FeatParser::Initializer::Initializer() { 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, - 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, 0x2, 0x18, 0x3, 0x2, 0x2d, + 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, 0x2, 0x19, 0x3, 0x2, 0x2d, 0x30, 0x3, 0x2, 0x17, 0x1a, 0x3, 0x2, 0x26, 0x27, 0x3, 0x2, 0x40, 0x41, 0x3, 0x2, 0x42, 0x43, 0x3, 0x2, 0x4c, 0x4f, 0x3, 0x2, 0x6f, 0x71, 0x3, 0x2, 0x58, 0x5e, 0x4, 0x2, 0x53, 0x56, 0x5f, 0x60, 0x3, 0x2, 0x62, 0x63, 0x3, 0x2, 0x6c, 0x6d, 0x3, 0x2, 0x73, 0x74, 0x4, - 0x2, 0x10, 0x10, 0x81, 0x83, 0x5, 0x2, 0x37, 0x37, 0x82, 0x83, 0x88, - 0x88, 0x4, 0x2, 0x84, 0x84, 0x87, 0x87, 0x3, 0x2, 0x85, 0x87, 0x3, - 0x2, 0x22, 0x23, 0x3, 0x2, 0x24, 0x25, 0x3, 0x2, 0x3, 0x4, 0x3, 0x2, - 0x1e, 0x1f, 0x3, 0x2, 0x28, 0x29, 0x3, 0x2, 0x3b, 0x3c, 0x2, 0x4c2, - 0x2, 0xe7, 0x3, 0x2, 0x2, 0x2, 0x4, 0xf2, 0x3, 0x2, 0x2, 0x2, 0x6, - 0xf6, 0x3, 0x2, 0x2, 0x2, 0x8, 0xfb, 0x3, 0x2, 0x2, 0x2, 0xa, 0xff, - 0x3, 0x2, 0x2, 0x2, 0xc, 0x103, 0x3, 0x2, 0x2, 0x2, 0xe, 0x10b, 0x3, - 0x2, 0x2, 0x2, 0x10, 0x114, 0x3, 0x2, 0x2, 0x2, 0x12, 0x118, 0x3, - 0x2, 0x2, 0x2, 0x14, 0x127, 0x3, 0x2, 0x2, 0x2, 0x16, 0x133, 0x3, - 0x2, 0x2, 0x2, 0x18, 0x13e, 0x3, 0x2, 0x2, 0x2, 0x1a, 0x150, 0x3, - 0x2, 0x2, 0x2, 0x1c, 0x152, 0x3, 0x2, 0x2, 0x2, 0x1e, 0x164, 0x3, - 0x2, 0x2, 0x2, 0x20, 0x171, 0x3, 0x2, 0x2, 0x2, 0x22, 0x180, 0x3, - 0x2, 0x2, 0x2, 0x24, 0x190, 0x3, 0x2, 0x2, 0x2, 0x26, 0x194, 0x3, - 0x2, 0x2, 0x2, 0x28, 0x197, 0x3, 0x2, 0x2, 0x2, 0x2a, 0x19a, 0x3, - 0x2, 0x2, 0x2, 0x2c, 0x19f, 0x3, 0x2, 0x2, 0x2, 0x2e, 0x1b0, 0x3, - 0x2, 0x2, 0x2, 0x30, 0x1b2, 0x3, 0x2, 0x2, 0x2, 0x32, 0x1c9, 0x3, - 0x2, 0x2, 0x2, 0x34, 0x1e0, 0x3, 0x2, 0x2, 0x2, 0x36, 0x21e, 0x3, - 0x2, 0x2, 0x2, 0x38, 0x227, 0x3, 0x2, 0x2, 0x2, 0x3a, 0x230, 0x3, - 0x2, 0x2, 0x2, 0x3c, 0x232, 0x3, 0x2, 0x2, 0x2, 0x3e, 0x236, 0x3, - 0x2, 0x2, 0x2, 0x40, 0x23c, 0x3, 0x2, 0x2, 0x2, 0x42, 0x247, 0x3, - 0x2, 0x2, 0x2, 0x44, 0x24d, 0x3, 0x2, 0x2, 0x2, 0x46, 0x25a, 0x3, - 0x2, 0x2, 0x2, 0x48, 0x263, 0x3, 0x2, 0x2, 0x2, 0x4a, 0x265, 0x3, - 0x2, 0x2, 0x2, 0x4c, 0x273, 0x3, 0x2, 0x2, 0x2, 0x4e, 0x277, 0x3, - 0x2, 0x2, 0x2, 0x50, 0x27d, 0x3, 0x2, 0x2, 0x2, 0x52, 0x286, 0x3, - 0x2, 0x2, 0x2, 0x54, 0x28d, 0x3, 0x2, 0x2, 0x2, 0x56, 0x29d, 0x3, - 0x2, 0x2, 0x2, 0x58, 0x2a1, 0x3, 0x2, 0x2, 0x2, 0x5a, 0x2aa, 0x3, - 0x2, 0x2, 0x2, 0x5c, 0x2b1, 0x3, 0x2, 0x2, 0x2, 0x5e, 0x2b8, 0x3, - 0x2, 0x2, 0x2, 0x60, 0x2bf, 0x3, 0x2, 0x2, 0x2, 0x62, 0x2cc, 0x3, - 0x2, 0x2, 0x2, 0x64, 0x2d0, 0x3, 0x2, 0x2, 0x2, 0x66, 0x2d3, 0x3, - 0x2, 0x2, 0x2, 0x68, 0x2e1, 0x3, 0x2, 0x2, 0x2, 0x6a, 0x2e5, 0x3, - 0x2, 0x2, 0x2, 0x6c, 0x2e8, 0x3, 0x2, 0x2, 0x2, 0x6e, 0x2f6, 0x3, - 0x2, 0x2, 0x2, 0x70, 0x2fa, 0x3, 0x2, 0x2, 0x2, 0x72, 0x2fd, 0x3, - 0x2, 0x2, 0x2, 0x74, 0x30a, 0x3, 0x2, 0x2, 0x2, 0x76, 0x30e, 0x3, - 0x2, 0x2, 0x2, 0x78, 0x31c, 0x3, 0x2, 0x2, 0x2, 0x7a, 0x329, 0x3, - 0x2, 0x2, 0x2, 0x7c, 0x348, 0x3, 0x2, 0x2, 0x2, 0x7e, 0x34a, 0x3, - 0x2, 0x2, 0x2, 0x80, 0x35a, 0x3, 0x2, 0x2, 0x2, 0x82, 0x35e, 0x3, - 0x2, 0x2, 0x2, 0x84, 0x369, 0x3, 0x2, 0x2, 0x2, 0x86, 0x376, 0x3, - 0x2, 0x2, 0x2, 0x88, 0x37a, 0x3, 0x2, 0x2, 0x2, 0x8a, 0x383, 0x3, - 0x2, 0x2, 0x2, 0x8c, 0x389, 0x3, 0x2, 0x2, 0x2, 0x8e, 0x394, 0x3, - 0x2, 0x2, 0x2, 0x90, 0x398, 0x3, 0x2, 0x2, 0x2, 0x92, 0x39b, 0x3, - 0x2, 0x2, 0x2, 0x94, 0x3a8, 0x3, 0x2, 0x2, 0x2, 0x96, 0x3b5, 0x3, - 0x2, 0x2, 0x2, 0x98, 0x3b9, 0x3, 0x2, 0x2, 0x2, 0x9a, 0x3bd, 0x3, - 0x2, 0x2, 0x2, 0x9c, 0x3cc, 0x3, 0x2, 0x2, 0x2, 0x9e, 0x3d0, 0x3, - 0x2, 0x2, 0x2, 0xa0, 0x3d9, 0x3, 0x2, 0x2, 0x2, 0xa2, 0x3df, 0x3, - 0x2, 0x2, 0x2, 0xa4, 0x3e5, 0x3, 0x2, 0x2, 0x2, 0xa6, 0x3e9, 0x3, - 0x2, 0x2, 0x2, 0xa8, 0x3eb, 0x3, 0x2, 0x2, 0x2, 0xaa, 0x3f9, 0x3, - 0x2, 0x2, 0x2, 0xac, 0x3fd, 0x3, 0x2, 0x2, 0x2, 0xae, 0x3ff, 0x3, - 0x2, 0x2, 0x2, 0xb0, 0x401, 0x3, 0x2, 0x2, 0x2, 0xb2, 0x403, 0x3, - 0x2, 0x2, 0x2, 0xb4, 0x405, 0x3, 0x2, 0x2, 0x2, 0xb6, 0x407, 0x3, - 0x2, 0x2, 0x2, 0xb8, 0x40c, 0x3, 0x2, 0x2, 0x2, 0xba, 0x414, 0x3, - 0x2, 0x2, 0x2, 0xbc, 0x41c, 0x3, 0x2, 0x2, 0x2, 0xbe, 0x424, 0x3, - 0x2, 0x2, 0x2, 0xc0, 0x42c, 0x3, 0x2, 0x2, 0x2, 0xc2, 0x434, 0x3, - 0x2, 0x2, 0x2, 0xc4, 0x43c, 0x3, 0x2, 0x2, 0x2, 0xc6, 0x444, 0x3, - 0x2, 0x2, 0x2, 0xc8, 0x44c, 0x3, 0x2, 0x2, 0x2, 0xca, 0x454, 0x3, - 0x2, 0x2, 0x2, 0xcc, 0x45c, 0x3, 0x2, 0x2, 0x2, 0xce, 0x464, 0x3, - 0x2, 0x2, 0x2, 0xd0, 0x46c, 0x3, 0x2, 0x2, 0x2, 0xd2, 0x474, 0x3, - 0x2, 0x2, 0x2, 0xd4, 0x479, 0x3, 0x2, 0x2, 0x2, 0xd6, 0x47b, 0x3, - 0x2, 0x2, 0x2, 0xd8, 0x47d, 0x3, 0x2, 0x2, 0x2, 0xda, 0x47f, 0x3, - 0x2, 0x2, 0x2, 0xdc, 0x481, 0x3, 0x2, 0x2, 0x2, 0xde, 0x483, 0x3, - 0x2, 0x2, 0x2, 0xe0, 0xe6, 0x5, 0x4, 0x3, 0x2, 0xe1, 0xe6, 0x5, 0x12, - 0xa, 0x2, 0xe2, 0xe6, 0x5, 0x14, 0xb, 0x2, 0xe3, 0xe6, 0x5, 0x16, - 0xc, 0x2, 0xe4, 0xe6, 0x5, 0x18, 0xd, 0x2, 0xe5, 0xe0, 0x3, 0x2, - 0x2, 0x2, 0xe5, 0xe1, 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe2, 0x3, 0x2, 0x2, - 0x2, 0xe5, 0xe3, 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe4, 0x3, 0x2, 0x2, 0x2, - 0xe6, 0xe9, 0x3, 0x2, 0x2, 0x2, 0xe7, 0xe5, 0x3, 0x2, 0x2, 0x2, 0xe7, - 0xe8, 0x3, 0x2, 0x2, 0x2, 0xe8, 0xea, 0x3, 0x2, 0x2, 0x2, 0xe9, 0xe7, - 0x3, 0x2, 0x2, 0x2, 0xea, 0xeb, 0x7, 0x2, 0x2, 0x3, 0xeb, 0x3, 0x3, - 0x2, 0x2, 0x2, 0xec, 0xf3, 0x5, 0x6, 0x4, 0x2, 0xed, 0xf3, 0x5, 0x8, - 0x5, 0x2, 0xee, 0xf3, 0x5, 0xa, 0x6, 0x2, 0xef, 0xf3, 0x5, 0xc, 0x7, - 0x2, 0xf0, 0xf3, 0x5, 0xe, 0x8, 0x2, 0xf1, 0xf3, 0x5, 0x10, 0x9, - 0x2, 0xf2, 0xec, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xed, 0x3, 0x2, 0x2, 0x2, - 0xf2, 0xee, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xef, 0x3, 0x2, 0x2, 0x2, 0xf2, - 0xf0, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xf1, 0x3, 0x2, 0x2, 0x2, 0xf3, 0xf4, - 0x3, 0x2, 0x2, 0x2, 0xf4, 0xf5, 0x7, 0x7a, 0x2, 0x2, 0xf5, 0x5, 0x3, - 0x2, 0x2, 0x2, 0xf6, 0xf7, 0x7, 0x7, 0x2, 0x2, 0xf7, 0xf8, 0x7, 0x8f, - 0x2, 0x2, 0xf8, 0xf9, 0x7, 0x90, 0x2, 0x2, 0xf9, 0xfa, 0x7, 0x91, - 0x2, 0x2, 0xfa, 0x7, 0x3, 0x2, 0x2, 0x2, 0xfb, 0xfc, 0x7, 0x7f, 0x2, - 0x2, 0xfc, 0xfd, 0x7, 0x7b, 0x2, 0x2, 0xfd, 0xfe, 0x5, 0xa6, 0x54, - 0x2, 0xfe, 0x9, 0x3, 0x2, 0x2, 0x2, 0xff, 0x100, 0x7, 0xc, 0x2, 0x2, - 0x100, 0x101, 0x5, 0xb2, 0x5a, 0x2, 0x101, 0x102, 0x5, 0xb2, 0x5a, - 0x2, 0x102, 0xb, 0x3, 0x2, 0x2, 0x2, 0x103, 0x106, 0x7, 0x38, 0x2, - 0x2, 0x104, 0x107, 0x5, 0xac, 0x57, 0x2, 0x105, 0x107, 0x5, 0xa6, - 0x54, 0x2, 0x106, 0x104, 0x3, 0x2, 0x2, 0x2, 0x106, 0x105, 0x3, 0x2, - 0x2, 0x2, 0x107, 0x108, 0x3, 0x2, 0x2, 0x2, 0x108, 0x109, 0x5, 0x9a, - 0x4e, 0x2, 0x109, 0x10a, 0x7, 0x7f, 0x2, 0x2, 0x10a, 0xd, 0x3, 0x2, - 0x2, 0x2, 0x10b, 0x10c, 0x7, 0x35, 0x2, 0x2, 0x10c, 0x10d, 0x7, 0x87, + 0x2, 0x10, 0x10, 0x81, 0x83, 0x4, 0x2, 0x37, 0x37, 0x82, 0x82, 0x5, + 0x2, 0x37, 0x37, 0x82, 0x83, 0x88, 0x88, 0x4, 0x2, 0x84, 0x84, 0x87, + 0x87, 0x3, 0x2, 0x85, 0x87, 0x3, 0x2, 0x22, 0x23, 0x3, 0x2, 0x24, + 0x25, 0x3, 0x2, 0x3, 0x4, 0x3, 0x2, 0x1e, 0x1f, 0x3, 0x2, 0x28, 0x29, + 0x3, 0x2, 0x3b, 0x3c, 0x2, 0x4c2, 0x2, 0xe7, 0x3, 0x2, 0x2, 0x2, + 0x4, 0xf2, 0x3, 0x2, 0x2, 0x2, 0x6, 0xf6, 0x3, 0x2, 0x2, 0x2, 0x8, + 0xfb, 0x3, 0x2, 0x2, 0x2, 0xa, 0xff, 0x3, 0x2, 0x2, 0x2, 0xc, 0x103, + 0x3, 0x2, 0x2, 0x2, 0xe, 0x10b, 0x3, 0x2, 0x2, 0x2, 0x10, 0x114, + 0x3, 0x2, 0x2, 0x2, 0x12, 0x118, 0x3, 0x2, 0x2, 0x2, 0x14, 0x127, + 0x3, 0x2, 0x2, 0x2, 0x16, 0x133, 0x3, 0x2, 0x2, 0x2, 0x18, 0x13e, + 0x3, 0x2, 0x2, 0x2, 0x1a, 0x150, 0x3, 0x2, 0x2, 0x2, 0x1c, 0x152, + 0x3, 0x2, 0x2, 0x2, 0x1e, 0x164, 0x3, 0x2, 0x2, 0x2, 0x20, 0x171, + 0x3, 0x2, 0x2, 0x2, 0x22, 0x180, 0x3, 0x2, 0x2, 0x2, 0x24, 0x190, + 0x3, 0x2, 0x2, 0x2, 0x26, 0x194, 0x3, 0x2, 0x2, 0x2, 0x28, 0x197, + 0x3, 0x2, 0x2, 0x2, 0x2a, 0x19a, 0x3, 0x2, 0x2, 0x2, 0x2c, 0x19f, + 0x3, 0x2, 0x2, 0x2, 0x2e, 0x1b0, 0x3, 0x2, 0x2, 0x2, 0x30, 0x1b2, + 0x3, 0x2, 0x2, 0x2, 0x32, 0x1c9, 0x3, 0x2, 0x2, 0x2, 0x34, 0x1e0, + 0x3, 0x2, 0x2, 0x2, 0x36, 0x21e, 0x3, 0x2, 0x2, 0x2, 0x38, 0x227, + 0x3, 0x2, 0x2, 0x2, 0x3a, 0x230, 0x3, 0x2, 0x2, 0x2, 0x3c, 0x232, + 0x3, 0x2, 0x2, 0x2, 0x3e, 0x236, 0x3, 0x2, 0x2, 0x2, 0x40, 0x23c, + 0x3, 0x2, 0x2, 0x2, 0x42, 0x247, 0x3, 0x2, 0x2, 0x2, 0x44, 0x24d, + 0x3, 0x2, 0x2, 0x2, 0x46, 0x25a, 0x3, 0x2, 0x2, 0x2, 0x48, 0x263, + 0x3, 0x2, 0x2, 0x2, 0x4a, 0x265, 0x3, 0x2, 0x2, 0x2, 0x4c, 0x273, + 0x3, 0x2, 0x2, 0x2, 0x4e, 0x277, 0x3, 0x2, 0x2, 0x2, 0x50, 0x27d, + 0x3, 0x2, 0x2, 0x2, 0x52, 0x286, 0x3, 0x2, 0x2, 0x2, 0x54, 0x28d, + 0x3, 0x2, 0x2, 0x2, 0x56, 0x29d, 0x3, 0x2, 0x2, 0x2, 0x58, 0x2a1, + 0x3, 0x2, 0x2, 0x2, 0x5a, 0x2aa, 0x3, 0x2, 0x2, 0x2, 0x5c, 0x2b1, + 0x3, 0x2, 0x2, 0x2, 0x5e, 0x2b8, 0x3, 0x2, 0x2, 0x2, 0x60, 0x2bf, + 0x3, 0x2, 0x2, 0x2, 0x62, 0x2cc, 0x3, 0x2, 0x2, 0x2, 0x64, 0x2d0, + 0x3, 0x2, 0x2, 0x2, 0x66, 0x2d3, 0x3, 0x2, 0x2, 0x2, 0x68, 0x2e1, + 0x3, 0x2, 0x2, 0x2, 0x6a, 0x2e5, 0x3, 0x2, 0x2, 0x2, 0x6c, 0x2e8, + 0x3, 0x2, 0x2, 0x2, 0x6e, 0x2f6, 0x3, 0x2, 0x2, 0x2, 0x70, 0x2fa, + 0x3, 0x2, 0x2, 0x2, 0x72, 0x2fd, 0x3, 0x2, 0x2, 0x2, 0x74, 0x30a, + 0x3, 0x2, 0x2, 0x2, 0x76, 0x30e, 0x3, 0x2, 0x2, 0x2, 0x78, 0x31c, + 0x3, 0x2, 0x2, 0x2, 0x7a, 0x329, 0x3, 0x2, 0x2, 0x2, 0x7c, 0x348, + 0x3, 0x2, 0x2, 0x2, 0x7e, 0x34a, 0x3, 0x2, 0x2, 0x2, 0x80, 0x35a, + 0x3, 0x2, 0x2, 0x2, 0x82, 0x35e, 0x3, 0x2, 0x2, 0x2, 0x84, 0x369, + 0x3, 0x2, 0x2, 0x2, 0x86, 0x376, 0x3, 0x2, 0x2, 0x2, 0x88, 0x37a, + 0x3, 0x2, 0x2, 0x2, 0x8a, 0x383, 0x3, 0x2, 0x2, 0x2, 0x8c, 0x389, + 0x3, 0x2, 0x2, 0x2, 0x8e, 0x394, 0x3, 0x2, 0x2, 0x2, 0x90, 0x398, + 0x3, 0x2, 0x2, 0x2, 0x92, 0x39b, 0x3, 0x2, 0x2, 0x2, 0x94, 0x3a8, + 0x3, 0x2, 0x2, 0x2, 0x96, 0x3b5, 0x3, 0x2, 0x2, 0x2, 0x98, 0x3b9, + 0x3, 0x2, 0x2, 0x2, 0x9a, 0x3bd, 0x3, 0x2, 0x2, 0x2, 0x9c, 0x3cc, + 0x3, 0x2, 0x2, 0x2, 0x9e, 0x3d0, 0x3, 0x2, 0x2, 0x2, 0xa0, 0x3d9, + 0x3, 0x2, 0x2, 0x2, 0xa2, 0x3df, 0x3, 0x2, 0x2, 0x2, 0xa4, 0x3e5, + 0x3, 0x2, 0x2, 0x2, 0xa6, 0x3e9, 0x3, 0x2, 0x2, 0x2, 0xa8, 0x3eb, + 0x3, 0x2, 0x2, 0x2, 0xaa, 0x3f9, 0x3, 0x2, 0x2, 0x2, 0xac, 0x3fd, + 0x3, 0x2, 0x2, 0x2, 0xae, 0x3ff, 0x3, 0x2, 0x2, 0x2, 0xb0, 0x401, + 0x3, 0x2, 0x2, 0x2, 0xb2, 0x403, 0x3, 0x2, 0x2, 0x2, 0xb4, 0x405, + 0x3, 0x2, 0x2, 0x2, 0xb6, 0x407, 0x3, 0x2, 0x2, 0x2, 0xb8, 0x40c, + 0x3, 0x2, 0x2, 0x2, 0xba, 0x414, 0x3, 0x2, 0x2, 0x2, 0xbc, 0x41c, + 0x3, 0x2, 0x2, 0x2, 0xbe, 0x424, 0x3, 0x2, 0x2, 0x2, 0xc0, 0x42c, + 0x3, 0x2, 0x2, 0x2, 0xc2, 0x434, 0x3, 0x2, 0x2, 0x2, 0xc4, 0x43c, + 0x3, 0x2, 0x2, 0x2, 0xc6, 0x444, 0x3, 0x2, 0x2, 0x2, 0xc8, 0x44c, + 0x3, 0x2, 0x2, 0x2, 0xca, 0x454, 0x3, 0x2, 0x2, 0x2, 0xcc, 0x45c, + 0x3, 0x2, 0x2, 0x2, 0xce, 0x464, 0x3, 0x2, 0x2, 0x2, 0xd0, 0x46c, + 0x3, 0x2, 0x2, 0x2, 0xd2, 0x474, 0x3, 0x2, 0x2, 0x2, 0xd4, 0x479, + 0x3, 0x2, 0x2, 0x2, 0xd6, 0x47b, 0x3, 0x2, 0x2, 0x2, 0xd8, 0x47d, + 0x3, 0x2, 0x2, 0x2, 0xda, 0x47f, 0x3, 0x2, 0x2, 0x2, 0xdc, 0x481, + 0x3, 0x2, 0x2, 0x2, 0xde, 0x483, 0x3, 0x2, 0x2, 0x2, 0xe0, 0xe6, + 0x5, 0x4, 0x3, 0x2, 0xe1, 0xe6, 0x5, 0x12, 0xa, 0x2, 0xe2, 0xe6, + 0x5, 0x14, 0xb, 0x2, 0xe3, 0xe6, 0x5, 0x16, 0xc, 0x2, 0xe4, 0xe6, + 0x5, 0x18, 0xd, 0x2, 0xe5, 0xe0, 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe1, + 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe2, 0x3, 0x2, 0x2, 0x2, 0xe5, 0xe3, 0x3, + 0x2, 0x2, 0x2, 0xe5, 0xe4, 0x3, 0x2, 0x2, 0x2, 0xe6, 0xe9, 0x3, 0x2, + 0x2, 0x2, 0xe7, 0xe5, 0x3, 0x2, 0x2, 0x2, 0xe7, 0xe8, 0x3, 0x2, 0x2, + 0x2, 0xe8, 0xea, 0x3, 0x2, 0x2, 0x2, 0xe9, 0xe7, 0x3, 0x2, 0x2, 0x2, + 0xea, 0xeb, 0x7, 0x2, 0x2, 0x3, 0xeb, 0x3, 0x3, 0x2, 0x2, 0x2, 0xec, + 0xf3, 0x5, 0x6, 0x4, 0x2, 0xed, 0xf3, 0x5, 0x8, 0x5, 0x2, 0xee, 0xf3, + 0x5, 0xa, 0x6, 0x2, 0xef, 0xf3, 0x5, 0xc, 0x7, 0x2, 0xf0, 0xf3, 0x5, + 0xe, 0x8, 0x2, 0xf1, 0xf3, 0x5, 0x10, 0x9, 0x2, 0xf2, 0xec, 0x3, + 0x2, 0x2, 0x2, 0xf2, 0xed, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xee, 0x3, 0x2, + 0x2, 0x2, 0xf2, 0xef, 0x3, 0x2, 0x2, 0x2, 0xf2, 0xf0, 0x3, 0x2, 0x2, + 0x2, 0xf2, 0xf1, 0x3, 0x2, 0x2, 0x2, 0xf3, 0xf4, 0x3, 0x2, 0x2, 0x2, + 0xf4, 0xf5, 0x7, 0x7a, 0x2, 0x2, 0xf5, 0x5, 0x3, 0x2, 0x2, 0x2, 0xf6, + 0xf7, 0x7, 0x7, 0x2, 0x2, 0xf7, 0xf8, 0x7, 0x8f, 0x2, 0x2, 0xf8, + 0xf9, 0x7, 0x90, 0x2, 0x2, 0xf9, 0xfa, 0x7, 0x91, 0x2, 0x2, 0xfa, + 0x7, 0x3, 0x2, 0x2, 0x2, 0xfb, 0xfc, 0x7, 0x7f, 0x2, 0x2, 0xfc, 0xfd, + 0x7, 0x7b, 0x2, 0x2, 0xfd, 0xfe, 0x5, 0xa6, 0x54, 0x2, 0xfe, 0x9, + 0x3, 0x2, 0x2, 0x2, 0xff, 0x100, 0x7, 0xc, 0x2, 0x2, 0x100, 0x101, + 0x5, 0xb2, 0x5a, 0x2, 0x101, 0x102, 0x5, 0xb2, 0x5a, 0x2, 0x102, + 0xb, 0x3, 0x2, 0x2, 0x2, 0x103, 0x106, 0x7, 0x38, 0x2, 0x2, 0x104, + 0x107, 0x5, 0xac, 0x57, 0x2, 0x105, 0x107, 0x5, 0xa6, 0x54, 0x2, + 0x106, 0x104, 0x3, 0x2, 0x2, 0x2, 0x106, 0x105, 0x3, 0x2, 0x2, 0x2, + 0x107, 0x108, 0x3, 0x2, 0x2, 0x2, 0x108, 0x109, 0x5, 0x9a, 0x4e, + 0x2, 0x109, 0x10a, 0x7, 0x7f, 0x2, 0x2, 0x10a, 0xd, 0x3, 0x2, 0x2, + 0x2, 0x10b, 0x10c, 0x7, 0x35, 0x2, 0x2, 0x10c, 0x10d, 0x7, 0x87, 0x2, 0x2, 0x10d, 0x110, 0x7, 0x87, 0x2, 0x2, 0x10e, 0x10f, 0x7, 0x33, 0x2, 0x2, 0x10f, 0x111, 0x7, 0x87, 0x2, 0x2, 0x110, 0x10e, 0x3, 0x2, 0x2, 0x2, 0x110, 0x111, 0x3, 0x2, 0x2, 0x2, 0x111, 0x112, 0x3, 0x2, @@ -10815,10 +10829,10 @@ FeatParser::Initializer::Initializer() { 0x5, 0xae, 0x58, 0x2, 0x3fc, 0x3fe, 0x7, 0x80, 0x2, 0x2, 0x3fd, 0x3fb, 0x3, 0x2, 0x2, 0x2, 0x3fd, 0x3fc, 0x3, 0x2, 0x2, 0x2, 0x3fe, 0xad, 0x3, 0x2, 0x2, 0x2, 0x3ff, 0x400, 0x9, 0xe, 0x2, 0x2, 0x400, 0xaf, - 0x3, 0x2, 0x2, 0x2, 0x401, 0x402, 0x7, 0x82, 0x2, 0x2, 0x402, 0xb1, - 0x3, 0x2, 0x2, 0x2, 0x403, 0x404, 0x9, 0xf, 0x2, 0x2, 0x404, 0xb3, - 0x3, 0x2, 0x2, 0x2, 0x405, 0x406, 0x9, 0x10, 0x2, 0x2, 0x406, 0xb5, - 0x3, 0x2, 0x2, 0x2, 0x407, 0x408, 0x9, 0x11, 0x2, 0x2, 0x408, 0xb7, + 0x3, 0x2, 0x2, 0x2, 0x401, 0x402, 0x9, 0xf, 0x2, 0x2, 0x402, 0xb1, + 0x3, 0x2, 0x2, 0x2, 0x403, 0x404, 0x9, 0x10, 0x2, 0x2, 0x404, 0xb3, + 0x3, 0x2, 0x2, 0x2, 0x405, 0x406, 0x9, 0x11, 0x2, 0x2, 0x406, 0xb5, + 0x3, 0x2, 0x2, 0x2, 0x407, 0x408, 0x9, 0x12, 0x2, 0x2, 0x408, 0xb7, 0x3, 0x2, 0x2, 0x2, 0x409, 0x40b, 0x5, 0x1a, 0xe, 0x2, 0x40a, 0x409, 0x3, 0x2, 0x2, 0x2, 0x40b, 0x40e, 0x3, 0x2, 0x2, 0x2, 0x40c, 0x40a, 0x3, 0x2, 0x2, 0x2, 0x40c, 0x40d, 0x3, 0x2, 0x2, 0x2, 0x40d, 0x40f, @@ -10882,12 +10896,12 @@ FeatParser::Initializer::Initializer() { 0x3, 0x2, 0x2, 0x2, 0x474, 0x472, 0x3, 0x2, 0x2, 0x2, 0x474, 0x475, 0x3, 0x2, 0x2, 0x2, 0x475, 0x477, 0x3, 0x2, 0x2, 0x2, 0x476, 0x474, 0x3, 0x2, 0x2, 0x2, 0x477, 0x478, 0x7, 0x2, 0x2, 0x3, 0x478, 0xd3, - 0x3, 0x2, 0x2, 0x2, 0x479, 0x47a, 0x9, 0x12, 0x2, 0x2, 0x47a, 0xd5, - 0x3, 0x2, 0x2, 0x2, 0x47b, 0x47c, 0x9, 0x13, 0x2, 0x2, 0x47c, 0xd7, - 0x3, 0x2, 0x2, 0x2, 0x47d, 0x47e, 0x9, 0x14, 0x2, 0x2, 0x47e, 0xd9, - 0x3, 0x2, 0x2, 0x2, 0x47f, 0x480, 0x9, 0x15, 0x2, 0x2, 0x480, 0xdb, - 0x3, 0x2, 0x2, 0x2, 0x481, 0x482, 0x9, 0x16, 0x2, 0x2, 0x482, 0xdd, - 0x3, 0x2, 0x2, 0x2, 0x483, 0x484, 0x9, 0x17, 0x2, 0x2, 0x484, 0xdf, + 0x3, 0x2, 0x2, 0x2, 0x479, 0x47a, 0x9, 0x13, 0x2, 0x2, 0x47a, 0xd5, + 0x3, 0x2, 0x2, 0x2, 0x47b, 0x47c, 0x9, 0x14, 0x2, 0x2, 0x47c, 0xd7, + 0x3, 0x2, 0x2, 0x2, 0x47d, 0x47e, 0x9, 0x15, 0x2, 0x2, 0x47e, 0xd9, + 0x3, 0x2, 0x2, 0x2, 0x47f, 0x480, 0x9, 0x16, 0x2, 0x2, 0x480, 0xdb, + 0x3, 0x2, 0x2, 0x2, 0x481, 0x482, 0x9, 0x17, 0x2, 0x2, 0x482, 0xdd, + 0x3, 0x2, 0x2, 0x2, 0x483, 0x484, 0x9, 0x18, 0x2, 0x2, 0x484, 0xdf, 0x3, 0x2, 0x2, 0x2, 0x7c, 0xe5, 0xe7, 0xf2, 0x106, 0x110, 0x11b, 0x121, 0x131, 0x139, 0x141, 0x147, 0x150, 0x155, 0x15b, 0x160, 0x169, 0x171, 0x17a, 0x180, 0x190, 0x19d, 0x1a4, 0x1a6, 0x1b0, 0x1b6, 0x1bd, diff --git a/c/makeotf/lib/hotconv/FeatParser.g4 b/c/makeotf/lib/hotconv/FeatParser.g4 index 972014fcb..110119456 100644 --- a/c/makeotf/lib/hotconv/FeatParser.g4 +++ b/c/makeotf/lib/hotconv/FeatParser.g4 @@ -499,7 +499,7 @@ glyphName: ; label: - NAMELABEL + NAMELABEL | MARK ; tag: diff --git a/c/makeotf/lib/hotconv/FeatParser.h b/c/makeotf/lib/hotconv/FeatParser.h index 7a4d94a8d..40c42fb17 100644 --- a/c/makeotf/lib/hotconv/FeatParser.h +++ b/c/makeotf/lib/hotconv/FeatParser.h @@ -1754,6 +1754,7 @@ class FeatParser : public antlr4::Parser { LabelContext(antlr4::ParserRuleContext *parent, size_t invokingState); virtual size_t getRuleIndex() const override; antlr4::tree::TerminalNode *NAMELABEL(); + antlr4::tree::TerminalNode *MARK(); virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override; diff --git a/c/makeotf/lib/hotconv/FeatParser.interp b/c/makeotf/lib/hotconv/FeatParser.interp index 9d483931a..963ed375a 100644 --- a/c/makeotf/lib/hotconv/FeatParser.interp +++ b/c/makeotf/lib/hotconv/FeatParser.interp @@ -409,4 +409,4 @@ markligtok atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 147, 1158, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 230, 10, 2, 12, 2, 14, 2, 233, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 243, 10, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 263, 10, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 273, 10, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 5, 10, 284, 10, 10, 3, 10, 3, 10, 6, 10, 288, 10, 10, 13, 10, 14, 10, 289, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 306, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 312, 10, 12, 12, 12, 14, 12, 315, 11, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 5, 13, 322, 10, 13, 3, 13, 3, 13, 6, 13, 326, 10, 13, 13, 13, 14, 13, 327, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 5, 14, 337, 10, 14, 3, 15, 3, 15, 3, 15, 5, 15, 342, 10, 15, 3, 15, 3, 15, 6, 15, 346, 10, 15, 13, 15, 14, 15, 347, 3, 15, 3, 15, 3, 15, 5, 15, 353, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 7, 16, 360, 10, 16, 12, 16, 14, 16, 363, 11, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 370, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 6, 18, 377, 10, 18, 13, 18, 14, 18, 378, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 385, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 401, 10, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 5, 22, 414, 10, 22, 3, 23, 3, 23, 3, 23, 6, 23, 419, 10, 23, 13, 23, 14, 23, 420, 5, 23, 423, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 433, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 439, 10, 25, 3, 25, 3, 25, 3, 25, 7, 25, 444, 10, 25, 12, 25, 14, 25, 447, 11, 25, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 453, 10, 26, 12, 26, 14, 26, 456, 11, 26, 5, 26, 458, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 465, 10, 26, 5, 26, 467, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 474, 10, 26, 5, 26, 476, 10, 26, 5, 26, 478, 10, 26, 3, 27, 5, 27, 481, 10, 27, 3, 27, 3, 27, 5, 27, 485, 10, 27, 3, 27, 3, 27, 7, 27, 489, 10, 27, 12, 27, 14, 27, 492, 11, 27, 3, 27, 3, 27, 6, 27, 496, 10, 27, 13, 27, 14, 27, 497, 3, 27, 7, 27, 501, 10, 27, 12, 27, 14, 27, 504, 11, 27, 3, 27, 3, 27, 3, 27, 5, 27, 509, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 514, 10, 27, 13, 27, 14, 27, 515, 3, 27, 5, 27, 519, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 524, 10, 27, 13, 27, 14, 27, 525, 3, 27, 5, 27, 529, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 534, 10, 27, 13, 27, 14, 27, 535, 3, 27, 5, 27, 539, 10, 27, 5, 27, 541, 10, 27, 3, 28, 3, 28, 5, 28, 545, 10, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 552, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 561, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 571, 10, 32, 3, 33, 3, 33, 3, 33, 5, 33, 576, 10, 33, 3, 33, 5, 33, 579, 10, 33, 3, 33, 5, 33, 582, 10, 33, 3, 34, 3, 34, 6, 34, 586, 10, 34, 13, 34, 14, 34, 587, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 595, 10, 35, 5, 35, 597, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 6, 36, 606, 10, 36, 13, 36, 14, 36, 607, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 6, 38, 617, 10, 38, 13, 38, 14, 38, 618, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 5, 39, 628, 10, 39, 3, 39, 3, 39, 3, 40, 3, 40, 6, 40, 634, 10, 40, 13, 40, 14, 40, 635, 3, 41, 3, 41, 3, 41, 3, 41, 7, 41, 642, 10, 41, 12, 41, 14, 41, 645, 11, 41, 3, 42, 3, 42, 3, 42, 6, 42, 650, 10, 42, 13, 42, 14, 42, 651, 3, 43, 3, 43, 3, 43, 6, 43, 657, 10, 43, 13, 43, 14, 43, 658, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 670, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 6, 46, 686, 10, 46, 13, 46, 14, 46, 687, 3, 47, 3, 47, 3, 47, 6, 47, 693, 10, 47, 13, 47, 14, 47, 694, 3, 48, 3, 48, 3, 48, 6, 48, 700, 10, 48, 13, 48, 14, 48, 701, 3, 49, 3, 49, 3, 49, 6, 49, 707, 10, 49, 13, 49, 14, 49, 708, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 5, 50, 717, 10, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 7, 52, 727, 10, 52, 12, 52, 14, 52, 730, 11, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 5, 53, 738, 10, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 7, 55, 748, 10, 55, 12, 55, 14, 55, 751, 11, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 759, 10, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 6, 58, 769, 10, 58, 13, 58, 14, 58, 770, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 5, 59, 779, 10, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 789, 10, 60, 5, 60, 791, 10, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 6, 61, 800, 10, 61, 13, 61, 14, 61, 801, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 5, 62, 810, 10, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 6, 63, 837, 10, 63, 13, 63, 14, 63, 838, 5, 63, 841, 10, 63, 3, 64, 3, 64, 3, 64, 6, 64, 846, 10, 64, 13, 64, 14, 64, 847, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 5, 65, 859, 10, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 6, 66, 868, 10, 66, 13, 66, 14, 66, 869, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 6, 67, 877, 10, 67, 13, 67, 14, 67, 878, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 5, 68, 887, 10, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 5, 69, 896, 10, 69, 5, 69, 898, 10, 69, 3, 70, 3, 70, 6, 70, 902, 10, 70, 13, 70, 14, 70, 903, 3, 71, 3, 71, 3, 71, 6, 71, 909, 10, 71, 13, 71, 14, 71, 910, 3, 71, 3, 71, 3, 72, 3, 72, 5, 72, 917, 10, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 929, 10, 74, 5, 74, 931, 10, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 6, 75, 940, 10, 75, 13, 75, 14, 75, 941, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 5, 76, 950, 10, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 5, 78, 964, 10, 78, 3, 78, 3, 78, 5, 78, 968, 10, 78, 3, 78, 3, 78, 3, 79, 6, 79, 973, 10, 79, 13, 79, 14, 79, 974, 3, 80, 3, 80, 3, 80, 7, 80, 980, 10, 80, 12, 80, 14, 80, 983, 11, 80, 3, 81, 6, 81, 986, 10, 81, 13, 81, 14, 81, 987, 3, 82, 3, 82, 5, 82, 992, 10, 82, 3, 82, 5, 82, 995, 10, 82, 3, 83, 5, 83, 998, 10, 83, 3, 84, 3, 84, 5, 84, 1002, 10, 84, 3, 85, 3, 85, 6, 85, 1006, 10, 85, 13, 85, 14, 85, 1007, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 5, 86, 1015, 10, 86, 3, 86, 5, 86, 1018, 10, 86, 3, 87, 3, 87, 5, 87, 1022, 10, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 7, 93, 1035, 10, 93, 12, 93, 14, 93, 1038, 11, 93, 3, 93, 3, 93, 3, 94, 7, 94, 1043, 10, 94, 12, 94, 14, 94, 1046, 11, 94, 3, 94, 3, 94, 3, 95, 7, 95, 1051, 10, 95, 12, 95, 14, 95, 1054, 11, 95, 3, 95, 3, 95, 3, 96, 7, 96, 1059, 10, 96, 12, 96, 14, 96, 1062, 11, 96, 3, 96, 3, 96, 3, 97, 7, 97, 1067, 10, 97, 12, 97, 14, 97, 1070, 11, 97, 3, 97, 3, 97, 3, 98, 7, 98, 1075, 10, 98, 12, 98, 14, 98, 1078, 11, 98, 3, 98, 3, 98, 3, 99, 7, 99, 1083, 10, 99, 12, 99, 14, 99, 1086, 11, 99, 3, 99, 3, 99, 3, 100, 7, 100, 1091, 10, 100, 12, 100, 14, 100, 1094, 11, 100, 3, 100, 3, 100, 3, 101, 7, 101, 1099, 10, 101, 12, 101, 14, 101, 1102, 11, 101, 3, 101, 3, 101, 3, 102, 7, 102, 1107, 10, 102, 12, 102, 14, 102, 1110, 11, 102, 3, 102, 3, 102, 3, 103, 7, 103, 1115, 10, 103, 12, 103, 14, 103, 1118, 11, 103, 3, 103, 3, 103, 3, 104, 7, 104, 1123, 10, 104, 12, 104, 14, 104, 1126, 11, 104, 3, 104, 3, 104, 3, 105, 7, 105, 1131, 10, 105, 12, 105, 14, 105, 1134, 11, 105, 3, 105, 3, 105, 3, 106, 7, 106, 1139, 10, 106, 12, 106, 14, 106, 1142, 11, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 109, 3, 109, 3, 110, 3, 110, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 2, 2, 113, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 2, 24, 3, 2, 45, 48, 3, 2, 23, 26, 3, 2, 38, 39, 3, 2, 64, 65, 3, 2, 66, 67, 3, 2, 76, 79, 3, 2, 111, 113, 3, 2, 88, 94, 4, 2, 83, 86, 95, 96, 3, 2, 98, 99, 3, 2, 108, 109, 3, 2, 115, 116, 4, 2, 16, 16, 129, 131, 5, 2, 55, 55, 130, 131, 136, 136, 4, 2, 132, 132, 135, 135, 3, 2, 133, 135, 3, 2, 34, 35, 3, 2, 36, 37, 3, 2, 3, 4, 3, 2, 30, 31, 3, 2, 40, 41, 3, 2, 59, 60, 2, 1218, 2, 231, 3, 2, 2, 2, 4, 242, 3, 2, 2, 2, 6, 246, 3, 2, 2, 2, 8, 251, 3, 2, 2, 2, 10, 255, 3, 2, 2, 2, 12, 259, 3, 2, 2, 2, 14, 267, 3, 2, 2, 2, 16, 276, 3, 2, 2, 2, 18, 280, 3, 2, 2, 2, 20, 295, 3, 2, 2, 2, 22, 307, 3, 2, 2, 2, 24, 318, 3, 2, 2, 2, 26, 336, 3, 2, 2, 2, 28, 338, 3, 2, 2, 2, 30, 356, 3, 2, 2, 2, 32, 369, 3, 2, 2, 2, 34, 384, 3, 2, 2, 2, 36, 400, 3, 2, 2, 2, 38, 404, 3, 2, 2, 2, 40, 407, 3, 2, 2, 2, 42, 410, 3, 2, 2, 2, 44, 415, 3, 2, 2, 2, 46, 432, 3, 2, 2, 2, 48, 434, 3, 2, 2, 2, 50, 457, 3, 2, 2, 2, 52, 480, 3, 2, 2, 2, 54, 542, 3, 2, 2, 2, 56, 551, 3, 2, 2, 2, 58, 560, 3, 2, 2, 2, 60, 562, 3, 2, 2, 2, 62, 566, 3, 2, 2, 2, 64, 572, 3, 2, 2, 2, 66, 583, 3, 2, 2, 2, 68, 589, 3, 2, 2, 2, 70, 602, 3, 2, 2, 2, 72, 611, 3, 2, 2, 2, 74, 613, 3, 2, 2, 2, 76, 627, 3, 2, 2, 2, 78, 631, 3, 2, 2, 2, 80, 637, 3, 2, 2, 2, 82, 646, 3, 2, 2, 2, 84, 653, 3, 2, 2, 2, 86, 669, 3, 2, 2, 2, 88, 673, 3, 2, 2, 2, 90, 682, 3, 2, 2, 2, 92, 689, 3, 2, 2, 2, 94, 696, 3, 2, 2, 2, 96, 703, 3, 2, 2, 2, 98, 716, 3, 2, 2, 2, 100, 720, 3, 2, 2, 2, 102, 723, 3, 2, 2, 2, 104, 737, 3, 2, 2, 2, 106, 741, 3, 2, 2, 2, 108, 744, 3, 2, 2, 2, 110, 758, 3, 2, 2, 2, 112, 762, 3, 2, 2, 2, 114, 765, 3, 2, 2, 2, 116, 778, 3, 2, 2, 2, 118, 782, 3, 2, 2, 2, 120, 796, 3, 2, 2, 2, 122, 809, 3, 2, 2, 2, 124, 840, 3, 2, 2, 2, 126, 842, 3, 2, 2, 2, 128, 858, 3, 2, 2, 2, 130, 862, 3, 2, 2, 2, 132, 873, 3, 2, 2, 2, 134, 886, 3, 2, 2, 2, 136, 890, 3, 2, 2, 2, 138, 899, 3, 2, 2, 2, 140, 905, 3, 2, 2, 2, 142, 916, 3, 2, 2, 2, 144, 920, 3, 2, 2, 2, 146, 923, 3, 2, 2, 2, 148, 936, 3, 2, 2, 2, 150, 949, 3, 2, 2, 2, 152, 953, 3, 2, 2, 2, 154, 957, 3, 2, 2, 2, 156, 972, 3, 2, 2, 2, 158, 976, 3, 2, 2, 2, 160, 985, 3, 2, 2, 2, 162, 991, 3, 2, 2, 2, 164, 997, 3, 2, 2, 2, 166, 1001, 3, 2, 2, 2, 168, 1003, 3, 2, 2, 2, 170, 1017, 3, 2, 2, 2, 172, 1021, 3, 2, 2, 2, 174, 1023, 3, 2, 2, 2, 176, 1025, 3, 2, 2, 2, 178, 1027, 3, 2, 2, 2, 180, 1029, 3, 2, 2, 2, 182, 1031, 3, 2, 2, 2, 184, 1036, 3, 2, 2, 2, 186, 1044, 3, 2, 2, 2, 188, 1052, 3, 2, 2, 2, 190, 1060, 3, 2, 2, 2, 192, 1068, 3, 2, 2, 2, 194, 1076, 3, 2, 2, 2, 196, 1084, 3, 2, 2, 2, 198, 1092, 3, 2, 2, 2, 200, 1100, 3, 2, 2, 2, 202, 1108, 3, 2, 2, 2, 204, 1116, 3, 2, 2, 2, 206, 1124, 3, 2, 2, 2, 208, 1132, 3, 2, 2, 2, 210, 1140, 3, 2, 2, 2, 212, 1145, 3, 2, 2, 2, 214, 1147, 3, 2, 2, 2, 216, 1149, 3, 2, 2, 2, 218, 1151, 3, 2, 2, 2, 220, 1153, 3, 2, 2, 2, 222, 1155, 3, 2, 2, 2, 224, 230, 5, 4, 3, 2, 225, 230, 5, 18, 10, 2, 226, 230, 5, 20, 11, 2, 227, 230, 5, 22, 12, 2, 228, 230, 5, 24, 13, 2, 229, 224, 3, 2, 2, 2, 229, 225, 3, 2, 2, 2, 229, 226, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 228, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 234, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 7, 2, 2, 3, 235, 3, 3, 2, 2, 2, 236, 243, 5, 6, 4, 2, 237, 243, 5, 8, 5, 2, 238, 243, 5, 10, 6, 2, 239, 243, 5, 12, 7, 2, 240, 243, 5, 14, 8, 2, 241, 243, 5, 16, 9, 2, 242, 236, 3, 2, 2, 2, 242, 237, 3, 2, 2, 2, 242, 238, 3, 2, 2, 2, 242, 239, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 122, 2, 2, 245, 5, 3, 2, 2, 2, 246, 247, 7, 7, 2, 2, 247, 248, 7, 143, 2, 2, 248, 249, 7, 144, 2, 2, 249, 250, 7, 145, 2, 2, 250, 7, 3, 2, 2, 2, 251, 252, 7, 127, 2, 2, 252, 253, 7, 123, 2, 2, 253, 254, 5, 166, 84, 2, 254, 9, 3, 2, 2, 2, 255, 256, 7, 12, 2, 2, 256, 257, 5, 178, 90, 2, 257, 258, 5, 178, 90, 2, 258, 11, 3, 2, 2, 2, 259, 262, 7, 56, 2, 2, 260, 263, 5, 172, 87, 2, 261, 263, 5, 166, 84, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 265, 5, 154, 78, 2, 265, 266, 7, 127, 2, 2, 266, 13, 3, 2, 2, 2, 267, 268, 7, 53, 2, 2, 268, 269, 7, 135, 2, 2, 269, 272, 7, 135, 2, 2, 270, 271, 7, 51, 2, 2, 271, 273, 7, 135, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 5, 176, 89, 2, 275, 15, 3, 2, 2, 2, 276, 277, 7, 54, 2, 2, 277, 278, 5, 58, 30, 2, 278, 279, 5, 176, 89, 2, 279, 17, 3, 2, 2, 2, 280, 281, 7, 8, 2, 2, 281, 283, 5, 178, 90, 2, 282, 284, 7, 27, 2, 2, 283, 282, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 287, 7, 117, 2, 2, 286, 288, 5, 26, 14, 2, 287, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 292, 7, 118, 2, 2, 292, 293, 5, 178, 90, 2, 293, 294, 7, 122, 2, 2, 294, 19, 3, 2, 2, 2, 295, 305, 7, 9, 2, 2, 296, 306, 5, 74, 38, 2, 297, 306, 5, 84, 43, 2, 298, 306, 5, 96, 49, 2, 299, 306, 5, 102, 52, 2, 300, 306, 5, 108, 55, 2, 301, 306, 5, 114, 58, 2, 302, 306, 5, 120, 61, 2, 303, 306, 5, 126, 64, 2, 304, 306, 5, 148, 75, 2, 305, 296, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 298, 3, 2, 2, 2, 305, 299, 3, 2, 2, 2, 305, 300, 3, 2, 2, 2, 305, 301, 3, 2, 2, 2, 305, 302, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 21, 3, 2, 2, 2, 307, 308, 5, 216, 109, 2, 308, 309, 7, 138, 2, 2, 309, 313, 7, 139, 2, 2, 310, 312, 7, 141, 2, 2, 311, 310, 3, 2, 2, 2, 312, 315, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 316, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 316, 317, 7, 140, 2, 2, 317, 23, 3, 2, 2, 2, 318, 319, 7, 14, 2, 2, 319, 321, 5, 176, 89, 2, 320, 322, 7, 27, 2, 2, 321, 320, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 325, 7, 117, 2, 2, 324, 326, 5, 36, 19, 2, 325, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 330, 7, 118, 2, 2, 330, 331, 5, 176, 89, 2, 331, 332, 7, 122, 2, 2, 332, 25, 3, 2, 2, 2, 333, 337, 5, 36, 19, 2, 334, 337, 5, 28, 15, 2, 335, 337, 5, 30, 16, 2, 336, 333, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 335, 3, 2, 2, 2, 337, 27, 3, 2, 2, 2, 338, 339, 7, 14, 2, 2, 339, 352, 5, 176, 89, 2, 340, 342, 7, 27, 2, 2, 341, 340, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 345, 7, 117, 2, 2, 344, 346, 5, 36, 19, 2, 345, 344, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 7, 118, 2, 2, 350, 351, 5, 176, 89, 2, 351, 353, 3, 2, 2, 2, 352, 341, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 355, 7, 122, 2, 2, 355, 29, 3, 2, 2, 2, 356, 357, 7, 44, 2, 2, 357, 361, 7, 117, 2, 2, 358, 360, 5, 32, 17, 2, 359, 358, 3, 2, 2, 2, 360, 363, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 364, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 364, 365, 7, 118, 2, 2, 365, 366, 7, 122, 2, 2, 366, 31, 3, 2, 2, 2, 367, 370, 5, 34, 18, 2, 368, 370, 5, 6, 4, 2, 369, 367, 3, 2, 2, 2, 369, 368, 3, 2, 2, 2, 370, 371, 3, 2, 2, 2, 371, 372, 7, 122, 2, 2, 372, 33, 3, 2, 2, 2, 373, 374, 9, 2, 2, 2, 374, 376, 7, 117, 2, 2, 375, 377, 5, 142, 72, 2, 376, 375, 3, 2, 2, 2, 377, 378, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 118, 2, 2, 381, 385, 3, 2, 2, 2, 382, 383, 7, 49, 2, 2, 383, 385, 5, 182, 92, 2, 384, 373, 3, 2, 2, 2, 384, 382, 3, 2, 2, 2, 385, 35, 3, 2, 2, 2, 386, 401, 5, 38, 20, 2, 387, 401, 5, 40, 21, 2, 388, 401, 5, 42, 22, 2, 389, 401, 5, 44, 23, 2, 390, 401, 5, 8, 5, 2, 391, 401, 5, 48, 25, 2, 392, 401, 5, 50, 26, 2, 393, 401, 5, 12, 7, 2, 394, 401, 5, 52, 27, 2, 395, 401, 5, 66, 34, 2, 396, 401, 5, 68, 35, 2, 397, 401, 5, 70, 36, 2, 398, 401, 5, 72, 37, 2, 399, 401, 5, 6, 4, 2, 400, 386, 3, 2, 2, 2, 400, 387, 3, 2, 2, 2, 400, 388, 3, 2, 2, 2, 400, 389, 3, 2, 2, 2, 400, 390, 3, 2, 2, 2, 400, 391, 3, 2, 2, 2, 400, 392, 3, 2, 2, 2, 400, 393, 3, 2, 2, 2, 400, 394, 3, 2, 2, 2, 400, 395, 3, 2, 2, 2, 400, 396, 3, 2, 2, 2, 400, 397, 3, 2, 2, 2, 400, 398, 3, 2, 2, 2, 400, 399, 3, 2, 2, 2, 401, 402, 3, 2, 2, 2, 402, 403, 7, 122, 2, 2, 403, 37, 3, 2, 2, 2, 404, 405, 7, 8, 2, 2, 405, 406, 5, 178, 90, 2, 406, 39, 3, 2, 2, 2, 407, 408, 7, 10, 2, 2, 408, 409, 5, 178, 90, 2, 409, 41, 3, 2, 2, 2, 410, 411, 7, 11, 2, 2, 411, 413, 5, 178, 90, 2, 412, 414, 9, 3, 2, 2, 413, 412, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 43, 3, 2, 2, 2, 415, 422, 7, 15, 2, 2, 416, 423, 7, 135, 2, 2, 417, 419, 5, 46, 24, 2, 418, 417, 3, 2, 2, 2, 419, 420, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 420, 421, 3, 2, 2, 2, 421, 423, 3, 2, 2, 2, 422, 416, 3, 2, 2, 2, 422, 418, 3, 2, 2, 2, 423, 45, 3, 2, 2, 2, 424, 433, 7, 17, 2, 2, 425, 433, 7, 18, 2, 2, 426, 433, 7, 19, 2, 2, 427, 433, 7, 20, 2, 2, 428, 429, 7, 22, 2, 2, 429, 433, 5, 166, 84, 2, 430, 431, 7, 21, 2, 2, 431, 433, 5, 166, 84, 2, 432, 424, 3, 2, 2, 2, 432, 425, 3, 2, 2, 2, 432, 426, 3, 2, 2, 2, 432, 427, 3, 2, 2, 2, 432, 428, 3, 2, 2, 2, 432, 430, 3, 2, 2, 2, 433, 47, 3, 2, 2, 2, 434, 438, 7, 33, 2, 2, 435, 439, 5, 212, 107, 2, 436, 439, 5, 214, 108, 2, 437, 439, 5, 220, 111, 2, 438, 435, 3, 2, 2, 2, 438, 436, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 440, 3, 2, 2, 2, 440, 445, 5, 156, 79, 2, 441, 442, 7, 125, 2, 2, 442, 444, 5, 156, 79, 2, 443, 441, 3, 2, 2, 2, 444, 447, 3, 2, 2, 2, 445, 443, 3, 2, 2, 2, 445, 446, 3, 2, 2, 2, 446, 49, 3, 2, 2, 2, 447, 445, 3, 2, 2, 2, 448, 449, 7, 32, 2, 2, 449, 454, 5, 156, 79, 2, 450, 451, 7, 125, 2, 2, 451, 453, 5, 156, 79, 2, 452, 450, 3, 2, 2, 2, 453, 456, 3, 2, 2, 2, 454, 452, 3, 2, 2, 2, 454, 455, 3, 2, 2, 2, 455, 458, 3, 2, 2, 2, 456, 454, 3, 2, 2, 2, 457, 448, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 477, 3, 2, 2, 2, 459, 460, 5, 214, 108, 2, 460, 466, 5, 156, 79, 2, 461, 464, 7, 38, 2, 2, 462, 465, 7, 62, 2, 2, 463, 465, 5, 156, 79, 2, 464, 462, 3, 2, 2, 2, 464, 463, 3, 2, 2, 2, 465, 467, 3, 2, 2, 2, 466, 461, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 478, 3, 2, 2, 2, 468, 469, 5, 212, 107, 2, 469, 475, 5, 156, 79, 2, 470, 473, 9, 4, 2, 2, 471, 474, 7, 62, 2, 2, 472, 474, 5, 156, 79, 2, 473, 471, 3, 2, 2, 2, 473, 472, 3, 2, 2, 2, 474, 476, 3, 2, 2, 2, 475, 470, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 478, 3, 2, 2, 2, 477, 459, 3, 2, 2, 2, 477, 468, 3, 2, 2, 2, 478, 51, 3, 2, 2, 2, 479, 481, 5, 218, 110, 2, 480, 479, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 482, 3, 2, 2, 2, 482, 484, 5, 220, 111, 2, 483, 485, 5, 160, 81, 2, 484, 483, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 540, 3, 2, 2, 2, 486, 490, 5, 56, 29, 2, 487, 489, 5, 54, 28, 2, 488, 487, 3, 2, 2, 2, 489, 492, 3, 2, 2, 2, 490, 488, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 541, 3, 2, 2, 2, 492, 490, 3, 2, 2, 2, 493, 494, 7, 14, 2, 2, 494, 496, 5, 176, 89, 2, 495, 493, 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, 502, 3, 2, 2, 2, 499, 501, 5, 158, 80, 2, 500, 499, 3, 2, 2, 2, 501, 504, 3, 2, 2, 2, 502, 500, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 541, 3, 2, 2, 2, 504, 502, 3, 2, 2, 2, 505, 506, 7, 57, 2, 2, 506, 508, 5, 60, 31, 2, 507, 509, 5, 160, 81, 2, 508, 507, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 541, 3, 2, 2, 2, 510, 511, 7, 58, 2, 2, 511, 513, 5, 160, 81, 2, 512, 514, 5, 62, 32, 2, 513, 512, 3, 2, 2, 2, 514, 515, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 516, 3, 2, 2, 2, 516, 518, 3, 2, 2, 2, 517, 519, 5, 160, 81, 2, 518, 517, 3, 2, 2, 2, 518, 519, 3, 2, 2, 2, 519, 541, 3, 2, 2, 2, 520, 521, 5, 222, 112, 2, 521, 523, 5, 160, 81, 2, 522, 524, 5, 64, 33, 2, 523, 522, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 523, 3, 2, 2, 2, 525, 526, 3, 2, 2, 2, 526, 528, 3, 2, 2, 2, 527, 529, 5, 160, 81, 2, 528, 527, 3, 2, 2, 2, 528, 529, 3, 2, 2, 2, 529, 541, 3, 2, 2, 2, 530, 531, 7, 55, 2, 2, 531, 533, 5, 160, 81, 2, 532, 534, 5, 62, 32, 2, 533, 532, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 533, 3, 2, 2, 2, 535, 536, 3, 2, 2, 2, 536, 538, 3, 2, 2, 2, 537, 539, 5, 160, 81, 2, 538, 537, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 541, 3, 2, 2, 2, 540, 486, 3, 2, 2, 2, 540, 495, 3, 2, 2, 2, 540, 505, 3, 2, 2, 2, 540, 510, 3, 2, 2, 2, 540, 520, 3, 2, 2, 2, 540, 530, 3, 2, 2, 2, 541, 53, 3, 2, 2, 2, 542, 544, 5, 162, 82, 2, 543, 545, 5, 56, 29, 2, 544, 543, 3, 2, 2, 2, 544, 545, 3, 2, 2, 2, 545, 55, 3, 2, 2, 2, 546, 547, 7, 28, 2, 2, 547, 548, 5, 176, 89, 2, 548, 549, 7, 29, 2, 2, 549, 552, 3, 2, 2, 2, 550, 552, 5, 58, 30, 2, 551, 546, 3, 2, 2, 2, 551, 550, 3, 2, 2, 2, 552, 57, 3, 2, 2, 2, 553, 554, 7, 28, 2, 2, 554, 555, 7, 135, 2, 2, 555, 556, 7, 135, 2, 2, 556, 557, 7, 135, 2, 2, 557, 558, 7, 135, 2, 2, 558, 561, 7, 29, 2, 2, 559, 561, 7, 135, 2, 2, 560, 553, 3, 2, 2, 2, 560, 559, 3, 2, 2, 2, 561, 59, 3, 2, 2, 2, 562, 563, 5, 162, 82, 2, 563, 564, 5, 154, 78, 2, 564, 565, 5, 154, 78, 2, 565, 61, 3, 2, 2, 2, 566, 567, 5, 154, 78, 2, 567, 568, 7, 55, 2, 2, 568, 570, 7, 127, 2, 2, 569, 571, 7, 124, 2, 2, 570, 569, 3, 2, 2, 2, 570, 571, 3, 2, 2, 2, 571, 63, 3, 2, 2, 2, 572, 575, 5, 154, 78, 2, 573, 574, 7, 55, 2, 2, 574, 576, 7, 127, 2, 2, 575, 573, 3, 2, 2, 2, 575, 576, 3, 2, 2, 2, 576, 578, 3, 2, 2, 2, 577, 579, 7, 61, 2, 2, 578, 577, 3, 2, 2, 2, 578, 579, 3, 2, 2, 2, 579, 581, 3, 2, 2, 2, 580, 582, 7, 124, 2, 2, 581, 580, 3, 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 65, 3, 2, 2, 2, 583, 585, 7, 42, 2, 2, 584, 586, 5, 180, 91, 2, 585, 584, 3, 2, 2, 2, 586, 587, 3, 2, 2, 2, 587, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 67, 3, 2, 2, 2, 589, 596, 7, 50, 2, 2, 590, 594, 5, 182, 92, 2, 591, 592, 5, 182, 92, 2, 592, 593, 5, 182, 92, 2, 593, 595, 3, 2, 2, 2, 594, 591, 3, 2, 2, 2, 594, 595, 3, 2, 2, 2, 595, 597, 3, 2, 2, 2, 596, 590, 3, 2, 2, 2, 596, 597, 3, 2, 2, 2, 597, 598, 3, 2, 2, 2, 598, 599, 7, 126, 2, 2, 599, 600, 7, 146, 2, 2, 600, 601, 7, 147, 2, 2, 601, 69, 3, 2, 2, 2, 602, 603, 7, 43, 2, 2, 603, 605, 7, 117, 2, 2, 604, 606, 5, 142, 72, 2, 605, 604, 3, 2, 2, 2, 606, 607, 3, 2, 2, 2, 607, 605, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2, 608, 609, 3, 2, 2, 2, 609, 610, 7, 118, 2, 2, 610, 71, 3, 2, 2, 2, 611, 612, 7, 13, 2, 2, 612, 73, 3, 2, 2, 2, 613, 614, 7, 63, 2, 2, 614, 616, 7, 117, 2, 2, 615, 617, 5, 76, 39, 2, 616, 615, 3, 2, 2, 2, 617, 618, 3, 2, 2, 2, 618, 616, 3, 2, 2, 2, 618, 619, 3, 2, 2, 2, 619, 620, 3, 2, 2, 2, 620, 621, 7, 118, 2, 2, 621, 622, 7, 63, 2, 2, 622, 623, 7, 122, 2, 2, 623, 75, 3, 2, 2, 2, 624, 628, 5, 78, 40, 2, 625, 628, 5, 80, 41, 2, 626, 628, 5, 6, 4, 2, 627, 624, 3, 2, 2, 2, 627, 625, 3, 2, 2, 2, 627, 626, 3, 2, 2, 2, 628, 629, 3, 2, 2, 2, 629, 630, 7, 122, 2, 2, 630, 77, 3, 2, 2, 2, 631, 633, 9, 5, 2, 2, 632, 634, 5, 178, 90, 2, 633, 632, 3, 2, 2, 2, 634, 635, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 79, 3, 2, 2, 2, 637, 638, 9, 6, 2, 2, 638, 643, 5, 82, 42, 2, 639, 640, 7, 125, 2, 2, 640, 642, 5, 82, 42, 2, 641, 639, 3, 2, 2, 2, 642, 645, 3, 2, 2, 2, 643, 641, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, 81, 3, 2, 2, 2, 645, 643, 3, 2, 2, 2, 646, 647, 5, 178, 90, 2, 647, 649, 5, 178, 90, 2, 648, 650, 7, 135, 2, 2, 649, 648, 3, 2, 2, 2, 650, 651, 3, 2, 2, 2, 651, 649, 3, 2, 2, 2, 651, 652, 3, 2, 2, 2, 652, 83, 3, 2, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 7, 117, 2, 2, 655, 657, 5, 86, 44, 2, 656, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 656, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 661, 7, 118, 2, 2, 661, 662, 7, 68, 2, 2, 662, 663, 7, 122, 2, 2, 663, 85, 3, 2, 2, 2, 664, 670, 5, 88, 45, 2, 665, 670, 5, 90, 46, 2, 666, 670, 5, 92, 47, 2, 667, 670, 5, 94, 48, 2, 668, 670, 5, 6, 4, 2, 669, 664, 3, 2, 2, 2, 669, 665, 3, 2, 2, 2, 669, 666, 3, 2, 2, 2, 669, 667, 3, 2, 2, 2, 669, 668, 3, 2, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 7, 122, 2, 2, 672, 87, 3, 2, 2, 2, 673, 674, 7, 69, 2, 2, 674, 675, 5, 164, 83, 2, 675, 676, 7, 125, 2, 2, 676, 677, 5, 164, 83, 2, 677, 678, 7, 125, 2, 2, 678, 679, 5, 164, 83, 2, 679, 680, 7, 125, 2, 2, 680, 681, 5, 164, 83, 2, 681, 89, 3, 2, 2, 2, 682, 683, 7, 70, 2, 2, 683, 685, 5, 156, 79, 2, 684, 686, 7, 135, 2, 2, 685, 684, 3, 2, 2, 2, 686, 687, 3, 2, 2, 2, 687, 685, 3, 2, 2, 2, 687, 688, 3, 2, 2, 2, 688, 91, 3, 2, 2, 2, 689, 690, 7, 71, 2, 2, 690, 692, 5, 156, 79, 2, 691, 693, 7, 135, 2, 2, 692, 691, 3, 2, 2, 2, 693, 694, 3, 2, 2, 2, 694, 692, 3, 2, 2, 2, 694, 695, 3, 2, 2, 2, 695, 93, 3, 2, 2, 2, 696, 697, 7, 72, 2, 2, 697, 699, 5, 156, 79, 2, 698, 700, 7, 135, 2, 2, 699, 698, 3, 2, 2, 2, 700, 701, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 95, 3, 2, 2, 2, 703, 704, 7, 73, 2, 2, 704, 706, 7, 117, 2, 2, 705, 707, 5, 98, 50, 2, 706, 705, 3, 2, 2, 2, 707, 708, 3, 2, 2, 2, 708, 706, 3, 2, 2, 2, 708, 709, 3, 2, 2, 2, 709, 710, 3, 2, 2, 2, 710, 711, 7, 118, 2, 2, 711, 712, 7, 73, 2, 2, 712, 713, 7, 122, 2, 2, 713, 97, 3, 2, 2, 2, 714, 717, 5, 100, 51, 2, 715, 717, 5, 6, 4, 2, 716, 714, 3, 2, 2, 2, 716, 715, 3, 2, 2, 2, 717, 718, 3, 2, 2, 2, 718, 719, 7, 122, 2, 2, 719, 99, 3, 2, 2, 2, 720, 721, 7, 74, 2, 2, 721, 722, 7, 132, 2, 2, 722, 101, 3, 2, 2, 2, 723, 724, 7, 75, 2, 2, 724, 728, 7, 117, 2, 2, 725, 727, 5, 104, 53, 2, 726, 725, 3, 2, 2, 2, 727, 730, 3, 2, 2, 2, 728, 726, 3, 2, 2, 2, 728, 729, 3, 2, 2, 2, 729, 731, 3, 2, 2, 2, 730, 728, 3, 2, 2, 2, 731, 732, 7, 118, 2, 2, 732, 733, 7, 75, 2, 2, 733, 734, 7, 122, 2, 2, 734, 103, 3, 2, 2, 2, 735, 738, 5, 106, 54, 2, 736, 738, 5, 6, 4, 2, 737, 735, 3, 2, 2, 2, 737, 736, 3, 2, 2, 2, 738, 739, 3, 2, 2, 2, 739, 740, 7, 122, 2, 2, 740, 105, 3, 2, 2, 2, 741, 742, 9, 7, 2, 2, 742, 743, 7, 135, 2, 2, 743, 107, 3, 2, 2, 2, 744, 745, 7, 110, 2, 2, 745, 749, 7, 117, 2, 2, 746, 748, 5, 110, 56, 2, 747, 746, 3, 2, 2, 2, 748, 751, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 749, 750, 3, 2, 2, 2, 750, 752, 3, 2, 2, 2, 751, 749, 3, 2, 2, 2, 752, 753, 7, 118, 2, 2, 753, 754, 7, 110, 2, 2, 754, 755, 7, 122, 2, 2, 755, 109, 3, 2, 2, 2, 756, 759, 5, 112, 57, 2, 757, 759, 5, 6, 4, 2, 758, 756, 3, 2, 2, 2, 758, 757, 3, 2, 2, 2, 759, 760, 3, 2, 2, 2, 760, 761, 7, 122, 2, 2, 761, 111, 3, 2, 2, 2, 762, 763, 9, 8, 2, 2, 763, 764, 7, 135, 2, 2, 764, 113, 3, 2, 2, 2, 765, 766, 7, 80, 2, 2, 766, 768, 7, 117, 2, 2, 767, 769, 5, 116, 59, 2, 768, 767, 3, 2, 2, 2, 769, 770, 3, 2, 2, 2, 770, 768, 3, 2, 2, 2, 770, 771, 3, 2, 2, 2, 771, 772, 3, 2, 2, 2, 772, 773, 7, 118, 2, 2, 773, 774, 7, 80, 2, 2, 774, 775, 7, 122, 2, 2, 775, 115, 3, 2, 2, 2, 776, 779, 5, 118, 60, 2, 777, 779, 5, 6, 4, 2, 778, 776, 3, 2, 2, 2, 778, 777, 3, 2, 2, 2, 779, 780, 3, 2, 2, 2, 780, 781, 7, 122, 2, 2, 781, 117, 3, 2, 2, 2, 782, 783, 7, 81, 2, 2, 783, 790, 5, 182, 92, 2, 784, 788, 5, 182, 92, 2, 785, 786, 5, 182, 92, 2, 786, 787, 5, 182, 92, 2, 787, 789, 3, 2, 2, 2, 788, 785, 3, 2, 2, 2, 788, 789, 3, 2, 2, 2, 789, 791, 3, 2, 2, 2, 790, 784, 3, 2, 2, 2, 790, 791, 3, 2, 2, 2, 791, 792, 3, 2, 2, 2, 792, 793, 7, 126, 2, 2, 793, 794, 7, 146, 2, 2, 794, 795, 7, 147, 2, 2, 795, 119, 3, 2, 2, 2, 796, 797, 7, 82, 2, 2, 797, 799, 7, 117, 2, 2, 798, 800, 5, 122, 62, 2, 799, 798, 3, 2, 2, 2, 800, 801, 3, 2, 2, 2, 801, 799, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 803, 3, 2, 2, 2, 803, 804, 7, 118, 2, 2, 804, 805, 7, 82, 2, 2, 805, 806, 7, 122, 2, 2, 806, 121, 3, 2, 2, 2, 807, 810, 5, 124, 63, 2, 808, 810, 5, 6, 4, 2, 809, 807, 3, 2, 2, 2, 809, 808, 3, 2, 2, 2, 810, 811, 3, 2, 2, 2, 811, 812, 7, 122, 2, 2, 812, 123, 3, 2, 2, 2, 813, 814, 9, 9, 2, 2, 814, 841, 7, 135, 2, 2, 815, 816, 9, 10, 2, 2, 816, 841, 7, 135, 2, 2, 817, 818, 7, 100, 2, 2, 818, 841, 5, 182, 92, 2, 819, 820, 7, 97, 2, 2, 820, 821, 7, 126, 2, 2, 821, 822, 7, 146, 2, 2, 822, 841, 7, 147, 2, 2, 823, 824, 7, 87, 2, 2, 824, 825, 7, 135, 2, 2, 825, 826, 7, 135, 2, 2, 826, 827, 7, 135, 2, 2, 827, 828, 7, 135, 2, 2, 828, 829, 7, 135, 2, 2, 829, 830, 7, 135, 2, 2, 830, 831, 7, 135, 2, 2, 831, 832, 7, 135, 2, 2, 832, 833, 7, 135, 2, 2, 833, 841, 7, 135, 2, 2, 834, 836, 9, 11, 2, 2, 835, 837, 7, 135, 2, 2, 836, 835, 3, 2, 2, 2, 837, 838, 3, 2, 2, 2, 838, 836, 3, 2, 2, 2, 838, 839, 3, 2, 2, 2, 839, 841, 3, 2, 2, 2, 840, 813, 3, 2, 2, 2, 840, 815, 3, 2, 2, 2, 840, 817, 3, 2, 2, 2, 840, 819, 3, 2, 2, 2, 840, 823, 3, 2, 2, 2, 840, 834, 3, 2, 2, 2, 841, 125, 3, 2, 2, 2, 842, 843, 7, 101, 2, 2, 843, 845, 7, 117, 2, 2, 844, 846, 5, 128, 65, 2, 845, 844, 3, 2, 2, 2, 846, 847, 3, 2, 2, 2, 847, 845, 3, 2, 2, 2, 847, 848, 3, 2, 2, 2, 848, 849, 3, 2, 2, 2, 849, 850, 7, 118, 2, 2, 850, 851, 7, 101, 2, 2, 851, 852, 7, 122, 2, 2, 852, 127, 3, 2, 2, 2, 853, 859, 5, 130, 66, 2, 854, 859, 5, 132, 67, 2, 855, 859, 5, 140, 71, 2, 856, 859, 5, 144, 73, 2, 857, 859, 5, 6, 4, 2, 858, 853, 3, 2, 2, 2, 858, 854, 3, 2, 2, 2, 858, 855, 3, 2, 2, 2, 858, 856, 3, 2, 2, 2, 858, 857, 3, 2, 2, 2, 859, 860, 3, 2, 2, 2, 860, 861, 7, 122, 2, 2, 861, 129, 3, 2, 2, 2, 862, 863, 7, 104, 2, 2, 863, 864, 5, 178, 90, 2, 864, 865, 7, 135, 2, 2, 865, 867, 7, 117, 2, 2, 866, 868, 5, 142, 72, 2, 867, 866, 3, 2, 2, 2, 868, 869, 3, 2, 2, 2, 869, 867, 3, 2, 2, 2, 869, 870, 3, 2, 2, 2, 870, 871, 3, 2, 2, 2, 871, 872, 7, 118, 2, 2, 872, 131, 3, 2, 2, 2, 873, 874, 7, 105, 2, 2, 874, 876, 7, 117, 2, 2, 875, 877, 5, 134, 68, 2, 876, 875, 3, 2, 2, 2, 877, 878, 3, 2, 2, 2, 878, 876, 3, 2, 2, 2, 878, 879, 3, 2, 2, 2, 879, 880, 3, 2, 2, 2, 880, 881, 7, 118, 2, 2, 881, 133, 3, 2, 2, 2, 882, 887, 5, 146, 74, 2, 883, 887, 5, 136, 69, 2, 884, 887, 5, 138, 70, 2, 885, 887, 5, 6, 4, 2, 886, 882, 3, 2, 2, 2, 886, 883, 3, 2, 2, 2, 886, 884, 3, 2, 2, 2, 886, 885, 3, 2, 2, 2, 887, 888, 3, 2, 2, 2, 888, 889, 7, 122, 2, 2, 889, 135, 3, 2, 2, 2, 890, 891, 7, 107, 2, 2, 891, 892, 5, 178, 90, 2, 892, 897, 5, 180, 91, 2, 893, 895, 5, 180, 91, 2, 894, 896, 5, 180, 91, 2, 895, 894, 3, 2, 2, 2, 895, 896, 3, 2, 2, 2, 896, 898, 3, 2, 2, 2, 897, 893, 3, 2, 2, 2, 897, 898, 3, 2, 2, 2, 898, 137, 3, 2, 2, 2, 899, 901, 7, 106, 2, 2, 900, 902, 9, 12, 2, 2, 901, 900, 3, 2, 2, 2, 902, 903, 3, 2, 2, 2, 903, 901, 3, 2, 2, 2, 903, 904, 3, 2, 2, 2, 904, 139, 3, 2, 2, 2, 905, 906, 7, 102, 2, 2, 906, 908, 7, 117, 2, 2, 907, 909, 5, 142, 72, 2, 908, 907, 3, 2, 2, 2, 909, 910, 3, 2, 2, 2, 910, 908, 3, 2, 2, 2, 910, 911, 3, 2, 2, 2, 911, 912, 3, 2, 2, 2, 912, 913, 7, 118, 2, 2, 913, 141, 3, 2, 2, 2, 914, 917, 5, 146, 74, 2, 915, 917, 5, 6, 4, 2, 916, 914, 3, 2, 2, 2, 916, 915, 3, 2, 2, 2, 917, 918, 3, 2, 2, 2, 918, 919, 7, 122, 2, 2, 919, 143, 3, 2, 2, 2, 920, 921, 7, 103, 2, 2, 921, 922, 5, 182, 92, 2, 922, 145, 3, 2, 2, 2, 923, 930, 7, 80, 2, 2, 924, 928, 5, 182, 92, 2, 925, 926, 5, 182, 92, 2, 926, 927, 5, 182, 92, 2, 927, 929, 3, 2, 2, 2, 928, 925, 3, 2, 2, 2, 928, 929, 3, 2, 2, 2, 929, 931, 3, 2, 2, 2, 930, 924, 3, 2, 2, 2, 930, 931, 3, 2, 2, 2, 931, 932, 3, 2, 2, 2, 932, 933, 7, 126, 2, 2, 933, 934, 7, 146, 2, 2, 934, 935, 7, 147, 2, 2, 935, 147, 3, 2, 2, 2, 936, 937, 7, 114, 2, 2, 937, 939, 7, 117, 2, 2, 938, 940, 5, 150, 76, 2, 939, 938, 3, 2, 2, 2, 940, 941, 3, 2, 2, 2, 941, 939, 3, 2, 2, 2, 941, 942, 3, 2, 2, 2, 942, 943, 3, 2, 2, 2, 943, 944, 7, 118, 2, 2, 944, 945, 7, 114, 2, 2, 945, 946, 7, 122, 2, 2, 946, 149, 3, 2, 2, 2, 947, 950, 5, 152, 77, 2, 948, 950, 5, 6, 4, 2, 949, 947, 3, 2, 2, 2, 949, 948, 3, 2, 2, 2, 950, 951, 3, 2, 2, 2, 951, 952, 7, 122, 2, 2, 952, 151, 3, 2, 2, 2, 953, 954, 9, 13, 2, 2, 954, 955, 5, 172, 87, 2, 955, 956, 7, 135, 2, 2, 956, 153, 3, 2, 2, 2, 957, 958, 7, 28, 2, 2, 958, 967, 7, 52, 2, 2, 959, 960, 7, 135, 2, 2, 960, 963, 7, 135, 2, 2, 961, 962, 7, 51, 2, 2, 962, 964, 7, 135, 2, 2, 963, 961, 3, 2, 2, 2, 963, 964, 3, 2, 2, 2, 964, 968, 3, 2, 2, 2, 965, 968, 7, 62, 2, 2, 966, 968, 5, 176, 89, 2, 967, 959, 3, 2, 2, 2, 967, 965, 3, 2, 2, 2, 967, 966, 3, 2, 2, 2, 968, 969, 3, 2, 2, 2, 969, 970, 7, 29, 2, 2, 970, 155, 3, 2, 2, 2, 971, 973, 5, 158, 80, 2, 972, 971, 3, 2, 2, 2, 973, 974, 3, 2, 2, 2, 974, 972, 3, 2, 2, 2, 974, 975, 3, 2, 2, 2, 975, 157, 3, 2, 2, 2, 976, 981, 5, 162, 82, 2, 977, 978, 7, 14, 2, 2, 978, 980, 5, 176, 89, 2, 979, 977, 3, 2, 2, 2, 980, 983, 3, 2, 2, 2, 981, 979, 3, 2, 2, 2, 981, 982, 3, 2, 2, 2, 982, 159, 3, 2, 2, 2, 983, 981, 3, 2, 2, 2, 984, 986, 5, 162, 82, 2, 985, 984, 3, 2, 2, 2, 986, 987, 3, 2, 2, 2, 987, 985, 3, 2, 2, 2, 987, 988, 3, 2, 2, 2, 988, 161, 3, 2, 2, 2, 989, 992, 5, 166, 84, 2, 990, 992, 5, 172, 87, 2, 991, 989, 3, 2, 2, 2, 991, 990, 3, 2, 2, 2, 992, 994, 3, 2, 2, 2, 993, 995, 7, 124, 2, 2, 994, 993, 3, 2, 2, 2, 994, 995, 3, 2, 2, 2, 995, 163, 3, 2, 2, 2, 996, 998, 5, 166, 84, 2, 997, 996, 3, 2, 2, 2, 997, 998, 3, 2, 2, 2, 998, 165, 3, 2, 2, 2, 999, 1002, 7, 127, 2, 2, 1000, 1002, 5, 168, 85, 2, 1001, 999, 3, 2, 2, 2, 1001, 1000, 3, 2, 2, 2, 1002, 167, 3, 2, 2, 2, 1003, 1005, 7, 119, 2, 2, 1004, 1006, 5, 170, 86, 2, 1005, 1004, 3, 2, 2, 2, 1006, 1007, 3, 2, 2, 2, 1007, 1005, 3, 2, 2, 2, 1007, 1008, 3, 2, 2, 2, 1008, 1009, 3, 2, 2, 2, 1009, 1010, 7, 120, 2, 2, 1010, 169, 3, 2, 2, 2, 1011, 1014, 5, 172, 87, 2, 1012, 1013, 7, 121, 2, 2, 1013, 1015, 5, 172, 87, 2, 1014, 1012, 3, 2, 2, 2, 1014, 1015, 3, 2, 2, 2, 1015, 1018, 3, 2, 2, 2, 1016, 1018, 7, 127, 2, 2, 1017, 1011, 3, 2, 2, 2, 1017, 1016, 3, 2, 2, 2, 1018, 171, 3, 2, 2, 2, 1019, 1022, 5, 174, 88, 2, 1020, 1022, 7, 128, 2, 2, 1021, 1019, 3, 2, 2, 2, 1021, 1020, 3, 2, 2, 2, 1022, 173, 3, 2, 2, 2, 1023, 1024, 9, 14, 2, 2, 1024, 175, 3, 2, 2, 2, 1025, 1026, 7, 130, 2, 2, 1026, 177, 3, 2, 2, 2, 1027, 1028, 9, 15, 2, 2, 1028, 179, 3, 2, 2, 2, 1029, 1030, 9, 16, 2, 2, 1030, 181, 3, 2, 2, 2, 1031, 1032, 9, 17, 2, 2, 1032, 183, 3, 2, 2, 2, 1033, 1035, 5, 26, 14, 2, 1034, 1033, 3, 2, 2, 2, 1035, 1038, 3, 2, 2, 2, 1036, 1034, 3, 2, 2, 2, 1036, 1037, 3, 2, 2, 2, 1037, 1039, 3, 2, 2, 2, 1038, 1036, 3, 2, 2, 2, 1039, 1040, 7, 2, 2, 3, 1040, 185, 3, 2, 2, 2, 1041, 1043, 5, 36, 19, 2, 1042, 1041, 3, 2, 2, 2, 1043, 1046, 3, 2, 2, 2, 1044, 1042, 3, 2, 2, 2, 1044, 1045, 3, 2, 2, 2, 1045, 1047, 3, 2, 2, 2, 1046, 1044, 3, 2, 2, 2, 1047, 1048, 7, 2, 2, 3, 1048, 187, 3, 2, 2, 2, 1049, 1051, 5, 32, 17, 2, 1050, 1049, 3, 2, 2, 2, 1051, 1054, 3, 2, 2, 2, 1052, 1050, 3, 2, 2, 2, 1052, 1053, 3, 2, 2, 2, 1053, 1055, 3, 2, 2, 2, 1054, 1052, 3, 2, 2, 2, 1055, 1056, 7, 2, 2, 3, 1056, 189, 3, 2, 2, 2, 1057, 1059, 5, 76, 39, 2, 1058, 1057, 3, 2, 2, 2, 1059, 1062, 3, 2, 2, 2, 1060, 1058, 3, 2, 2, 2, 1060, 1061, 3, 2, 2, 2, 1061, 1063, 3, 2, 2, 2, 1062, 1060, 3, 2, 2, 2, 1063, 1064, 7, 2, 2, 3, 1064, 191, 3, 2, 2, 2, 1065, 1067, 5, 98, 50, 2, 1066, 1065, 3, 2, 2, 2, 1067, 1070, 3, 2, 2, 2, 1068, 1066, 3, 2, 2, 2, 1068, 1069, 3, 2, 2, 2, 1069, 1071, 3, 2, 2, 2, 1070, 1068, 3, 2, 2, 2, 1071, 1072, 7, 2, 2, 3, 1072, 193, 3, 2, 2, 2, 1073, 1075, 5, 104, 53, 2, 1074, 1073, 3, 2, 2, 2, 1075, 1078, 3, 2, 2, 2, 1076, 1074, 3, 2, 2, 2, 1076, 1077, 3, 2, 2, 2, 1077, 1079, 3, 2, 2, 2, 1078, 1076, 3, 2, 2, 2, 1079, 1080, 7, 2, 2, 3, 1080, 195, 3, 2, 2, 2, 1081, 1083, 5, 110, 56, 2, 1082, 1081, 3, 2, 2, 2, 1083, 1086, 3, 2, 2, 2, 1084, 1082, 3, 2, 2, 2, 1084, 1085, 3, 2, 2, 2, 1085, 1087, 3, 2, 2, 2, 1086, 1084, 3, 2, 2, 2, 1087, 1088, 7, 2, 2, 3, 1088, 197, 3, 2, 2, 2, 1089, 1091, 5, 86, 44, 2, 1090, 1089, 3, 2, 2, 2, 1091, 1094, 3, 2, 2, 2, 1092, 1090, 3, 2, 2, 2, 1092, 1093, 3, 2, 2, 2, 1093, 1095, 3, 2, 2, 2, 1094, 1092, 3, 2, 2, 2, 1095, 1096, 7, 2, 2, 3, 1096, 199, 3, 2, 2, 2, 1097, 1099, 5, 116, 59, 2, 1098, 1097, 3, 2, 2, 2, 1099, 1102, 3, 2, 2, 2, 1100, 1098, 3, 2, 2, 2, 1100, 1101, 3, 2, 2, 2, 1101, 1103, 3, 2, 2, 2, 1102, 1100, 3, 2, 2, 2, 1103, 1104, 7, 2, 2, 3, 1104, 201, 3, 2, 2, 2, 1105, 1107, 5, 150, 76, 2, 1106, 1105, 3, 2, 2, 2, 1107, 1110, 3, 2, 2, 2, 1108, 1106, 3, 2, 2, 2, 1108, 1109, 3, 2, 2, 2, 1109, 1111, 3, 2, 2, 2, 1110, 1108, 3, 2, 2, 2, 1111, 1112, 7, 2, 2, 3, 1112, 203, 3, 2, 2, 2, 1113, 1115, 5, 122, 62, 2, 1114, 1113, 3, 2, 2, 2, 1115, 1118, 3, 2, 2, 2, 1116, 1114, 3, 2, 2, 2, 1116, 1117, 3, 2, 2, 2, 1117, 1119, 3, 2, 2, 2, 1118, 1116, 3, 2, 2, 2, 1119, 1120, 7, 2, 2, 3, 1120, 205, 3, 2, 2, 2, 1121, 1123, 5, 128, 65, 2, 1122, 1121, 3, 2, 2, 2, 1123, 1126, 3, 2, 2, 2, 1124, 1122, 3, 2, 2, 2, 1124, 1125, 3, 2, 2, 2, 1125, 1127, 3, 2, 2, 2, 1126, 1124, 3, 2, 2, 2, 1127, 1128, 7, 2, 2, 3, 1128, 207, 3, 2, 2, 2, 1129, 1131, 5, 134, 68, 2, 1130, 1129, 3, 2, 2, 2, 1131, 1134, 3, 2, 2, 2, 1132, 1130, 3, 2, 2, 2, 1132, 1133, 3, 2, 2, 2, 1133, 1135, 3, 2, 2, 2, 1134, 1132, 3, 2, 2, 2, 1135, 1136, 7, 2, 2, 3, 1136, 209, 3, 2, 2, 2, 1137, 1139, 5, 142, 72, 2, 1138, 1137, 3, 2, 2, 2, 1139, 1142, 3, 2, 2, 2, 1140, 1138, 3, 2, 2, 2, 1140, 1141, 3, 2, 2, 2, 1141, 1143, 3, 2, 2, 2, 1142, 1140, 3, 2, 2, 2, 1143, 1144, 7, 2, 2, 3, 1144, 211, 3, 2, 2, 2, 1145, 1146, 9, 18, 2, 2, 1146, 213, 3, 2, 2, 2, 1147, 1148, 9, 19, 2, 2, 1148, 215, 3, 2, 2, 2, 1149, 1150, 9, 20, 2, 2, 1150, 217, 3, 2, 2, 2, 1151, 1152, 9, 21, 2, 2, 1152, 219, 3, 2, 2, 2, 1153, 1154, 9, 22, 2, 2, 1154, 221, 3, 2, 2, 2, 1155, 1156, 9, 23, 2, 2, 1156, 223, 3, 2, 2, 2, 124, 229, 231, 242, 262, 272, 283, 289, 305, 313, 321, 327, 336, 341, 347, 352, 361, 369, 378, 384, 400, 413, 420, 422, 432, 438, 445, 454, 457, 464, 466, 473, 475, 477, 480, 484, 490, 497, 502, 508, 515, 518, 525, 528, 535, 538, 540, 544, 551, 560, 570, 575, 578, 581, 587, 594, 596, 607, 618, 627, 635, 643, 651, 658, 669, 687, 694, 701, 708, 716, 728, 737, 749, 758, 770, 778, 788, 790, 801, 809, 838, 840, 847, 858, 869, 878, 886, 895, 897, 903, 910, 916, 928, 930, 941, 949, 963, 967, 974, 981, 987, 991, 994, 997, 1001, 1007, 1014, 1017, 1021, 1036, 1044, 1052, 1060, 1068, 1076, 1084, 1092, 1100, 1108, 1116, 1124, 1132, 1140] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 147, 1158, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 230, 10, 2, 12, 2, 14, 2, 233, 11, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 243, 10, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 5, 7, 263, 10, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 273, 10, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 5, 10, 284, 10, 10, 3, 10, 3, 10, 6, 10, 288, 10, 10, 13, 10, 14, 10, 289, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 306, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 312, 10, 12, 12, 12, 14, 12, 315, 11, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 5, 13, 322, 10, 13, 3, 13, 3, 13, 6, 13, 326, 10, 13, 13, 13, 14, 13, 327, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 5, 14, 337, 10, 14, 3, 15, 3, 15, 3, 15, 5, 15, 342, 10, 15, 3, 15, 3, 15, 6, 15, 346, 10, 15, 13, 15, 14, 15, 347, 3, 15, 3, 15, 3, 15, 5, 15, 353, 10, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 7, 16, 360, 10, 16, 12, 16, 14, 16, 363, 11, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 5, 17, 370, 10, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 6, 18, 377, 10, 18, 13, 18, 14, 18, 378, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 385, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 401, 10, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 5, 22, 414, 10, 22, 3, 23, 3, 23, 3, 23, 6, 23, 419, 10, 23, 13, 23, 14, 23, 420, 5, 23, 423, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 5, 24, 433, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 439, 10, 25, 3, 25, 3, 25, 3, 25, 7, 25, 444, 10, 25, 12, 25, 14, 25, 447, 11, 25, 3, 26, 3, 26, 3, 26, 3, 26, 7, 26, 453, 10, 26, 12, 26, 14, 26, 456, 11, 26, 5, 26, 458, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 465, 10, 26, 5, 26, 467, 10, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 474, 10, 26, 5, 26, 476, 10, 26, 5, 26, 478, 10, 26, 3, 27, 5, 27, 481, 10, 27, 3, 27, 3, 27, 5, 27, 485, 10, 27, 3, 27, 3, 27, 7, 27, 489, 10, 27, 12, 27, 14, 27, 492, 11, 27, 3, 27, 3, 27, 6, 27, 496, 10, 27, 13, 27, 14, 27, 497, 3, 27, 7, 27, 501, 10, 27, 12, 27, 14, 27, 504, 11, 27, 3, 27, 3, 27, 3, 27, 5, 27, 509, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 514, 10, 27, 13, 27, 14, 27, 515, 3, 27, 5, 27, 519, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 524, 10, 27, 13, 27, 14, 27, 525, 3, 27, 5, 27, 529, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 534, 10, 27, 13, 27, 14, 27, 535, 3, 27, 5, 27, 539, 10, 27, 5, 27, 541, 10, 27, 3, 28, 3, 28, 5, 28, 545, 10, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 552, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 561, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 571, 10, 32, 3, 33, 3, 33, 3, 33, 5, 33, 576, 10, 33, 3, 33, 5, 33, 579, 10, 33, 3, 33, 5, 33, 582, 10, 33, 3, 34, 3, 34, 6, 34, 586, 10, 34, 13, 34, 14, 34, 587, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 595, 10, 35, 5, 35, 597, 10, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 6, 36, 606, 10, 36, 13, 36, 14, 36, 607, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 6, 38, 617, 10, 38, 13, 38, 14, 38, 618, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 5, 39, 628, 10, 39, 3, 39, 3, 39, 3, 40, 3, 40, 6, 40, 634, 10, 40, 13, 40, 14, 40, 635, 3, 41, 3, 41, 3, 41, 3, 41, 7, 41, 642, 10, 41, 12, 41, 14, 41, 645, 11, 41, 3, 42, 3, 42, 3, 42, 6, 42, 650, 10, 42, 13, 42, 14, 42, 651, 3, 43, 3, 43, 3, 43, 6, 43, 657, 10, 43, 13, 43, 14, 43, 658, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 5, 44, 670, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 6, 46, 686, 10, 46, 13, 46, 14, 46, 687, 3, 47, 3, 47, 3, 47, 6, 47, 693, 10, 47, 13, 47, 14, 47, 694, 3, 48, 3, 48, 3, 48, 6, 48, 700, 10, 48, 13, 48, 14, 48, 701, 3, 49, 3, 49, 3, 49, 6, 49, 707, 10, 49, 13, 49, 14, 49, 708, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 5, 50, 717, 10, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 7, 52, 727, 10, 52, 12, 52, 14, 52, 730, 11, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 5, 53, 738, 10, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 7, 55, 748, 10, 55, 12, 55, 14, 55, 751, 11, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 759, 10, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 6, 58, 769, 10, 58, 13, 58, 14, 58, 770, 3, 58, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 5, 59, 779, 10, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 5, 60, 789, 10, 60, 5, 60, 791, 10, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 6, 61, 800, 10, 61, 13, 61, 14, 61, 801, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 5, 62, 810, 10, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 6, 63, 837, 10, 63, 13, 63, 14, 63, 838, 5, 63, 841, 10, 63, 3, 64, 3, 64, 3, 64, 6, 64, 846, 10, 64, 13, 64, 14, 64, 847, 3, 64, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 5, 65, 859, 10, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 6, 66, 868, 10, 66, 13, 66, 14, 66, 869, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 6, 67, 877, 10, 67, 13, 67, 14, 67, 878, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 5, 68, 887, 10, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 5, 69, 896, 10, 69, 5, 69, 898, 10, 69, 3, 70, 3, 70, 6, 70, 902, 10, 70, 13, 70, 14, 70, 903, 3, 71, 3, 71, 3, 71, 6, 71, 909, 10, 71, 13, 71, 14, 71, 910, 3, 71, 3, 71, 3, 72, 3, 72, 5, 72, 917, 10, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 929, 10, 74, 5, 74, 931, 10, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 6, 75, 940, 10, 75, 13, 75, 14, 75, 941, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 5, 76, 950, 10, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 5, 78, 964, 10, 78, 3, 78, 3, 78, 5, 78, 968, 10, 78, 3, 78, 3, 78, 3, 79, 6, 79, 973, 10, 79, 13, 79, 14, 79, 974, 3, 80, 3, 80, 3, 80, 7, 80, 980, 10, 80, 12, 80, 14, 80, 983, 11, 80, 3, 81, 6, 81, 986, 10, 81, 13, 81, 14, 81, 987, 3, 82, 3, 82, 5, 82, 992, 10, 82, 3, 82, 5, 82, 995, 10, 82, 3, 83, 5, 83, 998, 10, 83, 3, 84, 3, 84, 5, 84, 1002, 10, 84, 3, 85, 3, 85, 6, 85, 1006, 10, 85, 13, 85, 14, 85, 1007, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 5, 86, 1015, 10, 86, 3, 86, 5, 86, 1018, 10, 86, 3, 87, 3, 87, 5, 87, 1022, 10, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 7, 93, 1035, 10, 93, 12, 93, 14, 93, 1038, 11, 93, 3, 93, 3, 93, 3, 94, 7, 94, 1043, 10, 94, 12, 94, 14, 94, 1046, 11, 94, 3, 94, 3, 94, 3, 95, 7, 95, 1051, 10, 95, 12, 95, 14, 95, 1054, 11, 95, 3, 95, 3, 95, 3, 96, 7, 96, 1059, 10, 96, 12, 96, 14, 96, 1062, 11, 96, 3, 96, 3, 96, 3, 97, 7, 97, 1067, 10, 97, 12, 97, 14, 97, 1070, 11, 97, 3, 97, 3, 97, 3, 98, 7, 98, 1075, 10, 98, 12, 98, 14, 98, 1078, 11, 98, 3, 98, 3, 98, 3, 99, 7, 99, 1083, 10, 99, 12, 99, 14, 99, 1086, 11, 99, 3, 99, 3, 99, 3, 100, 7, 100, 1091, 10, 100, 12, 100, 14, 100, 1094, 11, 100, 3, 100, 3, 100, 3, 101, 7, 101, 1099, 10, 101, 12, 101, 14, 101, 1102, 11, 101, 3, 101, 3, 101, 3, 102, 7, 102, 1107, 10, 102, 12, 102, 14, 102, 1110, 11, 102, 3, 102, 3, 102, 3, 103, 7, 103, 1115, 10, 103, 12, 103, 14, 103, 1118, 11, 103, 3, 103, 3, 103, 3, 104, 7, 104, 1123, 10, 104, 12, 104, 14, 104, 1126, 11, 104, 3, 104, 3, 104, 3, 105, 7, 105, 1131, 10, 105, 12, 105, 14, 105, 1134, 11, 105, 3, 105, 3, 105, 3, 106, 7, 106, 1139, 10, 106, 12, 106, 14, 106, 1142, 11, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, 108, 3, 108, 3, 109, 3, 109, 3, 110, 3, 110, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 2, 2, 113, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 2, 25, 3, 2, 45, 48, 3, 2, 23, 26, 3, 2, 38, 39, 3, 2, 64, 65, 3, 2, 66, 67, 3, 2, 76, 79, 3, 2, 111, 113, 3, 2, 88, 94, 4, 2, 83, 86, 95, 96, 3, 2, 98, 99, 3, 2, 108, 109, 3, 2, 115, 116, 4, 2, 16, 16, 129, 131, 4, 2, 55, 55, 130, 130, 5, 2, 55, 55, 130, 131, 136, 136, 4, 2, 132, 132, 135, 135, 3, 2, 133, 135, 3, 2, 34, 35, 3, 2, 36, 37, 3, 2, 3, 4, 3, 2, 30, 31, 3, 2, 40, 41, 3, 2, 59, 60, 2, 1218, 2, 231, 3, 2, 2, 2, 4, 242, 3, 2, 2, 2, 6, 246, 3, 2, 2, 2, 8, 251, 3, 2, 2, 2, 10, 255, 3, 2, 2, 2, 12, 259, 3, 2, 2, 2, 14, 267, 3, 2, 2, 2, 16, 276, 3, 2, 2, 2, 18, 280, 3, 2, 2, 2, 20, 295, 3, 2, 2, 2, 22, 307, 3, 2, 2, 2, 24, 318, 3, 2, 2, 2, 26, 336, 3, 2, 2, 2, 28, 338, 3, 2, 2, 2, 30, 356, 3, 2, 2, 2, 32, 369, 3, 2, 2, 2, 34, 384, 3, 2, 2, 2, 36, 400, 3, 2, 2, 2, 38, 404, 3, 2, 2, 2, 40, 407, 3, 2, 2, 2, 42, 410, 3, 2, 2, 2, 44, 415, 3, 2, 2, 2, 46, 432, 3, 2, 2, 2, 48, 434, 3, 2, 2, 2, 50, 457, 3, 2, 2, 2, 52, 480, 3, 2, 2, 2, 54, 542, 3, 2, 2, 2, 56, 551, 3, 2, 2, 2, 58, 560, 3, 2, 2, 2, 60, 562, 3, 2, 2, 2, 62, 566, 3, 2, 2, 2, 64, 572, 3, 2, 2, 2, 66, 583, 3, 2, 2, 2, 68, 589, 3, 2, 2, 2, 70, 602, 3, 2, 2, 2, 72, 611, 3, 2, 2, 2, 74, 613, 3, 2, 2, 2, 76, 627, 3, 2, 2, 2, 78, 631, 3, 2, 2, 2, 80, 637, 3, 2, 2, 2, 82, 646, 3, 2, 2, 2, 84, 653, 3, 2, 2, 2, 86, 669, 3, 2, 2, 2, 88, 673, 3, 2, 2, 2, 90, 682, 3, 2, 2, 2, 92, 689, 3, 2, 2, 2, 94, 696, 3, 2, 2, 2, 96, 703, 3, 2, 2, 2, 98, 716, 3, 2, 2, 2, 100, 720, 3, 2, 2, 2, 102, 723, 3, 2, 2, 2, 104, 737, 3, 2, 2, 2, 106, 741, 3, 2, 2, 2, 108, 744, 3, 2, 2, 2, 110, 758, 3, 2, 2, 2, 112, 762, 3, 2, 2, 2, 114, 765, 3, 2, 2, 2, 116, 778, 3, 2, 2, 2, 118, 782, 3, 2, 2, 2, 120, 796, 3, 2, 2, 2, 122, 809, 3, 2, 2, 2, 124, 840, 3, 2, 2, 2, 126, 842, 3, 2, 2, 2, 128, 858, 3, 2, 2, 2, 130, 862, 3, 2, 2, 2, 132, 873, 3, 2, 2, 2, 134, 886, 3, 2, 2, 2, 136, 890, 3, 2, 2, 2, 138, 899, 3, 2, 2, 2, 140, 905, 3, 2, 2, 2, 142, 916, 3, 2, 2, 2, 144, 920, 3, 2, 2, 2, 146, 923, 3, 2, 2, 2, 148, 936, 3, 2, 2, 2, 150, 949, 3, 2, 2, 2, 152, 953, 3, 2, 2, 2, 154, 957, 3, 2, 2, 2, 156, 972, 3, 2, 2, 2, 158, 976, 3, 2, 2, 2, 160, 985, 3, 2, 2, 2, 162, 991, 3, 2, 2, 2, 164, 997, 3, 2, 2, 2, 166, 1001, 3, 2, 2, 2, 168, 1003, 3, 2, 2, 2, 170, 1017, 3, 2, 2, 2, 172, 1021, 3, 2, 2, 2, 174, 1023, 3, 2, 2, 2, 176, 1025, 3, 2, 2, 2, 178, 1027, 3, 2, 2, 2, 180, 1029, 3, 2, 2, 2, 182, 1031, 3, 2, 2, 2, 184, 1036, 3, 2, 2, 2, 186, 1044, 3, 2, 2, 2, 188, 1052, 3, 2, 2, 2, 190, 1060, 3, 2, 2, 2, 192, 1068, 3, 2, 2, 2, 194, 1076, 3, 2, 2, 2, 196, 1084, 3, 2, 2, 2, 198, 1092, 3, 2, 2, 2, 200, 1100, 3, 2, 2, 2, 202, 1108, 3, 2, 2, 2, 204, 1116, 3, 2, 2, 2, 206, 1124, 3, 2, 2, 2, 208, 1132, 3, 2, 2, 2, 210, 1140, 3, 2, 2, 2, 212, 1145, 3, 2, 2, 2, 214, 1147, 3, 2, 2, 2, 216, 1149, 3, 2, 2, 2, 218, 1151, 3, 2, 2, 2, 220, 1153, 3, 2, 2, 2, 222, 1155, 3, 2, 2, 2, 224, 230, 5, 4, 3, 2, 225, 230, 5, 18, 10, 2, 226, 230, 5, 20, 11, 2, 227, 230, 5, 22, 12, 2, 228, 230, 5, 24, 13, 2, 229, 224, 3, 2, 2, 2, 229, 225, 3, 2, 2, 2, 229, 226, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 228, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 234, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 7, 2, 2, 3, 235, 3, 3, 2, 2, 2, 236, 243, 5, 6, 4, 2, 237, 243, 5, 8, 5, 2, 238, 243, 5, 10, 6, 2, 239, 243, 5, 12, 7, 2, 240, 243, 5, 14, 8, 2, 241, 243, 5, 16, 9, 2, 242, 236, 3, 2, 2, 2, 242, 237, 3, 2, 2, 2, 242, 238, 3, 2, 2, 2, 242, 239, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 122, 2, 2, 245, 5, 3, 2, 2, 2, 246, 247, 7, 7, 2, 2, 247, 248, 7, 143, 2, 2, 248, 249, 7, 144, 2, 2, 249, 250, 7, 145, 2, 2, 250, 7, 3, 2, 2, 2, 251, 252, 7, 127, 2, 2, 252, 253, 7, 123, 2, 2, 253, 254, 5, 166, 84, 2, 254, 9, 3, 2, 2, 2, 255, 256, 7, 12, 2, 2, 256, 257, 5, 178, 90, 2, 257, 258, 5, 178, 90, 2, 258, 11, 3, 2, 2, 2, 259, 262, 7, 56, 2, 2, 260, 263, 5, 172, 87, 2, 261, 263, 5, 166, 84, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 265, 5, 154, 78, 2, 265, 266, 7, 127, 2, 2, 266, 13, 3, 2, 2, 2, 267, 268, 7, 53, 2, 2, 268, 269, 7, 135, 2, 2, 269, 272, 7, 135, 2, 2, 270, 271, 7, 51, 2, 2, 271, 273, 7, 135, 2, 2, 272, 270, 3, 2, 2, 2, 272, 273, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 275, 5, 176, 89, 2, 275, 15, 3, 2, 2, 2, 276, 277, 7, 54, 2, 2, 277, 278, 5, 58, 30, 2, 278, 279, 5, 176, 89, 2, 279, 17, 3, 2, 2, 2, 280, 281, 7, 8, 2, 2, 281, 283, 5, 178, 90, 2, 282, 284, 7, 27, 2, 2, 283, 282, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 287, 7, 117, 2, 2, 286, 288, 5, 26, 14, 2, 287, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 290, 3, 2, 2, 2, 290, 291, 3, 2, 2, 2, 291, 292, 7, 118, 2, 2, 292, 293, 5, 178, 90, 2, 293, 294, 7, 122, 2, 2, 294, 19, 3, 2, 2, 2, 295, 305, 7, 9, 2, 2, 296, 306, 5, 74, 38, 2, 297, 306, 5, 84, 43, 2, 298, 306, 5, 96, 49, 2, 299, 306, 5, 102, 52, 2, 300, 306, 5, 108, 55, 2, 301, 306, 5, 114, 58, 2, 302, 306, 5, 120, 61, 2, 303, 306, 5, 126, 64, 2, 304, 306, 5, 148, 75, 2, 305, 296, 3, 2, 2, 2, 305, 297, 3, 2, 2, 2, 305, 298, 3, 2, 2, 2, 305, 299, 3, 2, 2, 2, 305, 300, 3, 2, 2, 2, 305, 301, 3, 2, 2, 2, 305, 302, 3, 2, 2, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 21, 3, 2, 2, 2, 307, 308, 5, 216, 109, 2, 308, 309, 7, 138, 2, 2, 309, 313, 7, 139, 2, 2, 310, 312, 7, 141, 2, 2, 311, 310, 3, 2, 2, 2, 312, 315, 3, 2, 2, 2, 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 316, 3, 2, 2, 2, 315, 313, 3, 2, 2, 2, 316, 317, 7, 140, 2, 2, 317, 23, 3, 2, 2, 2, 318, 319, 7, 14, 2, 2, 319, 321, 5, 176, 89, 2, 320, 322, 7, 27, 2, 2, 321, 320, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 325, 7, 117, 2, 2, 324, 326, 5, 36, 19, 2, 325, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 330, 7, 118, 2, 2, 330, 331, 5, 176, 89, 2, 331, 332, 7, 122, 2, 2, 332, 25, 3, 2, 2, 2, 333, 337, 5, 36, 19, 2, 334, 337, 5, 28, 15, 2, 335, 337, 5, 30, 16, 2, 336, 333, 3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 336, 335, 3, 2, 2, 2, 337, 27, 3, 2, 2, 2, 338, 339, 7, 14, 2, 2, 339, 352, 5, 176, 89, 2, 340, 342, 7, 27, 2, 2, 341, 340, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 345, 7, 117, 2, 2, 344, 346, 5, 36, 19, 2, 345, 344, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 345, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 7, 118, 2, 2, 350, 351, 5, 176, 89, 2, 351, 353, 3, 2, 2, 2, 352, 341, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 355, 7, 122, 2, 2, 355, 29, 3, 2, 2, 2, 356, 357, 7, 44, 2, 2, 357, 361, 7, 117, 2, 2, 358, 360, 5, 32, 17, 2, 359, 358, 3, 2, 2, 2, 360, 363, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 361, 362, 3, 2, 2, 2, 362, 364, 3, 2, 2, 2, 363, 361, 3, 2, 2, 2, 364, 365, 7, 118, 2, 2, 365, 366, 7, 122, 2, 2, 366, 31, 3, 2, 2, 2, 367, 370, 5, 34, 18, 2, 368, 370, 5, 6, 4, 2, 369, 367, 3, 2, 2, 2, 369, 368, 3, 2, 2, 2, 370, 371, 3, 2, 2, 2, 371, 372, 7, 122, 2, 2, 372, 33, 3, 2, 2, 2, 373, 374, 9, 2, 2, 2, 374, 376, 7, 117, 2, 2, 375, 377, 5, 142, 72, 2, 376, 375, 3, 2, 2, 2, 377, 378, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 118, 2, 2, 381, 385, 3, 2, 2, 2, 382, 383, 7, 49, 2, 2, 383, 385, 5, 182, 92, 2, 384, 373, 3, 2, 2, 2, 384, 382, 3, 2, 2, 2, 385, 35, 3, 2, 2, 2, 386, 401, 5, 38, 20, 2, 387, 401, 5, 40, 21, 2, 388, 401, 5, 42, 22, 2, 389, 401, 5, 44, 23, 2, 390, 401, 5, 8, 5, 2, 391, 401, 5, 48, 25, 2, 392, 401, 5, 50, 26, 2, 393, 401, 5, 12, 7, 2, 394, 401, 5, 52, 27, 2, 395, 401, 5, 66, 34, 2, 396, 401, 5, 68, 35, 2, 397, 401, 5, 70, 36, 2, 398, 401, 5, 72, 37, 2, 399, 401, 5, 6, 4, 2, 400, 386, 3, 2, 2, 2, 400, 387, 3, 2, 2, 2, 400, 388, 3, 2, 2, 2, 400, 389, 3, 2, 2, 2, 400, 390, 3, 2, 2, 2, 400, 391, 3, 2, 2, 2, 400, 392, 3, 2, 2, 2, 400, 393, 3, 2, 2, 2, 400, 394, 3, 2, 2, 2, 400, 395, 3, 2, 2, 2, 400, 396, 3, 2, 2, 2, 400, 397, 3, 2, 2, 2, 400, 398, 3, 2, 2, 2, 400, 399, 3, 2, 2, 2, 401, 402, 3, 2, 2, 2, 402, 403, 7, 122, 2, 2, 403, 37, 3, 2, 2, 2, 404, 405, 7, 8, 2, 2, 405, 406, 5, 178, 90, 2, 406, 39, 3, 2, 2, 2, 407, 408, 7, 10, 2, 2, 408, 409, 5, 178, 90, 2, 409, 41, 3, 2, 2, 2, 410, 411, 7, 11, 2, 2, 411, 413, 5, 178, 90, 2, 412, 414, 9, 3, 2, 2, 413, 412, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 43, 3, 2, 2, 2, 415, 422, 7, 15, 2, 2, 416, 423, 7, 135, 2, 2, 417, 419, 5, 46, 24, 2, 418, 417, 3, 2, 2, 2, 419, 420, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 420, 421, 3, 2, 2, 2, 421, 423, 3, 2, 2, 2, 422, 416, 3, 2, 2, 2, 422, 418, 3, 2, 2, 2, 423, 45, 3, 2, 2, 2, 424, 433, 7, 17, 2, 2, 425, 433, 7, 18, 2, 2, 426, 433, 7, 19, 2, 2, 427, 433, 7, 20, 2, 2, 428, 429, 7, 22, 2, 2, 429, 433, 5, 166, 84, 2, 430, 431, 7, 21, 2, 2, 431, 433, 5, 166, 84, 2, 432, 424, 3, 2, 2, 2, 432, 425, 3, 2, 2, 2, 432, 426, 3, 2, 2, 2, 432, 427, 3, 2, 2, 2, 432, 428, 3, 2, 2, 2, 432, 430, 3, 2, 2, 2, 433, 47, 3, 2, 2, 2, 434, 438, 7, 33, 2, 2, 435, 439, 5, 212, 107, 2, 436, 439, 5, 214, 108, 2, 437, 439, 5, 220, 111, 2, 438, 435, 3, 2, 2, 2, 438, 436, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 440, 3, 2, 2, 2, 440, 445, 5, 156, 79, 2, 441, 442, 7, 125, 2, 2, 442, 444, 5, 156, 79, 2, 443, 441, 3, 2, 2, 2, 444, 447, 3, 2, 2, 2, 445, 443, 3, 2, 2, 2, 445, 446, 3, 2, 2, 2, 446, 49, 3, 2, 2, 2, 447, 445, 3, 2, 2, 2, 448, 449, 7, 32, 2, 2, 449, 454, 5, 156, 79, 2, 450, 451, 7, 125, 2, 2, 451, 453, 5, 156, 79, 2, 452, 450, 3, 2, 2, 2, 453, 456, 3, 2, 2, 2, 454, 452, 3, 2, 2, 2, 454, 455, 3, 2, 2, 2, 455, 458, 3, 2, 2, 2, 456, 454, 3, 2, 2, 2, 457, 448, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 477, 3, 2, 2, 2, 459, 460, 5, 214, 108, 2, 460, 466, 5, 156, 79, 2, 461, 464, 7, 38, 2, 2, 462, 465, 7, 62, 2, 2, 463, 465, 5, 156, 79, 2, 464, 462, 3, 2, 2, 2, 464, 463, 3, 2, 2, 2, 465, 467, 3, 2, 2, 2, 466, 461, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 478, 3, 2, 2, 2, 468, 469, 5, 212, 107, 2, 469, 475, 5, 156, 79, 2, 470, 473, 9, 4, 2, 2, 471, 474, 7, 62, 2, 2, 472, 474, 5, 156, 79, 2, 473, 471, 3, 2, 2, 2, 473, 472, 3, 2, 2, 2, 474, 476, 3, 2, 2, 2, 475, 470, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 478, 3, 2, 2, 2, 477, 459, 3, 2, 2, 2, 477, 468, 3, 2, 2, 2, 478, 51, 3, 2, 2, 2, 479, 481, 5, 218, 110, 2, 480, 479, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 482, 3, 2, 2, 2, 482, 484, 5, 220, 111, 2, 483, 485, 5, 160, 81, 2, 484, 483, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 540, 3, 2, 2, 2, 486, 490, 5, 56, 29, 2, 487, 489, 5, 54, 28, 2, 488, 487, 3, 2, 2, 2, 489, 492, 3, 2, 2, 2, 490, 488, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 541, 3, 2, 2, 2, 492, 490, 3, 2, 2, 2, 493, 494, 7, 14, 2, 2, 494, 496, 5, 176, 89, 2, 495, 493, 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, 502, 3, 2, 2, 2, 499, 501, 5, 158, 80, 2, 500, 499, 3, 2, 2, 2, 501, 504, 3, 2, 2, 2, 502, 500, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 541, 3, 2, 2, 2, 504, 502, 3, 2, 2, 2, 505, 506, 7, 57, 2, 2, 506, 508, 5, 60, 31, 2, 507, 509, 5, 160, 81, 2, 508, 507, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 541, 3, 2, 2, 2, 510, 511, 7, 58, 2, 2, 511, 513, 5, 160, 81, 2, 512, 514, 5, 62, 32, 2, 513, 512, 3, 2, 2, 2, 514, 515, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 516, 3, 2, 2, 2, 516, 518, 3, 2, 2, 2, 517, 519, 5, 160, 81, 2, 518, 517, 3, 2, 2, 2, 518, 519, 3, 2, 2, 2, 519, 541, 3, 2, 2, 2, 520, 521, 5, 222, 112, 2, 521, 523, 5, 160, 81, 2, 522, 524, 5, 64, 33, 2, 523, 522, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 523, 3, 2, 2, 2, 525, 526, 3, 2, 2, 2, 526, 528, 3, 2, 2, 2, 527, 529, 5, 160, 81, 2, 528, 527, 3, 2, 2, 2, 528, 529, 3, 2, 2, 2, 529, 541, 3, 2, 2, 2, 530, 531, 7, 55, 2, 2, 531, 533, 5, 160, 81, 2, 532, 534, 5, 62, 32, 2, 533, 532, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 533, 3, 2, 2, 2, 535, 536, 3, 2, 2, 2, 536, 538, 3, 2, 2, 2, 537, 539, 5, 160, 81, 2, 538, 537, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 541, 3, 2, 2, 2, 540, 486, 3, 2, 2, 2, 540, 495, 3, 2, 2, 2, 540, 505, 3, 2, 2, 2, 540, 510, 3, 2, 2, 2, 540, 520, 3, 2, 2, 2, 540, 530, 3, 2, 2, 2, 541, 53, 3, 2, 2, 2, 542, 544, 5, 162, 82, 2, 543, 545, 5, 56, 29, 2, 544, 543, 3, 2, 2, 2, 544, 545, 3, 2, 2, 2, 545, 55, 3, 2, 2, 2, 546, 547, 7, 28, 2, 2, 547, 548, 5, 176, 89, 2, 548, 549, 7, 29, 2, 2, 549, 552, 3, 2, 2, 2, 550, 552, 5, 58, 30, 2, 551, 546, 3, 2, 2, 2, 551, 550, 3, 2, 2, 2, 552, 57, 3, 2, 2, 2, 553, 554, 7, 28, 2, 2, 554, 555, 7, 135, 2, 2, 555, 556, 7, 135, 2, 2, 556, 557, 7, 135, 2, 2, 557, 558, 7, 135, 2, 2, 558, 561, 7, 29, 2, 2, 559, 561, 7, 135, 2, 2, 560, 553, 3, 2, 2, 2, 560, 559, 3, 2, 2, 2, 561, 59, 3, 2, 2, 2, 562, 563, 5, 162, 82, 2, 563, 564, 5, 154, 78, 2, 564, 565, 5, 154, 78, 2, 565, 61, 3, 2, 2, 2, 566, 567, 5, 154, 78, 2, 567, 568, 7, 55, 2, 2, 568, 570, 7, 127, 2, 2, 569, 571, 7, 124, 2, 2, 570, 569, 3, 2, 2, 2, 570, 571, 3, 2, 2, 2, 571, 63, 3, 2, 2, 2, 572, 575, 5, 154, 78, 2, 573, 574, 7, 55, 2, 2, 574, 576, 7, 127, 2, 2, 575, 573, 3, 2, 2, 2, 575, 576, 3, 2, 2, 2, 576, 578, 3, 2, 2, 2, 577, 579, 7, 61, 2, 2, 578, 577, 3, 2, 2, 2, 578, 579, 3, 2, 2, 2, 579, 581, 3, 2, 2, 2, 580, 582, 7, 124, 2, 2, 581, 580, 3, 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 65, 3, 2, 2, 2, 583, 585, 7, 42, 2, 2, 584, 586, 5, 180, 91, 2, 585, 584, 3, 2, 2, 2, 586, 587, 3, 2, 2, 2, 587, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 67, 3, 2, 2, 2, 589, 596, 7, 50, 2, 2, 590, 594, 5, 182, 92, 2, 591, 592, 5, 182, 92, 2, 592, 593, 5, 182, 92, 2, 593, 595, 3, 2, 2, 2, 594, 591, 3, 2, 2, 2, 594, 595, 3, 2, 2, 2, 595, 597, 3, 2, 2, 2, 596, 590, 3, 2, 2, 2, 596, 597, 3, 2, 2, 2, 597, 598, 3, 2, 2, 2, 598, 599, 7, 126, 2, 2, 599, 600, 7, 146, 2, 2, 600, 601, 7, 147, 2, 2, 601, 69, 3, 2, 2, 2, 602, 603, 7, 43, 2, 2, 603, 605, 7, 117, 2, 2, 604, 606, 5, 142, 72, 2, 605, 604, 3, 2, 2, 2, 606, 607, 3, 2, 2, 2, 607, 605, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2, 608, 609, 3, 2, 2, 2, 609, 610, 7, 118, 2, 2, 610, 71, 3, 2, 2, 2, 611, 612, 7, 13, 2, 2, 612, 73, 3, 2, 2, 2, 613, 614, 7, 63, 2, 2, 614, 616, 7, 117, 2, 2, 615, 617, 5, 76, 39, 2, 616, 615, 3, 2, 2, 2, 617, 618, 3, 2, 2, 2, 618, 616, 3, 2, 2, 2, 618, 619, 3, 2, 2, 2, 619, 620, 3, 2, 2, 2, 620, 621, 7, 118, 2, 2, 621, 622, 7, 63, 2, 2, 622, 623, 7, 122, 2, 2, 623, 75, 3, 2, 2, 2, 624, 628, 5, 78, 40, 2, 625, 628, 5, 80, 41, 2, 626, 628, 5, 6, 4, 2, 627, 624, 3, 2, 2, 2, 627, 625, 3, 2, 2, 2, 627, 626, 3, 2, 2, 2, 628, 629, 3, 2, 2, 2, 629, 630, 7, 122, 2, 2, 630, 77, 3, 2, 2, 2, 631, 633, 9, 5, 2, 2, 632, 634, 5, 178, 90, 2, 633, 632, 3, 2, 2, 2, 634, 635, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 79, 3, 2, 2, 2, 637, 638, 9, 6, 2, 2, 638, 643, 5, 82, 42, 2, 639, 640, 7, 125, 2, 2, 640, 642, 5, 82, 42, 2, 641, 639, 3, 2, 2, 2, 642, 645, 3, 2, 2, 2, 643, 641, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, 81, 3, 2, 2, 2, 645, 643, 3, 2, 2, 2, 646, 647, 5, 178, 90, 2, 647, 649, 5, 178, 90, 2, 648, 650, 7, 135, 2, 2, 649, 648, 3, 2, 2, 2, 650, 651, 3, 2, 2, 2, 651, 649, 3, 2, 2, 2, 651, 652, 3, 2, 2, 2, 652, 83, 3, 2, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 7, 117, 2, 2, 655, 657, 5, 86, 44, 2, 656, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 656, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 661, 7, 118, 2, 2, 661, 662, 7, 68, 2, 2, 662, 663, 7, 122, 2, 2, 663, 85, 3, 2, 2, 2, 664, 670, 5, 88, 45, 2, 665, 670, 5, 90, 46, 2, 666, 670, 5, 92, 47, 2, 667, 670, 5, 94, 48, 2, 668, 670, 5, 6, 4, 2, 669, 664, 3, 2, 2, 2, 669, 665, 3, 2, 2, 2, 669, 666, 3, 2, 2, 2, 669, 667, 3, 2, 2, 2, 669, 668, 3, 2, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 7, 122, 2, 2, 672, 87, 3, 2, 2, 2, 673, 674, 7, 69, 2, 2, 674, 675, 5, 164, 83, 2, 675, 676, 7, 125, 2, 2, 676, 677, 5, 164, 83, 2, 677, 678, 7, 125, 2, 2, 678, 679, 5, 164, 83, 2, 679, 680, 7, 125, 2, 2, 680, 681, 5, 164, 83, 2, 681, 89, 3, 2, 2, 2, 682, 683, 7, 70, 2, 2, 683, 685, 5, 156, 79, 2, 684, 686, 7, 135, 2, 2, 685, 684, 3, 2, 2, 2, 686, 687, 3, 2, 2, 2, 687, 685, 3, 2, 2, 2, 687, 688, 3, 2, 2, 2, 688, 91, 3, 2, 2, 2, 689, 690, 7, 71, 2, 2, 690, 692, 5, 156, 79, 2, 691, 693, 7, 135, 2, 2, 692, 691, 3, 2, 2, 2, 693, 694, 3, 2, 2, 2, 694, 692, 3, 2, 2, 2, 694, 695, 3, 2, 2, 2, 695, 93, 3, 2, 2, 2, 696, 697, 7, 72, 2, 2, 697, 699, 5, 156, 79, 2, 698, 700, 7, 135, 2, 2, 699, 698, 3, 2, 2, 2, 700, 701, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 95, 3, 2, 2, 2, 703, 704, 7, 73, 2, 2, 704, 706, 7, 117, 2, 2, 705, 707, 5, 98, 50, 2, 706, 705, 3, 2, 2, 2, 707, 708, 3, 2, 2, 2, 708, 706, 3, 2, 2, 2, 708, 709, 3, 2, 2, 2, 709, 710, 3, 2, 2, 2, 710, 711, 7, 118, 2, 2, 711, 712, 7, 73, 2, 2, 712, 713, 7, 122, 2, 2, 713, 97, 3, 2, 2, 2, 714, 717, 5, 100, 51, 2, 715, 717, 5, 6, 4, 2, 716, 714, 3, 2, 2, 2, 716, 715, 3, 2, 2, 2, 717, 718, 3, 2, 2, 2, 718, 719, 7, 122, 2, 2, 719, 99, 3, 2, 2, 2, 720, 721, 7, 74, 2, 2, 721, 722, 7, 132, 2, 2, 722, 101, 3, 2, 2, 2, 723, 724, 7, 75, 2, 2, 724, 728, 7, 117, 2, 2, 725, 727, 5, 104, 53, 2, 726, 725, 3, 2, 2, 2, 727, 730, 3, 2, 2, 2, 728, 726, 3, 2, 2, 2, 728, 729, 3, 2, 2, 2, 729, 731, 3, 2, 2, 2, 730, 728, 3, 2, 2, 2, 731, 732, 7, 118, 2, 2, 732, 733, 7, 75, 2, 2, 733, 734, 7, 122, 2, 2, 734, 103, 3, 2, 2, 2, 735, 738, 5, 106, 54, 2, 736, 738, 5, 6, 4, 2, 737, 735, 3, 2, 2, 2, 737, 736, 3, 2, 2, 2, 738, 739, 3, 2, 2, 2, 739, 740, 7, 122, 2, 2, 740, 105, 3, 2, 2, 2, 741, 742, 9, 7, 2, 2, 742, 743, 7, 135, 2, 2, 743, 107, 3, 2, 2, 2, 744, 745, 7, 110, 2, 2, 745, 749, 7, 117, 2, 2, 746, 748, 5, 110, 56, 2, 747, 746, 3, 2, 2, 2, 748, 751, 3, 2, 2, 2, 749, 747, 3, 2, 2, 2, 749, 750, 3, 2, 2, 2, 750, 752, 3, 2, 2, 2, 751, 749, 3, 2, 2, 2, 752, 753, 7, 118, 2, 2, 753, 754, 7, 110, 2, 2, 754, 755, 7, 122, 2, 2, 755, 109, 3, 2, 2, 2, 756, 759, 5, 112, 57, 2, 757, 759, 5, 6, 4, 2, 758, 756, 3, 2, 2, 2, 758, 757, 3, 2, 2, 2, 759, 760, 3, 2, 2, 2, 760, 761, 7, 122, 2, 2, 761, 111, 3, 2, 2, 2, 762, 763, 9, 8, 2, 2, 763, 764, 7, 135, 2, 2, 764, 113, 3, 2, 2, 2, 765, 766, 7, 80, 2, 2, 766, 768, 7, 117, 2, 2, 767, 769, 5, 116, 59, 2, 768, 767, 3, 2, 2, 2, 769, 770, 3, 2, 2, 2, 770, 768, 3, 2, 2, 2, 770, 771, 3, 2, 2, 2, 771, 772, 3, 2, 2, 2, 772, 773, 7, 118, 2, 2, 773, 774, 7, 80, 2, 2, 774, 775, 7, 122, 2, 2, 775, 115, 3, 2, 2, 2, 776, 779, 5, 118, 60, 2, 777, 779, 5, 6, 4, 2, 778, 776, 3, 2, 2, 2, 778, 777, 3, 2, 2, 2, 779, 780, 3, 2, 2, 2, 780, 781, 7, 122, 2, 2, 781, 117, 3, 2, 2, 2, 782, 783, 7, 81, 2, 2, 783, 790, 5, 182, 92, 2, 784, 788, 5, 182, 92, 2, 785, 786, 5, 182, 92, 2, 786, 787, 5, 182, 92, 2, 787, 789, 3, 2, 2, 2, 788, 785, 3, 2, 2, 2, 788, 789, 3, 2, 2, 2, 789, 791, 3, 2, 2, 2, 790, 784, 3, 2, 2, 2, 790, 791, 3, 2, 2, 2, 791, 792, 3, 2, 2, 2, 792, 793, 7, 126, 2, 2, 793, 794, 7, 146, 2, 2, 794, 795, 7, 147, 2, 2, 795, 119, 3, 2, 2, 2, 796, 797, 7, 82, 2, 2, 797, 799, 7, 117, 2, 2, 798, 800, 5, 122, 62, 2, 799, 798, 3, 2, 2, 2, 800, 801, 3, 2, 2, 2, 801, 799, 3, 2, 2, 2, 801, 802, 3, 2, 2, 2, 802, 803, 3, 2, 2, 2, 803, 804, 7, 118, 2, 2, 804, 805, 7, 82, 2, 2, 805, 806, 7, 122, 2, 2, 806, 121, 3, 2, 2, 2, 807, 810, 5, 124, 63, 2, 808, 810, 5, 6, 4, 2, 809, 807, 3, 2, 2, 2, 809, 808, 3, 2, 2, 2, 810, 811, 3, 2, 2, 2, 811, 812, 7, 122, 2, 2, 812, 123, 3, 2, 2, 2, 813, 814, 9, 9, 2, 2, 814, 841, 7, 135, 2, 2, 815, 816, 9, 10, 2, 2, 816, 841, 7, 135, 2, 2, 817, 818, 7, 100, 2, 2, 818, 841, 5, 182, 92, 2, 819, 820, 7, 97, 2, 2, 820, 821, 7, 126, 2, 2, 821, 822, 7, 146, 2, 2, 822, 841, 7, 147, 2, 2, 823, 824, 7, 87, 2, 2, 824, 825, 7, 135, 2, 2, 825, 826, 7, 135, 2, 2, 826, 827, 7, 135, 2, 2, 827, 828, 7, 135, 2, 2, 828, 829, 7, 135, 2, 2, 829, 830, 7, 135, 2, 2, 830, 831, 7, 135, 2, 2, 831, 832, 7, 135, 2, 2, 832, 833, 7, 135, 2, 2, 833, 841, 7, 135, 2, 2, 834, 836, 9, 11, 2, 2, 835, 837, 7, 135, 2, 2, 836, 835, 3, 2, 2, 2, 837, 838, 3, 2, 2, 2, 838, 836, 3, 2, 2, 2, 838, 839, 3, 2, 2, 2, 839, 841, 3, 2, 2, 2, 840, 813, 3, 2, 2, 2, 840, 815, 3, 2, 2, 2, 840, 817, 3, 2, 2, 2, 840, 819, 3, 2, 2, 2, 840, 823, 3, 2, 2, 2, 840, 834, 3, 2, 2, 2, 841, 125, 3, 2, 2, 2, 842, 843, 7, 101, 2, 2, 843, 845, 7, 117, 2, 2, 844, 846, 5, 128, 65, 2, 845, 844, 3, 2, 2, 2, 846, 847, 3, 2, 2, 2, 847, 845, 3, 2, 2, 2, 847, 848, 3, 2, 2, 2, 848, 849, 3, 2, 2, 2, 849, 850, 7, 118, 2, 2, 850, 851, 7, 101, 2, 2, 851, 852, 7, 122, 2, 2, 852, 127, 3, 2, 2, 2, 853, 859, 5, 130, 66, 2, 854, 859, 5, 132, 67, 2, 855, 859, 5, 140, 71, 2, 856, 859, 5, 144, 73, 2, 857, 859, 5, 6, 4, 2, 858, 853, 3, 2, 2, 2, 858, 854, 3, 2, 2, 2, 858, 855, 3, 2, 2, 2, 858, 856, 3, 2, 2, 2, 858, 857, 3, 2, 2, 2, 859, 860, 3, 2, 2, 2, 860, 861, 7, 122, 2, 2, 861, 129, 3, 2, 2, 2, 862, 863, 7, 104, 2, 2, 863, 864, 5, 178, 90, 2, 864, 865, 7, 135, 2, 2, 865, 867, 7, 117, 2, 2, 866, 868, 5, 142, 72, 2, 867, 866, 3, 2, 2, 2, 868, 869, 3, 2, 2, 2, 869, 867, 3, 2, 2, 2, 869, 870, 3, 2, 2, 2, 870, 871, 3, 2, 2, 2, 871, 872, 7, 118, 2, 2, 872, 131, 3, 2, 2, 2, 873, 874, 7, 105, 2, 2, 874, 876, 7, 117, 2, 2, 875, 877, 5, 134, 68, 2, 876, 875, 3, 2, 2, 2, 877, 878, 3, 2, 2, 2, 878, 876, 3, 2, 2, 2, 878, 879, 3, 2, 2, 2, 879, 880, 3, 2, 2, 2, 880, 881, 7, 118, 2, 2, 881, 133, 3, 2, 2, 2, 882, 887, 5, 146, 74, 2, 883, 887, 5, 136, 69, 2, 884, 887, 5, 138, 70, 2, 885, 887, 5, 6, 4, 2, 886, 882, 3, 2, 2, 2, 886, 883, 3, 2, 2, 2, 886, 884, 3, 2, 2, 2, 886, 885, 3, 2, 2, 2, 887, 888, 3, 2, 2, 2, 888, 889, 7, 122, 2, 2, 889, 135, 3, 2, 2, 2, 890, 891, 7, 107, 2, 2, 891, 892, 5, 178, 90, 2, 892, 897, 5, 180, 91, 2, 893, 895, 5, 180, 91, 2, 894, 896, 5, 180, 91, 2, 895, 894, 3, 2, 2, 2, 895, 896, 3, 2, 2, 2, 896, 898, 3, 2, 2, 2, 897, 893, 3, 2, 2, 2, 897, 898, 3, 2, 2, 2, 898, 137, 3, 2, 2, 2, 899, 901, 7, 106, 2, 2, 900, 902, 9, 12, 2, 2, 901, 900, 3, 2, 2, 2, 902, 903, 3, 2, 2, 2, 903, 901, 3, 2, 2, 2, 903, 904, 3, 2, 2, 2, 904, 139, 3, 2, 2, 2, 905, 906, 7, 102, 2, 2, 906, 908, 7, 117, 2, 2, 907, 909, 5, 142, 72, 2, 908, 907, 3, 2, 2, 2, 909, 910, 3, 2, 2, 2, 910, 908, 3, 2, 2, 2, 910, 911, 3, 2, 2, 2, 911, 912, 3, 2, 2, 2, 912, 913, 7, 118, 2, 2, 913, 141, 3, 2, 2, 2, 914, 917, 5, 146, 74, 2, 915, 917, 5, 6, 4, 2, 916, 914, 3, 2, 2, 2, 916, 915, 3, 2, 2, 2, 917, 918, 3, 2, 2, 2, 918, 919, 7, 122, 2, 2, 919, 143, 3, 2, 2, 2, 920, 921, 7, 103, 2, 2, 921, 922, 5, 182, 92, 2, 922, 145, 3, 2, 2, 2, 923, 930, 7, 80, 2, 2, 924, 928, 5, 182, 92, 2, 925, 926, 5, 182, 92, 2, 926, 927, 5, 182, 92, 2, 927, 929, 3, 2, 2, 2, 928, 925, 3, 2, 2, 2, 928, 929, 3, 2, 2, 2, 929, 931, 3, 2, 2, 2, 930, 924, 3, 2, 2, 2, 930, 931, 3, 2, 2, 2, 931, 932, 3, 2, 2, 2, 932, 933, 7, 126, 2, 2, 933, 934, 7, 146, 2, 2, 934, 935, 7, 147, 2, 2, 935, 147, 3, 2, 2, 2, 936, 937, 7, 114, 2, 2, 937, 939, 7, 117, 2, 2, 938, 940, 5, 150, 76, 2, 939, 938, 3, 2, 2, 2, 940, 941, 3, 2, 2, 2, 941, 939, 3, 2, 2, 2, 941, 942, 3, 2, 2, 2, 942, 943, 3, 2, 2, 2, 943, 944, 7, 118, 2, 2, 944, 945, 7, 114, 2, 2, 945, 946, 7, 122, 2, 2, 946, 149, 3, 2, 2, 2, 947, 950, 5, 152, 77, 2, 948, 950, 5, 6, 4, 2, 949, 947, 3, 2, 2, 2, 949, 948, 3, 2, 2, 2, 950, 951, 3, 2, 2, 2, 951, 952, 7, 122, 2, 2, 952, 151, 3, 2, 2, 2, 953, 954, 9, 13, 2, 2, 954, 955, 5, 172, 87, 2, 955, 956, 7, 135, 2, 2, 956, 153, 3, 2, 2, 2, 957, 958, 7, 28, 2, 2, 958, 967, 7, 52, 2, 2, 959, 960, 7, 135, 2, 2, 960, 963, 7, 135, 2, 2, 961, 962, 7, 51, 2, 2, 962, 964, 7, 135, 2, 2, 963, 961, 3, 2, 2, 2, 963, 964, 3, 2, 2, 2, 964, 968, 3, 2, 2, 2, 965, 968, 7, 62, 2, 2, 966, 968, 5, 176, 89, 2, 967, 959, 3, 2, 2, 2, 967, 965, 3, 2, 2, 2, 967, 966, 3, 2, 2, 2, 968, 969, 3, 2, 2, 2, 969, 970, 7, 29, 2, 2, 970, 155, 3, 2, 2, 2, 971, 973, 5, 158, 80, 2, 972, 971, 3, 2, 2, 2, 973, 974, 3, 2, 2, 2, 974, 972, 3, 2, 2, 2, 974, 975, 3, 2, 2, 2, 975, 157, 3, 2, 2, 2, 976, 981, 5, 162, 82, 2, 977, 978, 7, 14, 2, 2, 978, 980, 5, 176, 89, 2, 979, 977, 3, 2, 2, 2, 980, 983, 3, 2, 2, 2, 981, 979, 3, 2, 2, 2, 981, 982, 3, 2, 2, 2, 982, 159, 3, 2, 2, 2, 983, 981, 3, 2, 2, 2, 984, 986, 5, 162, 82, 2, 985, 984, 3, 2, 2, 2, 986, 987, 3, 2, 2, 2, 987, 985, 3, 2, 2, 2, 987, 988, 3, 2, 2, 2, 988, 161, 3, 2, 2, 2, 989, 992, 5, 166, 84, 2, 990, 992, 5, 172, 87, 2, 991, 989, 3, 2, 2, 2, 991, 990, 3, 2, 2, 2, 992, 994, 3, 2, 2, 2, 993, 995, 7, 124, 2, 2, 994, 993, 3, 2, 2, 2, 994, 995, 3, 2, 2, 2, 995, 163, 3, 2, 2, 2, 996, 998, 5, 166, 84, 2, 997, 996, 3, 2, 2, 2, 997, 998, 3, 2, 2, 2, 998, 165, 3, 2, 2, 2, 999, 1002, 7, 127, 2, 2, 1000, 1002, 5, 168, 85, 2, 1001, 999, 3, 2, 2, 2, 1001, 1000, 3, 2, 2, 2, 1002, 167, 3, 2, 2, 2, 1003, 1005, 7, 119, 2, 2, 1004, 1006, 5, 170, 86, 2, 1005, 1004, 3, 2, 2, 2, 1006, 1007, 3, 2, 2, 2, 1007, 1005, 3, 2, 2, 2, 1007, 1008, 3, 2, 2, 2, 1008, 1009, 3, 2, 2, 2, 1009, 1010, 7, 120, 2, 2, 1010, 169, 3, 2, 2, 2, 1011, 1014, 5, 172, 87, 2, 1012, 1013, 7, 121, 2, 2, 1013, 1015, 5, 172, 87, 2, 1014, 1012, 3, 2, 2, 2, 1014, 1015, 3, 2, 2, 2, 1015, 1018, 3, 2, 2, 2, 1016, 1018, 7, 127, 2, 2, 1017, 1011, 3, 2, 2, 2, 1017, 1016, 3, 2, 2, 2, 1018, 171, 3, 2, 2, 2, 1019, 1022, 5, 174, 88, 2, 1020, 1022, 7, 128, 2, 2, 1021, 1019, 3, 2, 2, 2, 1021, 1020, 3, 2, 2, 2, 1022, 173, 3, 2, 2, 2, 1023, 1024, 9, 14, 2, 2, 1024, 175, 3, 2, 2, 2, 1025, 1026, 9, 15, 2, 2, 1026, 177, 3, 2, 2, 2, 1027, 1028, 9, 16, 2, 2, 1028, 179, 3, 2, 2, 2, 1029, 1030, 9, 17, 2, 2, 1030, 181, 3, 2, 2, 2, 1031, 1032, 9, 18, 2, 2, 1032, 183, 3, 2, 2, 2, 1033, 1035, 5, 26, 14, 2, 1034, 1033, 3, 2, 2, 2, 1035, 1038, 3, 2, 2, 2, 1036, 1034, 3, 2, 2, 2, 1036, 1037, 3, 2, 2, 2, 1037, 1039, 3, 2, 2, 2, 1038, 1036, 3, 2, 2, 2, 1039, 1040, 7, 2, 2, 3, 1040, 185, 3, 2, 2, 2, 1041, 1043, 5, 36, 19, 2, 1042, 1041, 3, 2, 2, 2, 1043, 1046, 3, 2, 2, 2, 1044, 1042, 3, 2, 2, 2, 1044, 1045, 3, 2, 2, 2, 1045, 1047, 3, 2, 2, 2, 1046, 1044, 3, 2, 2, 2, 1047, 1048, 7, 2, 2, 3, 1048, 187, 3, 2, 2, 2, 1049, 1051, 5, 32, 17, 2, 1050, 1049, 3, 2, 2, 2, 1051, 1054, 3, 2, 2, 2, 1052, 1050, 3, 2, 2, 2, 1052, 1053, 3, 2, 2, 2, 1053, 1055, 3, 2, 2, 2, 1054, 1052, 3, 2, 2, 2, 1055, 1056, 7, 2, 2, 3, 1056, 189, 3, 2, 2, 2, 1057, 1059, 5, 76, 39, 2, 1058, 1057, 3, 2, 2, 2, 1059, 1062, 3, 2, 2, 2, 1060, 1058, 3, 2, 2, 2, 1060, 1061, 3, 2, 2, 2, 1061, 1063, 3, 2, 2, 2, 1062, 1060, 3, 2, 2, 2, 1063, 1064, 7, 2, 2, 3, 1064, 191, 3, 2, 2, 2, 1065, 1067, 5, 98, 50, 2, 1066, 1065, 3, 2, 2, 2, 1067, 1070, 3, 2, 2, 2, 1068, 1066, 3, 2, 2, 2, 1068, 1069, 3, 2, 2, 2, 1069, 1071, 3, 2, 2, 2, 1070, 1068, 3, 2, 2, 2, 1071, 1072, 7, 2, 2, 3, 1072, 193, 3, 2, 2, 2, 1073, 1075, 5, 104, 53, 2, 1074, 1073, 3, 2, 2, 2, 1075, 1078, 3, 2, 2, 2, 1076, 1074, 3, 2, 2, 2, 1076, 1077, 3, 2, 2, 2, 1077, 1079, 3, 2, 2, 2, 1078, 1076, 3, 2, 2, 2, 1079, 1080, 7, 2, 2, 3, 1080, 195, 3, 2, 2, 2, 1081, 1083, 5, 110, 56, 2, 1082, 1081, 3, 2, 2, 2, 1083, 1086, 3, 2, 2, 2, 1084, 1082, 3, 2, 2, 2, 1084, 1085, 3, 2, 2, 2, 1085, 1087, 3, 2, 2, 2, 1086, 1084, 3, 2, 2, 2, 1087, 1088, 7, 2, 2, 3, 1088, 197, 3, 2, 2, 2, 1089, 1091, 5, 86, 44, 2, 1090, 1089, 3, 2, 2, 2, 1091, 1094, 3, 2, 2, 2, 1092, 1090, 3, 2, 2, 2, 1092, 1093, 3, 2, 2, 2, 1093, 1095, 3, 2, 2, 2, 1094, 1092, 3, 2, 2, 2, 1095, 1096, 7, 2, 2, 3, 1096, 199, 3, 2, 2, 2, 1097, 1099, 5, 116, 59, 2, 1098, 1097, 3, 2, 2, 2, 1099, 1102, 3, 2, 2, 2, 1100, 1098, 3, 2, 2, 2, 1100, 1101, 3, 2, 2, 2, 1101, 1103, 3, 2, 2, 2, 1102, 1100, 3, 2, 2, 2, 1103, 1104, 7, 2, 2, 3, 1104, 201, 3, 2, 2, 2, 1105, 1107, 5, 150, 76, 2, 1106, 1105, 3, 2, 2, 2, 1107, 1110, 3, 2, 2, 2, 1108, 1106, 3, 2, 2, 2, 1108, 1109, 3, 2, 2, 2, 1109, 1111, 3, 2, 2, 2, 1110, 1108, 3, 2, 2, 2, 1111, 1112, 7, 2, 2, 3, 1112, 203, 3, 2, 2, 2, 1113, 1115, 5, 122, 62, 2, 1114, 1113, 3, 2, 2, 2, 1115, 1118, 3, 2, 2, 2, 1116, 1114, 3, 2, 2, 2, 1116, 1117, 3, 2, 2, 2, 1117, 1119, 3, 2, 2, 2, 1118, 1116, 3, 2, 2, 2, 1119, 1120, 7, 2, 2, 3, 1120, 205, 3, 2, 2, 2, 1121, 1123, 5, 128, 65, 2, 1122, 1121, 3, 2, 2, 2, 1123, 1126, 3, 2, 2, 2, 1124, 1122, 3, 2, 2, 2, 1124, 1125, 3, 2, 2, 2, 1125, 1127, 3, 2, 2, 2, 1126, 1124, 3, 2, 2, 2, 1127, 1128, 7, 2, 2, 3, 1128, 207, 3, 2, 2, 2, 1129, 1131, 5, 134, 68, 2, 1130, 1129, 3, 2, 2, 2, 1131, 1134, 3, 2, 2, 2, 1132, 1130, 3, 2, 2, 2, 1132, 1133, 3, 2, 2, 2, 1133, 1135, 3, 2, 2, 2, 1134, 1132, 3, 2, 2, 2, 1135, 1136, 7, 2, 2, 3, 1136, 209, 3, 2, 2, 2, 1137, 1139, 5, 142, 72, 2, 1138, 1137, 3, 2, 2, 2, 1139, 1142, 3, 2, 2, 2, 1140, 1138, 3, 2, 2, 2, 1140, 1141, 3, 2, 2, 2, 1141, 1143, 3, 2, 2, 2, 1142, 1140, 3, 2, 2, 2, 1143, 1144, 7, 2, 2, 3, 1144, 211, 3, 2, 2, 2, 1145, 1146, 9, 19, 2, 2, 1146, 213, 3, 2, 2, 2, 1147, 1148, 9, 20, 2, 2, 1148, 215, 3, 2, 2, 2, 1149, 1150, 9, 21, 2, 2, 1150, 217, 3, 2, 2, 2, 1151, 1152, 9, 22, 2, 2, 1152, 219, 3, 2, 2, 2, 1153, 1154, 9, 23, 2, 2, 1154, 221, 3, 2, 2, 2, 1155, 1156, 9, 24, 2, 2, 1156, 223, 3, 2, 2, 2, 124, 229, 231, 242, 262, 272, 283, 289, 305, 313, 321, 327, 336, 341, 347, 352, 361, 369, 378, 384, 400, 413, 420, 422, 432, 438, 445, 454, 457, 464, 466, 473, 475, 477, 480, 484, 490, 497, 502, 508, 515, 518, 525, 528, 535, 538, 540, 544, 551, 560, 570, 575, 578, 581, 587, 594, 596, 607, 618, 627, 635, 643, 651, 658, 669, 687, 694, 701, 708, 716, 728, 737, 749, 758, 770, 778, 788, 790, 801, 809, 838, 840, 847, 858, 869, 878, 886, 895, 897, 903, 910, 916, 928, 930, 941, 949, 963, 967, 974, 981, 987, 991, 994, 997, 1001, 1007, 1014, 1017, 1021, 1036, 1044, 1052, 1060, 1068, 1076, 1084, 1092, 1100, 1108, 1116, 1124, 1132, 1140] \ No newline at end of file diff --git a/docs/OpenTypeFeatureFileSpecification.md b/docs/OpenTypeFeatureFileSpecification.md index 0edc11e72..543b36abc 100644 --- a/docs/OpenTypeFeatureFileSpecification.md +++ b/docs/OpenTypeFeatureFileSpecification.md @@ -11,7 +11,7 @@ OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. Document version 1.26 -Last updated 1 June 2021 +Last updated 7 June 2021 **Caution: Portions of the syntax unimplemented by Adobe are subject to change.** @@ -191,7 +191,7 @@ contexts. [`languagesystem`](#4.b.i)
[`lookup`](#4.e)
[`lookupflag`](#4.d)
-[`mark`](#6.d)
+[`mark`](#6.d) (can also be used as a [tag](#2.h) or [lookup block label](#2.i))
[`MarkAttachmentType`](#4.d)
[`markClass`](#4.f)
[`nameid`](#9.e)
@@ -849,14 +849,16 @@ A tag can only have characters from the following set: and must not start with a digit or hyphen. However, use of characters beyond those in production glyph names is not recommended. -The special language tag `dflt` denotes the default language system of the +The keyword `mark` is a valid tag but other (short) keywords are not. The +special language tag `dflt` denotes the default language system of the corresponding script.
### 2.i. Lookup block labels The same length and name restrictions that apply to a production glyph name -apply to a lookup block label. +apply to a lookup block label. For historical reasons the keyword `mark' also +accepted as a label but other keywords are not. ## 3. Including files @@ -3996,7 +3998,7 @@ along with the tag `sbit`. ## 11. Document revisions -**v1.26 [1 June 2021]:** +**v1.26 [7 June 2021]:** * Clarified syntax of [keywords](#2.c), [glyph names](#2.f.i), [named glyph classes](#2.g.iii), [tags](#2.h), [lookup block labels](#2.i), and [include directives](#3), diff --git a/tests/makeotfexe_data/input/bug993/feat.fea b/tests/makeotfexe_data/input/bug993/feat.fea index 817572ca5..778ac5bcc 100644 --- a/tests/makeotfexe_data/input/bug993/feat.fea +++ b/tests/makeotfexe_data/input/bug993/feat.fea @@ -1,5 +1,5 @@ markClass [acute grave] @TOP_MARKS; -lookup mrk { +lookup mark { position base [a e o u]' mark @TOP_MARKS; -} mrk; +} mark; diff --git a/tests/makeotfexe_data/input/spec/6d-3.fea b/tests/makeotfexe_data/input/spec/6d-3.fea index 09b7abf74..6fe9d5c1b 100644 --- a/tests/makeotfexe_data/input/spec/6d-3.fea +++ b/tests/makeotfexe_data/input/spec/6d-3.fea @@ -1,6 +1,6 @@ # Contextual mark to base with backtrace and look ahead. markClass [acute grave] @TOP_MARKS; -lookup mrk { +lookup mark { position base [A B C] [a e o u]' [X Y Z] mark @TOP_MARKS; position base A a' X mark @TOP_MARKS; -} mrk; +} mark; From 4ed60cdac19d72a1232720eed11333e4aac21f67 Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Mon, 7 Jun 2021 21:24:49 -0700 Subject: [PATCH 4/4] Use slightly more recent Antlr 4 cpp commit to work around utfcpp test compilation issues --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 373189086..d7f86fb65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,10 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) add_definitions(-DANTLR4CPP_STATIC) set(ANTLR4_WITH_STATIC_CRT OFF) -set(ANTLR4_TAG tags/4.9.2) +# Use slightly more recent commit than 4.9.2 to deal with utfcpp test +# compilation problems +# set(ANTLR4_TAG tags/4.9.2) +set(ANTLR4_TAG 916f03366edf15bf8b50010b11d479c189bf9f96) include(ExternalAntlr4Cpp) # sanitizer support