diff --git a/.github/workflows/windows-intelLLVM.yml b/.github/workflows/windows-intelLLVM.yml new file mode 100644 index 000000000..9fe8d8a26 --- /dev/null +++ b/.github/workflows/windows-intelLLVM.yml @@ -0,0 +1,37 @@ +name: windows-intelLLVM + +on: + pull_request: + branches: + - main + - dev + +jobs: + + builds-and-tests: + runs-on: windows-latest + strategy: + matrix: + optimization-type: ["Debug", "Release"] + + steps: + + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Setup intel fortran + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2024.0' + + - name: Setup ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: CMake build + shell: bash + run: | + cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=${{matrix.optimization-type}} CC=icx + cmake --build build -j \ No newline at end of file diff --git a/.gitignore b/.gitignore index b03bee0ee..369d615ff 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,8 @@ Makefile.in /ar-lib /ngspice.pc -/src/frontend/parse-bison.* -/src/spicelib/parser/inpptree-parser.* +# /src/frontend/parse-bison.*k +# /src/spicelib/parser/inpptree-parser.* /src/include/ngspice/config.h.in # /src/include/ngspice/config.h @@ -81,10 +81,10 @@ Makefile.in **/*.vcxproj.user .vscode/ -src/frontend/parse-bison.c -src/frontend/parse-bison.h -src/spicelib/parser/inpptree-parser.c -src/spicelib/parser/inpptree-parser.h +# src/frontend/parse-bison.c +# src/frontend/parse-bison.h +# src/spicelib/parser/inpptree-parser.c +# src/spicelib/parser/inpptree-parser.h # Visual Studio Code user options files .vscode/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f26e39e41..f47087e29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,17 +2,44 @@ cmake_minimum_required (VERSION 3.15) message(STATUS "Creating build system for ngspice") -project(ngspice C) +project(ngspice) +enable_language(C CXX) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +option(NGSPICE_ENABLE_KLU "Enables KLU compilation in maths" ON) +option(NGSPICE_ENABLE_XSPICE "Enables xspice" ON) +option(NGSPICE_ENABLE_PSS_ANALYSIS "Enable PSS analysis" OFF) +option(NGSPICE_COMPILE_MAIN "Enables standalone executable compilaiton" OFF) + +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + add_definitions(-DHAVE_STRINGS_H=1) + add_definitions(-DHAVE_TERMIOS_H=1) + add_definitions(-DHAVE_PWD_H=1) + add_definitions(-DHAVE_NETINET_IN_H=1) + add_definitions(-DHAVE_NETDB_H=1) + add_definitions(-DHAVE_SYS_SOCKET_H=1) + add_definitions(-DHAVE_SYS_WAIT_H=1) + add_definitions(-DHAVE_DIRENT_H=1) + add_definitions(-DHAVE_GETRLIMIT=1) + add_definitions(-DHAVE_UNISTD_H=1) + add_definitions(-DHAVE_LIBPTHREAD=1) + add_definitions(-DHAVE_SIGSETJMP=1) + add_definitions(-DHAVE_SIG_T=1) + add_definitions(-DHAVE___SIGHANDLER_T=1) + add_definitions(-DHAVE_TDESTROY=1) + add_definitions(-DHAVE_TSEARCH=1) + add_definitions(-DHAVE_SYS_IOCTL_H=1) +endif() + include_directories( "src/" "src/include/" ) +# --- maths add_library(ngspice-maths "./src/maths/ni/nicomcof.c" "./src/maths/ni/nipred.c" @@ -27,14 +54,6 @@ add_library(ngspice-maths "./src/maths/ni/nireinit.c" "./src/maths/ni/niniter.c" "./src/maths/ni/nidest.c" - "./src/maths/sparse/spextra.c" - "./src/maths/sparse/spbuild.c" - "./src/maths/sparse/spfactor.c" - "./src/maths/sparse/sputils.c" - "./src/maths/sparse/spsolve.c" - "./src/maths/sparse/spalloc.c" - "./src/maths/sparse/spoutput.c" - "./src/maths/sparse/spsmp.c" "./src/maths/fft/fftext.c" "./src/maths/fft/fftlib.c" "./src/maths/fft/matlib.c" @@ -42,10 +61,10 @@ add_library(ngspice-maths "./src/maths/poly/interpolate.c" "./src/maths/poly/polyderiv.c" "./src/maths/poly/polyfit.c" + "./src/maths/cmaths/cmath1.c" "./src/maths/cmaths/cmath2.c" "./src/maths/cmaths/cmath3.c" "./src/maths/cmaths/cmath4.c" - "./src/maths/cmaths/cmath1.c" "./src/maths/deriv/plusder.c" "./src/maths/deriv/divderiv.c" "./src/maths/deriv/powderiv.c" @@ -69,51 +88,1206 @@ add_library(ngspice-maths "./src/maths/misc/isinf.c" "./src/maths/misc/logb.c" "./src/maths/misc/norm.c" - "./src/maths/KLU/amd_info.c" - "./src/maths/KLU/klusmp.c" - "./src/maths/KLU/klu.c" - "./src/maths/KLU/klu_analyze.c" - "./src/maths/KLU/klu_sort.c" - "./src/maths/KLU/klu_factor.c" - "./src/maths/KLU/klu_utils.c" - "./src/maths/KLU/klu_kernel.c" - "./src/maths/KLU/klu_scale.c" - "./src/maths/KLU/klu_extract.c" - "./src/maths/KLU/klu_memory.c" - "./src/maths/KLU/klu_diagnostics.c" - "./src/maths/KLU/klu_free_numeric.c" - "./src/maths/KLU/klu_free_symbolic.c" - "./src/maths/KLU/klu_defaults.c" - "./src/maths/KLU/klu_dump.c" - "./src/maths/KLU/klu_tsolve.c" - "./src/maths/KLU/klu_multiply.c" - "./src/maths/KLU/klu_analyze_given.c" - "./src/maths/KLU/klu_refactor.c" - "./src/maths/KLU/klu_solve.c" - "./src/maths/KLU/btf_maxtrans.c" - "./src/maths/KLU/btf_order.c" - "./src/maths/KLU/btf_strongcomp.c" - "./src/maths/KLU/amd_global.c" - "./src/maths/KLU/amd_dump.c" - "./src/maths/KLU/amd_2.c" - "./src/maths/KLU/amd_control.c" - "./src/maths/KLU/amd_aat.c" - "./src/maths/KLU/amd_post_tree.c" - "./src/maths/KLU/amd_order.c" - "./src/maths/KLU/amd_valid.c" - "./src/maths/KLU/amd_preprocess.c" - "./src/maths/KLU/amd_1.c" - "./src/maths/KLU/amd_defaults.c" - "./src/maths/KLU/amd_postorder.c" - "./src/maths/KLU/colamd.c" - "./src/maths/KLU/colamd_global.c" ) + +add_library(ngspice-maths-sparse + "./src/maths/sparse/spextra.c" + "./src/maths/sparse/spbuild.c" + "./src/maths/sparse/spfactor.c" + "./src/maths/sparse/sputils.c" + "./src/maths/sparse/spsolve.c" + "./src/maths/sparse/spalloc.c" + "./src/maths/sparse/spoutput.c" +) + +if(NGSPICE_ENABLE_KLU) + message(STATUS "NGSPICE_ENABLE_KLU is ON") + set(NGSPICE_KLU_VERSIONABLE_SRCS + "./src/maths/KLU/amd_info.c" + "./src/maths/KLU/amd_global.c" + "./src/maths/KLU/amd_dump.c" + "./src/maths/KLU/amd_2.c" + "./src/maths/KLU/amd_control.c" + "./src/maths/KLU/amd_aat.c" + "./src/maths/KLU/amd_post_tree.c" + "./src/maths/KLU/amd_order.c" + "./src/maths/KLU/amd_valid.c" + "./src/maths/KLU/amd_preprocess.c" + "./src/maths/KLU/amd_1.c" + "./src/maths/KLU/amd_defaults.c" + "./src/maths/KLU/amd_postorder.c" + "./src/maths/KLU/btf_maxtrans.c" + "./src/maths/KLU/btf_order.c" + "./src/maths/KLU/btf_strongcomp.c" + "./src/maths/KLU/colamd.c" + "./src/maths/KLU/colamd_global.c" + "./src/maths/KLU/klu_scale.c" + "./src/maths/KLU/klu_solve.c" + "./src/maths/KLU/klu_tsolve.c" + "./src/maths/KLU/klu_free_numeric.c" + "./src/maths/KLU/klu_factor.c" + "./src/maths/KLU/klu_refactor.c" + "./src/maths/KLU/klu_analyze.c" + "./src/maths/KLU/klu_kernel.c" + "./src/maths/KLU/klu.c" + "./src/maths/KLU/klu_diagnostics.c" + "./src/maths/KLU/klu_extract.c" + "./src/maths/KLU/klu_sort.c" + "./src/maths/KLU/klu_utils.c" + "./src/maths/KLU/klu_memory.c" + "./src/maths/KLU/klu_free_symbolic.c" + "./src/maths/KLU/klu_defaults.c" + "./src/maths/KLU/klu_dump.c" + "./src/maths/KLU/klu_multiply.c" + "./src/maths/KLU/klu_analyze_given.c" + ) + add_library(ngspice-maths-klu-float ${NGSPICE_KLU_VERSIONABLE_SRCS}) + add_library(ngspice-maths-klu-complex ${NGSPICE_KLU_VERSIONABLE_SRCS}) + target_compile_definitions(ngspice-maths-klu-complex PRIVATE + -DCOMPLEX + ) + + add_library(ngspice-maths-klu + "./src/maths/KLU/klusmp.c" + ) + target_include_directories(ngspice-maths-klu PRIVATE + "./src/include/ngspice/" + ) + + target_link_libraries(ngspice-maths-klu PRIVATE + ngspice-maths-sparse + ngspice-maths-klu-float + ngspice-maths-klu-complex + ) + target_link_libraries(ngspice-maths PRIVATE ngspice-maths-klu) +else() + target_sources(ngspice-maths PUBLIC + "./src/maths/sparse/spsmp.c" + ) + target_link_libraries(ngspice-maths ngspice-maths-sparse) +endif() + target_include_directories(ngspice-maths PUBLIC - "./src/maths/poly" + "./src/maths/poly/" ) +# --- xspice +if (NGSPICE_ENABLE_XSPICE) + message (STATUS "NGSPICE_ENABLE_XSPICE is ON") + add_library(ngspice-xspice + "./src/xspice/enh/enh.c" + "./src/xspice/enh/enhtrans.c" + "./src/xspice/mif/mif.c" + "./src/xspice/mif/mif_inp2.c" + "./src/xspice/mif/mifask.c" + "./src/xspice/mif/mifbindCSC.c" + "./src/xspice/mif/mifconvt.c" + "./src/xspice/mif/mifdelete.c" + "./src/xspice/mif/mifdestr.c" + "./src/xspice/mif/mifgetmod.c" + "./src/xspice/mif/mifgetvalue.c" + "./src/xspice/mif/mifload.c" + "./src/xspice/mif/mifmask.c" + "./src/xspice/mif/mifmdelete.c" + "./src/xspice/mif/mifmpara.c" + "./src/xspice/mif/mifsetup.c" + "./src/xspice/mif/miftrunc.c" + "./src/xspice/mif/mifutil.c" + "./src/xspice/cm/cm.c" + "./src/xspice/cm/cmevt.c" + "./src/xspice/cm/cmexport.c" + "./src/xspice/cm/cmmeters.c" + "./src/xspice/cm/cmutil.c" + "./src/xspice/evt/evtaccept.c" + "./src/xspice/evt/evtbackup.c" + "./src/xspice/evt/evtcall_hybrids.c" + "./src/xspice/evt/evtcheck_nodes.c" + "./src/xspice/evt/evtdeque.c" + "./src/xspice/evt/evtdest.c" + "./src/xspice/evt/evtdump.c" + "./src/xspice/evt/evtinit.c" + "./src/xspice/evt/evtiter.c" + "./src/xspice/evt/evtload.c" + "./src/xspice/evt/evtnext_time.c" + "./src/xspice/evt/evtnode_copy.c" + "./src/xspice/evt/evtop.c" + "./src/xspice/evt/evtplot.c" + "./src/xspice/evt/evtprint.c" + "./src/xspice/evt/evtqueue.c" + "./src/xspice/evt/evtsetup.c" + "./src/xspice/evt/evtshared.c" + "./src/xspice/evt/evttermi.c" + "./src/xspice/ipc/ipc.c" + "./src/xspice/ipc/ipcaegis.c" + "./src/xspice/ipc/ipcsockets.c" + "./src/xspice/ipc/ipcstdio.c" + "./src/xspice/ipc/ipctiein.c" + "./src/xspice/idn/idndig.c" + "./src/xspice/cmpp/file_buffer.c" + "./src/xspice/cmpp/ifs_lex.c" + "./src/xspice/cmpp/ifs_yacc.c" + "./src/xspice/cmpp/main.c" + "./src/xspice/cmpp/mod_lex.c" + "./src/xspice/cmpp/mod_yacc.c" + "./src/xspice/cmpp/pp_ifs.c" + "./src/xspice/cmpp/pp_lst.c" + "./src/xspice/cmpp/pp_mod.c" + "./src/xspice/cmpp/read_ifs.c" + "./src/xspice/cmpp/util.c" + "./src/xspice/cmpp/writ_ifs.c" + ) + + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + target_compile_definitions(ngspice-xspice PRIVATE + YY_NO_UNISTD_H + ) + endif() + + target_include_directories(ngspice-xspice PUBLIC + "./src/include/ngspice" + "./src/spicelib/devices/" + "./src/xspice/spice2poly/" + "./src/xspice/icm/spice2poly/" + ) + +endif() + +# --- Spicelib add_library(ngspice-spicelib "./src/ngspice.c" + "./src/ciderlib/input/bdryset.c" + "./src/ciderlib/input/boundary.c" + "./src/ciderlib/input/cards.c" + "./src/ciderlib/input/contact.c" + "./src/ciderlib/input/contset.c" + "./src/ciderlib/input/domain.c" + "./src/ciderlib/input/domnset.c" + "./src/ciderlib/input/doping.c" + "./src/ciderlib/input/dopset.c" + "./src/ciderlib/input/elctset.c" + "./src/ciderlib/input/electrod.c" + "./src/ciderlib/input/material.c" + "./src/ciderlib/input/matlset.c" + "./src/ciderlib/input/mesh.c" + "./src/ciderlib/input/meshset.c" + "./src/ciderlib/input/method.c" + "./src/ciderlib/input/mobility.c" + "./src/ciderlib/input/mobset.c" + "./src/ciderlib/input/models.c" + "./src/ciderlib/input/modlset.c" + "./src/ciderlib/input/optionsc.c" + "./src/ciderlib/input/outpset.c" + "./src/ciderlib/input/output.c" + "./src/ciderlib/oned/oneadmit.c" + "./src/ciderlib/oned/oneaval.c" + "./src/ciderlib/oned/onecond.c" + "./src/ciderlib/oned/onecont.c" + "./src/ciderlib/oned/onedest.c" + "./src/ciderlib/oned/onedopng.c" + "./src/ciderlib/oned/onefreez.c" + "./src/ciderlib/oned/onemesh.c" + "./src/ciderlib/oned/onepoiss.c" + "./src/ciderlib/oned/oneprint.c" + "./src/ciderlib/oned/oneproj.c" + "./src/ciderlib/oned/oneread.c" + "./src/ciderlib/oned/onesetup.c" + "./src/ciderlib/oned/onesolve.c" + "./src/ciderlib/support/database.c" + "./src/ciderlib/support/devprint.c" + "./src/ciderlib/support/geominfo.c" + "./src/ciderlib/support/globals.c" + "./src/ciderlib/support/integset.c" + "./src/ciderlib/support/integuse.c" + "./src/ciderlib/support/logfile.c" + "./src/ciderlib/support/mater.c" + "./src/ciderlib/support/misc.c" + "./src/ciderlib/support/mobil.c" + "./src/ciderlib/support/recomb.c" + "./src/ciderlib/support/suprem.c" + "./src/ciderlib/support/suprmitf.c" + "./src/ciderlib/twod/twoadmit.c" + "./src/ciderlib/twod/twoaval.c" + "./src/ciderlib/twod/twocond.c" + "./src/ciderlib/twod/twocont.c" + "./src/ciderlib/twod/twocurr.c" + "./src/ciderlib/twod/twodest.c" + "./src/ciderlib/twod/twodopng.c" + "./src/ciderlib/twod/twoelect.c" + "./src/ciderlib/twod/twofield.c" + "./src/ciderlib/twod/twomesh.c" + "./src/ciderlib/twod/twomobdv.c" + "./src/ciderlib/twod/twomobfn.c" + "./src/ciderlib/twod/twomobil.c" + "./src/ciderlib/twod/twoncont.c" + "./src/ciderlib/twod/twopcont.c" + "./src/ciderlib/twod/twopoiss.c" + "./src/ciderlib/twod/twoprint.c" + "./src/ciderlib/twod/twoproj.c" + "./src/ciderlib/twod/tworead.c" + "./src/ciderlib/twod/twosetbc.c" + "./src/ciderlib/twod/twosetup.c" + "./src/ciderlib/twod/twosolve.c" + "./src/spicelib/devices/asrc/asrc.c" + "./src/spicelib/devices/asrc/asrcacld.c" + "./src/spicelib/devices/asrc/asrcask.c" + "./src/spicelib/devices/asrc/asrcconv.c" + "./src/spicelib/devices/asrc/asrcdel.c" + "./src/spicelib/devices/asrc/asrcdest.c" + "./src/spicelib/devices/asrc/asrcfbr.c" + "./src/spicelib/devices/asrc/asrcinit.c" + "./src/spicelib/devices/asrc/asrcload.c" + "./src/spicelib/devices/asrc/asrcpar.c" + "./src/spicelib/devices/asrc/asrcpzld.c" + "./src/spicelib/devices/asrc/asrcset.c" + "./src/spicelib/devices/asrc/asrctemp.c" + "./src/spicelib/devices/bjt/bjt.c" + "./src/spicelib/devices/bjt/bjtacld.c" + "./src/spicelib/devices/bjt/bjtask.c" + "./src/spicelib/devices/bjt/bjtconv.c" + "./src/spicelib/devices/bjt/bjtdel.c" + "./src/spicelib/devices/bjt/bjtdisto.c" + "./src/spicelib/devices/bjt/bjtdset.c" + "./src/spicelib/devices/bjt/bjtgetic.c" + "./src/spicelib/devices/bjt/bjtinit.c" + "./src/spicelib/devices/bjt/bjtload.c" + "./src/spicelib/devices/bjt/bjtmask.c" + "./src/spicelib/devices/bjt/bjtmpar.c" + "./src/spicelib/devices/bjt/bjtnoise.c" + "./src/spicelib/devices/bjt/bjtparam.c" + "./src/spicelib/devices/bjt/bjtpzld.c" + "./src/spicelib/devices/bjt/bjtsacl.c" + "./src/spicelib/devices/bjt/bjtsetup.c" + "./src/spicelib/devices/bjt/bjtsload.c" + "./src/spicelib/devices/bjt/bjtsoachk.c" + "./src/spicelib/devices/bjt/bjtsprt.c" + "./src/spicelib/devices/bjt/bjtsset.c" + "./src/spicelib/devices/bjt/bjtsupd.c" + "./src/spicelib/devices/bjt/bjttemp.c" + "./src/spicelib/devices/bjt/bjttrunc.c" + "./src/spicelib/devices/bsim1/b1.c" + "./src/spicelib/devices/bsim1/b1acld.c" + "./src/spicelib/devices/bsim1/b1ask.c" + "./src/spicelib/devices/bsim1/b1cvtest.c" + "./src/spicelib/devices/bsim1/b1disto.c" + "./src/spicelib/devices/bsim1/b1dset.c" + "./src/spicelib/devices/bsim1/b1eval.c" + "./src/spicelib/devices/bsim1/b1getic.c" + "./src/spicelib/devices/bsim1/b1ld.c" + "./src/spicelib/devices/bsim1/b1mask.c" + "./src/spicelib/devices/bsim1/b1moscap.c" + "./src/spicelib/devices/bsim1/b1mpar.c" + "./src/spicelib/devices/bsim1/b1noi.c" + "./src/spicelib/devices/bsim1/b1par.c" + "./src/spicelib/devices/bsim1/b1pzld.c" + "./src/spicelib/devices/bsim1/b1set.c" + "./src/spicelib/devices/bsim1/b1temp.c" + "./src/spicelib/devices/bsim1/b1trunc.c" + "./src/spicelib/devices/bsim1/bsim1init.c" + "./src/spicelib/devices/bsim2/b2.c" + "./src/spicelib/devices/bsim2/b2acld.c" + "./src/spicelib/devices/bsim2/b2ask.c" + "./src/spicelib/devices/bsim2/b2cvtest.c" + "./src/spicelib/devices/bsim2/b2eval.c" + "./src/spicelib/devices/bsim2/b2getic.c" + "./src/spicelib/devices/bsim2/b2ld.c" + "./src/spicelib/devices/bsim2/b2mask.c" + "./src/spicelib/devices/bsim2/b2moscap.c" + "./src/spicelib/devices/bsim2/b2mpar.c" + "./src/spicelib/devices/bsim2/b2noi.c" + "./src/spicelib/devices/bsim2/b2par.c" + "./src/spicelib/devices/bsim2/b2pzld.c" + "./src/spicelib/devices/bsim2/b2set.c" + "./src/spicelib/devices/bsim2/b2temp.c" + "./src/spicelib/devices/bsim2/b2trunc.c" + "./src/spicelib/devices/bsim2/bsim2init.c" + "./src/spicelib/devices/bsim3/b3.c" + "./src/spicelib/devices/bsim3/b3acld.c" + "./src/spicelib/devices/bsim3/b3ask.c" + "./src/spicelib/devices/bsim3/b3check.c" + "./src/spicelib/devices/bsim3/b3cvtest.c" + "./src/spicelib/devices/bsim3/b3getic.c" + "./src/spicelib/devices/bsim3/b3ld.c" + "./src/spicelib/devices/bsim3/b3mask.c" + "./src/spicelib/devices/bsim3/b3mdel.c" + "./src/spicelib/devices/bsim3/b3mpar.c" + "./src/spicelib/devices/bsim3/b3noi.c" + "./src/spicelib/devices/bsim3/b3par.c" + "./src/spicelib/devices/bsim3/b3pzld.c" + "./src/spicelib/devices/bsim3/b3set.c" + "./src/spicelib/devices/bsim3/b3soachk.c" + "./src/spicelib/devices/bsim3/b3temp.c" + "./src/spicelib/devices/bsim3/b3trunc.c" + "./src/spicelib/devices/bsim3/bsim3init.c" + "./src/spicelib/devices/bsim3soi_dd/b3soidd.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddacld.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddask.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddcheck.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddcvtest.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddgetic.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddinit.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddld.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddmask.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddmpar.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddpar.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddset.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddtrunc.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifd.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdacld.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdask.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdcheck.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdcvtest.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdgetic.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdinit.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdld.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdmask.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdmpar.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdpar.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdset.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdtrunc.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipd.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdacld.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdask.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdcheck.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdcvtest.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdgetic.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdinit.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdld.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdmask.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdmpar.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdpar.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdset.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdtrunc.c" + "./src/spicelib/devices/bsim3v0/b3v0.c" + "./src/spicelib/devices/bsim3v0/b3v0acld.c" + "./src/spicelib/devices/bsim3v0/b3v0ask.c" + "./src/spicelib/devices/bsim3v0/b3v0cvtest.c" + "./src/spicelib/devices/bsim3v0/b3v0getic.c" + "./src/spicelib/devices/bsim3v0/b3v0ld.c" + "./src/spicelib/devices/bsim3v0/b3v0mask.c" + "./src/spicelib/devices/bsim3v0/b3v0mpar.c" + "./src/spicelib/devices/bsim3v0/b3v0noi.c" + "./src/spicelib/devices/bsim3v0/b3v0par.c" + "./src/spicelib/devices/bsim3v0/b3v0pzld.c" + "./src/spicelib/devices/bsim3v0/b3v0set.c" + "./src/spicelib/devices/bsim3v0/b3v0temp.c" + "./src/spicelib/devices/bsim3v0/b3v0trunc.c" + "./src/spicelib/devices/bsim3v0/bsim3v0init.c" + "./src/spicelib/devices/bsim3v1/b3v1.c" + "./src/spicelib/devices/bsim3v1/b3v1acld.c" + "./src/spicelib/devices/bsim3v1/b3v1ask.c" + "./src/spicelib/devices/bsim3v1/b3v1check.c" + "./src/spicelib/devices/bsim3v1/b3v1cvtest.c" + "./src/spicelib/devices/bsim3v1/b3v1getic.c" + "./src/spicelib/devices/bsim3v1/b3v1ld.c" + "./src/spicelib/devices/bsim3v1/b3v1mask.c" + "./src/spicelib/devices/bsim3v1/b3v1mpar.c" + "./src/spicelib/devices/bsim3v1/b3v1noi.c" + "./src/spicelib/devices/bsim3v1/b3v1par.c" + "./src/spicelib/devices/bsim3v1/b3v1pzld.c" + "./src/spicelib/devices/bsim3v1/b3v1set.c" + "./src/spicelib/devices/bsim3v1/b3v1temp.c" + "./src/spicelib/devices/bsim3v1/b3v1trunc.c" + "./src/spicelib/devices/bsim3v1/bsim3v1init.c" + "./src/spicelib/devices/bsim3v32/b3v32.c" + "./src/spicelib/devices/bsim3v32/b3v32acld.c" + "./src/spicelib/devices/bsim3v32/b3v32ask.c" + "./src/spicelib/devices/bsim3v32/b3v32check.c" + "./src/spicelib/devices/bsim3v32/b3v32cvtest.c" + "./src/spicelib/devices/bsim3v32/b3v32getic.c" + "./src/spicelib/devices/bsim3v32/b3v32ld.c" + "./src/spicelib/devices/bsim3v32/b3v32mask.c" + "./src/spicelib/devices/bsim3v32/b3v32mdel.c" + "./src/spicelib/devices/bsim3v32/b3v32mpar.c" + "./src/spicelib/devices/bsim3v32/b3v32noi.c" + "./src/spicelib/devices/bsim3v32/b3v32par.c" + "./src/spicelib/devices/bsim3v32/b3v32pzld.c" + "./src/spicelib/devices/bsim3v32/b3v32set.c" + "./src/spicelib/devices/bsim3v32/b3v32soachk.c" + "./src/spicelib/devices/bsim3v32/b3v32temp.c" + "./src/spicelib/devices/bsim3v32/b3v32trunc.c" + "./src/spicelib/devices/bsim3v32/bsim3v32init.c" + "./src/spicelib/devices/bsim4/b4.c" + "./src/spicelib/devices/bsim4/b4acld.c" + "./src/spicelib/devices/bsim4/b4ask.c" + "./src/spicelib/devices/bsim4/b4check.c" + "./src/spicelib/devices/bsim4/b4cvtest.c" + "./src/spicelib/devices/bsim4/b4geo.c" + "./src/spicelib/devices/bsim4/b4getic.c" + "./src/spicelib/devices/bsim4/b4ld.c" + "./src/spicelib/devices/bsim4/b4mask.c" + "./src/spicelib/devices/bsim4/b4mdel.c" + "./src/spicelib/devices/bsim4/b4mpar.c" + "./src/spicelib/devices/bsim4/b4noi.c" + "./src/spicelib/devices/bsim4/b4par.c" + "./src/spicelib/devices/bsim4/b4pzld.c" + "./src/spicelib/devices/bsim4/b4set.c" + "./src/spicelib/devices/bsim4/b4soachk.c" + "./src/spicelib/devices/bsim4/b4temp.c" + "./src/spicelib/devices/bsim4/b4trunc.c" + "./src/spicelib/devices/bsim4/bsim4init.c" + "./src/spicelib/devices/bsim4v5/b4v5.c" + "./src/spicelib/devices/bsim4v5/b4v5acld.c" + "./src/spicelib/devices/bsim4v5/b4v5ask.c" + "./src/spicelib/devices/bsim4v5/b4v5check.c" + "./src/spicelib/devices/bsim4v5/b4v5cvtest.c" + "./src/spicelib/devices/bsim4v5/b4v5geo.c" + "./src/spicelib/devices/bsim4v5/b4v5getic.c" + "./src/spicelib/devices/bsim4v5/b4v5ld.c" + "./src/spicelib/devices/bsim4v5/b4v5mask.c" + "./src/spicelib/devices/bsim4v5/b4v5mdel.c" + "./src/spicelib/devices/bsim4v5/b4v5mpar.c" + "./src/spicelib/devices/bsim4v5/b4v5noi.c" + "./src/spicelib/devices/bsim4v5/b4v5par.c" + "./src/spicelib/devices/bsim4v5/b4v5pzld.c" + "./src/spicelib/devices/bsim4v5/b4v5set.c" + "./src/spicelib/devices/bsim4v5/b4v5soachk.c" + "./src/spicelib/devices/bsim4v5/b4v5temp.c" + "./src/spicelib/devices/bsim4v5/b4v5trunc.c" + "./src/spicelib/devices/bsim4v5/bsim4v5init.c" + "./src/spicelib/devices/bsim4v6/b4v6.c" + "./src/spicelib/devices/bsim4v6/b4v6acld.c" + "./src/spicelib/devices/bsim4v6/b4v6ask.c" + "./src/spicelib/devices/bsim4v6/b4v6check.c" + "./src/spicelib/devices/bsim4v6/b4v6cvtest.c" + "./src/spicelib/devices/bsim4v6/b4v6geo.c" + "./src/spicelib/devices/bsim4v6/b4v6getic.c" + "./src/spicelib/devices/bsim4v6/b4v6ld.c" + "./src/spicelib/devices/bsim4v6/b4v6mask.c" + "./src/spicelib/devices/bsim4v6/b4v6mdel.c" + "./src/spicelib/devices/bsim4v6/b4v6mpar.c" + "./src/spicelib/devices/bsim4v6/b4v6noi.c" + "./src/spicelib/devices/bsim4v6/b4v6par.c" + "./src/spicelib/devices/bsim4v6/b4v6pzld.c" + "./src/spicelib/devices/bsim4v6/b4v6set.c" + "./src/spicelib/devices/bsim4v6/b4v6soachk.c" + "./src/spicelib/devices/bsim4v6/b4v6temp.c" + "./src/spicelib/devices/bsim4v6/b4v6trunc.c" + "./src/spicelib/devices/bsim4v6/bsim4v6init.c" + "./src/spicelib/devices/bsim4v7/b4v7.c" + "./src/spicelib/devices/bsim4v7/b4v7acld.c" + "./src/spicelib/devices/bsim4v7/b4v7ask.c" + "./src/spicelib/devices/bsim4v7/b4v7check.c" + "./src/spicelib/devices/bsim4v7/b4v7cvtest.c" + "./src/spicelib/devices/bsim4v7/b4v7geo.c" + "./src/spicelib/devices/bsim4v7/b4v7getic.c" + "./src/spicelib/devices/bsim4v7/b4v7ld.c" + "./src/spicelib/devices/bsim4v7/b4v7mask.c" + "./src/spicelib/devices/bsim4v7/b4v7mdel.c" + "./src/spicelib/devices/bsim4v7/b4v7mpar.c" + "./src/spicelib/devices/bsim4v7/b4v7noi.c" + "./src/spicelib/devices/bsim4v7/b4v7par.c" + "./src/spicelib/devices/bsim4v7/b4v7pzld.c" + "./src/spicelib/devices/bsim4v7/b4v7set.c" + "./src/spicelib/devices/bsim4v7/b4v7soachk.c" + "./src/spicelib/devices/bsim4v7/b4v7temp.c" + "./src/spicelib/devices/bsim4v7/b4v7trunc.c" + "./src/spicelib/devices/bsim4v7/bsim4v7init.c" + "./src/spicelib/devices/bsimsoi/b4soi.c" + "./src/spicelib/devices/bsimsoi/b4soiacld.c" + "./src/spicelib/devices/bsimsoi/b4soiask.c" + "./src/spicelib/devices/bsimsoi/b4soicheck.c" + "./src/spicelib/devices/bsimsoi/b4soicvtest.c" + "./src/spicelib/devices/bsimsoi/b4soigetic.c" + "./src/spicelib/devices/bsimsoi/b4soiinit.c" + "./src/spicelib/devices/bsimsoi/b4soild.c" + "./src/spicelib/devices/bsimsoi/b4soimask.c" + "./src/spicelib/devices/bsimsoi/b4soimdel.c" + "./src/spicelib/devices/bsimsoi/b4soimpar.c" + "./src/spicelib/devices/bsimsoi/b4soinoi.c" + "./src/spicelib/devices/bsimsoi/b4soipar.c" + "./src/spicelib/devices/bsimsoi/b4soipzld.c" + "./src/spicelib/devices/bsimsoi/b4soiset.c" + "./src/spicelib/devices/bsimsoi/b4soisoachk.c" + "./src/spicelib/devices/bsimsoi/b4soitemp.c" + "./src/spicelib/devices/bsimsoi/b4soitrunc.c" + "./src/spicelib/devices/cap/cap.c" + "./src/spicelib/devices/cap/capacld.c" + "./src/spicelib/devices/cap/capask.c" + "./src/spicelib/devices/cap/capgetic.c" + "./src/spicelib/devices/cap/capinit.c" + "./src/spicelib/devices/cap/capload.c" + "./src/spicelib/devices/cap/capmask.c" + "./src/spicelib/devices/cap/capmpar.c" + "./src/spicelib/devices/cap/capparam.c" + "./src/spicelib/devices/cap/cappzld.c" + "./src/spicelib/devices/cap/capsacl.c" + "./src/spicelib/devices/cap/capsetup.c" + "./src/spicelib/devices/cap/capsload.c" + "./src/spicelib/devices/cap/capsoachk.c" + "./src/spicelib/devices/cap/capsprt.c" + "./src/spicelib/devices/cap/capsset.c" + "./src/spicelib/devices/cap/capsupd.c" + "./src/spicelib/devices/cap/captemp.c" + "./src/spicelib/devices/cap/captrunc.c" + "./src/spicelib/devices/cccs/cccs.c" + "./src/spicelib/devices/cccs/cccsask.c" + "./src/spicelib/devices/cccs/cccsinit.c" + "./src/spicelib/devices/cccs/cccsload.c" + "./src/spicelib/devices/cccs/cccspar.c" + "./src/spicelib/devices/cccs/cccspzld.c" + "./src/spicelib/devices/cccs/cccssacl.c" + "./src/spicelib/devices/cccs/cccsset.c" + "./src/spicelib/devices/cccs/cccssld.c" + "./src/spicelib/devices/cccs/cccssprt.c" + "./src/spicelib/devices/cccs/cccssset.c" + "./src/spicelib/devices/ccvs/ccvs.c" + "./src/spicelib/devices/ccvs/ccvsask.c" + "./src/spicelib/devices/ccvs/ccvsfbr.c" + "./src/spicelib/devices/ccvs/ccvsinit.c" + "./src/spicelib/devices/ccvs/ccvsload.c" + "./src/spicelib/devices/ccvs/ccvspar.c" + "./src/spicelib/devices/ccvs/ccvspzld.c" + "./src/spicelib/devices/ccvs/ccvssacl.c" + "./src/spicelib/devices/ccvs/ccvsset.c" + "./src/spicelib/devices/ccvs/ccvssld.c" + "./src/spicelib/devices/ccvs/ccvssprt.c" + "./src/spicelib/devices/ccvs/ccvssset.c" + "./src/spicelib/devices/cktaccept.c" + "./src/spicelib/devices/cktask.c" + "./src/spicelib/devices/cktbindnode.c" + "./src/spicelib/devices/cktcrte.c" + "./src/spicelib/devices/cktfinddev.c" + "./src/spicelib/devices/cktinit.c" + "./src/spicelib/devices/cktsoachk.c" + "./src/spicelib/devices/cpl/cpl.c" + "./src/spicelib/devices/cpl/cplask.c" + "./src/spicelib/devices/cpl/cpldelete.c" + "./src/spicelib/devices/cpl/cplhash.c" + "./src/spicelib/devices/cpl/cplinit.c" + "./src/spicelib/devices/cpl/cplload.c" + "./src/spicelib/devices/cpl/cplmask.c" + "./src/spicelib/devices/cpl/cplmdel.c" + "./src/spicelib/devices/cpl/cplmpar.c" + "./src/spicelib/devices/cpl/cplparam.c" + "./src/spicelib/devices/cpl/cplsetup.c" + "./src/spicelib/devices/csw/csw.c" + "./src/spicelib/devices/csw/cswacld.c" + "./src/spicelib/devices/csw/cswask.c" + "./src/spicelib/devices/csw/cswinit.c" + "./src/spicelib/devices/csw/cswload.c" + "./src/spicelib/devices/csw/cswmask.c" + "./src/spicelib/devices/csw/cswmpar.c" + "./src/spicelib/devices/csw/cswnoise.c" + "./src/spicelib/devices/csw/cswbindCSC.c" + "./src/spicelib/devices/bsim4v7/b4v7bindCSC.c" + "./src/spicelib/devices/bsimsoi/b4soibindCSC.c" + "./src/spicelib/devices/cap/capbindCSC.c" + "./src/spicelib/devices/cccs/cccsbindCSC.c" + "./src/spicelib/devices/ccvs/ccvsbindCSC.c" + "./src/spicelib/devices/cpl/cplbindCSC.c" + "./src/spicelib/devices/asrc/asrcbindCSC.c" + "./src/spicelib/devices/bjt/bjtbindCSC.c" + "./src/spicelib/devices/bsim1/b1bindCSC.c" + "./src/spicelib/devices/bsim2/b2bindCSC.c" + "./src/spicelib/devices/bsim3/b3bindCSC.c" + "./src/spicelib/devices/bsim3soi_dd/b3soiddbindCSC.c" + "./src/spicelib/devices/bsim3soi_fd/b3soifdbindCSC.c" + "./src/spicelib/devices/bsim3soi_pd/b3soipdbindCSC.c" + "./src/spicelib/devices/bsim3v0/b3v0bindCSC.c" + "./src/spicelib/devices/bsim3v1/b3v1bindCSC.c" + "./src/spicelib/devices/bsim3v32/b3v32bindCSC.c" + "./src/spicelib/devices/bsim4/b4bindCSC.c" + "./src/spicelib/devices/bsim4v5/b4v5bindCSC.c" + "./src/spicelib/devices/bsim4v6/b4v6bindCSC.c" + "./src/spicelib/devices/hfet1/hfetbindCSC.c" + "./src/spicelib/devices/tra/trabindCSC.c" + "./src/spicelib/devices/vsrc/vsrcbindCSC.c" + "./src/spicelib/devices/vdmos/vdmosbindCSC.c" + "./src/spicelib/devices/vcvs/vcvsbindCSC.c" + "./src/spicelib/devices/vccs/vccsbindCSC.c" + "./src/spicelib/devices/vbic/vbicbindCSC.c" + "./src/spicelib/devices/txl/txlbindCSC.c" + "./src/spicelib/devices/sw/swbindCSC.c" + "./src/spicelib/devices/soi3/soi3bindCSC.c" + "./src/spicelib/devices/res/resbindCSC.c" + "./src/spicelib/devices/numos/numosbindCSC.c" + "./src/spicelib/devices/numd2/numd2bindCSC.c" + "./src/spicelib/devices/numd/numdbindCSC.c" + "./src/spicelib/devices/nbjt2/nbjt2bindCSC.c" + "./src/spicelib/devices/nbjt/nbjtbindCSC.c" + "./src/spicelib/devices/mos9/mos9bindCSC.c" + "./src/spicelib/devices/mos6/mos6bindCSC.c" + "./src/spicelib/devices/mos3/mos3bindCSC.c" + "./src/spicelib/devices/mos2/mos2bindCSC.c" + "./src/spicelib/devices/mos1/mos1bindCSC.c" + "./src/spicelib/devices/mesa/mesabindCSC.c" + "./src/spicelib/devices/mes/mesbindCSC.c" + "./src/spicelib/devices/ltra/ltrabindCSC.c" + "./src/spicelib/devices/jfet2/jfet2bindCSC.c" + "./src/spicelib/devices/jfet/jfetbindCSC.c" + "./src/spicelib/devices/ind/mutbindCSC.c" + "./src/spicelib/devices/ind/indbindCSC.c" + "./src/spicelib/devices/hisimhv2/hsmhv2bindCSC.c" + "./src/spicelib/devices/hisimhv1/hsmhvbindCSC.c" + "./src/spicelib/devices/hicum2/hicum2bindCSC.c" + "./src/spicelib/devices/hisim2/hsm2bindCSC.c" + "./src/spicelib/devices/dio/diobindCSC.c" + "./src/spicelib/devices/csw/cswparam.c" + "./src/spicelib/devices/csw/cswpzld.c" + "./src/spicelib/devices/csw/cswsetup.c" + "./src/spicelib/devices/csw/cswtrunc.c" + "./src/spicelib/devices/dev.c" + "./src/spicelib/devices/devsup.c" + "./src/spicelib/devices/dio/dio.c" + "./src/spicelib/devices/dio/dioacld.c" + "./src/spicelib/devices/dio/dioask.c" + "./src/spicelib/devices/dio/dioconv.c" + "./src/spicelib/devices/dio/diodisto.c" + "./src/spicelib/devices/dio/diodset.c" + "./src/spicelib/devices/dio/diogetic.c" + "./src/spicelib/devices/dio/dioinit.c" + "./src/spicelib/devices/dio/dioload.c" + "./src/spicelib/devices/dio/diomask.c" + "./src/spicelib/devices/dio/diompar.c" + "./src/spicelib/devices/dio/dionoise.c" + "./src/spicelib/devices/dio/dioparam.c" + "./src/spicelib/devices/dio/diopzld.c" + "./src/spicelib/devices/dio/diosacl.c" + "./src/spicelib/devices/dio/diosetup.c" + "./src/spicelib/devices/dio/diosload.c" + "./src/spicelib/devices/dio/diosoachk.c" + "./src/spicelib/devices/dio/diosprt.c" + "./src/spicelib/devices/dio/diosset.c" + "./src/spicelib/devices/dio/diosupd.c" + "./src/spicelib/devices/dio/diotemp.c" + "./src/spicelib/devices/dio/diotrunc.c" + "./src/spicelib/devices/hfet1/hfet.c" + "./src/spicelib/devices/hfet1/hfetacl.c" + "./src/spicelib/devices/hfet1/hfetask.c" + "./src/spicelib/devices/hfet1/hfetgetic.c" + "./src/spicelib/devices/hfet1/hfetinit.c" + "./src/spicelib/devices/hfet1/hfetload.c" + "./src/spicelib/devices/hfet1/hfetmask.c" + "./src/spicelib/devices/hfet1/hfetmpar.c" + "./src/spicelib/devices/hfet1/hfetparam.c" + "./src/spicelib/devices/hfet1/hfetpzl.c" + "./src/spicelib/devices/hfet1/hfetsetup.c" + "./src/spicelib/devices/hfet1/hfettemp.c" + "./src/spicelib/devices/hfet1/hfettrunc.c" + "./src/spicelib/devices/hfet2/hfet2.c" + "./src/spicelib/devices/hfet2/hfet2acl.c" + "./src/spicelib/devices/hfet2/hfet2ask.c" + "./src/spicelib/devices/hfet2/hfet2bindCSC.c" + "./src/spicelib/devices/hfet2/hfet2getic.c" + "./src/spicelib/devices/hfet2/hfet2init.c" + "./src/spicelib/devices/hfet2/hfet2load.c" + "./src/spicelib/devices/hfet2/hfet2mask.c" + "./src/spicelib/devices/hfet2/hfet2mpar.c" + "./src/spicelib/devices/hfet2/hfet2param.c" + "./src/spicelib/devices/hfet2/hfet2pzl.c" + "./src/spicelib/devices/hfet2/hfet2setup.c" + "./src/spicelib/devices/hfet2/hfet2temp.c" + "./src/spicelib/devices/hfet2/hfet2trunc.c" + "./src/spicelib/devices/hicum2/hicum2.c" + "./src/spicelib/devices/hicum2/hicum2acld.c" + "./src/spicelib/devices/hicum2/hicum2ask.c" + "./src/spicelib/devices/hicum2/hicumL2.cpp" + "./src/spicelib/devices/hicum2/hicumL2temp.cpp" + "./src/spicelib/devices/hicum2/hicum2conv.c" + "./src/spicelib/devices/hicum2/hicum2getic.c" + "./src/spicelib/devices/hicum2/hicum2init.c" + "./src/spicelib/devices/hicum2/hicum2mask.c" + "./src/spicelib/devices/hicum2/hicum2mpar.c" + "./src/spicelib/devices/hicum2/hicum2noise.c" + "./src/spicelib/devices/hicum2/hicum2param.c" + "./src/spicelib/devices/hicum2/hicum2pzld.c" + "./src/spicelib/devices/hicum2/hicum2setup.c" + "./src/spicelib/devices/hicum2/hicum2soachk.c" + "./src/spicelib/devices/hicum2/hicum2trunc.c" + "./src/spicelib/devices/hisim2/hsm2.c" + "./src/spicelib/devices/hisim2/hsm2acld.c" + "./src/spicelib/devices/hisim2/hsm2ask.c" + "./src/spicelib/devices/hisim2/hsm2cvtest.c" + "./src/spicelib/devices/hisim2/hsm2eval.c" + "./src/spicelib/devices/hisim2/hsm2getic.c" + "./src/spicelib/devices/hisim2/hsm2init.c" + "./src/spicelib/devices/hisim2/hsm2ld.c" + "./src/spicelib/devices/hisim2/hsm2mask.c" + "./src/spicelib/devices/hisim2/hsm2mdel.c" + "./src/spicelib/devices/hisim2/hsm2mpar.c" + "./src/spicelib/devices/hisim2/hsm2noi.c" + "./src/spicelib/devices/hisim2/hsm2par.c" + "./src/spicelib/devices/hisim2/hsm2pzld.c" + "./src/spicelib/devices/hisim2/hsm2set.c" + "./src/spicelib/devices/hisim2/hsm2soachk.c" + "./src/spicelib/devices/hisim2/hsm2temp.c" + "./src/spicelib/devices/hisim2/hsm2trunc.c" + "./src/spicelib/devices/hisimhv1/hsmhv.c" + "./src/spicelib/devices/hisimhv1/hsmhvacld.c" + "./src/spicelib/devices/hisimhv1/hsmhvask.c" + "./src/spicelib/devices/hisimhv1/hsmhvcvtest.c" + "./src/spicelib/devices/hisimhv1/hsmhveval.c" + "./src/spicelib/devices/hisimhv1/hsmhvgetic.c" + "./src/spicelib/devices/hisimhv1/hsmhvinit.c" + "./src/spicelib/devices/hisimhv1/hsmhvld.c" + "./src/spicelib/devices/hisimhv1/hsmhvmask.c" + "./src/spicelib/devices/hisimhv1/hsmhvmpar.c" + "./src/spicelib/devices/hisimhv1/hsmhvnoi.c" + "./src/spicelib/devices/hisimhv1/hsmhvpar.c" + "./src/spicelib/devices/hisimhv1/hsmhvpzld.c" + "./src/spicelib/devices/hisimhv1/hsmhvset.c" + "./src/spicelib/devices/hisimhv1/hsmhvsoachk.c" + "./src/spicelib/devices/hisimhv1/hsmhvtemp.c" + "./src/spicelib/devices/hisimhv1/hsmhvtrunc.c" + "./src/spicelib/devices/hisimhv2/hsmhv2.c" + "./src/spicelib/devices/hisimhv2/hsmhv2acld.c" + "./src/spicelib/devices/hisimhv2/hsmhv2ask.c" + "./src/spicelib/devices/hisimhv2/hsmhv2cvtest.c" + "./src/spicelib/devices/hisimhv2/hsmhv2eval.c" + "./src/spicelib/devices/hisimhv2/hsmhv2eval_dio.c" + "./src/spicelib/devices/hisimhv2/hsmhv2eval_rdrift.c" + "./src/spicelib/devices/hisimhv2/hsmhv2getic.c" + "./src/spicelib/devices/hisimhv2/hsmhv2init.c" + "./src/spicelib/devices/hisimhv2/hsmhv2ld.c" + "./src/spicelib/devices/hisimhv2/hsmhv2mask.c" + "./src/spicelib/devices/hisimhv2/hsmhv2mpar.c" + "./src/spicelib/devices/hisimhv2/hsmhv2noi.c" + "./src/spicelib/devices/hisimhv2/hsmhv2par.c" + "./src/spicelib/devices/hisimhv2/hsmhv2pzld.c" + "./src/spicelib/devices/hisimhv2/hsmhv2set.c" + "./src/spicelib/devices/hisimhv2/hsmhv2soachk.c" + "./src/spicelib/devices/hisimhv2/hsmhv2temp.c" + "./src/spicelib/devices/hisimhv2/hsmhv2trunc.c" + "./src/spicelib/devices/ind/ind.c" + "./src/spicelib/devices/ind/indacld.c" + "./src/spicelib/devices/ind/indask.c" + "./src/spicelib/devices/ind/indinit.c" + "./src/spicelib/devices/ind/indload.c" + "./src/spicelib/devices/ind/indmask.c" + "./src/spicelib/devices/ind/indmpar.c" + "./src/spicelib/devices/ind/indparam.c" + "./src/spicelib/devices/ind/indpzld.c" + "./src/spicelib/devices/ind/indsacl.c" + "./src/spicelib/devices/ind/indsetup.c" + "./src/spicelib/devices/ind/indsload.c" + "./src/spicelib/devices/ind/indsprt.c" + "./src/spicelib/devices/ind/indsset.c" + "./src/spicelib/devices/ind/indsupd.c" + "./src/spicelib/devices/ind/indtemp.c" + "./src/spicelib/devices/ind/indtrunc.c" + "./src/spicelib/devices/ind/mutacld.c" + "./src/spicelib/devices/ind/mutask.c" + "./src/spicelib/devices/ind/mutparam.c" + "./src/spicelib/devices/ind/mutpzld.c" + "./src/spicelib/devices/ind/mutsetup.c" + "./src/spicelib/devices/ind/mutsprt.c" + "./src/spicelib/devices/ind/mutsset.c" + "./src/spicelib/devices/ind/muttemp.c" + "./src/spicelib/devices/isrc/isrc.c" + "./src/spicelib/devices/isrc/isrcacct.c" + "./src/spicelib/devices/isrc/isrcacld.c" + "./src/spicelib/devices/isrc/isrcask.c" + "./src/spicelib/devices/isrc/isrcdel.c" + "./src/spicelib/devices/isrc/isrcinit.c" + "./src/spicelib/devices/isrc/isrcload.c" + "./src/spicelib/devices/isrc/isrcpar.c" + "./src/spicelib/devices/isrc/isrctemp.c" + "./src/spicelib/devices/jfet/jfet.c" + "./src/spicelib/devices/jfet/jfetacld.c" + "./src/spicelib/devices/jfet/jfetask.c" + "./src/spicelib/devices/jfet/jfetdist.c" + "./src/spicelib/devices/jfet/jfetdset.c" + "./src/spicelib/devices/jfet/jfetic.c" + "./src/spicelib/devices/jfet/jfetinit.c" + "./src/spicelib/devices/jfet/jfetload.c" + "./src/spicelib/devices/jfet/jfetmask.c" + "./src/spicelib/devices/jfet/jfetmpar.c" + "./src/spicelib/devices/jfet/jfetnoi.c" + "./src/spicelib/devices/jfet/jfetpar.c" + "./src/spicelib/devices/jfet/jfetpzld.c" + "./src/spicelib/devices/jfet/jfetset.c" + "./src/spicelib/devices/jfet/jfettemp.c" + "./src/spicelib/devices/jfet/jfettrun.c" + "./src/spicelib/devices/jfet2/jfet2.c" + "./src/spicelib/devices/jfet2/jfet2acld.c" + "./src/spicelib/devices/jfet2/jfet2ask.c" + "./src/spicelib/devices/jfet2/jfet2ic.c" + "./src/spicelib/devices/jfet2/jfet2init.c" + "./src/spicelib/devices/jfet2/jfet2load.c" + "./src/spicelib/devices/jfet2/jfet2mask.c" + "./src/spicelib/devices/jfet2/jfet2mpar.c" + "./src/spicelib/devices/jfet2/jfet2noi.c" + "./src/spicelib/devices/jfet2/jfet2par.c" + "./src/spicelib/devices/jfet2/jfet2set.c" + "./src/spicelib/devices/jfet2/jfet2temp.c" + "./src/spicelib/devices/jfet2/jfet2trun.c" + "./src/spicelib/devices/jfet2/psmodel.c" + "./src/spicelib/devices/limit.c" + "./src/spicelib/devices/ltra/ltra.c" + "./src/spicelib/devices/ltra/ltraacct.c" + "./src/spicelib/devices/ltra/ltraacld.c" + "./src/spicelib/devices/ltra/ltraask.c" + "./src/spicelib/devices/ltra/ltrainit.c" + "./src/spicelib/devices/ltra/ltraload.c" + "./src/spicelib/devices/ltra/ltramask.c" + "./src/spicelib/devices/ltra/ltramisc.c" + "./src/spicelib/devices/ltra/ltrampar.c" + "./src/spicelib/devices/ltra/ltrapar.c" + "./src/spicelib/devices/ltra/ltraset.c" + "./src/spicelib/devices/ltra/ltratemp.c" + "./src/spicelib/devices/ltra/ltratrun.c" + "./src/spicelib/devices/mes/mes.c" + "./src/spicelib/devices/mes/mesacl.c" + "./src/spicelib/devices/mes/mesask.c" + "./src/spicelib/devices/mes/mesdisto.c" + "./src/spicelib/devices/mes/mesdset.c" + "./src/spicelib/devices/mes/mesgetic.c" + "./src/spicelib/devices/mes/mesinit.c" + "./src/spicelib/devices/mes/mesload.c" + "./src/spicelib/devices/mes/mesmask.c" + "./src/spicelib/devices/mes/mesmpar.c" + "./src/spicelib/devices/mes/mesnoise.c" + "./src/spicelib/devices/mes/mesparam.c" + "./src/spicelib/devices/mes/mespzld.c" + "./src/spicelib/devices/mes/messetup.c" + "./src/spicelib/devices/mes/mestemp.c" + "./src/spicelib/devices/mes/mestrunc.c" + "./src/spicelib/devices/mesa/mesa.c" + "./src/spicelib/devices/mesa/mesaacl.c" + "./src/spicelib/devices/mesa/mesaask.c" + "./src/spicelib/devices/mesa/mesagetic.c" + "./src/spicelib/devices/mesa/mesainit.c" + "./src/spicelib/devices/mesa/mesaload.c" + "./src/spicelib/devices/mesa/mesamask.c" + "./src/spicelib/devices/mesa/mesamparam.c" + "./src/spicelib/devices/mesa/mesaparam.c" + "./src/spicelib/devices/mesa/mesapzl.c" + "./src/spicelib/devices/mesa/mesasetup.c" + "./src/spicelib/devices/mesa/mesatemp.c" + "./src/spicelib/devices/mesa/mesatrunc.c" + "./src/spicelib/devices/mos1/mos1.c" + "./src/spicelib/devices/mos1/mos1acld.c" + "./src/spicelib/devices/mos1/mos1ask.c" + "./src/spicelib/devices/mos1/mos1conv.c" + "./src/spicelib/devices/mos1/mos1del.c" + "./src/spicelib/devices/mos1/mos1dist.c" + "./src/spicelib/devices/mos1/mos1dset.c" + "./src/spicelib/devices/mos1/mos1ic.c" + "./src/spicelib/devices/mos1/mos1init.c" + "./src/spicelib/devices/mos1/mos1load.c" + "./src/spicelib/devices/mos1/mos1mask.c" + "./src/spicelib/devices/mos1/mos1mpar.c" + "./src/spicelib/devices/mos1/mos1noi.c" + "./src/spicelib/devices/mos1/mos1par.c" + "./src/spicelib/devices/mos1/mos1pzld.c" + "./src/spicelib/devices/mos1/mos1sacl.c" + "./src/spicelib/devices/mos1/mos1set.c" + "./src/spicelib/devices/mos1/mos1sld.c" + "./src/spicelib/devices/mos1/mos1sprt.c" + "./src/spicelib/devices/mos1/mos1sset.c" + "./src/spicelib/devices/mos1/mos1supd.c" + "./src/spicelib/devices/mos1/mos1temp.c" + "./src/spicelib/devices/mos1/mos1trun.c" + "./src/spicelib/devices/mos2/mos2.c" + "./src/spicelib/devices/mos2/mos2acld.c" + "./src/spicelib/devices/mos2/mos2ask.c" + "./src/spicelib/devices/mos2/mos2conv.c" + "./src/spicelib/devices/mos2/mos2del.c" + "./src/spicelib/devices/mos2/mos2dist.c" + "./src/spicelib/devices/mos2/mos2dset.c" + "./src/spicelib/devices/mos2/mos2ic.c" + "./src/spicelib/devices/mos2/mos2init.c" + "./src/spicelib/devices/mos2/mos2load.c" + "./src/spicelib/devices/mos2/mos2mask.c" + "./src/spicelib/devices/mos2/mos2mpar.c" + "./src/spicelib/devices/mos2/mos2noi.c" + "./src/spicelib/devices/mos2/mos2par.c" + "./src/spicelib/devices/mos2/mos2pzld.c" + "./src/spicelib/devices/mos2/mos2sacl.c" + "./src/spicelib/devices/mos2/mos2set.c" + "./src/spicelib/devices/mos2/mos2sld.c" + "./src/spicelib/devices/mos2/mos2sprt.c" + "./src/spicelib/devices/mos2/mos2sset.c" + "./src/spicelib/devices/mos2/mos2supd.c" + "./src/spicelib/devices/mos2/mos2temp.c" + "./src/spicelib/devices/mos2/mos2trun.c" + "./src/spicelib/devices/mos3/mos3.c" + "./src/spicelib/devices/mos3/mos3acld.c" + "./src/spicelib/devices/mos3/mos3ask.c" + "./src/spicelib/devices/mos3/mos3conv.c" + "./src/spicelib/devices/mos3/mos3del.c" + "./src/spicelib/devices/mos3/mos3dist.c" + "./src/spicelib/devices/mos3/mos3dset.c" + "./src/spicelib/devices/mos3/mos3ic.c" + "./src/spicelib/devices/mos3/mos3init.c" + "./src/spicelib/devices/mos3/mos3load.c" + "./src/spicelib/devices/mos3/mos3mask.c" + "./src/spicelib/devices/mos3/mos3mpar.c" + "./src/spicelib/devices/mos3/mos3noi.c" + "./src/spicelib/devices/mos3/mos3par.c" + "./src/spicelib/devices/mos3/mos3pzld.c" + "./src/spicelib/devices/mos3/mos3sacl.c" + "./src/spicelib/devices/mos3/mos3set.c" + "./src/spicelib/devices/mos3/mos3sld.c" + "./src/spicelib/devices/mos3/mos3sprt.c" + "./src/spicelib/devices/mos3/mos3sset.c" + "./src/spicelib/devices/mos3/mos3supd.c" + "./src/spicelib/devices/mos3/mos3temp.c" + "./src/spicelib/devices/mos3/mos3trun.c" + "./src/spicelib/devices/mos6/mos6.c" + "./src/spicelib/devices/mos6/mos6ask.c" + "./src/spicelib/devices/mos6/mos6conv.c" + "./src/spicelib/devices/mos6/mos6del.c" + "./src/spicelib/devices/mos6/mos6ic.c" + "./src/spicelib/devices/mos6/mos6init.c" + "./src/spicelib/devices/mos6/mos6load.c" + "./src/spicelib/devices/mos6/mos6mask.c" + "./src/spicelib/devices/mos6/mos6mpar.c" + "./src/spicelib/devices/mos6/mos6par.c" + "./src/spicelib/devices/mos6/mos6set.c" + "./src/spicelib/devices/mos6/mos6temp.c" + "./src/spicelib/devices/mos6/mos6trun.c" + "./src/spicelib/devices/mos9/mos9.c" + "./src/spicelib/devices/mos9/mos9acld.c" + "./src/spicelib/devices/mos9/mos9ask.c" + "./src/spicelib/devices/mos9/mos9conv.c" + "./src/spicelib/devices/mos9/mos9del.c" + "./src/spicelib/devices/mos9/mos9dist.c" + "./src/spicelib/devices/mos9/mos9dset.c" + "./src/spicelib/devices/mos9/mos9ic.c" + "./src/spicelib/devices/mos9/mos9init.c" + "./src/spicelib/devices/mos9/mos9load.c" + "./src/spicelib/devices/mos9/mos9mask.c" + "./src/spicelib/devices/mos9/mos9mpar.c" + "./src/spicelib/devices/mos9/mos9noi.c" + "./src/spicelib/devices/mos9/mos9par.c" + "./src/spicelib/devices/mos9/mos9pzld.c" + "./src/spicelib/devices/mos9/mos9sacl.c" + "./src/spicelib/devices/mos9/mos9set.c" + "./src/spicelib/devices/mos9/mos9sld.c" + "./src/spicelib/devices/mos9/mos9sprt.c" + "./src/spicelib/devices/mos9/mos9sset.c" + "./src/spicelib/devices/mos9/mos9supd.c" + "./src/spicelib/devices/mos9/mos9temp.c" + "./src/spicelib/devices/mos9/mos9trun.c" + "./src/spicelib/devices/nbjt/nbjt.c" + "./src/spicelib/devices/nbjt/nbjtacld.c" + "./src/spicelib/devices/nbjt/nbjtask.c" + "./src/spicelib/devices/nbjt/nbjtdel.c" + "./src/spicelib/devices/nbjt/nbjtdump.c" + "./src/spicelib/devices/nbjt/nbjtinit.c" + "./src/spicelib/devices/nbjt/nbjtload.c" + "./src/spicelib/devices/nbjt/nbjtmpar.c" + "./src/spicelib/devices/nbjt/nbjtparm.c" + "./src/spicelib/devices/nbjt/nbjtpzld.c" + "./src/spicelib/devices/nbjt/nbjtset.c" + "./src/spicelib/devices/nbjt/nbjttemp.c" + "./src/spicelib/devices/nbjt/nbjttrun.c" + "./src/spicelib/devices/nbjt2/nbt2.c" + "./src/spicelib/devices/nbjt2/nbt2acld.c" + "./src/spicelib/devices/nbjt2/nbt2ask.c" + "./src/spicelib/devices/nbjt2/nbt2del.c" + "./src/spicelib/devices/nbjt2/nbt2dump.c" + "./src/spicelib/devices/nbjt2/nbt2init.c" + "./src/spicelib/devices/nbjt2/nbt2load.c" + "./src/spicelib/devices/nbjt2/nbt2mpar.c" + "./src/spicelib/devices/nbjt2/nbt2parm.c" + "./src/spicelib/devices/nbjt2/nbt2pzld.c" + "./src/spicelib/devices/nbjt2/nbt2set.c" + "./src/spicelib/devices/nbjt2/nbt2temp.c" + "./src/spicelib/devices/nbjt2/nbt2trun.c" + "./src/spicelib/devices/ndev/ndev.c" + "./src/spicelib/devices/ndev/ndevaccept.c" + "./src/spicelib/devices/ndev/ndevacld.c" + "./src/spicelib/devices/ndev/ndevask.c" + "./src/spicelib/devices/ndev/ndevdump.c" + "./src/spicelib/devices/ndev/ndevinit.c" + "./src/spicelib/devices/ndev/ndevload.c" + "./src/spicelib/devices/ndev/ndevmdel.c" + "./src/spicelib/devices/ndev/ndevmpar.c" + "./src/spicelib/devices/ndev/ndevparm.c" + "./src/spicelib/devices/ndev/ndevpzld.c" + "./src/spicelib/devices/ndev/ndevset.c" + "./src/spicelib/devices/ndev/ndevtemp.c" + "./src/spicelib/devices/ndev/ndevtrun.c" + "./src/spicelib/devices/numd/numd.c" + "./src/spicelib/devices/numd/numdacld.c" + "./src/spicelib/devices/numd/numdask.c" + "./src/spicelib/devices/numd/numddel.c" + "./src/spicelib/devices/numd/numddump.c" + "./src/spicelib/devices/numd/numdinit.c" + "./src/spicelib/devices/numd/numdload.c" + "./src/spicelib/devices/numd/numdmpar.c" + "./src/spicelib/devices/numd/numdparm.c" + "./src/spicelib/devices/numd/numdpzld.c" + "./src/spicelib/devices/numd/numdset.c" + "./src/spicelib/devices/numd/numdtemp.c" + "./src/spicelib/devices/numd/numdtrun.c" + "./src/spicelib/devices/numd2/nud2.c" + "./src/spicelib/devices/numd2/nud2acld.c" + "./src/spicelib/devices/numd2/nud2ask.c" + "./src/spicelib/devices/numd2/nud2del.c" + "./src/spicelib/devices/numd2/nud2dump.c" + "./src/spicelib/devices/numd2/nud2load.c" + "./src/spicelib/devices/numd2/nud2mpar.c" + "./src/spicelib/devices/numd2/nud2parm.c" + "./src/spicelib/devices/numd2/nud2pzld.c" + "./src/spicelib/devices/numd2/nud2set.c" + "./src/spicelib/devices/numd2/nud2temp.c" + "./src/spicelib/devices/numd2/nud2trun.c" + "./src/spicelib/devices/numd2/numd2init.c" + "./src/spicelib/devices/numos/numm.c" + "./src/spicelib/devices/numos/nummacld.c" + "./src/spicelib/devices/numos/nummask.c" + "./src/spicelib/devices/numos/nummdel.c" + "./src/spicelib/devices/numos/nummdump.c" + "./src/spicelib/devices/numos/nummload.c" + "./src/spicelib/devices/numos/nummmpar.c" + "./src/spicelib/devices/numos/nummparm.c" + "./src/spicelib/devices/numos/nummpzld.c" + "./src/spicelib/devices/numos/nummset.c" + "./src/spicelib/devices/numos/nummtemp.c" + "./src/spicelib/devices/numos/nummtrun.c" + "./src/spicelib/devices/numos/numosinit.c" + "./src/spicelib/devices/res/res.c" + "./src/spicelib/devices/res/resask.c" + "./src/spicelib/devices/res/resinit.c" + "./src/spicelib/devices/res/resload.c" + "./src/spicelib/devices/res/resmask.c" + "./src/spicelib/devices/res/resmpar.c" + "./src/spicelib/devices/res/resnoise.c" + "./src/spicelib/devices/res/resparam.c" + "./src/spicelib/devices/res/respzld.c" + "./src/spicelib/devices/res/ressacl.c" + "./src/spicelib/devices/res/ressetup.c" + "./src/spicelib/devices/res/ressload.c" + "./src/spicelib/devices/res/ressoachk.c" + "./src/spicelib/devices/res/ressprt.c" + "./src/spicelib/devices/res/ressset.c" + "./src/spicelib/devices/res/restemp.c" + "./src/spicelib/devices/soi3/soi3.c" + "./src/spicelib/devices/soi3/soi3acld.c" + "./src/spicelib/devices/soi3/soi3ask.c" + "./src/spicelib/devices/soi3/soi3cap.c" + "./src/spicelib/devices/soi3/soi3conv.c" + "./src/spicelib/devices/soi3/soi3ic.c" + "./src/spicelib/devices/soi3/soi3init.c" + "./src/spicelib/devices/soi3/soi3load.c" + "./src/spicelib/devices/soi3/soi3mask.c" + "./src/spicelib/devices/soi3/soi3mpar.c" + "./src/spicelib/devices/soi3/soi3nois.c" + "./src/spicelib/devices/soi3/soi3par.c" + "./src/spicelib/devices/soi3/soi3set.c" + "./src/spicelib/devices/soi3/soi3temp.c" + "./src/spicelib/devices/soi3/soi3trun.c" + "./src/spicelib/devices/sw/sw.c" + "./src/spicelib/devices/sw/swacload.c" + "./src/spicelib/devices/sw/swask.c" + "./src/spicelib/devices/sw/swinit.c" + "./src/spicelib/devices/sw/swload.c" + "./src/spicelib/devices/sw/swmask.c" + "./src/spicelib/devices/sw/swmparam.c" + "./src/spicelib/devices/sw/swnoise.c" + "./src/spicelib/devices/sw/swparam.c" + "./src/spicelib/devices/sw/swpzload.c" + "./src/spicelib/devices/sw/swsetup.c" + "./src/spicelib/devices/sw/swtrunc.c" + "./src/spicelib/devices/tra/tra.c" + "./src/spicelib/devices/tra/traacct.c" + "./src/spicelib/devices/tra/traacld.c" + "./src/spicelib/devices/tra/traask.c" + "./src/spicelib/devices/tra/trainit.c" + "./src/spicelib/devices/tra/traload.c" + "./src/spicelib/devices/tra/traparam.c" + "./src/spicelib/devices/tra/trasetup.c" + "./src/spicelib/devices/tra/tratemp.c" + "./src/spicelib/devices/tra/tratrunc.c" + "./src/spicelib/devices/txl/txl.c" + "./src/spicelib/devices/txl/txlacct.c" + "./src/spicelib/devices/txl/txlask.c" + "./src/spicelib/devices/txl/txlfbr.c" + "./src/spicelib/devices/txl/txlinit.c" + "./src/spicelib/devices/txl/txlload.c" + "./src/spicelib/devices/txl/txlmask.c" + "./src/spicelib/devices/txl/txlmpar.c" + "./src/spicelib/devices/txl/txlparam.c" + "./src/spicelib/devices/txl/txlsetup.c" + "./src/spicelib/devices/urc/urc.c" + "./src/spicelib/devices/urc/urcask.c" + "./src/spicelib/devices/urc/urcinit.c" + "./src/spicelib/devices/urc/urcmask.c" + "./src/spicelib/devices/urc/urcmpar.c" + "./src/spicelib/devices/urc/urcparam.c" + "./src/spicelib/devices/urc/urcsetup.c" + "./src/spicelib/devices/vbic/vbic.c" + "./src/spicelib/devices/vbic/vbicacld.c" + "./src/spicelib/devices/vbic/vbicask.c" + "./src/spicelib/devices/vbic/vbicconv.c" + "./src/spicelib/devices/vbic/vbicgetic.c" + "./src/spicelib/devices/vbic/vbicinit.c" + "./src/spicelib/devices/vbic/vbicload.c" + "./src/spicelib/devices/vbic/vbicmask.c" + "./src/spicelib/devices/vbic/vbicmpar.c" + "./src/spicelib/devices/vbic/vbicnoise.c" + "./src/spicelib/devices/vbic/vbicparam.c" + "./src/spicelib/devices/vbic/vbicpzld.c" + "./src/spicelib/devices/vbic/vbicsetup.c" + "./src/spicelib/devices/vbic/vbicsoachk.c" + "./src/spicelib/devices/vbic/vbictemp.c" + "./src/spicelib/devices/vbic/vbictrunc.c" + "./src/spicelib/devices/vccs/vccs.c" + "./src/spicelib/devices/vccs/vccsask.c" + "./src/spicelib/devices/vccs/vccsinit.c" + "./src/spicelib/devices/vccs/vccsload.c" + "./src/spicelib/devices/vccs/vccspar.c" + "./src/spicelib/devices/vccs/vccspzld.c" + "./src/spicelib/devices/vccs/vccssacl.c" + "./src/spicelib/devices/vccs/vccsset.c" + "./src/spicelib/devices/vccs/vccssld.c" + "./src/spicelib/devices/vccs/vccssprt.c" + "./src/spicelib/devices/vccs/vccssset.c" + "./src/spicelib/devices/vcvs/vcvs.c" + "./src/spicelib/devices/vcvs/vcvsask.c" + "./src/spicelib/devices/vcvs/vcvsfbr.c" + "./src/spicelib/devices/vcvs/vcvsinit.c" + "./src/spicelib/devices/vcvs/vcvsload.c" + "./src/spicelib/devices/vcvs/vcvspar.c" + "./src/spicelib/devices/vcvs/vcvspzld.c" + "./src/spicelib/devices/vcvs/vcvssacl.c" + "./src/spicelib/devices/vcvs/vcvsset.c" + "./src/spicelib/devices/vcvs/vcvssld.c" + "./src/spicelib/devices/vcvs/vcvssprt.c" + "./src/spicelib/devices/vcvs/vcvssset.c" + "./src/spicelib/devices/vdmos/vdmos.c" + "./src/spicelib/devices/vdmos/vdmosacld.c" + "./src/spicelib/devices/vdmos/vdmosask.c" + "./src/spicelib/devices/vdmos/vdmosconv.c" + "./src/spicelib/devices/vdmos/vdmosdist.c" + "./src/spicelib/devices/vdmos/vdmosdset.c" + "./src/spicelib/devices/vdmos/vdmosic.c" + "./src/spicelib/devices/vdmos/vdmosinit.c" + "./src/spicelib/devices/vdmos/vdmosload.c" + "./src/spicelib/devices/vdmos/vdmosmask.c" + "./src/spicelib/devices/vdmos/vdmosmpar.c" + "./src/spicelib/devices/vdmos/vdmosnoi.c" + "./src/spicelib/devices/vdmos/vdmospar.c" + "./src/spicelib/devices/vdmos/vdmospzld.c" + "./src/spicelib/devices/vdmos/vdmosset.c" + "./src/spicelib/devices/vdmos/vdmossoachk.c" + "./src/spicelib/devices/vdmos/vdmostemp.c" + "./src/spicelib/devices/vdmos/vdmostrun.c" + "./src/spicelib/devices/vsrc/vsrc.c" + "./src/spicelib/devices/vsrc/vsrcacct.c" + "./src/spicelib/devices/vsrc/vsrcacld.c" + "./src/spicelib/devices/vsrc/vsrcask.c" + "./src/spicelib/devices/vsrc/vsrcdel.c" + "./src/spicelib/devices/vsrc/vsrcfbr.c" + "./src/spicelib/devices/vsrc/vsrcinit.c" + "./src/spicelib/devices/vsrc/vsrcload.c" + "./src/spicelib/devices/vsrc/vsrcpar.c" + "./src/spicelib/devices/vsrc/vsrcpzld.c" + "./src/spicelib/devices/vsrc/vsrcpzs.c" + "./src/spicelib/devices/vsrc/vsrcset.c" + "./src/spicelib/devices/vsrc/vsrctemp.c" "./src/spicelib/analysis/dctran.c" "./src/spicelib/analysis/cktterr.c" "./src/spicelib/analysis/cktmask.c" @@ -214,6 +1388,65 @@ add_library(ngspice-spicelib "./src/spicelib/analysis/senssetp.c" "./src/spicelib/analysis/dctsetp.c" "./src/spicelib/analysis/optran.c" + "./src/spicelib/parser/ifeval.c" + "./src/spicelib/parser/ifnewuid.c" + "./src/spicelib/parser/inp2b.c" + "./src/spicelib/parser/inp2c.c" + "./src/spicelib/parser/inp2d.c" + "./src/spicelib/parser/inp2dot.c" + "./src/spicelib/parser/inp2e.c" + "./src/spicelib/parser/inp2f.c" + "./src/spicelib/parser/inp2g.c" + "./src/spicelib/parser/inp2h.c" + "./src/spicelib/parser/inp2i.c" + "./src/spicelib/parser/inp2j.c" + "./src/spicelib/parser/inp2k.c" + "./src/spicelib/parser/inp2l.c" + "./src/spicelib/parser/inp2m.c" + # "./src/spicelib/parser/inp2n.c" + "./src/spicelib/parser/inp2o.c" + "./src/spicelib/parser/inp2p.c" + "./src/spicelib/parser/inp2q.c" + "./src/spicelib/parser/inp2r.c" + "./src/spicelib/parser/inp2s.c" + "./src/spicelib/parser/inp2t.c" + "./src/spicelib/parser/inp2u.c" + "./src/spicelib/parser/inp2v.c" + "./src/spicelib/parser/inp2w.c" + "./src/spicelib/parser/inp2y.c" + "./src/spicelib/parser/inp2z.c" + "./src/spicelib/parser/inpaname.c" + "./src/spicelib/parser/inpapnam.c" + "./src/spicelib/parser/inpcfix.c" + "./src/spicelib/parser/inpdomod.c" + "./src/spicelib/parser/inpdoopt.c" + "./src/spicelib/parser/inpdpar.c" + "./src/spicelib/parser/inperrc.c" + "./src/spicelib/parser/inperror.c" + "./src/spicelib/parser/inpeval.c" + "./src/spicelib/parser/inpfindl.c" + "./src/spicelib/parser/inpfindv.c" + "./src/spicelib/parser/inpgmod.c" + "./src/spicelib/parser/inpgstr.c" + "./src/spicelib/parser/inpgtitl.c" + "./src/spicelib/parser/inpgtok.c" + "./src/spicelib/parser/inpgval.c" + "./src/spicelib/parser/inpkmods.c" + "./src/spicelib/parser/inplist.c" + "./src/spicelib/parser/inplkmod.c" + "./src/spicelib/parser/inpmkmod.c" + "./src/spicelib/parser/inpmktmp.c" + "./src/spicelib/parser/inppas1.c" + "./src/spicelib/parser/inppas2.c" + "./src/spicelib/parser/inppas3.c" + "./src/spicelib/parser/inppas4.c" + "./src/spicelib/parser/inppname.c" + "./src/spicelib/parser/inpptree-parser.c" + "./src/spicelib/parser/inpptree.c" + "./src/spicelib/parser/inpsymt.c" + "./src/spicelib/parser/inptyplk.c" + "./src/spicelib/parser/ptfuncs.c" + "./src/spicelib/parser/sperror.c" "./src/frontend/arg.c" "./src/frontend/aspice.c" "./src/frontend/breakp.c" @@ -299,6 +1532,7 @@ add_library(ngspice-spicelib "./src/frontend/options.c" "./src/frontend/outitf.c" "./src/frontend/parse.c" + "./src/frontend/parse-bison.c" "./src/frontend/parser/backq.c" "./src/frontend/parser/complete.c" "./src/frontend/parser/cshpar.c" @@ -336,7 +1570,7 @@ add_library(ngspice-spicelib "./src/frontend/subckt.c" "./src/frontend/svg.c" "./src/frontend/terminal.c" - "./src/frontend/testcommands.c" + # "./src/frontend/testcommands.c" "./src/frontend/trannoise/1-f-code.c" "./src/frontend/trannoise/FastNorm3.c" "./src/frontend/trannoise/wallace.c" @@ -348,8 +1582,33 @@ add_library(ngspice-spicelib "./src/frontend/wdisp/windisp.c" "./src/frontend/wdisp/winprint.c" "./src/frontend/where.c" + "./src/misc/alloc.c" + "./src/misc/dstring.c" + "./src/misc/dup2.c" + "./src/misc/getopt_long_bsd.c" + "./src/misc/hash.c" + "./src/misc/ivars.c" + "./src/misc/misc_time.c" + "./src/misc/mktemp.c" + "./src/misc/printnum.c" + "./src/misc/string.c" + "./src/misc/tilde.c" + "./src/misc/util.c" + # "./src/misc/win_time.c" + "./src/misc/wlist.c" + # "./src/osdi/osdiacld.c" + # "./src/osdi/osdicallbacks.c" + # "./src/osdi/osdiinit.c" + # "./src/osdi/osdiload.c" + # "./src/osdi/osdinoise.c" + # "./src/osdi/osdiparam.c" + # "./src/osdi/osdipzld.c" + # "./src/osdi/osdiregistry.c" + # "./src/osdi/osdisetup.c" + # "./src/osdi/osditrunc.c" ) + if (NGSPICE_ENABLE_PSS_ANALYSIS) target_sources(ngspice-spicelib PRIVATE "./src/spicelib/analysis/pssinit.c" @@ -359,28 +1618,38 @@ if (NGSPICE_ENABLE_PSS_ANALYSIS) endif() target_include_directories(ngspice-spicelib PUBLIC - "./src/include/ngspice" - "./src/spicelib/devices" + "./src/spicelib/parser/" + "./src/include/cppduals/" + "./src/spicelib/devices/" + "./src/frontend/" ) # -------- Shared spice ----- -target_link_libraries(ngspice-spicelib ngspice-maths) +target_link_libraries(ngspice-spicelib PRIVATE + ngspice-maths +) +if (NGSPICE_ENABLE_XSPICE) + target_link_libraries(ngspice-spicelib PRIVATE + ngspice-xspice + # spice2poly + ) +endif() add_library(ngspice - "./src/nghelp.c" + "./src/conf.c" "./src/sharedspice.c" ) -target_link_libraries(ngspice ngspice-spicelib) +target_link_libraries(ngspice PRIVATE ngspice-spicelib) # ------- ngspice executable -# add_executable(ngspice_main -# "./src/main.c" -# ) -# target_link_libraries(ngspice_main ngspice-spicelib) - +if (NGSPICE_COMPILE_MAIN) + message(STATUS "NGSPICE_COMPILE_MAIN is ON") + add_executable(ngspice_main + "./src/main.c" + ) + target_link_libraries(ngspice_main) +endif() # ------- Tests - - if (NGSPICE_ENABLE_TESTS) # TODO # "./src/maths/cmaths/test_cx_ph.c" diff --git a/ChangeLog b/ChangeLog index b586ca150..184557334 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4297,7 +4297,7 @@ kept only for historical reasons. * src/include/ngspice/cidersupt.h, * src/include/ngspice/cluster.h, * src/include/ngspice/compatmode.h, - * src/include/ngspice/complex.h, + * src/include/ngspice/ngcomplex.h, * src/include/ngspice/cpstd.h, * src/include/ngspice/defines.h, * src/include/ngspice/dllitf.h, @@ -4328,7 +4328,7 @@ kept only for historical reasons. 2013-01-22 rlar * src/frontend/com_measure2.h, - * src/include/ngspice/complex.h, + * src/include/ngspice/ngcomplex.h, * src/include/ngspice/cpstd.h, * src/include/ngspice/defines.h, * src/include/ngspice/fteinput.h, @@ -9899,7 +9899,7 @@ kept only for historical reasons. polish make maintainer-clean, make mrproper 2012-02-07 Robert Larice - * src/include/ngspice/complex.h : + * src/include/ngspice/ngcomplex.h : #4/4 finish the switch from ngcomplex* args to ngcomplex 2012-02-07 Robert Larice @@ -9922,7 +9922,7 @@ kept only for historical reasons. * src/frontend/plotting/plotcurv.c , * src/frontend/plotting/plotit.c , * src/frontend/plotting/xgraph.c , - * src/include/ngspice/complex.h , + * src/include/ngspice/ngcomplex.h , * src/maths/cmaths/cmath1.c , * src/maths/cmaths/cmath2.c , * src/maths/cmaths/cmath3.c , @@ -9935,7 +9935,7 @@ kept only for historical reasons. 2012-02-07 Robert Larice * src/frontend/diff.c , - * src/include/ngspice/complex.h , + * src/include/ngspice/ngcomplex.h , * src/maths/cmaths/cmath1.c , * src/maths/cmaths/cmath2.c , * src/maths/cmaths/cmath3.c , @@ -9943,7 +9943,7 @@ kept only for historical reasons. #2/4 switch cph() and cmag() args from ngcomplex* to ngcomplex 2012-02-07 Robert Larice - * src/include/ngspice/complex.h : + * src/include/ngspice/ngcomplex.h : #1/4 drop cast (enable compiler type check) 2012-02-07 Holger Vogt / Robert Larice diff --git a/src/frontend/parse-bison.c b/src/frontend/parse-bison.c new file mode 100644 index 000000000..2989d6088 --- /dev/null +++ b/src/frontend/parse-bison.c @@ -0,0 +1,1794 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + +/* Substitute the variable and function names. */ +#define yyparse PPparse +#define yylex PPlex +#define yyerror PPerror +#define yydebug PPdebug +#define yynerrs PPnerrs + +/* First part of user prologue. */ +#line 1 "../../../src/frontend/parse-bison.y" + + /* + * (compile (concat "bison -ydo parse-bison.c " (file-relative-name buffer-file-name))) + */ + + #include "ngspice/ngspice.h" + #include "ngspice/fteparse.h" + + #include + #include + + # define YYLTYPE struct PPltype + + #include "parse.h" + #include "parse-bison.h" + #include "parse-bison-y.h" + + + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) { \ + (Current).start = YYRHSLOC(Rhs, 1).start; \ + (Current).stop = YYRHSLOC(Rhs, N).stop; \ + } else { \ + (Current).start = (Current).stop = YYRHSLOC(Rhs, 0).stop; \ + } \ + while (0) + + static void PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *); + + static char *keepline; + +#line 109 "parse-bison.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_PP_PARSE_BISON_H_INCLUDED +# define YY_PP_PARSE_BISON_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int PPdebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + TOK_NUM = 258, /* TOK_NUM */ + TOK_STR = 259, /* TOK_STR */ + TOK_LE = 260, /* TOK_LE */ + TOK_GE = 261, /* TOK_GE */ + TOK_NE = 262, /* TOK_NE */ + NEG = 263 /* NEG */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 +#define TOK_NUM 258 +#define TOK_STR 259 +#define TOK_LE 260 +#define TOK_GE 261 +#define TOK_NE 262 +#define NEG 263 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 47 "../../../src/frontend/parse-bison.y" + + double num; + const char *str; + struct pnode *pnode; + +#line 184 "parse-bison.c" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + +/* Location type. */ +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + + + +int PPparse (char **line, struct pnode **retval); + + +#endif /* !YY_PP_PARSE_BISON_H_INCLUDED */ +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_TOK_NUM = 3, /* TOK_NUM */ + YYSYMBOL_TOK_STR = 4, /* TOK_STR */ + YYSYMBOL_TOK_LE = 5, /* TOK_LE */ + YYSYMBOL_TOK_GE = 6, /* TOK_GE */ + YYSYMBOL_TOK_NE = 7, /* TOK_NE */ + YYSYMBOL_8_ = 8, /* '?' */ + YYSYMBOL_9_ = 9, /* ':' */ + YYSYMBOL_10_ = 10, /* '|' */ + YYSYMBOL_11_ = 11, /* '&' */ + YYSYMBOL_12_ = 12, /* '=' */ + YYSYMBOL_13_ = 13, /* '<' */ + YYSYMBOL_14_ = 14, /* '>' */ + YYSYMBOL_15_ = 15, /* '~' */ + YYSYMBOL_16_ = 16, /* ',' */ + YYSYMBOL_17_ = 17, /* '-' */ + YYSYMBOL_18_ = 18, /* '+' */ + YYSYMBOL_19_ = 19, /* '*' */ + YYSYMBOL_20_ = 20, /* '/' */ + YYSYMBOL_21_ = 21, /* '%' */ + YYSYMBOL_NEG = 22, /* NEG */ + YYSYMBOL_23_ = 23, /* '^' */ + YYSYMBOL_24_ = 24, /* '[' */ + YYSYMBOL_25_ = 25, /* ']' */ + YYSYMBOL_26_ = 26, /* '(' */ + YYSYMBOL_27_ = 27, /* ')' */ + YYSYMBOL_YYACCEPT = 28, /* $accept */ + YYSYMBOL_expression = 29, /* expression */ + YYSYMBOL_exp_list = 30, /* exp_list */ + YYSYMBOL_one_exp = 31, /* one_exp */ + YYSYMBOL_exp = 32 /* exp */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* !defined yyoverflow */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 14 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 235 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 28 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 5 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 30 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 60 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 263 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 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, 21, 11, 2, + 26, 27, 19, 18, 16, 17, 2, 20, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 9, 2, + 13, 12, 14, 8, 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, 24, 2, 25, 23, 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, 10, 2, 15, 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, 1, 2, 3, 4, + 5, 6, 7, 22 +}; + +#if YYDEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint8 yyrline[] = +{ + 0, 111, 111, 112, 116, 117, 121, 128, 129, 131, + 132, 133, 134, 135, 136, 137, 139, 141, 142, 144, + 150, 151, 152, 153, 154, 155, 157, 158, 160, 161, + 162 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "TOK_NUM", "TOK_STR", + "TOK_LE", "TOK_GE", "TOK_NE", "'?'", "':'", "'|'", "'&'", "'='", "'<'", + "'>'", "'~'", "','", "'-'", "'+'", "'*'", "'/'", "'%'", "NEG", "'^'", + "'['", "']'", "'('", "')'", "$accept", "expression", "exp_list", + "one_exp", "exp", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-24) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-1) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 32, -24, -23, 32, 32, 32, 12, -24, 32, 162, + 32, 211, -13, 54, -24, -24, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 28, 77, -24, 211, 211, 211, 142, 182, + 202, 211, 211, 211, 211, -15, -15, -13, -13, -13, + -13, 32, 100, -24, 32, 121, -24, 162, 5, -24 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 2, 7, 8, 0, 0, 0, 0, 3, 4, 6, + 0, 18, 17, 0, 1, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 16, 25, 24, 21, 0, 27, + 26, 20, 23, 22, 9, 11, 10, 12, 14, 13, + 15, 0, 0, 19, 0, 0, 28, 30, 0, 29 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -24, -24, 25, -24, -3 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + 0, 6, 7, 8, 9 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = +{ + 11, 12, 13, 10, 28, 29, 30, 33, 31, 32, + 31, 32, 14, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, + 59, 1, 2, 15, 0, 1, 2, 0, 0, 0, + 0, 0, 0, 3, 0, 4, 0, 3, 55, 4, + 0, 57, 51, 0, 5, 0, 0, 0, 5, 16, + 17, 18, 19, 0, 20, 21, 22, 23, 24, 0, + 25, 26, 27, 28, 29, 30, 0, 31, 32, 0, + 0, 34, 16, 17, 18, 19, 0, 20, 21, 22, + 23, 24, 0, 25, 26, 27, 28, 29, 30, 0, + 31, 32, 0, 0, 53, 16, 17, 18, 19, 0, + 20, 21, 22, 23, 24, 0, 25, 26, 27, 28, + 29, 30, 0, 31, 32, 56, 16, 17, 18, 19, + 0, 20, 21, 22, 23, 24, 0, 25, 26, 27, + 28, 29, 30, 0, 31, 32, 58, 16, 17, 18, + 19, 54, 20, 21, 22, 23, 24, 0, 25, 26, + 27, 28, 29, 30, 0, 31, 32, 16, 17, 18, + 19, 0, 20, 21, 22, 23, 24, 0, 25, 26, + 27, 28, 29, 30, 0, 31, 32, 16, 17, 18, + 0, 0, 0, 21, 22, 23, 24, 0, 25, 26, + 27, 28, 29, 30, 0, 31, 32, 16, 17, 18, + 0, 0, 0, 0, 22, 23, 24, 0, 25, 26, + 27, 28, 29, 30, 0, 31, 32, 25, 26, 27, + 28, 29, 30, 0, 31, 32 +}; + +static const yytype_int8 yycheck[] = +{ + 3, 4, 5, 26, 19, 20, 21, 10, 23, 24, + 23, 24, 0, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 25, 3, 4, 8, -1, 3, 4, -1, -1, -1, + -1, -1, -1, 15, -1, 17, -1, 15, 51, 17, + -1, 54, 24, -1, 26, -1, -1, -1, 26, 5, + 6, 7, 8, -1, 10, 11, 12, 13, 14, -1, + 16, 17, 18, 19, 20, 21, -1, 23, 24, -1, + -1, 27, 5, 6, 7, 8, -1, 10, 11, 12, + 13, 14, -1, 16, 17, 18, 19, 20, 21, -1, + 23, 24, -1, -1, 27, 5, 6, 7, 8, -1, + 10, 11, 12, 13, 14, -1, 16, 17, 18, 19, + 20, 21, -1, 23, 24, 25, 5, 6, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, 18, + 19, 20, 21, -1, 23, 24, 25, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, -1, 16, 17, + 18, 19, 20, 21, -1, 23, 24, 5, 6, 7, + 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, + 18, 19, 20, 21, -1, 23, 24, 5, 6, 7, + -1, -1, -1, 11, 12, 13, 14, -1, 16, 17, + 18, 19, 20, 21, -1, 23, 24, 5, 6, 7, + -1, -1, -1, -1, 12, 13, 14, -1, 16, 17, + 18, 19, 20, 21, -1, 23, 24, 16, 17, 18, + 19, 20, 21, -1, 23, 24 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 3, 4, 15, 17, 26, 29, 30, 31, 32, + 26, 32, 32, 32, 0, 30, 5, 6, 7, 8, + 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, + 21, 23, 24, 32, 27, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 24, 32, 27, 9, 32, 25, 32, 25, 25 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = +{ + 0, 28, 29, 29, 30, 30, 31, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 1, 1, 1, 3, + 3, 3, 3, 3, 3, 3, 3, 2, 2, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 4, 6, + 5 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, line, retval, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + +/* YYLOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +# ifndef YYLOCATION_PRINT + +# if defined YY_LOCATION_PRINT + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + +# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +YY_ATTRIBUTE_UNUSED +static int +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +{ + int res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); + } + return res; +} + +# define YYLOCATION_PRINT yy_location_print_ + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) + +# else + +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + +# endif +# endif /* !defined YYLOCATION_PRINT */ + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location, line, retval); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char **line, struct pnode **retval) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (yylocationp); + YY_USE (line); + YY_USE (retval); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char **line, struct pnode **retval) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + YYLOCATION_PRINT (yyo, yylocationp); + YYFPRINTF (yyo, ": "); + yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, line, retval); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, + int yyrule, char **line, struct pnode **retval) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)]), line, retval); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, line, retval); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + + + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, char **line, struct pnode **retval) +{ + YY_USE (yyvaluep); + YY_USE (yylocationp); + YY_USE (line); + YY_USE (retval); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (char **line, struct pnode **retval) +{ +/* Lookahead token kind. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; + + /* Number of syntax errors so far. */ + int yynerrs = 0; + + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + /* The location stack: array, bottom, top. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp = yyls; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; /* Cause a token to be read. */ + + +/* User initialization code. */ +#line 98 "../../../src/frontend/parse-bison.y" +{ + yylval.num = 0.0; + yylloc.start = yylloc.stop = NULL; + keepline = *line; +} + +#line 1194 "parse-bison.c" + + yyvsp[0] = yylval; + yylsp[0] = yylloc; + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc, line); + } + + if (yychar <= YYEOF) + { + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + *++yylsp = yylloc; + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + yyerror_range[1] = yyloc; + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* expression: %empty */ +#line 111 "../../../src/frontend/parse-bison.y" + { *retval = NULL; } +#line 1408 "parse-bison.c" + break; + + case 3: /* expression: exp_list */ +#line 112 "../../../src/frontend/parse-bison.y" + { *retval = (yyvsp[0].pnode); } +#line 1414 "parse-bison.c" + break; + + case 5: /* exp_list: one_exp exp_list */ +#line 117 "../../../src/frontend/parse-bison.y" + { (yyvsp[-1].pnode)->pn_next = (yyvsp[0].pnode); (yyvsp[0].pnode)->pn_use ++; (yyval.pnode) = (yyvsp[-1].pnode); } +#line 1420 "parse-bison.c" + break; + + case 6: /* one_exp: exp */ +#line 121 "../../../src/frontend/parse-bison.y" + { + (yyvsp[0].pnode)->pn_name = copy_substring((yylsp[0]).start, (yylsp[0]).stop); + (yyval.pnode) = (yyvsp[0].pnode); + } +#line 1429 "parse-bison.c" + break; + + case 7: /* exp: TOK_NUM */ +#line 128 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mknnode((yyvsp[0].num)); } +#line 1435 "parse-bison.c" + break; + + case 8: /* exp: TOK_STR */ +#line 129 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mksnode((yyvsp[0].str)); txfree((yyvsp[0].str)); } +#line 1441 "parse-bison.c" + break; + + case 9: /* exp: exp ',' exp */ +#line 131 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_COMMA, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1447 "parse-bison.c" + break; + + case 10: /* exp: exp '+' exp */ +#line 132 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_PLUS, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1453 "parse-bison.c" + break; + + case 11: /* exp: exp '-' exp */ +#line 133 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_MINUS, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1459 "parse-bison.c" + break; + + case 12: /* exp: exp '*' exp */ +#line 134 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_TIMES, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1465 "parse-bison.c" + break; + + case 13: /* exp: exp '%' exp */ +#line 135 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_MOD, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1471 "parse-bison.c" + break; + + case 14: /* exp: exp '/' exp */ +#line 136 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_DIVIDE, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1477 "parse-bison.c" + break; + + case 15: /* exp: exp '^' exp */ +#line 137 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_POWER, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1483 "parse-bison.c" + break; + + case 16: /* exp: '(' exp ')' */ +#line 139 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = (yyvsp[-1].pnode); } +#line 1489 "parse-bison.c" + break; + + case 17: /* exp: '-' exp */ +#line 141 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkunode(PT_OP_UMINUS, (yyvsp[0].pnode)); } +#line 1495 "parse-bison.c" + break; + + case 18: /* exp: '~' exp */ +#line 142 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkunode(PT_OP_NOT, (yyvsp[0].pnode)); } +#line 1501 "parse-bison.c" + break; + + case 19: /* exp: TOK_STR '(' exp ')' */ +#line 144 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkfnode((yyvsp[-3].str), (yyvsp[-1].pnode)); + txfree((yyvsp[-3].str)); + if(!(yyval.pnode)) + YYABORT; + } +#line 1511 "parse-bison.c" + break; + + case 20: /* exp: exp '=' exp */ +#line 150 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_EQ, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1517 "parse-bison.c" + break; + + case 21: /* exp: exp TOK_NE exp */ +#line 151 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_NE, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1523 "parse-bison.c" + break; + + case 22: /* exp: exp '>' exp */ +#line 152 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_GT, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1529 "parse-bison.c" + break; + + case 23: /* exp: exp '<' exp */ +#line 153 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_LT, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1535 "parse-bison.c" + break; + + case 24: /* exp: exp TOK_GE exp */ +#line 154 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_GE, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1541 "parse-bison.c" + break; + + case 25: /* exp: exp TOK_LE exp */ +#line 155 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_LE, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1547 "parse-bison.c" + break; + + case 26: /* exp: exp '&' exp */ +#line 157 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_AND, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1553 "parse-bison.c" + break; + + case 27: /* exp: exp '|' exp */ +#line 158 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_OR, (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1559 "parse-bison.c" + break; + + case 28: /* exp: exp '[' exp ']' */ +#line 160 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_INDX, (yyvsp[-3].pnode), (yyvsp[-1].pnode)); } +#line 1565 "parse-bison.c" + break; + + case 29: /* exp: exp '[' '[' exp ']' ']' */ +#line 161 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_RANGE, (yyvsp[-5].pnode), (yyvsp[-2].pnode)); } +#line 1571 "parse-bison.c" + break; + + case 30: /* exp: exp '?' exp ':' exp */ +#line 162 "../../../src/frontend/parse-bison.y" + { (yyval.pnode) = PP_mkbnode(PT_OP_TERNARY,(yyvsp[-4].pnode), + PP_mkbnode(PT_OP_COMMA,(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1578 "parse-bison.c" + break; + + +#line 1582 "parse-bison.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + yyerror (&yylloc, line, retval, YY_("syntax error")); + } + + yyerror_range[1] = yylloc; + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, line, retval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + yyerror_range[1] = *yylsp; + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, line, retval); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + yyerror_range[2] = yylloc; + ++yylsp; + YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (&yylloc, line, retval, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, line, retval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, line, retval); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + + return yyresult; +} + +#line 166 "../../../src/frontend/parse-bison.y" + + + +/* Called by yyparse on error. */ +static void +PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *s) +{ + NG_IGNORE(locp); + NG_IGNORE(line); + NG_IGNORE(retval); + char *tmpstr = strstr(keepline, *line); + int len = (int)strlen(keepline); + fprintf (stderr, "%s: %s in line segment\n %s\nnear\n %*s\n", + __func__, s, keepline, len, tmpstr); +} diff --git a/src/frontend/parse-bison.h b/src/frontend/parse-bison.h new file mode 100644 index 000000000..2e5568465 --- /dev/null +++ b/src/frontend/parse-bison.h @@ -0,0 +1,116 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_PP_PARSE_BISON_H_INCLUDED +# define YY_PP_PARSE_BISON_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int PPdebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + TOK_NUM = 258, /* TOK_NUM */ + TOK_STR = 259, /* TOK_STR */ + TOK_LE = 260, /* TOK_LE */ + TOK_GE = 261, /* TOK_GE */ + TOK_NE = 262, /* TOK_NE */ + NEG = 263 /* NEG */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 +#define TOK_NUM 258 +#define TOK_STR 259 +#define TOK_LE 260 +#define TOK_GE 261 +#define TOK_NE 262 +#define NEG 263 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 47 "../../../src/frontend/parse-bison.y" + + double num; + const char *str; + struct pnode *pnode; + +#line 89 "parse-bison.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + +/* Location type. */ +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + + + +int PPparse (char **line, struct pnode **retval); + + +#endif /* !YY_PP_PARSE_BISON_H_INCLUDED */ diff --git a/src/include/ngspice/config.h b/src/include/ngspice/config.h index 23b74ff36..b184162d2 100644 --- a/src/include/ngspice/config.h +++ b/src/include/ngspice/config.h @@ -87,7 +87,7 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ -#define HAVE_DIRENT_H 1 +// #define HAVE_DIRENT_H 1 /* Have dirname in libgen */ #define HAVE_DIRNAME 1 @@ -141,7 +141,7 @@ #define HAVE_GETOPT_LONG 1 /* Define to 1 if you have the `getrlimit' function. */ -#define HAVE_GETRLIMIT 1 +// #define HAVE_GETRLIMIT 1 /* Define to 1 if you have the `getrusage' function. */ /* #undef HAVE_GETRUSAGE */ @@ -186,7 +186,7 @@ #define HAVE_LIBM 1 /* Define to 1 if you have the `pthread' library (-lpthread). */ -#define HAVE_LIBPTHREAD 1 +// #define HAVE_LIBPTHREAD 1 /* Have xft routines in libxft */ /* #undef HAVE_LIBXFT */ @@ -219,16 +219,16 @@ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 +// #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 +// #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the `popen' function. */ #define HAVE_POPEN 1 /* Define to 1 if you have the header file. */ -#define HAVE_PWD_H 1 +// #define HAVE_PWD_H 1 // CMake /* Define to 1 if you have the `qsort' function. */ #define HAVE_QSORT 1 @@ -258,10 +258,10 @@ /* #undef HAVE_SIGHANDLER_T */ /* Define if we have sigsetjmp(). */ -#define HAVE_SIGSETJMP /**/ +// #define HAVE_SIGSETJMP /**/ /* Define to 1 if the system has the type `sig_t'. */ -#define HAVE_SIG_T 1 +// #define HAVE_SIG_T 1 /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 @@ -294,7 +294,7 @@ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 +// #define HAVE_STRINGS_H 1 // Managed in CMake /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 @@ -325,7 +325,7 @@ #define HAVE_SYS_FILE_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 +// #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IO_H 1 @@ -341,7 +341,7 @@ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 +// #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -359,7 +359,7 @@ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have that is POSIX.1 compatible. */ -#define HAVE_SYS_WAIT_H 1 +// #define HAVE_SYS_WAIT_H 1 /* Define to 1 if you have the `tcgetattr' function. */ #define HAVE_TCGETATTR 1 @@ -371,7 +371,7 @@ #define HAVE_TCSETATTR 1 /* Define to 1 if you have the `tdestroy' function. */ -#define HAVE_TDESTROY 1 +// #define HAVE_TDESTROY 1 /* Define if we have ncurses/terminfo or termcap */ /* #undef HAVE_TERMCAP */ @@ -380,7 +380,7 @@ /* #undef HAVE_TERMCAP_H */ /* Define to 1 if you have the header file. */ -#define HAVE_TERMIOS_H 1 +// #define HAVE_TERMIOS_H 1 // Managed by CMAKE /* Define to 1 if you have the header file. */ /* #undef HAVE_TERMIO_H */ @@ -393,7 +393,7 @@ #define HAVE_TM_ZONE 1 /* Define to 1 if you have the `tsearch' function. */ -#define HAVE_TSEARCH 1 +// #define HAVE_TSEARCH 1 /* Define to 1 if you don't have `tm_zone' but do have the external array `tzname'. */ @@ -403,7 +403,7 @@ /* #undef HAVE_ULIMIT */ /* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 +// #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `utimes' function. */ #define HAVE_UTIMES 1 @@ -433,7 +433,7 @@ /* #undef HAVE__PROC_MEMINFO */ /* Define to 1 if the system has the type `__sighandler_t'. */ -#define HAVE___SIGHANDLER_T 1 +// #define HAVE___SIGHANDLER_T 1 /* Client-Server only via stdio. */ /* #undef IPC_DEBUG_VIA_STDIO */ @@ -442,7 +442,7 @@ #define IPC_UNIX_SOCKETS 1 /* Define if we want KLU linear systems solver */ -#define KLU /**/ +#define KLU 1 /* Define to the sub-directory where libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -481,7 +481,7 @@ /* #undef OLD_BISON */ /* The OSDI enhancements */ -#define OSDI 1 +// #define OSDI 1 /* Other Operating System */ #define OS_COMPILED 6 diff --git a/src/spicelib/parser/inpptree-parser.c b/src/spicelib/parser/inpptree-parser.c new file mode 100644 index 000000000..b4e2ea295 --- /dev/null +++ b/src/spicelib/parser/inpptree-parser.c @@ -0,0 +1,1756 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + +/* Substitute the variable and function names. */ +#define yyparse PTparse +#define yylex PTlex +#define yyerror PTerror +#define yydebug PTdebug +#define yynerrs PTnerrs + +/* First part of user prologue. */ +#line 1 "../../../../src/spicelib/parser/inpptree-parser.y" + + /* + * (compile (concat "bison -ydo inpptree-parser.c " (file-relative-name buffer-file-name))) + */ + + #include "ngspice/ngspice.h" + #include "ngspice/inpptree.h" + + #include + #include + + # define YYLTYPE struct PTltype + + #include "inpptree-parser.h" + #include "inpptree-parser-y.h" + + + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) { \ + (Current).start = YYRHSLOC(Rhs, 1).start; \ + (Current).stop = YYRHSLOC(Rhs, N).stop; \ + } else { \ + (Current).start = (Current).stop = YYRHSLOC(Rhs, 0).stop; \ + } \ + while (0) + + static void PTerror (YYLTYPE *locp, char **line, struct INPparseNode **retval, void *ckt, char const *); + +#line 106 "inpptree-parser.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Use api.header.include to #include this header + instead of duplicating it here. */ +#ifndef YY_PT_INPPTREE_PARSER_H_INCLUDED +# define YY_PT_INPPTREE_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int PTdebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + TOK_NUM = 258, /* TOK_NUM */ + TOK_STR = 259, /* TOK_STR */ + TOK_pnode = 260, /* TOK_pnode */ + TOK_LE = 261, /* TOK_LE */ + TOK_LT = 262, /* TOK_LT */ + TOK_GE = 263, /* TOK_GE */ + TOK_GT = 264, /* TOK_GT */ + TOK_EQ = 265, /* TOK_EQ */ + TOK_NE = 266, /* TOK_NE */ + TOK_OR = 267, /* TOK_OR */ + TOK_AND = 268, /* TOK_AND */ + NEG = 269 /* NEG */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 +#define TOK_NUM 258 +#define TOK_STR 259 +#define TOK_pnode 260 +#define TOK_LE 261 +#define TOK_LT 262 +#define TOK_GE 263 +#define TOK_GT 264 +#define TOK_EQ 265 +#define TOK_NE 266 +#define TOK_OR 267 +#define TOK_AND 268 +#define NEG 269 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 43 "../../../../src/spicelib/parser/inpptree-parser.y" + + double num; + const char *str; + struct INPparseNode *pnode; + +#line 193 "inpptree-parser.c" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + +/* Location type. */ +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + + + +int PTparse (char **line, struct INPparseNode **retval, CKTcircuit *ckt); + + +#endif /* !YY_PT_INPPTREE_PARSER_H_INCLUDED */ +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_TOK_NUM = 3, /* TOK_NUM */ + YYSYMBOL_TOK_STR = 4, /* TOK_STR */ + YYSYMBOL_TOK_pnode = 5, /* TOK_pnode */ + YYSYMBOL_TOK_LE = 6, /* TOK_LE */ + YYSYMBOL_TOK_LT = 7, /* TOK_LT */ + YYSYMBOL_TOK_GE = 8, /* TOK_GE */ + YYSYMBOL_TOK_GT = 9, /* TOK_GT */ + YYSYMBOL_TOK_EQ = 10, /* TOK_EQ */ + YYSYMBOL_TOK_NE = 11, /* TOK_NE */ + YYSYMBOL_12_ = 12, /* ',' */ + YYSYMBOL_13_ = 13, /* '?' */ + YYSYMBOL_14_ = 14, /* ':' */ + YYSYMBOL_TOK_OR = 15, /* TOK_OR */ + YYSYMBOL_TOK_AND = 16, /* TOK_AND */ + YYSYMBOL_17_ = 17, /* '-' */ + YYSYMBOL_18_ = 18, /* '+' */ + YYSYMBOL_19_ = 19, /* '*' */ + YYSYMBOL_20_ = 20, /* '/' */ + YYSYMBOL_NEG = 21, /* NEG */ + YYSYMBOL_22_ = 22, /* '!' */ + YYSYMBOL_23_ = 23, /* '^' */ + YYSYMBOL_24_ = 24, /* '(' */ + YYSYMBOL_25_ = 25, /* ')' */ + YYSYMBOL_YYACCEPT = 26, /* $accept */ + YYSYMBOL_expression = 27, /* expression */ + YYSYMBOL_exp = 28, /* exp */ + YYSYMBOL_nonempty_arglist = 29 /* nonempty_arglist */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* !defined yyoverflow */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 15 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 147 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 26 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 4 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 26 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 52 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 269 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 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, 22, 2, 2, 2, 2, 2, 2, + 24, 25, 19, 18, 12, 17, 2, 20, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 14, 2, + 2, 2, 2, 13, 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, 23, 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, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 15, 16, 21 +}; + +#if YYDEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint8 yyrline[] = +{ + 0, 77, 77, 86, 87, 89, 90, 91, 92, 93, + 95, 97, 98, 100, 105, 107, 112, 113, 114, 115, + 116, 117, 119, 123, 127, 132, 133 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "TOK_NUM", "TOK_STR", + "TOK_pnode", "TOK_LE", "TOK_LT", "TOK_GE", "TOK_GT", "TOK_EQ", "TOK_NE", + "','", "'?'", "':'", "TOK_OR", "TOK_AND", "'-'", "'+'", "'*'", "'/'", + "NEG", "'!'", "'^'", "'('", "')'", "$accept", "expression", "exp", + "nonempty_arglist", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-18) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-1) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int8 yypact[] = +{ + 24, -18, -17, -18, 24, 24, 24, 24, 9, 81, + 24, -13, -13, -13, 43, -18, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 81, 14, -18, 13, 13, 13, 13, 124, 124, 63, + 99, 117, -15, -15, -13, -13, -18, 24, -18, 24, + 81, 81 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 0, 3, 4, 14, 0, 0, 0, 0, 0, 2, + 0, 11, 12, 24, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 10, 21, 19, 20, 18, 16, 17, 0, + 22, 23, 6, 5, 7, 8, 9, 0, 13, 0, + 26, 15 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -18, -18, -4, -18 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + 0, 8, 9, 31 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = +{ + 11, 12, 13, 14, 27, 28, 30, 10, 29, 15, + 29, 0, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 1, 2, 3, + 25, 26, 27, 28, 0, 0, 29, 0, 0, 48, + 0, 4, 5, 50, 0, 51, 6, 0, 7, 16, + 17, 18, 19, 20, 21, 0, 22, 0, 23, 24, + 25, 26, 27, 28, 0, 0, 29, 0, 32, 16, + 17, 18, 19, 20, 21, 0, 22, 49, 23, 24, + 25, 26, 27, 28, 0, 0, 29, 16, 17, 18, + 19, 20, 21, 0, 22, 0, 23, 24, 25, 26, + 27, 28, 0, 0, 29, 16, 17, 18, 19, 20, + 21, 0, 0, 0, 0, 24, 25, 26, 27, 28, + 0, 0, 29, 16, 17, 18, 19, 20, 21, 0, + 16, 17, 18, 19, 25, 26, 27, 28, 0, 0, + 29, 25, 26, 27, 28, 0, 0, 29 +}; + +static const yytype_int8 yycheck[] = +{ + 4, 5, 6, 7, 19, 20, 10, 24, 23, 0, + 23, -1, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 12, 3, 4, 5, + 17, 18, 19, 20, -1, -1, 23, -1, -1, 25, + -1, 17, 18, 47, -1, 49, 22, -1, 24, 6, + 7, 8, 9, 10, 11, -1, 13, -1, 15, 16, + 17, 18, 19, 20, -1, -1, 23, -1, 25, 6, + 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, + 17, 18, 19, 20, -1, -1, 23, 6, 7, 8, + 9, 10, 11, -1, 13, -1, 15, 16, 17, 18, + 19, 20, -1, -1, 23, 6, 7, 8, 9, 10, + 11, -1, -1, -1, -1, 16, 17, 18, 19, 20, + -1, -1, 23, 6, 7, 8, 9, 10, 11, -1, + 6, 7, 8, 9, 17, 18, 19, 20, -1, -1, + 23, 17, 18, 19, 20, -1, -1, 23 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 3, 4, 5, 17, 18, 22, 24, 27, 28, + 24, 28, 28, 28, 28, 0, 6, 7, 8, 9, + 10, 11, 13, 15, 16, 17, 18, 19, 20, 23, + 28, 29, 25, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 12, 25, 14, + 28, 28 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = +{ + 0, 26, 27, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 29, 29 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 1, 1, 3, 3, 3, 3, 3, + 3, 2, 2, 4, 1, 5, 3, 3, 3, 3, + 3, 3, 3, 3, 2, 1, 3 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, line, retval, ckt, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + +/* YYLOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +# ifndef YYLOCATION_PRINT + +# if defined YY_LOCATION_PRINT + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + +# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + +/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ + +YY_ATTRIBUTE_UNUSED +static int +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +{ + int res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); + } + return res; +} + +# define YYLOCATION_PRINT yy_location_print_ + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) + +# else + +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + +# endif +# endif /* !defined YYLOCATION_PRINT */ + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location, line, retval, ckt); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char **line, struct INPparseNode **retval, CKTcircuit *ckt) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (yylocationp); + YY_USE (line); + YY_USE (retval); + YY_USE (ckt); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char **line, struct INPparseNode **retval, CKTcircuit *ckt) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + YYLOCATION_PRINT (yyo, yylocationp); + YYFPRINTF (yyo, ": "); + yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, line, retval, ckt); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, + int yyrule, char **line, struct INPparseNode **retval, CKTcircuit *ckt) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)]), line, retval, ckt); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, line, retval, ckt); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + + + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, char **line, struct INPparseNode **retval, CKTcircuit *ckt) +{ + YY_USE (yyvaluep); + YY_USE (yylocationp); + YY_USE (line); + YY_USE (retval); + YY_USE (ckt); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (char **line, struct INPparseNode **retval, CKTcircuit *ckt) +{ +/* Lookahead token kind. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; + + /* Number of syntax errors so far. */ + int yynerrs = 0; + + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + /* The location stack: array, bottom, top. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp = yyls; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; /* Cause a token to be read. */ + + +/* User initialization code. */ +#line 70 "../../../../src/spicelib/parser/inpptree-parser.y" +{ + yylval.num = 0.0; + yylloc.start = yylloc.stop = NULL; +} + +#line 1180 "inpptree-parser.c" + + yyvsp[0] = yylval; + yylsp[0] = yylloc; + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc, line); + } + + if (yychar <= YYEOF) + { + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + *++yylsp = yylloc; + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + yyerror_range[1] = yyloc; + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* expression: exp */ +#line 78 "../../../../src/spicelib/parser/inpptree-parser.y" + { + *retval = (yyvsp[0].pnode); + *line = (yylsp[0]).stop; + YYACCEPT; + } +#line 1398 "inpptree-parser.c" + break; + + case 3: /* exp: TOK_NUM */ +#line 86 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mknnode((yyvsp[0].num)); } +#line 1404 "inpptree-parser.c" + break; + + case 4: /* exp: TOK_STR */ +#line 87 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mksnode((yyvsp[0].str), ckt); txfree((yyvsp[0].str)); } +#line 1410 "inpptree-parser.c" + break; + + case 5: /* exp: exp '+' exp */ +#line 89 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkbnode("+", (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1416 "inpptree-parser.c" + break; + + case 6: /* exp: exp '-' exp */ +#line 90 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkbnode("-", (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1422 "inpptree-parser.c" + break; + + case 7: /* exp: exp '*' exp */ +#line 91 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkbnode("*", (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1428 "inpptree-parser.c" + break; + + case 8: /* exp: exp '/' exp */ +#line 92 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkbnode("/", (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1434 "inpptree-parser.c" + break; + + case 9: /* exp: exp '^' exp */ +#line 93 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkbnode("^", (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1440 "inpptree-parser.c" + break; + + case 10: /* exp: '(' exp ')' */ +#line 95 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = (yyvsp[-1].pnode); } +#line 1446 "inpptree-parser.c" + break; + + case 11: /* exp: '-' exp */ +#line 97 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("-",(yyvsp[0].pnode)); } +#line 1452 "inpptree-parser.c" + break; + + case 12: /* exp: '+' exp */ +#line 98 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = (yyvsp[0].pnode); } +#line 1458 "inpptree-parser.c" + break; + + case 13: /* exp: TOK_STR '(' nonempty_arglist ')' */ +#line 100 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode((yyvsp[-3].str), (yyvsp[-1].pnode)); + if (!(yyval.pnode)) + YYERROR; + txfree((yyvsp[-3].str)); } +#line 1467 "inpptree-parser.c" + break; + + case 15: /* exp: exp '?' exp ':' exp */ +#line 107 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("ternary_fcn", + PT_mkbnode(",", + PT_mkbnode(",", (yyvsp[-4].pnode), (yyvsp[-2].pnode)), + (yyvsp[0].pnode))); } +#line 1476 "inpptree-parser.c" + break; + + case 16: /* exp: exp TOK_EQ exp */ +#line 112 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("eq0", PT_mkbnode("-",(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1482 "inpptree-parser.c" + break; + + case 17: /* exp: exp TOK_NE exp */ +#line 113 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("ne0", PT_mkbnode("-",(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1488 "inpptree-parser.c" + break; + + case 18: /* exp: exp TOK_GT exp */ +#line 114 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("gt0", PT_mkbnode("-",(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1494 "inpptree-parser.c" + break; + + case 19: /* exp: exp TOK_LT exp */ +#line 115 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("lt0", PT_mkbnode("-",(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1500 "inpptree-parser.c" + break; + + case 20: /* exp: exp TOK_GE exp */ +#line 116 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("ge0", PT_mkbnode("-",(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1506 "inpptree-parser.c" + break; + + case 21: /* exp: exp TOK_LE exp */ +#line 117 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("le0", PT_mkbnode("-",(yyvsp[-2].pnode),(yyvsp[0].pnode))); } +#line 1512 "inpptree-parser.c" + break; + + case 22: /* exp: exp TOK_OR exp */ +#line 119 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("ne0", + PT_mkbnode("+", + PT_mkfnode("ne0", (yyvsp[-2].pnode)), + PT_mkfnode("ne0", (yyvsp[0].pnode)))); } +#line 1521 "inpptree-parser.c" + break; + + case 23: /* exp: exp TOK_AND exp */ +#line 123 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("eq0", + PT_mkbnode("+", + PT_mkfnode("eq0", (yyvsp[-2].pnode)), + PT_mkfnode("eq0", (yyvsp[0].pnode)))); } +#line 1530 "inpptree-parser.c" + break; + + case 24: /* exp: '!' exp */ +#line 127 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkfnode("eq0", (yyvsp[0].pnode)); } +#line 1536 "inpptree-parser.c" + break; + + case 26: /* nonempty_arglist: nonempty_arglist ',' exp */ +#line 133 "../../../../src/spicelib/parser/inpptree-parser.y" + { (yyval.pnode) = PT_mkbnode(",", (yyvsp[-2].pnode), (yyvsp[0].pnode)); } +#line 1542 "inpptree-parser.c" + break; + + +#line 1546 "inpptree-parser.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + yyerror (&yylloc, line, retval, ckt, YY_("syntax error")); + } + + yyerror_range[1] = yylloc; + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, line, retval, ckt); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + yyerror_range[1] = *yylsp; + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, line, retval, ckt); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + yyerror_range[2] = yylloc; + ++yylsp; + YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (&yylloc, line, retval, ckt, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, line, retval, ckt); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, line, retval, ckt); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + + return yyresult; +} + +#line 135 "../../../../src/spicelib/parser/inpptree-parser.y" + + + +/* Called by yyparse on error. */ +static void +PTerror (YYLTYPE *locp, char **line, struct INPparseNode **retval, void *ckt, char const *s) +{ + NG_IGNORE(line); + NG_IGNORE(retval); + NG_IGNORE(ckt); + + fprintf (stderr, "\n%s: %s, parsing stopped at\n %s\n\n", __func__, s, locp->start); +} diff --git a/src/spicelib/parser/inpptree-parser.h b/src/spicelib/parser/inpptree-parser.h new file mode 100644 index 000000000..280c56e4f --- /dev/null +++ b/src/spicelib/parser/inpptree-parser.h @@ -0,0 +1,128 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_PT_INPPTREE_PARSER_H_INCLUDED +# define YY_PT_INPPTREE_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int PTdebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + TOK_NUM = 258, /* TOK_NUM */ + TOK_STR = 259, /* TOK_STR */ + TOK_pnode = 260, /* TOK_pnode */ + TOK_LE = 261, /* TOK_LE */ + TOK_LT = 262, /* TOK_LT */ + TOK_GE = 263, /* TOK_GE */ + TOK_GT = 264, /* TOK_GT */ + TOK_EQ = 265, /* TOK_EQ */ + TOK_NE = 266, /* TOK_NE */ + TOK_OR = 267, /* TOK_OR */ + TOK_AND = 268, /* TOK_AND */ + NEG = 269 /* NEG */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 +#define TOK_NUM 258 +#define TOK_STR 259 +#define TOK_pnode 260 +#define TOK_LE 261 +#define TOK_LT 262 +#define TOK_GE 263 +#define TOK_GT 264 +#define TOK_EQ 265 +#define TOK_NE 266 +#define TOK_OR 267 +#define TOK_AND 268 +#define NEG 269 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 43 "../../../../src/spicelib/parser/inpptree-parser.y" + + double num; + const char *str; + struct INPparseNode *pnode; + +#line 101 "inpptree-parser.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + +/* Location type. */ +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE YYLTYPE; +struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +}; +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + + + +int PTparse (char **line, struct INPparseNode **retval, CKTcircuit *ckt); + + +#endif /* !YY_PT_INPPTREE_PARSER_H_INCLUDED */ diff --git a/src/xspice/cmpp/.gitignore b/src/xspice/cmpp/.gitignore index 31f94eedf..bb764c5d9 100644 --- a/src/xspice/cmpp/.gitignore +++ b/src/xspice/cmpp/.gitignore @@ -1,7 +1,7 @@ -/mod_yacc.c -/mod_yacc.h -/mod_lex.c +# /mod_yacc.c +# /mod_yacc.h +# /mod_lex.c -/ifs_yacc.c -/ifs_yacc.h -/ifs_lex.c +# /ifs_yacc.c +# /ifs_yacc.h +# /ifs_lex.c diff --git a/src/xspice/cmpp/ifs_lex.c b/src/xspice/cmpp/ifs_lex.c new file mode 100644 index 000000000..835d07c12 --- /dev/null +++ b/src/xspice/cmpp/ifs_lex.c @@ -0,0 +1,2780 @@ +#line 2 "ifs_lex.c" + +#line 4 "ifs_lex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer ifs_yy_create_buffer +#define yy_delete_buffer ifs_yy_delete_buffer +#define yy_scan_buffer ifs_yy_scan_buffer +#define yy_scan_string ifs_yy_scan_string +#define yy_scan_bytes ifs_yy_scan_bytes +#define yy_init_buffer ifs_yy_init_buffer +#define yy_flush_buffer ifs_yy_flush_buffer +#define yy_load_buffer_state ifs_yy_load_buffer_state +#define yy_switch_to_buffer ifs_yy_switch_to_buffer +#define yypush_buffer_state ifs_yypush_buffer_state +#define yypop_buffer_state ifs_yypop_buffer_state +#define yyensure_buffer_stack ifs_yyensure_buffer_stack +#define yy_flex_debug ifs_yy_flex_debug +#define yyin ifs_yyin +#define yyleng ifs_yyleng +#define yylex ifs_yylex +#define yylineno ifs_yylineno +#define yyout ifs_yyout +#define yyrestart ifs_yyrestart +#define yytext ifs_yytext +#define yywrap ifs_yywrap +#define yyalloc ifs_yyalloc +#define yyrealloc ifs_yyrealloc +#define yyfree ifs_yyfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define ifs_yy_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer ifs_yy_create_buffer +#endif + +#ifdef yy_delete_buffer +#define ifs_yy_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer ifs_yy_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define ifs_yy_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer ifs_yy_scan_buffer +#endif + +#ifdef yy_scan_string +#define ifs_yy_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string ifs_yy_scan_string +#endif + +#ifdef yy_scan_bytes +#define ifs_yy_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes ifs_yy_scan_bytes +#endif + +#ifdef yy_init_buffer +#define ifs_yy_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer ifs_yy_init_buffer +#endif + +#ifdef yy_flush_buffer +#define ifs_yy_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer ifs_yy_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define ifs_yy_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state ifs_yy_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define ifs_yy_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer ifs_yy_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define ifs_yypush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state ifs_yypush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define ifs_yypop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state ifs_yypop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define ifs_yyensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack ifs_yyensure_buffer_stack +#endif + +#ifdef yylex +#define ifs_yylex_ALREADY_DEFINED +#else +#define yylex ifs_yylex +#endif + +#ifdef yyrestart +#define ifs_yyrestart_ALREADY_DEFINED +#else +#define yyrestart ifs_yyrestart +#endif + +#ifdef yylex_init +#define ifs_yylex_init_ALREADY_DEFINED +#else +#define yylex_init ifs_yylex_init +#endif + +#ifdef yylex_init_extra +#define ifs_yylex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra ifs_yylex_init_extra +#endif + +#ifdef yylex_destroy +#define ifs_yylex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy ifs_yylex_destroy +#endif + +#ifdef yyget_debug +#define ifs_yyget_debug_ALREADY_DEFINED +#else +#define yyget_debug ifs_yyget_debug +#endif + +#ifdef yyset_debug +#define ifs_yyset_debug_ALREADY_DEFINED +#else +#define yyset_debug ifs_yyset_debug +#endif + +#ifdef yyget_extra +#define ifs_yyget_extra_ALREADY_DEFINED +#else +#define yyget_extra ifs_yyget_extra +#endif + +#ifdef yyset_extra +#define ifs_yyset_extra_ALREADY_DEFINED +#else +#define yyset_extra ifs_yyset_extra +#endif + +#ifdef yyget_in +#define ifs_yyget_in_ALREADY_DEFINED +#else +#define yyget_in ifs_yyget_in +#endif + +#ifdef yyset_in +#define ifs_yyset_in_ALREADY_DEFINED +#else +#define yyset_in ifs_yyset_in +#endif + +#ifdef yyget_out +#define ifs_yyget_out_ALREADY_DEFINED +#else +#define yyget_out ifs_yyget_out +#endif + +#ifdef yyset_out +#define ifs_yyset_out_ALREADY_DEFINED +#else +#define yyset_out ifs_yyset_out +#endif + +#ifdef yyget_leng +#define ifs_yyget_leng_ALREADY_DEFINED +#else +#define yyget_leng ifs_yyget_leng +#endif + +#ifdef yyget_text +#define ifs_yyget_text_ALREADY_DEFINED +#else +#define yyget_text ifs_yyget_text +#endif + +#ifdef yyget_lineno +#define ifs_yyget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno ifs_yyget_lineno +#endif + +#ifdef yyset_lineno +#define ifs_yyset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno ifs_yyset_lineno +#endif + +#ifdef yywrap +#define ifs_yywrap_ALREADY_DEFINED +#else +#define yywrap ifs_yywrap +#endif + +#ifdef yyalloc +#define ifs_yyalloc_ALREADY_DEFINED +#else +#define yyalloc ifs_yyalloc +#endif + +#ifdef yyrealloc +#define ifs_yyrealloc_ALREADY_DEFINED +#else +#define yyrealloc ifs_yyrealloc +#endif + +#ifdef yyfree +#define ifs_yyfree_ALREADY_DEFINED +#else +#define yyfree ifs_yyfree +#endif + +#ifdef yytext +#define ifs_yytext_ALREADY_DEFINED +#else +#define yytext ifs_yytext +#endif + +#ifdef yyleng +#define ifs_yyleng_ALREADY_DEFINED +#else +#define yyleng ifs_yyleng +#endif + +#ifdef yyin +#define ifs_yyin_ALREADY_DEFINED +#else +#define yyin ifs_yyin +#endif + +#ifdef yyout +#define ifs_yyout_ALREADY_DEFINED +#else +#define yyout ifs_yyout +#endif + +#ifdef yy_flex_debug +#define ifs_yy_flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug ifs_yy_flex_debug +#endif + +#ifdef yylineno +#define ifs_yylineno_ALREADY_DEFINED +#else +#define yylineno ifs_yylineno +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern int yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE yylex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-yylineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + int yyl;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ + }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = NULL; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); + +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); + +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define ifs_yywrap() (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +FILE *yyin = NULL, *yyout = NULL; + +typedef int yy_state_type; + +extern int yylineno; +int yylineno = 1; + +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; +#define YY_NUM_RULES 64 +#define YY_END_OF_BUFFER 65 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[344] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 7, 7, 65, 62, 63, 6, 62, 55, + 56, 62, 62, 58, 51, 52, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 53, 54, 57, + 57, 41, 37, 39, 35, 32, 57, 57, 57, 57, + 57, 57, 57, 57, 2, 4, 3, 7, 8, 0, + 58, 60, 1, 59, 0, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 29, 57, 38, 40, 36, 33, 57, 42, + 57, 57, 57, 57, 57, 57, 57, 2, 3, 3, + + 5, 7, 0, 59, 0, 0, 61, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 28, 57, 57, 43, 57, 57, 46, + 57, 57, 57, 0, 60, 0, 0, 59, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 30, 57, 34, 57, 57, 57, 57, 45, + 57, 0, 59, 57, 57, 57, 57, 57, 57, 31, + 57, 57, 57, 57, 57, 57, 57, 57, 44, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + + 57, 49, 57, 57, 57, 57, 57, 57, 0, 22, + 57, 57, 57, 57, 57, 57, 57, 0, 10, 57, + 47, 48, 50, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 0, 15, 57, 57, 57, 0, + 19, 57, 57, 57, 0, 13, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 0, 23, 57, 57, 57, + 0, 14, 57, 57, 57, 57, 57, 57, 57, 0, + 18, 57, 57, 57, 57, 57, 57, 57, 57, 57, + + 0, 16, 57, 0, 24, 57, 57, 57, 57, 57, + 57, 0, 9, 57, 0, 17, 57, 57, 57, 57, + 57, 0, 11, 57, 0, 25, 57, 57, 57, 57, + 0, 12, 0, 26, 57, 0, 20, 57, 0, 27, + 0, 21, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, + 1, 5, 6, 7, 8, 9, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 12, 1, 13, + 1, 14, 1, 1, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, + 24, 30, 31, 32, 33, 34, 35, 36, 37, 24, + 38, 1, 39, 1, 40, 1, 41, 42, 43, 44, + + 45, 46, 47, 48, 49, 24, 24, 50, 51, 52, + 53, 54, 24, 55, 56, 57, 58, 59, 60, 61, + 62, 24, 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 const YY_CHAR yy_meta[63] = + { 0, + 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, + 5, 1, 1, 1, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 1, 1, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5 + } ; + +static const flex_int16_t yy_base[351] = + { 0, + 0, 0, 36, 37, 82, 124, 42, 43, 168, 209, + 64, 72, 796, 773, 764, 1047, 1047, 1047, 67, 1047, + 70, 751, 742, 74, 1047, 1047, 57, 683, 61, 91, + 79, 86, 122, 97, 132, 104, 133, 1047, 1047, 154, + 143, 226, 69, 149, 159, 202, 163, 142, 128, 190, + 181, 216, 183, 224, 0, 1047, 112, 0, 1047, 681, + 251, 223, 1047, 255, 198, 0, 675, 248, 265, 250, + 266, 225, 268, 273, 276, 278, 261, 279, 100, 290, + 277, 297, 551, 295, 550, 545, 505, 454, 302, 293, + 304, 309, 312, 318, 319, 330, 337, 0, 209, 334, + + 1047, 0, 347, 314, 358, 395, 394, 345, 321, 361, + 366, 369, 346, 359, 371, 374, 372, 373, 376, 378, + 385, 390, 392, 349, 399, 393, 336, 388, 389, 308, + 400, 405, 417, 284, 283, 423, 281, 272, 116, 412, + 117, 421, 426, 430, 425, 435, 434, 437, 442, 446, + 450, 448, 239, 447, 237, 451, 461, 465, 452, 205, + 467, 194, 185, 477, 474, 471, 476, 487, 488, 168, + 493, 491, 496, 494, 503, 449, 501, 510, 155, 516, + 514, 523, 530, 532, 521, 527, 535, 518, 547, 571, + 560, 541, 552, 570, 575, 543, 568, 595, 576, 569, + + 582, 137, 577, 591, 584, 589, 588, 593, 620, 1047, + 599, 608, 607, 613, 620, 614, 616, 641, 1047, 638, + 113, 110, 107, 636, 623, 637, 649, 646, 644, 648, + 650, 654, 655, 652, 661, 674, 659, 677, 680, 708, + 679, 686, 693, 722, 707, 688, 702, 726, 711, 724, + 706, 720, 729, 733, 747, 1047, 734, 740, 743, 764, + 1047, 769, 749, 764, 790, 1047, 795, 774, 744, 776, + 763, 778, 790, 746, 808, 810, 1047, 807, 812, 818, + 829, 1047, 775, 815, 825, 806, 823, 837, 833, 843, + 1047, 854, 847, 852, 843, 860, 865, 866, 879, 863, + + 881, 1047, 897, 884, 1047, 891, 892, 877, 893, 896, + 913, 918, 1047, 894, 925, 1047, 929, 915, 922, 924, + 934, 944, 1047, 950, 952, 1047, 955, 952, 974, 959, + 977, 1047, 979, 1047, 990, 993, 1047, 996, 1007, 1047, + 1009, 1047, 1047, 1021, 1026, 81, 1031, 1036, 1041, 79 + } ; + +static const flex_int16_t yy_def[351] = + { 0, + 343, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 344, 344, 345, 345, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 343, 343, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 347, 343, 348, 349, 343, 343, + 343, 343, 343, 343, 343, 350, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 347, 348, 348, + + 343, 349, 343, 343, 343, 343, 343, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 343, 343, 343, 343, 343, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 343, 343, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + + 346, 346, 346, 346, 346, 346, 346, 346, 343, 343, + 346, 346, 346, 346, 346, 346, 346, 343, 343, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, + 346, 346, 346, 346, 343, 343, 346, 346, 346, 343, + 343, 346, 346, 346, 343, 343, 346, 346, 346, 346, + 346, 346, 346, 346, 346, 343, 343, 346, 346, 346, + 343, 343, 346, 346, 346, 346, 346, 346, 346, 343, + 343, 346, 346, 346, 346, 346, 346, 346, 346, 346, + + 343, 343, 346, 343, 343, 346, 346, 346, 346, 346, + 346, 343, 343, 346, 343, 343, 346, 346, 346, 346, + 346, 343, 343, 346, 343, 343, 346, 346, 346, 346, + 343, 343, 343, 343, 346, 343, 343, 346, 343, 343, + 343, 343, 0, 343, 343, 343, 343, 343, 343, 343 + } ; + +static const flex_int16_t yy_nxt[1110] = + { 0, + 16, 16, 17, 18, 16, 19, 20, 21, 22, 23, + 24, 16, 25, 26, 27, 28, 29, 30, 28, 31, + 28, 28, 28, 28, 32, 28, 33, 28, 34, 28, + 35, 36, 28, 37, 28, 28, 28, 38, 39, 28, + 27, 28, 29, 30, 28, 31, 28, 28, 28, 32, + 28, 33, 28, 34, 28, 35, 36, 28, 37, 28, + 28, 28, 40, 40, 47, 47, 56, 66, 57, 48, + 48, 66, 41, 41, 56, 60, 57, 61, 60, 66, + 61, 68, 64, 66, 61, 67, 85, 40, 40, 66, + 47, 47, 65, 73, 48, 48, 66, 41, 41, 42, + + 69, 66, 43, 44, 45, 70, 68, 66, 74, 71, + 66, 77, 85, 72, 66, 46, 100, 66, 65, 73, + 66, 101, 120, 66, 78, 42, 66, 66, 43, 44, + 45, 70, 66, 81, 74, 71, 75, 77, 66, 72, + 46, 42, 66, 66, 43, 44, 45, 66, 120, 78, + 164, 82, 66, 66, 76, 92, 166, 46, 81, 66, + 79, 84, 75, 80, 66, 66, 86, 42, 75, 66, + 43, 44, 45, 66, 91, 164, 87, 82, 66, 76, + 92, 83, 46, 49, 50, 79, 76, 84, 80, 90, + 51, 66, 86, 66, 75, 163, 52, 53, 54, 91, + + 66, 96, 87, 106, 163, 106, 83, 94, 107, 49, + 50, 76, 66, 343, 90, 66, 51, 93, 343, 88, + 82, 52, 53, 54, 49, 50, 66, 96, 89, 69, + 77, 51, 94, 62, 66, 66, 66, 52, 53, 54, + 70, 103, 93, 95, 71, 88, 82, 66, 72, 66, + 49, 50, 79, 89, 113, 97, 77, 51, 66, 64, + 66, 61, 52, 53, 54, 104, 70, 103, 95, 65, + 71, 66, 108, 105, 72, 66, 66, 79, 66, 113, + 97, 110, 138, 66, 109, 111, 66, 66, 66, 66, + 118, 138, 114, 135, 135, 65, 112, 108, 115, 105, + + 66, 116, 117, 66, 121, 66, 110, 66, 119, 122, + 109, 111, 66, 123, 66, 118, 125, 114, 66, 66, + 126, 112, 66, 115, 104, 124, 116, 117, 66, 66, + 121, 66, 136, 119, 122, 127, 128, 129, 100, 123, + 66, 131, 125, 101, 132, 126, 66, 66, 119, 130, + 124, 121, 134, 140, 134, 66, 66, 135, 136, 66, + 127, 128, 129, 137, 144, 137, 133, 131, 138, 66, + 132, 66, 139, 119, 130, 141, 66, 121, 140, 66, + 142, 66, 66, 66, 66, 143, 66, 149, 66, 145, + 144, 133, 147, 146, 151, 66, 148, 139, 66, 66, + + 66, 141, 66, 66, 107, 107, 142, 150, 153, 66, + 66, 143, 157, 149, 145, 66, 152, 158, 147, 146, + 151, 148, 66, 154, 155, 156, 159, 66, 162, 160, + 162, 66, 150, 163, 153, 66, 66, 157, 165, 161, + 66, 152, 158, 170, 66, 66, 169, 66, 154, 155, + 156, 159, 66, 167, 160, 168, 66, 66, 66, 66, + 66, 66, 66, 165, 66, 161, 171, 174, 176, 170, + 177, 66, 169, 172, 178, 66, 173, 66, 167, 180, + 168, 66, 179, 182, 66, 175, 66, 66, 196, 181, + 185, 171, 174, 183, 176, 184, 177, 66, 66, 178, + + 187, 66, 186, 66, 66, 180, 66, 179, 182, 188, + 192, 66, 193, 66, 181, 66, 185, 197, 183, 189, + 66, 184, 191, 190, 66, 187, 66, 186, 66, 194, + 199, 66, 200, 66, 195, 188, 192, 66, 193, 198, + 66, 201, 66, 197, 189, 66, 207, 191, 190, 203, + 202, 66, 204, 66, 194, 66, 199, 66, 200, 195, + 66, 66, 66, 205, 198, 212, 206, 201, 216, 208, + 66, 207, 209, 209, 211, 203, 202, 204, 66, 66, + 66, 66, 210, 213, 214, 66, 66, 66, 205, 215, + 212, 206, 66, 216, 66, 208, 218, 218, 66, 66, + + 211, 66, 221, 66, 222, 66, 219, 217, 213, 66, + 214, 223, 226, 225, 230, 215, 224, 66, 66, 228, + 229, 209, 209, 66, 66, 232, 66, 221, 227, 222, + 66, 210, 231, 66, 220, 234, 223, 226, 233, 225, + 230, 235, 218, 218, 228, 229, 66, 66, 66, 236, + 239, 232, 219, 237, 66, 240, 66, 231, 66, 66, + 66, 234, 66, 233, 66, 66, 235, 238, 243, 66, + 244, 66, 245, 248, 236, 239, 249, 246, 250, 237, + 241, 240, 242, 247, 66, 66, 252, 66, 251, 66, + 66, 62, 238, 66, 243, 244, 66, 245, 66, 248, + + 258, 249, 246, 66, 250, 241, 254, 242, 247, 255, + 255, 252, 66, 253, 251, 257, 66, 66, 66, 256, + 259, 66, 263, 260, 260, 262, 258, 265, 265, 267, + 66, 254, 66, 261, 66, 269, 66, 266, 253, 66, + 257, 264, 268, 66, 66, 259, 63, 263, 255, 255, + 66, 262, 270, 66, 66, 267, 66, 271, 256, 66, + 269, 62, 273, 343, 274, 260, 260, 278, 268, 275, + 276, 276, 272, 66, 66, 261, 59, 270, 289, 66, + 277, 286, 271, 284, 66, 66, 66, 273, 66, 274, + 279, 265, 265, 278, 275, 280, 281, 281, 283, 59, + + 66, 266, 285, 289, 287, 66, 282, 286, 288, 290, + 290, 276, 276, 343, 295, 279, 66, 66, 66, 291, + 280, 277, 66, 283, 292, 66, 293, 285, 66, 287, + 281, 281, 294, 66, 288, 66, 299, 300, 301, 301, + 282, 296, 298, 66, 290, 290, 297, 66, 302, 343, + 292, 303, 293, 66, 291, 304, 304, 66, 294, 343, + 343, 299, 66, 300, 66, 305, 296, 307, 298, 308, + 66, 297, 306, 66, 309, 66, 66, 303, 343, 310, + 312, 312, 301, 301, 343, 304, 304, 66, 314, 66, + 313, 319, 302, 307, 308, 305, 311, 306, 315, 315, + + 309, 66, 66, 66, 66, 310, 66, 66, 316, 317, + 343, 321, 324, 314, 322, 322, 318, 319, 320, 312, + 312, 311, 343, 66, 323, 66, 315, 315, 343, 313, + 325, 325, 66, 327, 66, 317, 316, 321, 324, 66, + 326, 318, 329, 320, 66, 322, 322, 328, 343, 343, + 343, 331, 331, 325, 325, 323, 333, 333, 330, 327, + 66, 332, 66, 326, 343, 66, 334, 343, 329, 66, + 335, 343, 328, 343, 343, 336, 336, 338, 331, 331, + 333, 333, 343, 330, 66, 337, 343, 343, 332, 343, + 334, 339, 339, 343, 336, 336, 335, 341, 341, 343, + + 66, 340, 343, 338, 337, 343, 66, 342, 339, 339, + 341, 341, 343, 343, 343, 343, 343, 343, 340, 343, + 342, 55, 55, 55, 55, 55, 58, 58, 58, 58, + 58, 98, 343, 98, 343, 98, 99, 343, 99, 99, + 99, 102, 102, 343, 102, 102, 15, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + + 343, 343, 343, 343, 343, 343, 343, 343, 343 + } ; + +static const flex_int16_t yy_chk[1110] = + { 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 4, 7, 8, 11, 27, 11, 7, + 8, 29, 3, 4, 12, 19, 12, 19, 21, 43, + 21, 27, 24, 350, 24, 346, 43, 3, 4, 31, + 7, 8, 24, 31, 7, 8, 32, 3, 4, 5, + + 29, 30, 5, 5, 5, 30, 27, 34, 32, 30, + 79, 34, 43, 30, 36, 5, 57, 223, 24, 31, + 222, 57, 79, 221, 34, 5, 139, 141, 5, 5, + 5, 30, 33, 36, 32, 30, 33, 34, 49, 30, + 5, 6, 35, 37, 6, 6, 6, 202, 79, 34, + 139, 37, 48, 41, 33, 49, 141, 6, 36, 44, + 35, 41, 33, 35, 40, 179, 44, 6, 40, 45, + 6, 6, 6, 47, 48, 139, 45, 37, 170, 33, + 49, 40, 6, 9, 9, 35, 40, 41, 35, 47, + 9, 51, 44, 53, 40, 163, 9, 9, 9, 48, + + 50, 53, 45, 65, 162, 65, 40, 51, 65, 9, + 9, 40, 46, 99, 47, 160, 9, 50, 99, 46, + 46, 9, 9, 9, 10, 10, 52, 53, 46, 50, + 52, 10, 51, 62, 54, 72, 42, 10, 10, 10, + 42, 62, 50, 52, 42, 46, 46, 155, 42, 153, + 10, 10, 54, 46, 72, 54, 52, 10, 68, 61, + 70, 61, 10, 10, 10, 64, 42, 62, 52, 61, + 42, 77, 68, 64, 42, 69, 71, 54, 73, 72, + 54, 70, 138, 74, 69, 71, 75, 81, 76, 78, + 77, 137, 73, 135, 134, 61, 71, 68, 74, 64, + + 80, 75, 76, 90, 80, 84, 70, 82, 78, 81, + 69, 71, 89, 82, 91, 77, 89, 73, 130, 92, + 90, 71, 93, 74, 104, 84, 75, 76, 94, 95, + 80, 109, 104, 78, 81, 91, 92, 93, 100, 82, + 96, 95, 89, 100, 96, 90, 127, 97, 95, 94, + 84, 97, 103, 109, 103, 108, 113, 103, 104, 124, + 91, 92, 93, 105, 113, 105, 97, 95, 105, 114, + 96, 110, 108, 95, 94, 110, 111, 97, 109, 112, + 111, 115, 117, 118, 116, 112, 119, 118, 120, 114, + 113, 97, 116, 115, 120, 121, 117, 108, 128, 129, + + 122, 110, 123, 126, 107, 106, 111, 119, 122, 125, + 131, 112, 128, 118, 114, 132, 121, 129, 116, 115, + 120, 117, 140, 123, 125, 126, 131, 133, 136, 132, + 136, 142, 119, 136, 122, 145, 143, 128, 140, 133, + 144, 121, 129, 145, 147, 146, 144, 148, 123, 125, + 126, 131, 149, 142, 132, 143, 150, 154, 152, 176, + 151, 156, 159, 140, 88, 133, 146, 149, 151, 145, + 152, 157, 144, 147, 154, 158, 148, 161, 142, 157, + 143, 166, 156, 159, 165, 150, 167, 164, 176, 158, + 165, 146, 149, 161, 151, 164, 152, 168, 169, 154, + + 167, 172, 166, 171, 174, 157, 173, 156, 159, 168, + 173, 177, 174, 175, 158, 87, 165, 177, 161, 169, + 178, 164, 172, 171, 181, 167, 180, 166, 188, 175, + 180, 185, 181, 182, 175, 168, 173, 186, 174, 178, + 183, 182, 184, 177, 169, 187, 188, 172, 171, 184, + 183, 192, 185, 196, 175, 86, 180, 189, 181, 175, + 85, 83, 193, 186, 178, 192, 187, 182, 196, 189, + 191, 188, 190, 190, 191, 184, 183, 185, 197, 200, + 194, 190, 190, 193, 194, 195, 199, 203, 186, 195, + 192, 187, 201, 196, 205, 189, 198, 198, 207, 206, + + 191, 204, 199, 208, 200, 198, 198, 197, 193, 211, + 194, 201, 205, 204, 211, 195, 203, 213, 212, 207, + 208, 209, 209, 214, 216, 213, 217, 199, 206, 200, + 215, 209, 212, 225, 198, 215, 201, 205, 214, 204, + 211, 216, 218, 218, 207, 208, 224, 226, 220, 217, + 225, 213, 218, 220, 229, 226, 228, 212, 230, 227, + 231, 215, 234, 214, 232, 233, 216, 224, 228, 237, + 229, 235, 230, 233, 217, 225, 234, 231, 235, 220, + 227, 226, 227, 232, 236, 67, 237, 238, 236, 241, + 239, 60, 224, 28, 228, 229, 242, 230, 246, 233, + + 242, 234, 231, 243, 235, 227, 239, 227, 232, 240, + 240, 237, 247, 238, 236, 241, 251, 245, 240, 240, + 243, 249, 246, 244, 244, 245, 242, 248, 248, 249, + 252, 239, 244, 244, 250, 251, 248, 248, 238, 253, + 241, 247, 250, 254, 257, 243, 23, 246, 255, 255, + 258, 245, 252, 259, 269, 249, 274, 253, 255, 263, + 251, 22, 257, 15, 258, 260, 260, 263, 250, 259, + 262, 262, 254, 271, 264, 260, 14, 252, 274, 262, + 262, 271, 253, 269, 268, 283, 270, 257, 272, 258, + 264, 265, 265, 263, 259, 264, 267, 267, 268, 13, + + 273, 265, 270, 274, 272, 267, 267, 271, 273, 275, + 275, 276, 276, 0, 283, 264, 286, 278, 275, 275, + 264, 276, 279, 268, 278, 284, 279, 270, 280, 272, + 281, 281, 280, 287, 273, 285, 286, 287, 288, 288, + 281, 284, 285, 289, 290, 290, 284, 288, 288, 0, + 278, 289, 279, 295, 290, 292, 292, 293, 280, 0, + 0, 286, 294, 287, 292, 292, 284, 294, 285, 295, + 296, 284, 293, 300, 296, 297, 298, 289, 0, 297, + 299, 299, 301, 301, 0, 304, 304, 308, 300, 299, + 299, 308, 301, 294, 295, 304, 298, 293, 303, 303, + + 296, 306, 307, 309, 314, 297, 310, 303, 303, 306, + 0, 310, 314, 300, 311, 311, 307, 308, 309, 312, + 312, 298, 0, 311, 311, 318, 315, 315, 0, 312, + 317, 317, 319, 318, 320, 306, 315, 310, 314, 317, + 317, 307, 320, 309, 321, 322, 322, 319, 0, 0, + 0, 324, 324, 325, 325, 322, 327, 327, 321, 318, + 324, 324, 328, 325, 0, 327, 327, 0, 320, 330, + 328, 0, 319, 0, 0, 329, 329, 330, 331, 331, + 333, 333, 0, 321, 329, 329, 0, 0, 331, 0, + 333, 335, 335, 0, 336, 336, 328, 338, 338, 0, + + 335, 335, 0, 330, 336, 0, 338, 338, 339, 339, + 341, 341, 0, 0, 0, 0, 0, 0, 339, 0, + 341, 344, 344, 344, 344, 344, 345, 345, 345, 345, + 345, 347, 0, 347, 0, 347, 348, 0, 348, 348, + 348, 349, 349, 0, 349, 349, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + + 343, 343, 343, 343, 343, 343, 343, 343, 343 + } ; + +/* Table of booleans, true if rule could match eol. */ +static const flex_int32_t yy_rule_can_match_eol[65] = + { 0, +0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, }; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "../../../../src/xspice/cmpp/ifs_lex.l" +#define YY_NO_INPUT 1 +#line 8 "../../../../src/xspice/cmpp/ifs_lex.l" + +/*============================================================================ +FILE ifs_lex.l + +MEMBER OF process cmpp + +Copyright 1991 +Georgia Tech Research Corporation +Atlanta, Georgia 30332 +All Rights Reserved + +PROJECT A-8503 + +AUTHORS + + 9/12/91 Steve Tynor + +MODIFICATIONS + + 12/31/91 Bill Kuhn Change "array" to "vector" and "array_bounds" + to "vector_bounds". + +SUMMARY + + This file defines tokens applicable to parsing the ifspec.ifs + file, and actions to be taken on encountering those tokens. + +INTERFACES + + None. + +REFERENCED FILES + + ifs_yacc.y + +NON-STANDARD FEATURES + + None. + +============================================================================*/ + +#include + +#include "ifs_yacc_y.h" +#include "ifs_yacc.h" + +int yyival; +double yydval; + +/* + * IFS specs are case insensitive: + */ + +/*---------------------------------------------------------------------------*/ + +#line 1147 "ifs_lex.c" + +#line 1149 "ifs_lex.c" + +#define INITIAL 0 +#define BOOL 1 +#define CTYPE 2 +#define DIR 3 +#define DTYPE 4 +#define comment 5 +#define stringl 6 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals ( void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( void ); + +int yyget_debug ( void ); + +void yyset_debug ( int debug_flag ); + +YY_EXTRA_TYPE yyget_extra ( void ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in ( void ); + +void yyset_in ( FILE * _in_str ); + +FILE *yyget_out ( void ); + +void yyset_out ( FILE * _out_str ); + + int yyget_leng ( void ); + +char *yyget_text ( void ); + +int yyget_lineno ( void ); + +void yyset_lineno ( int _line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( void ); +#else +extern int yywrap ( void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * ); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( void ); +#else +static int input ( void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { +#line 78 "../../../../src/xspice/cmpp/ifs_lex.l" + + +#line 1373 "ifs_lex.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 344 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1047 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; +; + } + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 80 "../../../../src/xspice/cmpp/ifs_lex.l" +{ BEGIN(comment); } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 82 "../../../../src/xspice/cmpp/ifs_lex.l" +/* eat anything that's not a '*' */ + YY_BREAK +case 3: +YY_RULE_SETUP +#line 84 "../../../../src/xspice/cmpp/ifs_lex.l" +/* eat up '*'s not followed by '/'s */ + YY_BREAK +case 4: +/* rule 4 can match eol */ +YY_RULE_SETUP +#line 86 "../../../../src/xspice/cmpp/ifs_lex.l" +/* new line */ + YY_BREAK +case YY_STATE_EOF(comment): +#line 88 "../../../../src/xspice/cmpp/ifs_lex.l" +{ifs_yyerror ("Unterminated comment"); + BEGIN(INITIAL); + yyterminate(); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 92 "../../../../src/xspice/cmpp/ifs_lex.l" +{ BEGIN(INITIAL); } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 94 "../../../../src/xspice/cmpp/ifs_lex.l" +{ BEGIN(stringl); } + YY_BREAK +case 7: +/* rule 7 can match eol */ +YY_RULE_SETUP +#line 96 "../../../../src/xspice/cmpp/ifs_lex.l" +{ return TOK_STRING_LITERAL; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 98 "../../../../src/xspice/cmpp/ifs_lex.l" +{ BEGIN(INITIAL); } + YY_BREAK +case YY_STATE_EOF(stringl): +#line 100 "../../../../src/xspice/cmpp/ifs_lex.l" +{ifs_yyerror ("Unterminated string literal"); + BEGIN(INITIAL); + yyterminate(); } + YY_BREAK +case 9: +/* rule 9 can match eol */ +YY_RULE_SETUP +#line 104 "../../../../src/xspice/cmpp/ifs_lex.l" +{BEGIN CTYPE; return TOK_ALLOWED_TYPES;} + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 105 "../../../../src/xspice/cmpp/ifs_lex.l" +{BEGIN BOOL; return TOK_ARRAY;} + YY_BREAK +case 11: +/* rule 11 can match eol */ +YY_RULE_SETUP +#line 106 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_ARRAY_BOUNDS;} + YY_BREAK +case 12: +/* rule 12 can match eol */ +YY_RULE_SETUP +#line 107 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_C_FUNCTION_NAME;} + YY_BREAK +case 13: +/* rule 13 can match eol */ +YY_RULE_SETUP +#line 108 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_PORT_NAME;} + YY_BREAK +case 14: +/* rule 14 can match eol */ +YY_RULE_SETUP +#line 109 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_PORT_TABLE;} + YY_BREAK +case 15: +/* rule 15 can match eol */ +YY_RULE_SETUP +#line 110 "../../../../src/xspice/cmpp/ifs_lex.l" +{BEGIN DTYPE; return TOK_DATA_TYPE;} + YY_BREAK +case 16: +/* rule 16 can match eol */ +YY_RULE_SETUP +#line 111 "../../../../src/xspice/cmpp/ifs_lex.l" +{BEGIN CTYPE; return TOK_DEFAULT_TYPE;} + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP +#line 112 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DEFAULT_VALUE;} + YY_BREAK +case 18: +/* rule 18 can match eol */ +YY_RULE_SETUP +#line 113 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DESCRIPTION;} + YY_BREAK +case 19: +/* rule 19 can match eol */ +YY_RULE_SETUP +#line 114 "../../../../src/xspice/cmpp/ifs_lex.l" +{BEGIN DIR; return TOK_DIRECTION;} + YY_BREAK +case 20: +/* rule 20 can match eol */ +YY_RULE_SETUP +#line 115 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_STATIC_VAR_NAME;} + YY_BREAK +case 21: +/* rule 21 can match eol */ +YY_RULE_SETUP +#line 116 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_STATIC_VAR_TABLE;} + YY_BREAK +case 22: +/* rule 22 can match eol */ +YY_RULE_SETUP +#line 117 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_LIMITS;} + YY_BREAK +case 23: +/* rule 23 can match eol */ +YY_RULE_SETUP +#line 118 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_NAME_TABLE;} + YY_BREAK +case 24: +/* rule 24 can match eol */ +YY_RULE_SETUP +#line 119 "../../../../src/xspice/cmpp/ifs_lex.l" +{BEGIN BOOL; return TOK_NULL_ALLOWED;} + YY_BREAK +case 25: +/* rule 25 can match eol */ +YY_RULE_SETUP +#line 120 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_PARAMETER_NAME;} + YY_BREAK +case 26: +/* rule 26 can match eol */ +YY_RULE_SETUP +#line 121 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_PARAMETER_TABLE;} + YY_BREAK +case 27: +/* rule 27 can match eol */ +YY_RULE_SETUP +#line 122 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_SPICE_MODEL_NAME;} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 124 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_BOOL_YES;} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 125 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_BOOL_NO;} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 126 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_BOOL_YES;} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 127 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_BOOL_NO;} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 129 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_V;} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 130 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_VD;} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 131 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_VNAM;} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 132 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_I;} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 133 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_ID;} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 134 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_G;} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 135 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_GD;} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 136 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_H;} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 137 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_HD;} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 138 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_CTYPE_D;} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 140 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DIR_IN;} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 141 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DIR_OUT;} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 142 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DIR_INOUT;} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 144 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DTYPE_REAL;} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 145 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DTYPE_INT;} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 146 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DTYPE_BOOLEAN;} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 147 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DTYPE_COMPLEX;} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 148 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DTYPE_STRING;} + YY_BREAK +case 50: +YY_RULE_SETUP +#line 149 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DTYPE_POINTER;} + YY_BREAK +case 51: +YY_RULE_SETUP +#line 151 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_LANGLE;} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 152 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_RANGLE;} + YY_BREAK +case 53: +YY_RULE_SETUP +#line 153 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_LBRACKET;} + YY_BREAK +case 54: +YY_RULE_SETUP +#line 154 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_RBRACKET;} + YY_BREAK +case 55: +YY_RULE_SETUP +#line 155 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_COMMA;} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 156 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_DASH;} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 159 "../../../../src/xspice/cmpp/ifs_lex.l" +{return TOK_IDENTIFIER;} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 161 "../../../../src/xspice/cmpp/ifs_lex.l" +{yyival = atoi (yytext); + return TOK_INT_LITERAL;} + YY_BREAK +case 59: +#line 165 "../../../../src/xspice/cmpp/ifs_lex.l" +case 60: +#line 166 "../../../../src/xspice/cmpp/ifs_lex.l" +case 61: +YY_RULE_SETUP +#line 166 "../../../../src/xspice/cmpp/ifs_lex.l" +{yydval = atof (yytext); + return TOK_REAL_LITERAL;} + YY_BREAK +case 62: +YY_RULE_SETUP +#line 169 "../../../../src/xspice/cmpp/ifs_lex.l" +; /* ignore anything else */ + YY_BREAK +case 63: +/* rule 63 can match eol */ +YY_RULE_SETUP +#line 170 "../../../../src/xspice/cmpp/ifs_lex.l" +; /* ignore anything else */ + YY_BREAK +case 64: +YY_RULE_SETUP +#line 172 "../../../../src/xspice/cmpp/ifs_lex.l" +ECHO; + YY_BREAK +#line 1790 "ifs_lex.c" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(BOOL): +case YY_STATE_EOF(CTYPE): +case YY_STATE_EOF(DIR): +case YY_STATE_EOF(DTYPE): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 344 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 344 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 343); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + if ( c == '\n' ) + + yylineno++; +; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf ); + + yyfree( (void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr ) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg ) +{ + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param _line_number line number + * + */ +void yyset_lineno (int _line_number ) +{ + + yylineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str ) +{ + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str ) +{ + yyout = _out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int _bdebug ) +{ + yy_flex_debug = _bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + /* We do not touch yylineno unless the option is enabled. */ + yylineno = 1; + + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n ) +{ + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 172 "../../../../src/xspice/cmpp/ifs_lex.l" + + +/*--------------------------------------------------------------------------*/ + +#if 0 +void reset_lex_context (void) +{ + BEGIN 0; +} +#endif + diff --git a/src/xspice/cmpp/ifs_yacc.c b/src/xspice/cmpp/ifs_yacc.c new file mode 100644 index 000000000..7d633bb56 --- /dev/null +++ b/src/xspice/cmpp/ifs_yacc.c @@ -0,0 +1,2618 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* First part of user prologue. */ +#line 1 "../../../../src/xspice/cmpp/ifs_yacc.y" + + +/*============================================================================ +FILE ifs_yacc.y + +MEMBER OF process cmpp + +Copyright 1991 +Georgia Tech Research Corporation +Atlanta, Georgia 30332 +All Rights Reserved + +PROJECT A-8503 + +AUTHORS + + 9/12/91 Steve Tynor + +MODIFICATIONS + + 12/31/91 Bill Kuhn Fix bug in usage of strcmp in check_default_type() + +SUMMARY + + This file contains the BNF specification of the language used in + the ifspec.ifs file together with various support functions, + and parses the ifspec.ifs file to get the information from it + and place this information into a data structure + of type Ifs_Table_t. + +INTERFACES + + yyparse() - Generated automatically by UNIX 'yacc' utility. + +REFERENCED FILES + + ifs_lex.l + +NON-STANDARD FEATURES + + None. + +============================================================================*/ + +#include +#include +#include +#include "ifs_yacc_y.h" + +#define yymaxdepth ifs_yymaxdepth +#define yyparse ifs_yyparse +#define yylex ifs_yylex +#define yyerror ifs_yyerror +#define yylval ifs_yylval +#define yychar ifs_yychar +#define yydebug ifs_yydebug +#define yypact ifs_yypact +#define yyr1 ifs_yyr1 +#define yyr2 ifs_yyr2 +#define yydef ifs_yydef +#define yychk ifs_yychk +#define yypgo ifs_yypgo +#define yyact ifs_yyact +#define yyexca ifs_yyexca +#define yyerrflag ifs_yyerrflag +#define yynerrs ifs_yynerrs +#define yyps ifs_yyps +#define yypv ifs_yypv +#define yys ifs_yys +#define yy_yys ifs_yyyys +#define yystate ifs_yystate +#define yytmp ifs_yytmp +#define yyv ifs_yyv +#define yy_yyv ifs_yyyyv +#define yyval ifs_yyval +#define yylloc ifs_yylloc +#define yyreds ifs_yyreds +#define yytoks ifs_yytoks +#define yylhs ifs_yyyylhs +#define yylen ifs_yyyylen +#define yydefred ifs_yyyydefred +#define yydgoto ifs_yyyydgoto +#define yysindex ifs_yyyysindex +#define yyrindex ifs_yyyyrindex +#define yygindex ifs_yyyygindex +#define yytable ifs_yyyytable +#define yycheck ifs_yyyycheck +#define yyname ifs_yyyyname +#define yyrule ifs_yyyyrule + +extern int yylineno; +extern int yyival; +extern double yydval; +extern char *ifs_yytext; + extern int ifs_yylex(void); + +bool parser_just_names; +static bool saw_model_name; +static bool saw_function_name; + +static char *dtype_to_str[] = { + "BOOLEAN", "INTEGER", "REAL", "COMPLEX", "STRING", "POINTER" + }; + +static bool did_default_type; +static bool did_allowed_types; + +static int num_items; +static int item; +static int item_offset; +static bool num_items_fixed; + +Ifs_Table_t *parser_ifs_table; +#define TBL parser_ifs_table + +int ifs_num_errors; + +static size_t alloced_size [4]; + +/* + * !!!!! Make sure these are large enough so that they never get realloced + * !!!!! since that will cause garbage uninitialized data... + * !!!!! (FIX THIS!) + */ +#define DEFAULT_SIZE_CONN 100 +#define DEFAULT_SIZE_PARAM 100 +#define DEFAULT_SIZE_INST_VAR 100 +#define GROW_SIZE 10 + +typedef enum { + TBL_NAME, + TBL_PORT, + TBL_PARAMETER, + TBL_STATIC_VAR, +} Table_t; + +typedef struct { + Table_t table; + int record; +} Context_t; + +Context_t context; + +#define ITEM_BUFFER_SIZE 20 /* number of items that can be put in a table + * before requiring a new xxx_TABLE: keyword + */ +#define FOR_ITEM(i) for (i = item_offset; i < num_items; i++) +#define ITEM_BUF(i) item_buffer[i-item_offset] + +#define ASSIGN_BOUNDS(struct_name, i) \ + if (ITEM_BUF(i).range.is_named) {\ + TBL->struct_name[i].has_conn_ref = true;\ + TBL->struct_name[i].conn_ref = find_conn_ref (ITEM_BUF(i).range.u.name);\ + } else {\ + TBL->struct_name[i].has_conn_ref = false;\ + TBL->struct_name[i].has_lower_bound =\ + ITEM_BUF(i).range.u.bounds.lower.has_bound;\ + TBL->struct_name[i].has_upper_bound =\ + ITEM_BUF(i).range.u.bounds.upper.has_bound;\ + if (TBL->struct_name[i].has_lower_bound) {\ + assert (ITEM_BUF(i).range.u.bounds.lower.bound.kind == CMPP_INTEGER);\ + TBL->struct_name[i].lower_bound =\ + ITEM_BUF(i).range.u.bounds.lower.bound.u.ivalue;\ + }\ + if (TBL->struct_name[i].has_upper_bound) {\ + assert (ITEM_BUF(i).range.u.bounds.upper.bound.kind == CMPP_INTEGER);\ + TBL->struct_name[i].upper_bound =\ + ITEM_BUF(i).range.u.bounds.upper.bound.u.ivalue;\ + }\ + } + +/*---------------------------------------------------------------------------*/ +static void fatal (char *str) +{ + yyerror (str); + exit(1); +} + +/*---------------------------------------------------------------------------*/ +static int +find_conn_ref (char *name) +{ + int i; + char str[130]; + + for (i = 0; i < TBL->num_conn; i++) { + if (strcmp (name, TBL->conn[i].name) == 0) { + return i; + } + } + sprintf (str, "Port `%s' not found", name); + yyerror (str); + ifs_num_errors++; + + return 0; +} + +typedef enum {C_DOUBLE, C_BOOLEAN, C_POINTER, C_UNDEF} Ctype_Class_t; + +/*---------------------------------------------------------------------------*/ +static Ctype_Class_t get_ctype_class (Port_Type_t type) +{ + switch (type) { + case USER_DEFINED: + return C_POINTER; + break; + case DIGITAL: + return C_BOOLEAN; + break; + default: + return C_DOUBLE; + break; + } +} + +/*---------------------------------------------------------------------------*/ +static void check_port_type_direction (Dir_t dir, Port_Type_t port_type) +{ + switch (port_type) { + case VOLTAGE: + case DIFF_VOLTAGE: + case CURRENT: + case DIFF_CURRENT: + if (dir == CMPP_INOUT) { + yyerror ("Port types `v', `vd', `i', `id' are not valid for `inout' ports"); + ifs_num_errors++; + } + break; + case DIGITAL: + case USER_DEFINED: + /* + * anything goes + */ + break; + case VSOURCE_CURRENT: + if (dir != CMPP_IN) { + yyerror ("Port type `vnam' is only valid for `in' ports"); + ifs_num_errors++; + } + break; + case CONDUCTANCE: + case DIFF_CONDUCTANCE: + case RESISTANCE: + case DIFF_RESISTANCE: + if (dir != CMPP_INOUT) { + yyerror ("Port types `g', `gd', `h', `hd' are only valid for `inout' ports"); + ifs_num_errors++; + } + break; + default: + assert (0); + } +} + +/*---------------------------------------------------------------------------*/ +static void check_dtype_not_pointer (Data_Type_t dtype) +{ + if (dtype == CMPP_POINTER) { + yyerror("Invalid parameter type - POINTER type valid only for STATIC_VARs"); + ifs_num_errors++; + } +} + +/*---------------------------------------------------------------------------*/ +static void check_default_type (Conn_Info_t conn) +{ + int i; + + for (i = 0; i < conn.num_allowed_types; i++) { + if (conn.default_port_type == conn.allowed_port_type[i]) { + if ((conn.default_port_type != USER_DEFINED) || + (strcmp (conn.default_type, conn.allowed_type[i]) == 0)) { + return; + } + } + } + yyerror ("Port default type is not an allowed type"); + ifs_num_errors++; +} + +/*---------------------------------------------------------------------------*/ +static void +assign_ctype_list (Conn_Info_t *conn, Ctype_List_t *ctype_list ) +{ + int i; + Ctype_List_t *p; + Ctype_Class_t ctype_class = C_UNDEF; + + conn->num_allowed_types = 0; + for (p = ctype_list; p; p = p->next) { + conn->num_allowed_types++; + } + conn->allowed_type = (char**) calloc ((size_t) conn->num_allowed_types, + sizeof (char*)); + conn->allowed_port_type = (Port_Type_t*) calloc ((size_t) conn->num_allowed_types, + sizeof (Port_Type_t)); + if (! (conn->allowed_type && conn->allowed_port_type)) { + fatal ("Could not allocate memory"); + } + for (i = conn->num_allowed_types-1, p = ctype_list; p; i--, p = p->next) { + if (ctype_class == C_UNDEF) { + ctype_class = get_ctype_class (p->ctype.kind); + } + if (ctype_class != get_ctype_class (p->ctype.kind)) { + yyerror ("Incompatible port types in `allowed_types' clause"); + ifs_num_errors++; + } + check_port_type_direction (conn->direction, p->ctype.kind); + + conn->allowed_port_type[i] = p->ctype.kind; + conn->allowed_type[i] = p->ctype.id; + } +} + +/*---------------------------------------------------------------------------*/ +static void +assign_value (Data_Type_t type, Value_t *dest_value, My_Value_t src_value) +{ + char str[200]; + if ((type == CMPP_REAL) && (src_value.kind == CMPP_INTEGER)) { + dest_value->rvalue = src_value.u.ivalue; + return; + } else if (type != src_value.kind) { + sprintf (str, "Invalid parameter type (saw %s - expected %s)", + dtype_to_str[src_value.kind], + dtype_to_str[type] ); + yyerror (str); + ifs_num_errors++; + } + switch (type) { + case CMPP_BOOLEAN: + dest_value->bvalue = src_value.u.bvalue; + break; + case CMPP_INTEGER: + dest_value->ivalue = src_value.u.ivalue; + break; + case CMPP_REAL: + dest_value->rvalue = src_value.u.rvalue; + break; + case CMPP_COMPLEX: + dest_value->cvalue = src_value.u.cvalue; + break; + case CMPP_STRING: + dest_value->svalue = src_value.u.svalue; + break; + default: + yyerror ("INTERNAL ERROR - unexpected data type in `assign_value'"); + ifs_num_errors++; + } +} + +/*---------------------------------------------------------------------------*/ +static void +assign_limits (Data_Type_t type, Param_Info_t *param, Range_t range) +{ + if (range.is_named) { + yyerror ("Named range not allowed for limits"); + ifs_num_errors++; + } + param->has_lower_limit = range.u.bounds.lower.has_bound; + if (param->has_lower_limit) { + assign_value (type, ¶m->lower_limit, range.u.bounds.lower.bound); + } + param->has_upper_limit = range.u.bounds.upper.has_bound; + if (param->has_upper_limit) { + assign_value (type, ¶m->upper_limit, range.u.bounds.upper.bound); + } +} + +/*---------------------------------------------------------------------------*/ +static void +check_item_num (void) +{ + if (item-item_offset >= ITEM_BUFFER_SIZE) { + fatal ("Too many items in table - split into sub-tables"); + } + if (item > (int) alloced_size [context.table] ) { + switch (context.table) { + case TBL_NAME: + break; + case TBL_PORT: + alloced_size[context.table] += GROW_SIZE; + TBL->conn = (Conn_Info_t*) + realloc (TBL->conn, + alloced_size [context.table] * sizeof (Conn_Info_t)); + if (! TBL->conn) { + fatal ("Error allocating memory for port definition"); + } + break; + case TBL_PARAMETER: + alloced_size [context.table] += GROW_SIZE; + TBL->param = (Param_Info_t*) + realloc (TBL->param, + alloced_size [context.table] * sizeof (Param_Info_t)); + if (! TBL->param) { + fatal ("Error allocating memory for parameter definition"); + } + break; + case TBL_STATIC_VAR: + alloced_size [context.table] += GROW_SIZE; + TBL->inst_var = (Inst_Var_Info_t*) + realloc (TBL->inst_var, + alloced_size [context.table] * sizeof (Inst_Var_Info_t)); + if (! TBL->inst_var) { + fatal ("Error allocating memory for static variable definition"); + } + break; + } + } + item++; +} + +/*---------------------------------------------------------------------------*/ +static void +check_end_item_num (void) +{ + if (num_items_fixed) { + if (item != num_items) { + char buf[200]; + sprintf + (buf, + "Wrong number of elements in sub-table (saw %d - expected %d)", + item - item_offset, + num_items - item_offset); + fatal (buf); + } + } else { + num_items = item; + num_items_fixed = true; + switch (context.table) { + case TBL_NAME: + break; + case TBL_PORT: + TBL->num_conn = num_items; + break; + case TBL_PARAMETER: + TBL->num_param = num_items; + break; + case TBL_STATIC_VAR: + TBL->num_inst_var = num_items; + break; + } + } + item = item_offset; +} + +#define INIT(n) item = (n); item_offset = (n); num_items = (n); num_items_fixed = false +#define ITEM check_item_num() +#define END check_end_item_num() + + +#line 523 "ifs_yacc.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#include "ifs_yacc.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_TOK_ALLOWED_TYPES = 3, /* TOK_ALLOWED_TYPES */ + YYSYMBOL_TOK_ARRAY = 4, /* TOK_ARRAY */ + YYSYMBOL_TOK_ARRAY_BOUNDS = 5, /* TOK_ARRAY_BOUNDS */ + YYSYMBOL_TOK_BOOL_NO = 6, /* TOK_BOOL_NO */ + YYSYMBOL_TOK_BOOL_YES = 7, /* TOK_BOOL_YES */ + YYSYMBOL_TOK_COMMA = 8, /* TOK_COMMA */ + YYSYMBOL_TOK_PORT_NAME = 9, /* TOK_PORT_NAME */ + YYSYMBOL_TOK_PORT_TABLE = 10, /* TOK_PORT_TABLE */ + YYSYMBOL_TOK_CTYPE_D = 11, /* TOK_CTYPE_D */ + YYSYMBOL_TOK_CTYPE_G = 12, /* TOK_CTYPE_G */ + YYSYMBOL_TOK_CTYPE_GD = 13, /* TOK_CTYPE_GD */ + YYSYMBOL_TOK_CTYPE_H = 14, /* TOK_CTYPE_H */ + YYSYMBOL_TOK_CTYPE_HD = 15, /* TOK_CTYPE_HD */ + YYSYMBOL_TOK_CTYPE_I = 16, /* TOK_CTYPE_I */ + YYSYMBOL_TOK_CTYPE_ID = 17, /* TOK_CTYPE_ID */ + YYSYMBOL_TOK_CTYPE_V = 18, /* TOK_CTYPE_V */ + YYSYMBOL_TOK_CTYPE_VD = 19, /* TOK_CTYPE_VD */ + YYSYMBOL_TOK_CTYPE_VNAM = 20, /* TOK_CTYPE_VNAM */ + YYSYMBOL_TOK_C_FUNCTION_NAME = 21, /* TOK_C_FUNCTION_NAME */ + YYSYMBOL_TOK_DASH = 22, /* TOK_DASH */ + YYSYMBOL_TOK_DATA_TYPE = 23, /* TOK_DATA_TYPE */ + YYSYMBOL_TOK_DEFAULT_TYPE = 24, /* TOK_DEFAULT_TYPE */ + YYSYMBOL_TOK_DEFAULT_VALUE = 25, /* TOK_DEFAULT_VALUE */ + YYSYMBOL_TOK_DESCRIPTION = 26, /* TOK_DESCRIPTION */ + YYSYMBOL_TOK_DIRECTION = 27, /* TOK_DIRECTION */ + YYSYMBOL_TOK_DIR_IN = 28, /* TOK_DIR_IN */ + YYSYMBOL_TOK_DIR_INOUT = 29, /* TOK_DIR_INOUT */ + YYSYMBOL_TOK_DIR_OUT = 30, /* TOK_DIR_OUT */ + YYSYMBOL_TOK_DTYPE_BOOLEAN = 31, /* TOK_DTYPE_BOOLEAN */ + YYSYMBOL_TOK_DTYPE_COMPLEX = 32, /* TOK_DTYPE_COMPLEX */ + YYSYMBOL_TOK_DTYPE_INT = 33, /* TOK_DTYPE_INT */ + YYSYMBOL_TOK_DTYPE_POINTER = 34, /* TOK_DTYPE_POINTER */ + YYSYMBOL_TOK_DTYPE_REAL = 35, /* TOK_DTYPE_REAL */ + YYSYMBOL_TOK_DTYPE_STRING = 36, /* TOK_DTYPE_STRING */ + YYSYMBOL_TOK_IDENTIFIER = 37, /* TOK_IDENTIFIER */ + YYSYMBOL_TOK_STATIC_VAR_NAME = 38, /* TOK_STATIC_VAR_NAME */ + YYSYMBOL_TOK_STATIC_VAR_TABLE = 39, /* TOK_STATIC_VAR_TABLE */ + YYSYMBOL_TOK_INT_LITERAL = 40, /* TOK_INT_LITERAL */ + YYSYMBOL_TOK_LANGLE = 41, /* TOK_LANGLE */ + YYSYMBOL_TOK_LBRACKET = 42, /* TOK_LBRACKET */ + YYSYMBOL_TOK_LIMITS = 43, /* TOK_LIMITS */ + YYSYMBOL_TOK_NAME_TABLE = 44, /* TOK_NAME_TABLE */ + YYSYMBOL_TOK_NULL_ALLOWED = 45, /* TOK_NULL_ALLOWED */ + YYSYMBOL_TOK_PARAMETER_NAME = 46, /* TOK_PARAMETER_NAME */ + YYSYMBOL_TOK_PARAMETER_TABLE = 47, /* TOK_PARAMETER_TABLE */ + YYSYMBOL_TOK_RANGLE = 48, /* TOK_RANGLE */ + YYSYMBOL_TOK_RBRACKET = 49, /* TOK_RBRACKET */ + YYSYMBOL_TOK_REAL_LITERAL = 50, /* TOK_REAL_LITERAL */ + YYSYMBOL_TOK_SPICE_MODEL_NAME = 51, /* TOK_SPICE_MODEL_NAME */ + YYSYMBOL_TOK_STRING_LITERAL = 52, /* TOK_STRING_LITERAL */ + YYSYMBOL_YYACCEPT = 53, /* $accept */ + YYSYMBOL_ifs_file = 54, /* ifs_file */ + YYSYMBOL_55_1 = 55, /* $@1 */ + YYSYMBOL_list_of_tables = 56, /* list_of_tables */ + YYSYMBOL_table = 57, /* table */ + YYSYMBOL_58_2 = 58, /* $@2 */ + YYSYMBOL_59_3 = 59, /* $@3 */ + YYSYMBOL_60_4 = 60, /* $@4 */ + YYSYMBOL_61_5 = 61, /* $@5 */ + YYSYMBOL_name_table = 62, /* name_table */ + YYSYMBOL_name_table_item = 63, /* name_table_item */ + YYSYMBOL_port_table = 64, /* port_table */ + YYSYMBOL_port_table_item = 65, /* port_table_item */ + YYSYMBOL_parameter_table = 66, /* parameter_table */ + YYSYMBOL_parameter_table_item = 67, /* parameter_table_item */ + YYSYMBOL_static_var_table = 68, /* static_var_table */ + YYSYMBOL_static_var_table_item = 69, /* static_var_table_item */ + YYSYMBOL_list_of_ids = 70, /* list_of_ids */ + YYSYMBOL_list_of_array_bounds = 71, /* list_of_array_bounds */ + YYSYMBOL_list_of_strings = 72, /* list_of_strings */ + YYSYMBOL_list_of_directions = 73, /* list_of_directions */ + YYSYMBOL_direction = 74, /* direction */ + YYSYMBOL_list_of_bool = 75, /* list_of_bool */ + YYSYMBOL_list_of_ctypes = 76, /* list_of_ctypes */ + YYSYMBOL_ctype = 77, /* ctype */ + YYSYMBOL_list_of_dtypes = 78, /* list_of_dtypes */ + YYSYMBOL_dtype = 79, /* dtype */ + YYSYMBOL_list_of_ranges = 80, /* list_of_ranges */ + YYSYMBOL_int_range = 81, /* int_range */ + YYSYMBOL_maybe_comma = 82, /* maybe_comma */ + YYSYMBOL_int_or_dash = 83, /* int_or_dash */ + YYSYMBOL_range = 84, /* range */ + YYSYMBOL_number_or_dash = 85, /* number_or_dash */ + YYSYMBOL_list_of_values = 86, /* list_of_values */ + YYSYMBOL_value_or_dash = 87, /* value_or_dash */ + YYSYMBOL_value = 88, /* value */ + YYSYMBOL_complex = 89, /* complex */ + YYSYMBOL_list_of_ctype_lists = 90, /* list_of_ctype_lists */ + YYSYMBOL_delimited_ctype_list = 91, /* delimited_ctype_list */ + YYSYMBOL_ctype_list = 92, /* ctype_list */ + YYSYMBOL_btype = 93, /* btype */ + YYSYMBOL_string = 94, /* string */ + YYSYMBOL_identifier = 95, /* identifier */ + YYSYMBOL_number = 96, /* number */ + YYSYMBOL_integer_value = 97, /* integer_value */ + YYSYMBOL_real = 98, /* real */ + YYSYMBOL_integer = 99 /* integer */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + +/* Second part of user prologue. */ +#line 534 "../../../../src/xspice/cmpp/ifs_yacc.y" + +/* + * resuse the Yacc union for our buffer: + */ +YYSTYPE item_buffer [ITEM_BUFFER_SIZE]; + +/* + * Shorthand for refering to the current element of the item buffer: + */ +#define BUF ITEM_BUF(item-1) + + +#line 669 "ifs_yacc.c" + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_uint8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* !defined yyoverflow */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 109 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 53 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 47 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 114 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 143 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 307 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 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, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52 +}; + +#if YYDEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 549, 549, 549, 573, 574, 578, 577, 581, 580, + 588, 587, 593, 592, 599, 600, 603, 607, 611, 615, + 616, 619, 625, 631, 637, 649, 660, 666, 673, 681, + 682, 685, 691, 697, 704, 716, 724, 730, 736, 744, + 745, 748, 754, 760, 766, 774, 775, 778, 779, 782, + 788, 789, 792, 793, 796, 797, 798, 801, 802, 805, + 806, 809, 810, 811, 812, 813, 814, 815, 816, 817, + 818, 819, 823, 824, 827, 828, 829, 830, 831, 832, + 835, 836, 839, 842, 849, 850, 853, 854, 858, 861, + 868, 869, 873, 874, 877, 878, 881, 884, 887, 890, + 893, 898, 899, 903, 906, 914, 927, 928, 931, 934, + 937, 940, 943, 948, 951 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "TOK_ALLOWED_TYPES", + "TOK_ARRAY", "TOK_ARRAY_BOUNDS", "TOK_BOOL_NO", "TOK_BOOL_YES", + "TOK_COMMA", "TOK_PORT_NAME", "TOK_PORT_TABLE", "TOK_CTYPE_D", + "TOK_CTYPE_G", "TOK_CTYPE_GD", "TOK_CTYPE_H", "TOK_CTYPE_HD", + "TOK_CTYPE_I", "TOK_CTYPE_ID", "TOK_CTYPE_V", "TOK_CTYPE_VD", + "TOK_CTYPE_VNAM", "TOK_C_FUNCTION_NAME", "TOK_DASH", "TOK_DATA_TYPE", + "TOK_DEFAULT_TYPE", "TOK_DEFAULT_VALUE", "TOK_DESCRIPTION", + "TOK_DIRECTION", "TOK_DIR_IN", "TOK_DIR_INOUT", "TOK_DIR_OUT", + "TOK_DTYPE_BOOLEAN", "TOK_DTYPE_COMPLEX", "TOK_DTYPE_INT", + "TOK_DTYPE_POINTER", "TOK_DTYPE_REAL", "TOK_DTYPE_STRING", + "TOK_IDENTIFIER", "TOK_STATIC_VAR_NAME", "TOK_STATIC_VAR_TABLE", + "TOK_INT_LITERAL", "TOK_LANGLE", "TOK_LBRACKET", "TOK_LIMITS", + "TOK_NAME_TABLE", "TOK_NULL_ALLOWED", "TOK_PARAMETER_NAME", + "TOK_PARAMETER_TABLE", "TOK_RANGLE", "TOK_RBRACKET", "TOK_REAL_LITERAL", + "TOK_SPICE_MODEL_NAME", "TOK_STRING_LITERAL", "$accept", "ifs_file", + "$@1", "list_of_tables", "table", "$@2", "$@3", "$@4", "$@5", + "name_table", "name_table_item", "port_table", "port_table_item", + "parameter_table", "parameter_table_item", "static_var_table", + "static_var_table_item", "list_of_ids", "list_of_array_bounds", + "list_of_strings", "list_of_directions", "direction", "list_of_bool", + "list_of_ctypes", "ctype", "list_of_dtypes", "dtype", "list_of_ranges", + "int_range", "maybe_comma", "int_or_dash", "range", "number_or_dash", + "list_of_values", "value_or_dash", "value", "complex", + "list_of_ctype_lists", "delimited_ctype_list", "ctype_list", "btype", + "string", "identifier", "number", "integer_value", "real", "integer", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-101) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-1) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int8 yypact[] = +{ + -101, 10, 27, -101, -101, -101, -101, -101, 27, -101, + -101, -101, -101, -101, -101, 9, 4, 26, 18, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -26, -32, -26, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, 11, 19, -13, -26, + 67, -32, 72, 19, 19, 57, -32, -26, -101, -101, + -101, -101, -101, 19, -13, 57, -1, -32, 28, 19, + -26, 67, -101, -101, -101, -101, -101, 33, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, 7, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -101, -101, 6, + -101, -101, -4, -101, 59, -101, 59, -101, 59, -101, + -101, -101, 67, 33, 7, 6, -101, 23, 20, 46, + -101, -101, -101 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 2, 0, 0, 1, 8, 12, 6, 10, 3, 4, + 19, 39, 14, 29, 5, 9, 13, 7, 11, 101, + 57, 47, 45, 59, 50, 52, 57, 20, 57, 72, + 50, 45, 40, 0, 0, 0, 15, 57, 47, 72, + 92, 50, 80, 57, 45, 30, 25, 26, 27, 21, + 24, 22, 23, 28, 44, 43, 42, 41, 109, 16, + 108, 18, 17, 36, 37, 33, 34, 32, 35, 38, + 31, 0, 102, 107, 106, 58, 82, 0, 48, 49, + 46, 70, 66, 67, 68, 69, 64, 65, 61, 62, + 63, 60, 71, 51, 54, 56, 55, 53, 76, 77, + 75, 79, 74, 78, 73, 94, 114, 0, 113, 93, + 95, 98, 97, 96, 99, 111, 110, 112, 88, 0, + 81, 104, 84, 86, 84, 87, 84, 90, 84, 91, + 85, 103, 0, 0, 0, 0, 105, 0, 0, 0, + 83, 100, 89 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -101, -101, -101, -101, 89, -101, -101, -101, -101, -101, + -101, -101, -101, -101, -101, -101, -101, -12, 65, 35, + -101, -101, 32, -101, -70, 66, -101, -101, -101, -30, + -27, -101, -28, -101, -101, -101, -101, -101, -101, -101, + 42, -18, -33, 43, -74, -100, -101 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_uint8 yydefgoto[] = +{ + 0, 1, 2, 8, 9, 12, 10, 13, 11, 17, + 36, 15, 27, 18, 45, 16, 32, 49, 48, 51, + 52, 97, 47, 50, 91, 55, 104, 68, 78, 132, + 124, 120, 128, 66, 109, 110, 111, 46, 72, 122, + 75, 93, 80, 129, 115, 116, 117 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_uint8 yytable[] = +{ + 59, 121, 62, 125, 130, 73, 74, 126, 28, 76, + 3, 58, 19, 20, 21, 79, 61, 92, 22, 57, + 60, 105, 37, 38, 58, 73, 74, 29, 127, 77, + 30, 79, 70, 23, 138, 24, 25, 4, 92, 106, + 107, 39, 31, 40, 41, 131, 106, 33, 113, 108, + 118, 60, 34, 71, 26, 123, 108, 108, 53, 125, + 54, 42, 136, 43, 44, 56, 5, 130, 141, 63, + 119, 6, 140, 106, 7, 69, 67, 35, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 98, 99, + 100, 101, 102, 103, 133, 142, 134, 14, 135, 92, + 94, 95, 96, 64, 58, 65, 137, 139, 112, 114 +}; + +static const yytype_uint8 yycheck[] = +{ + 33, 71, 35, 77, 8, 6, 7, 107, 4, 22, + 0, 37, 3, 4, 5, 48, 34, 50, 9, 31, + 52, 22, 4, 5, 37, 6, 7, 23, 22, 42, + 26, 64, 44, 24, 134, 26, 27, 10, 71, 40, + 41, 23, 38, 25, 26, 49, 40, 21, 66, 50, + 22, 52, 26, 42, 45, 22, 50, 50, 26, 133, + 28, 43, 132, 45, 46, 30, 39, 8, 48, 37, + 42, 44, 49, 40, 47, 43, 41, 51, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 31, 32, + 33, 34, 35, 36, 124, 49, 126, 8, 128, 132, + 28, 29, 30, 38, 37, 39, 133, 135, 66, 66 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 54, 55, 0, 10, 39, 44, 47, 56, 57, + 59, 61, 58, 60, 57, 64, 68, 62, 66, 3, + 4, 5, 9, 24, 26, 27, 45, 65, 4, 23, + 26, 38, 69, 21, 26, 51, 63, 4, 5, 23, + 25, 26, 43, 45, 46, 67, 90, 75, 71, 70, + 76, 72, 73, 75, 75, 78, 72, 70, 37, 95, + 52, 94, 95, 75, 71, 78, 86, 72, 80, 75, + 70, 42, 91, 6, 7, 93, 22, 42, 81, 95, + 95, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 77, 95, 94, 28, 29, 30, 74, 31, 32, + 33, 34, 35, 36, 79, 22, 40, 41, 50, 87, + 88, 89, 93, 94, 96, 97, 98, 99, 22, 42, + 84, 77, 92, 22, 83, 97, 98, 22, 85, 96, + 8, 49, 82, 82, 82, 82, 77, 83, 98, 85, + 49, 48, 49 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = +{ + 0, 53, 55, 54, 56, 56, 58, 57, 59, 57, + 60, 57, 61, 57, 62, 62, 63, 63, 63, 64, + 64, 65, 65, 65, 65, 65, 65, 65, 65, 66, + 66, 67, 67, 67, 67, 67, 67, 67, 67, 68, + 68, 69, 69, 69, 69, 70, 70, 71, 71, 71, + 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, + 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 78, 78, 79, 79, 79, 79, 79, 79, + 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, + 85, 85, 86, 86, 87, 87, 88, 88, 88, 88, + 89, 90, 90, 91, 92, 92, 93, 93, 94, 95, + 96, 96, 97, 98, 99 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 0, 2, 1, 2, 0, 3, 0, 3, + 0, 3, 0, 3, 0, 2, 2, 2, 2, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, + 0, 2, 0, 2, 1, 1, 1, 0, 2, 0, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, + 0, 2, 1, 5, 0, 1, 1, 1, 1, 5, + 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, + 5, 0, 2, 3, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + yy_symbol_value_print (yyo, yykind, yyvaluep); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + + + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) +{ + YY_USE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/* Lookahead token kind. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; +/* Number of syntax errors so far. */ +int yynerrs; + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void) +{ + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; /* Cause a token to be read. */ + + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (); + } + + if (yychar <= YYEOF) + { + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* $@1: %empty */ +#line 549 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->num_conn = 0; + TBL->num_param = 0; + TBL->num_inst_var = 0; + + saw_function_name = false; + saw_model_name = false; + + alloced_size [TBL_PORT] = DEFAULT_SIZE_CONN; + alloced_size [TBL_PARAMETER] = DEFAULT_SIZE_PARAM; + alloced_size [TBL_STATIC_VAR] = DEFAULT_SIZE_INST_VAR; + + TBL->conn = (Conn_Info_t*) + calloc(DEFAULT_SIZE_CONN, sizeof (Conn_Info_t)); + TBL->param = (Param_Info_t*) + calloc (DEFAULT_SIZE_PARAM, sizeof (Param_Info_t)); + TBL->inst_var = (Inst_Var_Info_t*) + calloc (DEFAULT_SIZE_INST_VAR, sizeof (Inst_Var_Info_t)); + if (! (TBL->conn && TBL->param && TBL->inst_var) ) { + fatal ("Could not allocate enough memory"); + } + } +#line 1761 "ifs_yacc.c" + break; + + case 6: /* $@2: %empty */ +#line 578 "../../../../src/xspice/cmpp/ifs_yacc.y" + {context.table = TBL_NAME;} +#line 1767 "ifs_yacc.c" + break; + + case 8: /* $@3: %empty */ +#line 581 "../../../../src/xspice/cmpp/ifs_yacc.y" + {context.table = TBL_PORT; + did_default_type = false; + did_allowed_types = false; + INIT (TBL->num_conn);} +#line 1776 "ifs_yacc.c" + break; + + case 9: /* table: TOK_PORT_TABLE $@3 port_table */ +#line 586 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->num_conn = num_items;} +#line 1782 "ifs_yacc.c" + break; + + case 10: /* $@4: %empty */ +#line 588 "../../../../src/xspice/cmpp/ifs_yacc.y" + {context.table = TBL_PARAMETER; + INIT (TBL->num_param);} +#line 1789 "ifs_yacc.c" + break; + + case 11: /* table: TOK_PARAMETER_TABLE $@4 parameter_table */ +#line 591 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->num_param = num_items;} +#line 1795 "ifs_yacc.c" + break; + + case 12: /* $@5: %empty */ +#line 593 "../../../../src/xspice/cmpp/ifs_yacc.y" + {context.table = TBL_STATIC_VAR; + INIT (TBL->num_inst_var);} +#line 1802 "ifs_yacc.c" + break; + + case 13: /* table: TOK_STATIC_VAR_TABLE $@5 static_var_table */ +#line 596 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->num_inst_var = num_items;} +#line 1808 "ifs_yacc.c" + break; + + case 16: /* name_table_item: TOK_C_FUNCTION_NAME identifier */ +#line 604 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->name.c_fcn_name =strdup (ifs_yytext); + saw_function_name = true; + if (parser_just_names && saw_model_name) return 0;} +#line 1816 "ifs_yacc.c" + break; + + case 17: /* name_table_item: TOK_SPICE_MODEL_NAME identifier */ +#line 608 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->name.model_name = strdup (ifs_yytext); + saw_model_name = true; + if (parser_just_names && saw_function_name) return 0;} +#line 1824 "ifs_yacc.c" + break; + + case 18: /* name_table_item: TOK_DESCRIPTION string */ +#line 612 "../../../../src/xspice/cmpp/ifs_yacc.y" + {TBL->name.description = strdup (ifs_yytext);} +#line 1830 "ifs_yacc.c" + break; + + case 21: /* port_table_item: TOK_PORT_NAME list_of_ids */ +#line 620 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->conn[i].name = ITEM_BUF(i).str; + }} +#line 1840 "ifs_yacc.c" + break; + + case 22: /* port_table_item: TOK_DESCRIPTION list_of_strings */ +#line 626 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->conn[i].description = ITEM_BUF(i).str; + }} +#line 1850 "ifs_yacc.c" + break; + + case 23: /* port_table_item: TOK_DIRECTION list_of_directions */ +#line 632 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->conn[i].direction = ITEM_BUF(i).dir; + }} +#line 1860 "ifs_yacc.c" + break; + + case 24: /* port_table_item: TOK_DEFAULT_TYPE list_of_ctypes */ +#line 638 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + did_default_type = true; + FOR_ITEM (i) { + TBL->conn[i].default_port_type = + ITEM_BUF(i).ctype.kind; + TBL->conn[i].default_type = ITEM_BUF(i).ctype.id; + if (did_allowed_types) { + check_default_type (TBL->conn[i]); + } + }} +#line 1876 "ifs_yacc.c" + break; + + case 25: /* port_table_item: TOK_ALLOWED_TYPES list_of_ctype_lists */ +#line 650 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + did_allowed_types = true; + FOR_ITEM (i) { + assign_ctype_list (&TBL->conn[i], + ITEM_BUF(i).ctype_list); + if (did_default_type) { + check_default_type (TBL->conn[i]); + } + }} +#line 1891 "ifs_yacc.c" + break; + + case 26: /* port_table_item: TOK_ARRAY list_of_bool */ +#line 661 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->conn[i].is_array = ITEM_BUF(i).btype; + }} +#line 1901 "ifs_yacc.c" + break; + + case 27: /* port_table_item: TOK_ARRAY_BOUNDS list_of_array_bounds */ +#line 667 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + ASSIGN_BOUNDS (conn, i); + assert (!TBL->conn[i].has_conn_ref); + }} +#line 1912 "ifs_yacc.c" + break; + + case 28: /* port_table_item: TOK_NULL_ALLOWED list_of_bool */ +#line 674 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->conn[i].null_allowed = ITEM_BUF(i).btype; + }} +#line 1922 "ifs_yacc.c" + break; + + case 31: /* parameter_table_item: TOK_PARAMETER_NAME list_of_ids */ +#line 686 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->param[i].name = ITEM_BUF(i).str; + }} +#line 1932 "ifs_yacc.c" + break; + + case 32: /* parameter_table_item: TOK_DESCRIPTION list_of_strings */ +#line 692 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->param[i].description = ITEM_BUF(i).str; + }} +#line 1942 "ifs_yacc.c" + break; + + case 33: /* parameter_table_item: TOK_DATA_TYPE list_of_dtypes */ +#line 698 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + check_dtype_not_pointer (ITEM_BUF(i).dtype); + TBL->param[i].type = ITEM_BUF(i).dtype; + }} +#line 1953 "ifs_yacc.c" + break; + + case 34: /* parameter_table_item: TOK_DEFAULT_VALUE list_of_values */ +#line 705 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->param[i].has_default = + ITEM_BUF(i).value.has_value; + if (TBL->param[i].has_default) { + assign_value (TBL->param[i].type, + &TBL->param[i].default_value, + ITEM_BUF(i).value); + } + }} +#line 1969 "ifs_yacc.c" + break; + + case 35: /* parameter_table_item: TOK_LIMITS list_of_ranges */ +#line 717 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + assign_limits (TBL->param[i].type, + &TBL->param[i], + ITEM_BUF(i).range); + }} +#line 1981 "ifs_yacc.c" + break; + + case 36: /* parameter_table_item: TOK_ARRAY list_of_bool */ +#line 725 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->param[i].is_array = ITEM_BUF(i).btype; + }} +#line 1991 "ifs_yacc.c" + break; + + case 37: /* parameter_table_item: TOK_ARRAY_BOUNDS list_of_array_bounds */ +#line 731 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + ASSIGN_BOUNDS (param, i); + }} +#line 2001 "ifs_yacc.c" + break; + + case 38: /* parameter_table_item: TOK_NULL_ALLOWED list_of_bool */ +#line 737 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->param[i].null_allowed = ITEM_BUF(i).btype; + }} +#line 2011 "ifs_yacc.c" + break; + + case 41: /* static_var_table_item: TOK_STATIC_VAR_NAME list_of_ids */ +#line 749 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->inst_var[i].name = ITEM_BUF(i).str; + }} +#line 2021 "ifs_yacc.c" + break; + + case 42: /* static_var_table_item: TOK_DESCRIPTION list_of_strings */ +#line 755 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->inst_var[i].description = ITEM_BUF(i).str; + }} +#line 2031 "ifs_yacc.c" + break; + + case 43: /* static_var_table_item: TOK_DATA_TYPE list_of_dtypes */ +#line 761 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->inst_var[i].type = ITEM_BUF(i).dtype; + }} +#line 2041 "ifs_yacc.c" + break; + + case 44: /* static_var_table_item: TOK_ARRAY list_of_bool */ +#line 767 "../../../../src/xspice/cmpp/ifs_yacc.y" + {int i; + END; + FOR_ITEM (i) { + TBL->inst_var[i].is_array = ITEM_BUF(i).btype; + }} +#line 2051 "ifs_yacc.c" + break; + + case 46: /* list_of_ids: list_of_ids identifier */ +#line 775 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.str = (yyvsp[0].str);} +#line 2057 "ifs_yacc.c" + break; + + case 48: /* list_of_array_bounds: list_of_array_bounds int_range */ +#line 780 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; + BUF.range = (yyvsp[0].range);} +#line 2064 "ifs_yacc.c" + break; + + case 49: /* list_of_array_bounds: list_of_array_bounds identifier */ +#line 783 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; + BUF.range.is_named = true; + BUF.range.u.name = (yyvsp[0].str);} +#line 2072 "ifs_yacc.c" + break; + + case 51: /* list_of_strings: list_of_strings string */ +#line 789 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.str = (yyvsp[0].str);} +#line 2078 "ifs_yacc.c" + break; + + case 53: /* list_of_directions: list_of_directions direction */ +#line 793 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.dir = (yyvsp[0].dir);} +#line 2084 "ifs_yacc.c" + break; + + case 54: /* direction: TOK_DIR_IN */ +#line 796 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dir) = CMPP_IN;} +#line 2090 "ifs_yacc.c" + break; + + case 55: /* direction: TOK_DIR_OUT */ +#line 797 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dir) = CMPP_OUT;} +#line 2096 "ifs_yacc.c" + break; + + case 56: /* direction: TOK_DIR_INOUT */ +#line 798 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dir) = CMPP_INOUT;} +#line 2102 "ifs_yacc.c" + break; + + case 58: /* list_of_bool: list_of_bool btype */ +#line 802 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.btype = (yyvsp[0].btype);} +#line 2108 "ifs_yacc.c" + break; + + case 60: /* list_of_ctypes: list_of_ctypes ctype */ +#line 806 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.ctype = (yyvsp[0].ctype);} +#line 2114 "ifs_yacc.c" + break; + + case 61: /* ctype: TOK_CTYPE_V */ +#line 809 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = VOLTAGE;} +#line 2120 "ifs_yacc.c" + break; + + case 62: /* ctype: TOK_CTYPE_VD */ +#line 810 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = DIFF_VOLTAGE;} +#line 2126 "ifs_yacc.c" + break; + + case 63: /* ctype: TOK_CTYPE_VNAM */ +#line 811 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = VSOURCE_CURRENT;} +#line 2132 "ifs_yacc.c" + break; + + case 64: /* ctype: TOK_CTYPE_I */ +#line 812 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = CURRENT;} +#line 2138 "ifs_yacc.c" + break; + + case 65: /* ctype: TOK_CTYPE_ID */ +#line 813 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = DIFF_CURRENT;} +#line 2144 "ifs_yacc.c" + break; + + case 66: /* ctype: TOK_CTYPE_G */ +#line 814 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = CONDUCTANCE;} +#line 2150 "ifs_yacc.c" + break; + + case 67: /* ctype: TOK_CTYPE_GD */ +#line 815 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = DIFF_CONDUCTANCE;} +#line 2156 "ifs_yacc.c" + break; + + case 68: /* ctype: TOK_CTYPE_H */ +#line 816 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = RESISTANCE;} +#line 2162 "ifs_yacc.c" + break; + + case 69: /* ctype: TOK_CTYPE_HD */ +#line 817 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = DIFF_RESISTANCE;} +#line 2168 "ifs_yacc.c" + break; + + case 70: /* ctype: TOK_CTYPE_D */ +#line 818 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = DIGITAL;} +#line 2174 "ifs_yacc.c" + break; + + case 71: /* ctype: identifier */ +#line 819 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype).kind = USER_DEFINED; + (yyval.ctype).id = (yyvsp[0].str);} +#line 2181 "ifs_yacc.c" + break; + + case 73: /* list_of_dtypes: list_of_dtypes dtype */ +#line 824 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.dtype = (yyvsp[0].dtype);} +#line 2187 "ifs_yacc.c" + break; + + case 74: /* dtype: TOK_DTYPE_REAL */ +#line 827 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dtype) = CMPP_REAL;} +#line 2193 "ifs_yacc.c" + break; + + case 75: /* dtype: TOK_DTYPE_INT */ +#line 828 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dtype) = CMPP_INTEGER;} +#line 2199 "ifs_yacc.c" + break; + + case 76: /* dtype: TOK_DTYPE_BOOLEAN */ +#line 829 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dtype) = CMPP_BOOLEAN;} +#line 2205 "ifs_yacc.c" + break; + + case 77: /* dtype: TOK_DTYPE_COMPLEX */ +#line 830 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dtype) = CMPP_COMPLEX;} +#line 2211 "ifs_yacc.c" + break; + + case 78: /* dtype: TOK_DTYPE_STRING */ +#line 831 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dtype) = CMPP_STRING;} +#line 2217 "ifs_yacc.c" + break; + + case 79: /* dtype: TOK_DTYPE_POINTER */ +#line 832 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.dtype) = CMPP_POINTER;} +#line 2223 "ifs_yacc.c" + break; + + case 81: /* list_of_ranges: list_of_ranges range */ +#line 836 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.range = (yyvsp[0].range);} +#line 2229 "ifs_yacc.c" + break; + + case 82: /* int_range: TOK_DASH */ +#line 839 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.range).is_named = false; + (yyval.range).u.bounds.lower.has_bound = false; + (yyval.range).u.bounds.upper.has_bound = false;} +#line 2237 "ifs_yacc.c" + break; + + case 83: /* int_range: TOK_LBRACKET int_or_dash maybe_comma int_or_dash TOK_RBRACKET */ +#line 844 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.range).is_named = false; + (yyval.range).u.bounds.lower = (yyvsp[-3].bound); + (yyval.range).u.bounds.upper = (yyvsp[-1].bound);} +#line 2245 "ifs_yacc.c" + break; + + case 86: /* int_or_dash: TOK_DASH */ +#line 853 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.bound).has_bound = false;} +#line 2251 "ifs_yacc.c" + break; + + case 87: /* int_or_dash: integer_value */ +#line 854 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.bound).has_bound = true; + (yyval.bound).bound = (yyvsp[0].value);} +#line 2258 "ifs_yacc.c" + break; + + case 88: /* range: TOK_DASH */ +#line 858 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.range).is_named = false; + (yyval.range).u.bounds.lower.has_bound = false; + (yyval.range).u.bounds.upper.has_bound = false;} +#line 2266 "ifs_yacc.c" + break; + + case 89: /* range: TOK_LBRACKET number_or_dash maybe_comma number_or_dash TOK_RBRACKET */ +#line 863 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.range).is_named = false; + (yyval.range).u.bounds.lower = (yyvsp[-3].bound); + (yyval.range).u.bounds.upper = (yyvsp[-1].bound);} +#line 2274 "ifs_yacc.c" + break; + + case 90: /* number_or_dash: TOK_DASH */ +#line 868 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.bound).has_bound = false;} +#line 2280 "ifs_yacc.c" + break; + + case 91: /* number_or_dash: number */ +#line 869 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.bound).has_bound = true; + (yyval.bound).bound = (yyvsp[0].value);} +#line 2287 "ifs_yacc.c" + break; + + case 93: /* list_of_values: list_of_values value_or_dash */ +#line 874 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.value = (yyvsp[0].value);} +#line 2293 "ifs_yacc.c" + break; + + case 94: /* value_or_dash: TOK_DASH */ +#line 877 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.value).has_value = false;} +#line 2299 "ifs_yacc.c" + break; + + case 96: /* value: string */ +#line 881 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.value).has_value = true; + (yyval.value).kind = CMPP_STRING; + (yyval.value).u.svalue = (yyvsp[0].str);} +#line 2307 "ifs_yacc.c" + break; + + case 97: /* value: btype */ +#line 884 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.value).has_value = true; + (yyval.value).kind = CMPP_BOOLEAN; + (yyval.value).u.bvalue = (yyvsp[0].btype);} +#line 2315 "ifs_yacc.c" + break; + + case 98: /* value: complex */ +#line 887 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.value).has_value = true; + (yyval.value).kind = CMPP_COMPLEX; + (yyval.value).u.cvalue = (yyvsp[0].cval);} +#line 2323 "ifs_yacc.c" + break; + + case 100: /* complex: TOK_LANGLE real maybe_comma real TOK_RANGLE */ +#line 894 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.cval).real = (yyvsp[-3].rval); + (yyval.cval).imag = (yyvsp[-1].rval);} +#line 2330 "ifs_yacc.c" + break; + + case 102: /* list_of_ctype_lists: list_of_ctype_lists delimited_ctype_list */ +#line 900 "../../../../src/xspice/cmpp/ifs_yacc.y" + {ITEM; BUF.ctype_list = (yyvsp[0].ctype_list);} +#line 2336 "ifs_yacc.c" + break; + + case 103: /* delimited_ctype_list: TOK_LBRACKET ctype_list TOK_RBRACKET */ +#line 903 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype_list) = (yyvsp[-1].ctype_list);} +#line 2342 "ifs_yacc.c" + break; + + case 104: /* ctype_list: ctype */ +#line 907 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype_list) = (Ctype_List_t*)calloc (1, + sizeof (Ctype_List_t)); + if (!(yyval.ctype_list)) { + fatal ("Error allocating memory"); + } + (yyval.ctype_list)->ctype = (yyvsp[0].ctype); + (yyval.ctype_list)->next = (Ctype_List_t*)0;} +#line 2354 "ifs_yacc.c" + break; + + case 105: /* ctype_list: ctype_list maybe_comma ctype */ +#line 915 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ctype_list) = (Ctype_List_t*)calloc (1, + sizeof (Ctype_List_t)); + if (!(yyval.ctype_list)) { + fatal ("Error allocating memory"); + } + (yyval.ctype_list)->ctype = (yyvsp[0].ctype); + (yyval.ctype_list)->next = (yyvsp[-2].ctype_list); + /*$$->next = (Ctype_List_t*)0; + assert ($1); + $1->next = $$;*/} +#line 2369 "ifs_yacc.c" + break; + + case 106: /* btype: TOK_BOOL_YES */ +#line 927 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.btype) = true;} +#line 2375 "ifs_yacc.c" + break; + + case 107: /* btype: TOK_BOOL_NO */ +#line 928 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.btype) = false;} +#line 2381 "ifs_yacc.c" + break; + + case 108: /* string: TOK_STRING_LITERAL */ +#line 931 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.str) = strdup(ifs_yytext);} +#line 2387 "ifs_yacc.c" + break; + + case 109: /* identifier: TOK_IDENTIFIER */ +#line 934 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.str) = strdup(ifs_yytext);} +#line 2393 "ifs_yacc.c" + break; + + case 110: /* number: real */ +#line 937 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.value).has_value = true; + (yyval.value).kind = CMPP_REAL; + (yyval.value).u.rvalue = (yyvsp[0].rval);} +#line 2401 "ifs_yacc.c" + break; + + case 112: /* integer_value: integer */ +#line 943 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.value).has_value = true; + (yyval.value).kind = CMPP_INTEGER; + (yyval.value).u.ivalue = (yyvsp[0].ival);} +#line 2409 "ifs_yacc.c" + break; + + case 113: /* real: TOK_REAL_LITERAL */ +#line 948 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.rval) = yydval;} +#line 2415 "ifs_yacc.c" + break; + + case 114: /* integer: TOK_INT_LITERAL */ +#line 951 "../../../../src/xspice/cmpp/ifs_yacc.y" + {(yyval.ival) = yyival;} +#line 2421 "ifs_yacc.c" + break; + + +#line 2425 "ifs_yacc.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + yyerror (YY_("syntax error")); + } + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + + return yyresult; +} + +#line 954 "../../../../src/xspice/cmpp/ifs_yacc.y" + diff --git a/src/xspice/cmpp/ifs_yacc.h b/src/xspice/cmpp/ifs_yacc.h new file mode 100644 index 000000000..e6fd56912 --- /dev/null +++ b/src/xspice/cmpp/ifs_yacc.h @@ -0,0 +1,200 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_YY_IFS_YACC_H_INCLUDED +# define YY_YY_IFS_YACC_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + TOK_ALLOWED_TYPES = 258, /* TOK_ALLOWED_TYPES */ + TOK_ARRAY = 259, /* TOK_ARRAY */ + TOK_ARRAY_BOUNDS = 260, /* TOK_ARRAY_BOUNDS */ + TOK_BOOL_NO = 261, /* TOK_BOOL_NO */ + TOK_BOOL_YES = 262, /* TOK_BOOL_YES */ + TOK_COMMA = 263, /* TOK_COMMA */ + TOK_PORT_NAME = 264, /* TOK_PORT_NAME */ + TOK_PORT_TABLE = 265, /* TOK_PORT_TABLE */ + TOK_CTYPE_D = 266, /* TOK_CTYPE_D */ + TOK_CTYPE_G = 267, /* TOK_CTYPE_G */ + TOK_CTYPE_GD = 268, /* TOK_CTYPE_GD */ + TOK_CTYPE_H = 269, /* TOK_CTYPE_H */ + TOK_CTYPE_HD = 270, /* TOK_CTYPE_HD */ + TOK_CTYPE_I = 271, /* TOK_CTYPE_I */ + TOK_CTYPE_ID = 272, /* TOK_CTYPE_ID */ + TOK_CTYPE_V = 273, /* TOK_CTYPE_V */ + TOK_CTYPE_VD = 274, /* TOK_CTYPE_VD */ + TOK_CTYPE_VNAM = 275, /* TOK_CTYPE_VNAM */ + TOK_C_FUNCTION_NAME = 276, /* TOK_C_FUNCTION_NAME */ + TOK_DASH = 277, /* TOK_DASH */ + TOK_DATA_TYPE = 278, /* TOK_DATA_TYPE */ + TOK_DEFAULT_TYPE = 279, /* TOK_DEFAULT_TYPE */ + TOK_DEFAULT_VALUE = 280, /* TOK_DEFAULT_VALUE */ + TOK_DESCRIPTION = 281, /* TOK_DESCRIPTION */ + TOK_DIRECTION = 282, /* TOK_DIRECTION */ + TOK_DIR_IN = 283, /* TOK_DIR_IN */ + TOK_DIR_INOUT = 284, /* TOK_DIR_INOUT */ + TOK_DIR_OUT = 285, /* TOK_DIR_OUT */ + TOK_DTYPE_BOOLEAN = 286, /* TOK_DTYPE_BOOLEAN */ + TOK_DTYPE_COMPLEX = 287, /* TOK_DTYPE_COMPLEX */ + TOK_DTYPE_INT = 288, /* TOK_DTYPE_INT */ + TOK_DTYPE_POINTER = 289, /* TOK_DTYPE_POINTER */ + TOK_DTYPE_REAL = 290, /* TOK_DTYPE_REAL */ + TOK_DTYPE_STRING = 291, /* TOK_DTYPE_STRING */ + TOK_IDENTIFIER = 292, /* TOK_IDENTIFIER */ + TOK_STATIC_VAR_NAME = 293, /* TOK_STATIC_VAR_NAME */ + TOK_STATIC_VAR_TABLE = 294, /* TOK_STATIC_VAR_TABLE */ + TOK_INT_LITERAL = 295, /* TOK_INT_LITERAL */ + TOK_LANGLE = 296, /* TOK_LANGLE */ + TOK_LBRACKET = 297, /* TOK_LBRACKET */ + TOK_LIMITS = 298, /* TOK_LIMITS */ + TOK_NAME_TABLE = 299, /* TOK_NAME_TABLE */ + TOK_NULL_ALLOWED = 300, /* TOK_NULL_ALLOWED */ + TOK_PARAMETER_NAME = 301, /* TOK_PARAMETER_NAME */ + TOK_PARAMETER_TABLE = 302, /* TOK_PARAMETER_TABLE */ + TOK_RANGLE = 303, /* TOK_RANGLE */ + TOK_RBRACKET = 304, /* TOK_RBRACKET */ + TOK_REAL_LITERAL = 305, /* TOK_REAL_LITERAL */ + TOK_SPICE_MODEL_NAME = 306, /* TOK_SPICE_MODEL_NAME */ + TOK_STRING_LITERAL = 307 /* TOK_STRING_LITERAL */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 +#define TOK_ALLOWED_TYPES 258 +#define TOK_ARRAY 259 +#define TOK_ARRAY_BOUNDS 260 +#define TOK_BOOL_NO 261 +#define TOK_BOOL_YES 262 +#define TOK_COMMA 263 +#define TOK_PORT_NAME 264 +#define TOK_PORT_TABLE 265 +#define TOK_CTYPE_D 266 +#define TOK_CTYPE_G 267 +#define TOK_CTYPE_GD 268 +#define TOK_CTYPE_H 269 +#define TOK_CTYPE_HD 270 +#define TOK_CTYPE_I 271 +#define TOK_CTYPE_ID 272 +#define TOK_CTYPE_V 273 +#define TOK_CTYPE_VD 274 +#define TOK_CTYPE_VNAM 275 +#define TOK_C_FUNCTION_NAME 276 +#define TOK_DASH 277 +#define TOK_DATA_TYPE 278 +#define TOK_DEFAULT_TYPE 279 +#define TOK_DEFAULT_VALUE 280 +#define TOK_DESCRIPTION 281 +#define TOK_DIRECTION 282 +#define TOK_DIR_IN 283 +#define TOK_DIR_INOUT 284 +#define TOK_DIR_OUT 285 +#define TOK_DTYPE_BOOLEAN 286 +#define TOK_DTYPE_COMPLEX 287 +#define TOK_DTYPE_INT 288 +#define TOK_DTYPE_POINTER 289 +#define TOK_DTYPE_REAL 290 +#define TOK_DTYPE_STRING 291 +#define TOK_IDENTIFIER 292 +#define TOK_STATIC_VAR_NAME 293 +#define TOK_STATIC_VAR_TABLE 294 +#define TOK_INT_LITERAL 295 +#define TOK_LANGLE 296 +#define TOK_LBRACKET 297 +#define TOK_LIMITS 298 +#define TOK_NAME_TABLE 299 +#define TOK_NULL_ALLOWED 300 +#define TOK_PARAMETER_NAME 301 +#define TOK_PARAMETER_TABLE 302 +#define TOK_RANGLE 303 +#define TOK_RBRACKET 304 +#define TOK_REAL_LITERAL 305 +#define TOK_SPICE_MODEL_NAME 306 +#define TOK_STRING_LITERAL 307 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 504 "../../../../src/xspice/cmpp/ifs_yacc.y" + + Ctype_List_t *ctype_list; + Dir_t dir; + bool btype; + Range_t range; + Data_Type_t dtype; + My_Port_Type_t ctype; + My_Value_t value; + char *str; + Bound_t bound; + int ival; + double rval; + Complex_t cval; + +#line 186 "ifs_yacc.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE yylval; + + +int yyparse (void); + + +#endif /* !YY_YY_IFS_YACC_H_INCLUDED */ diff --git a/src/xspice/cmpp/mod_lex.c b/src/xspice/cmpp/mod_lex.c new file mode 100644 index 000000000..261fa1694 --- /dev/null +++ b/src/xspice/cmpp/mod_lex.c @@ -0,0 +1,2473 @@ +#line 2 "mod_lex.c" + +#line 4 "mod_lex.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer mod_yy_create_buffer +#define yy_delete_buffer mod_yy_delete_buffer +#define yy_scan_buffer mod_yy_scan_buffer +#define yy_scan_string mod_yy_scan_string +#define yy_scan_bytes mod_yy_scan_bytes +#define yy_init_buffer mod_yy_init_buffer +#define yy_flush_buffer mod_yy_flush_buffer +#define yy_load_buffer_state mod_yy_load_buffer_state +#define yy_switch_to_buffer mod_yy_switch_to_buffer +#define yypush_buffer_state mod_yypush_buffer_state +#define yypop_buffer_state mod_yypop_buffer_state +#define yyensure_buffer_stack mod_yyensure_buffer_stack +#define yy_flex_debug mod_yy_flex_debug +#define yyin mod_yyin +#define yyleng mod_yyleng +#define yylex mod_yylex +#define yylineno mod_yylineno +#define yyout mod_yyout +#define yyrestart mod_yyrestart +#define yytext mod_yytext +#define yywrap mod_yywrap +#define yyalloc mod_yyalloc +#define yyrealloc mod_yyrealloc +#define yyfree mod_yyfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define mod_yy_create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer mod_yy_create_buffer +#endif + +#ifdef yy_delete_buffer +#define mod_yy_delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer mod_yy_delete_buffer +#endif + +#ifdef yy_scan_buffer +#define mod_yy_scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer mod_yy_scan_buffer +#endif + +#ifdef yy_scan_string +#define mod_yy_scan_string_ALREADY_DEFINED +#else +#define yy_scan_string mod_yy_scan_string +#endif + +#ifdef yy_scan_bytes +#define mod_yy_scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes mod_yy_scan_bytes +#endif + +#ifdef yy_init_buffer +#define mod_yy_init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer mod_yy_init_buffer +#endif + +#ifdef yy_flush_buffer +#define mod_yy_flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer mod_yy_flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define mod_yy_load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state mod_yy_load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define mod_yy_switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer mod_yy_switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define mod_yypush_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state mod_yypush_buffer_state +#endif + +#ifdef yypop_buffer_state +#define mod_yypop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state mod_yypop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define mod_yyensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack mod_yyensure_buffer_stack +#endif + +#ifdef yylex +#define mod_yylex_ALREADY_DEFINED +#else +#define yylex mod_yylex +#endif + +#ifdef yyrestart +#define mod_yyrestart_ALREADY_DEFINED +#else +#define yyrestart mod_yyrestart +#endif + +#ifdef yylex_init +#define mod_yylex_init_ALREADY_DEFINED +#else +#define yylex_init mod_yylex_init +#endif + +#ifdef yylex_init_extra +#define mod_yylex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra mod_yylex_init_extra +#endif + +#ifdef yylex_destroy +#define mod_yylex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy mod_yylex_destroy +#endif + +#ifdef yyget_debug +#define mod_yyget_debug_ALREADY_DEFINED +#else +#define yyget_debug mod_yyget_debug +#endif + +#ifdef yyset_debug +#define mod_yyset_debug_ALREADY_DEFINED +#else +#define yyset_debug mod_yyset_debug +#endif + +#ifdef yyget_extra +#define mod_yyget_extra_ALREADY_DEFINED +#else +#define yyget_extra mod_yyget_extra +#endif + +#ifdef yyset_extra +#define mod_yyset_extra_ALREADY_DEFINED +#else +#define yyset_extra mod_yyset_extra +#endif + +#ifdef yyget_in +#define mod_yyget_in_ALREADY_DEFINED +#else +#define yyget_in mod_yyget_in +#endif + +#ifdef yyset_in +#define mod_yyset_in_ALREADY_DEFINED +#else +#define yyset_in mod_yyset_in +#endif + +#ifdef yyget_out +#define mod_yyget_out_ALREADY_DEFINED +#else +#define yyget_out mod_yyget_out +#endif + +#ifdef yyset_out +#define mod_yyset_out_ALREADY_DEFINED +#else +#define yyset_out mod_yyset_out +#endif + +#ifdef yyget_leng +#define mod_yyget_leng_ALREADY_DEFINED +#else +#define yyget_leng mod_yyget_leng +#endif + +#ifdef yyget_text +#define mod_yyget_text_ALREADY_DEFINED +#else +#define yyget_text mod_yyget_text +#endif + +#ifdef yyget_lineno +#define mod_yyget_lineno_ALREADY_DEFINED +#else +#define yyget_lineno mod_yyget_lineno +#endif + +#ifdef yyset_lineno +#define mod_yyset_lineno_ALREADY_DEFINED +#else +#define yyset_lineno mod_yyset_lineno +#endif + +#ifdef yywrap +#define mod_yywrap_ALREADY_DEFINED +#else +#define yywrap mod_yywrap +#endif + +#ifdef yyalloc +#define mod_yyalloc_ALREADY_DEFINED +#else +#define yyalloc mod_yyalloc +#endif + +#ifdef yyrealloc +#define mod_yyrealloc_ALREADY_DEFINED +#else +#define yyrealloc mod_yyrealloc +#endif + +#ifdef yyfree +#define mod_yyfree_ALREADY_DEFINED +#else +#define yyfree mod_yyfree +#endif + +#ifdef yytext +#define mod_yytext_ALREADY_DEFINED +#else +#define yytext mod_yytext +#endif + +#ifdef yyleng +#define mod_yyleng_ALREADY_DEFINED +#else +#define yyleng mod_yyleng +#endif + +#ifdef yyin +#define mod_yyin_ALREADY_DEFINED +#else +#define yyin mod_yyin +#endif + +#ifdef yyout +#define mod_yyout_ALREADY_DEFINED +#else +#define yyout mod_yyout +#endif + +#ifdef yy_flex_debug +#define mod_yy_flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug mod_yy_flex_debug +#endif + +#ifdef yylineno +#define mod_yylineno_ALREADY_DEFINED +#else +#define yylineno mod_yylineno +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern int yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE yylex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-yylineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + int yyl;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ + }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = NULL; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart ( FILE *input_file ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +void yy_delete_buffer ( YY_BUFFER_STATE b ); +void yy_flush_buffer ( YY_BUFFER_STATE b ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state ( void ); + +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); + +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define mod_yywrap() (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +FILE *yyin = NULL, *yyout = NULL; + +typedef int yy_state_type; + +extern int yylineno; +int yylineno = 1; + +extern char *yytext; +#ifdef yytext_ptr +#undef yytext_ptr +#endif +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; +#define YY_NUM_RULES 46 +#define YY_END_OF_BUFFER 47 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[214] = + { 0, + 0, 0, 47, 45, 43, 44, 45, 37, 38, 41, + 45, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 13, 39, 40, 0, 3, 0, 1, 2, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 4, 42, 5, + 42, 14, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 10, 42, 42, 42, 42, 42, 28, 42, 42, + 42, 17, 42, 42, 42, 42, 42, 42, 42, 42, + + 42, 42, 42, 42, 42, 32, 42, 42, 42, 42, + 42, 42, 42, 42, 23, 42, 42, 42, 42, 42, + 16, 42, 42, 42, 42, 22, 42, 42, 42, 42, + 42, 42, 7, 6, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 11, 42, 42, 42, + 9, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 21, 20, 42, 42, 42, 42, 42, 30, 42, + 42, 42, 42, 42, 42, 19, 18, 25, 42, 15, + 29, 42, 42, 42, 42, 42, 42, 35, 42, 12, + 42, 42, 42, 24, 33, 42, 42, 42, 42, 8, + + 42, 42, 42, 42, 31, 36, 42, 42, 42, 34, + 27, 26, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 1, 1, 1, 1, 5, + 6, 7, 1, 8, 1, 1, 9, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 1, 1, 1, + 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 20, 34, 35, + 36, 37, 38, 1, 39, 1, 20, 20, 20, 20, + + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 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 const YY_CHAR yy_meta[40] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 2 + } ; + +static const flex_int16_t yy_base[217] = + { 0, + 0, 0, 424, 425, 425, 425, 36, 425, 425, 425, + 34, 32, 413, 36, 34, 38, 39, 40, 41, 42, + 51, 47, 49, 425, 425, 61, 425, 419, 425, 425, + 0, 411, 56, 59, 61, 65, 66, 69, 71, 72, + 73, 74, 76, 79, 80, 78, 84, 86, 89, 87, + 98, 100, 101, 102, 103, 105, 104, 109, 110, 108, + 113, 114, 115, 122, 118, 135, 116, 410, 137, 409, + 126, 408, 143, 129, 120, 132, 138, 148, 150, 151, + 152, 407, 153, 154, 155, 158, 161, 162, 164, 167, + 168, 169, 172, 170, 175, 179, 178, 180, 183, 185, + + 187, 186, 192, 195, 201, 199, 202, 203, 204, 208, + 213, 205, 206, 219, 406, 220, 222, 224, 223, 226, + 405, 227, 238, 230, 235, 404, 236, 229, 245, 237, + 246, 249, 403, 402, 247, 255, 253, 260, 263, 265, + 261, 267, 268, 272, 274, 277, 401, 278, 275, 283, + 400, 285, 287, 288, 289, 294, 290, 298, 301, 300, + 303, 399, 398, 306, 307, 309, 310, 314, 397, 311, + 318, 321, 319, 326, 329, 396, 395, 323, 330, 394, + 390, 333, 327, 336, 337, 342, 344, 389, 345, 388, + 346, 348, 350, 387, 386, 349, 351, 353, 359, 385, + + 369, 357, 360, 338, 384, 383, 370, 371, 375, 382, + 381, 376, 425, 401, 382, 380 + } ; + +static const flex_int16_t yy_def[217] = + { 0, + 213, 1, 213, 213, 213, 213, 214, 213, 213, 213, + 213, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 213, 213, 214, 213, 214, 213, 213, + 216, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 0, 213, 213, 213 + } ; + +static const flex_int16_t yy_nxt[465] = + { 0, + 4, 5, 6, 7, 8, 9, 4, 10, 11, 4, + 12, 13, 14, 13, 13, 13, 13, 13, 15, 13, + 13, 16, 17, 18, 19, 20, 13, 21, 22, 23, + 13, 13, 13, 13, 13, 24, 4, 25, 13, 27, + 29, 31, 30, 31, 33, 31, 36, 31, 31, 31, + 31, 31, 42, 39, 40, 34, 31, 37, 31, 35, + 31, 44, 38, 46, 27, 31, 43, 47, 31, 50, + 31, 41, 28, 48, 31, 31, 45, 51, 31, 55, + 31, 31, 31, 31, 53, 31, 52, 31, 31, 31, + 62, 54, 61, 31, 49, 31, 31, 28, 31, 56, + + 63, 59, 58, 60, 57, 66, 64, 31, 67, 31, + 31, 31, 31, 31, 31, 65, 72, 31, 31, 31, + 76, 69, 31, 31, 31, 31, 68, 31, 83, 31, + 70, 31, 71, 73, 75, 31, 82, 78, 31, 77, + 81, 31, 74, 80, 31, 84, 31, 31, 86, 85, + 91, 79, 31, 89, 92, 88, 93, 31, 90, 31, + 31, 31, 31, 31, 31, 95, 97, 31, 101, 96, + 31, 31, 99, 31, 98, 87, 31, 31, 31, 31, + 104, 31, 108, 100, 31, 105, 94, 31, 31, 31, + 102, 112, 31, 109, 31, 31, 31, 106, 110, 117, + + 103, 31, 111, 116, 31, 113, 115, 107, 31, 121, + 31, 31, 31, 31, 31, 31, 131, 31, 114, 118, + 119, 120, 31, 122, 126, 124, 128, 129, 31, 31, + 125, 31, 31, 31, 127, 31, 31, 123, 31, 31, + 132, 138, 134, 130, 31, 31, 31, 31, 133, 135, + 139, 140, 136, 144, 31, 31, 31, 145, 31, 137, + 143, 151, 31, 146, 31, 152, 141, 142, 148, 31, + 31, 147, 31, 150, 31, 149, 31, 31, 154, 157, + 156, 31, 153, 31, 31, 155, 31, 31, 164, 160, + 158, 163, 31, 166, 31, 162, 31, 31, 31, 31, + + 159, 168, 169, 31, 171, 165, 161, 31, 173, 31, + 31, 172, 31, 170, 167, 31, 31, 177, 31, 31, + 31, 176, 180, 31, 181, 174, 175, 31, 31, 183, + 31, 185, 31, 178, 179, 31, 31, 182, 31, 31, + 187, 184, 31, 188, 190, 31, 31, 31, 186, 191, + 192, 31, 193, 31, 31, 31, 195, 31, 31, 31, + 31, 189, 31, 197, 201, 202, 31, 196, 31, 31, + 194, 204, 209, 198, 203, 199, 205, 200, 31, 31, + 31, 31, 206, 32, 31, 31, 207, 210, 208, 212, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + + 211, 26, 26, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 213, 31, 213, 3, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213 + } ; + +static const flex_int16_t yy_chk[465] = + { 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, 7, + 11, 12, 11, 15, 12, 14, 14, 16, 17, 18, + 19, 20, 20, 17, 18, 12, 22, 15, 23, 12, + 21, 21, 16, 23, 26, 33, 20, 23, 34, 34, + 35, 19, 7, 23, 36, 37, 22, 35, 38, 38, + 39, 40, 41, 42, 37, 43, 36, 46, 44, 45, + 45, 37, 44, 47, 33, 48, 50, 26, 49, 39, + + 46, 42, 41, 43, 40, 49, 47, 51, 50, 52, + 53, 54, 55, 57, 56, 48, 55, 60, 58, 59, + 59, 52, 61, 62, 63, 67, 51, 65, 65, 75, + 53, 64, 54, 56, 58, 71, 64, 60, 74, 59, + 63, 76, 57, 62, 66, 66, 69, 77, 69, 67, + 75, 61, 73, 73, 76, 71, 77, 78, 74, 79, + 80, 81, 83, 84, 85, 79, 81, 86, 86, 80, + 87, 88, 84, 89, 83, 69, 90, 91, 92, 94, + 89, 93, 93, 85, 95, 90, 78, 97, 96, 98, + 87, 96, 99, 94, 100, 102, 101, 91, 94, 101, + + 88, 103, 95, 100, 104, 97, 99, 92, 106, 104, + 105, 107, 108, 109, 112, 113, 113, 110, 98, 102, + 103, 103, 111, 105, 108, 107, 110, 111, 114, 116, + 107, 117, 119, 118, 109, 120, 122, 106, 128, 124, + 114, 122, 117, 112, 125, 127, 130, 123, 116, 118, + 123, 123, 119, 125, 129, 131, 135, 127, 132, 120, + 124, 135, 137, 128, 136, 136, 123, 123, 130, 138, + 141, 129, 139, 132, 140, 131, 142, 143, 137, 140, + 139, 144, 136, 145, 149, 138, 146, 148, 148, 143, + 141, 146, 150, 150, 152, 145, 153, 154, 155, 157, + + 142, 153, 154, 156, 156, 149, 144, 158, 158, 160, + 159, 157, 161, 155, 152, 164, 165, 161, 166, 167, + 170, 160, 166, 168, 167, 158, 159, 171, 173, 170, + 172, 172, 178, 164, 165, 174, 183, 168, 175, 179, + 174, 171, 182, 175, 179, 184, 185, 204, 173, 182, + 183, 186, 184, 187, 189, 191, 186, 192, 196, 193, + 197, 178, 198, 189, 193, 196, 202, 187, 199, 203, + 185, 198, 204, 189, 197, 191, 199, 192, 201, 207, + 208, 216, 201, 215, 209, 212, 202, 207, 203, 209, + 211, 210, 206, 205, 200, 195, 194, 190, 188, 181, + + 208, 214, 214, 180, 177, 176, 169, 163, 162, 151, + 147, 134, 133, 126, 121, 115, 82, 72, 70, 68, + 32, 28, 13, 3, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 213, 213 + } ; + +/* Table of booleans, true if rule could match eol. */ +static const flex_int32_t yy_rule_can_match_eol[47] = + { 0, +0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, }; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "../../../../src/xspice/cmpp/mod_lex.l" +#line 6 "../../../../src/xspice/cmpp/mod_lex.l" + +/*============================================================================ +FILE mod_lex.l + +MEMBER OF process cmpp + +Copyright 1991 +Georgia Tech Research Corporation +Atlanta, Georgia 30332 +All Rights Reserved + +PROJECT A-8503 + +AUTHORS + + 9/12/91 Steve Tynor + +MODIFICATIONS + + + +SUMMARY + + This file defines tokens applicable to parsing the cfunc.mod + file, and actions to be taken on encountering those tokens. + +INTERFACES + + None. + +REFERENCED FILES + + mod_yacc.y + +NON-STANDARD FEATURES + + None. + +============================================================================*/ + +#include "mod_yacc_y.h" +#include "mod_yacc.h" + +#line 946 "mod_lex.c" +#line 947 "mod_lex.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals ( void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( void ); + +int yyget_debug ( void ); + +void yyset_debug ( int debug_flag ); + +YY_EXTRA_TYPE yyget_extra ( void ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in ( void ); + +void yyset_in ( FILE * _in_str ); + +FILE *yyget_out ( void ); + +void yyset_out ( FILE * _out_str ); + + int yyget_leng ( void ); + +char *yyget_text ( void ); + +int yyget_lineno ( void ); + +void yyset_lineno ( int _line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( void ); +#else +extern int yywrap ( void ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * ); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( void ); +#else +static int input ( void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { +#line 54 "../../../../src/xspice/cmpp/mod_lex.l" + + +#line 1165 "mod_lex.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 214 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 425 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; +; + } + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 56 "../../../../src/xspice/cmpp/mod_lex.l" +{int ch, last_ch; + ECHO; /* a comment - repeat it */ + ch = '\0'; + do { + last_ch = ch; +#ifdef __cplusplus + ch = yyinput(); +#else + ch = input(); +#endif + if(ch == EOF) { + mod_yyerror ("Unterminated comment"); + break; + } + + fputc(ch,mod_yyout); + } while (!((last_ch == '*') && (ch == '/'))); + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 75 "../../../../src/xspice/cmpp/mod_lex.l" +{int ch; + ECHO; /* a comment - repeat it */ + do { +#ifdef __cplusplus + ch = yyinput(); +#else + ch = input(); +#endif + if(ch == EOF) { + mod_yyerror ("Unterminated comment"); + break; + } + + fputc(ch, mod_yyout); + } while (ch != '\n'); + } + YY_BREAK +case 3: +/* rule 3 can match eol */ +YY_RULE_SETUP +#line 92 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_IDENTIFIER;} /* Literal string. */ + YY_BREAK +case 4: +YY_RULE_SETUP +#line 94 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_ARGS;} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 95 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_INIT;} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 96 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_CALLBACK;} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 97 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_ANALYSIS;} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 98 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_NEW_TIMEPOINT;} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 99 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_CALL_TYPE;} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 100 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_TIME;} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 101 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_RAD_FREQ;} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 102 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_TEMPERATURE;} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 103 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_T;} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 104 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_LOAD;} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 105 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_TOTAL_LOAD;} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 106 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_MESSAGE;} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 107 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_PARAM;} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 108 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_PARAM_SIZE;} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 109 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_PARAM_NULL;} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 110 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_PORT_SIZE;} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 111 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_PORT_NULL;} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 112 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_PARTIAL;} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 113 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_AC_GAIN;} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 114 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_OUTPUT_DELAY;} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 115 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_STATIC_VAR;} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 116 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_STATIC_VAR_SIZE;} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 117 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_STATIC_VAR_INST;} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 118 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_INPUT;} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 119 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_INPUT_STATE;} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 120 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_INPUT_TYPE;} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 121 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_INPUT_STRENGTH;} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 122 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_OUTPUT;} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 123 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_OUTPUT_STATE;} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 124 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_OUTPUT_STRENGTH;} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 125 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_OUTPUT_TYPE;} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 126 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_OUTPUT_CHANGED;} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 128 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_LPAREN;} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 129 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_RPAREN;} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 130 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_LBRACKET;} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 131 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_RBRACKET;} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 132 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_COMMA;} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 134 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_IDENTIFIER;} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 135 "../../../../src/xspice/cmpp/mod_lex.l" +ECHO; /* just eat non-newline whitespace */ + YY_BREAK +case 44: +/* rule 44 can match eol */ +YY_RULE_SETUP +#line 136 "../../../../src/xspice/cmpp/mod_lex.l" +ECHO; /* echo newlines */ + YY_BREAK +case 45: +YY_RULE_SETUP +#line 137 "../../../../src/xspice/cmpp/mod_lex.l" +{return TOK_MISC_C;} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 139 "../../../../src/xspice/cmpp/mod_lex.l" +ECHO; + YY_BREAK +#line 1496 "mod_lex.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + yy_state_type yy_current_state; + char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 214 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + int yy_is_jam; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 214 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 213); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + if ( c == '\n' ) + + yylineno++; +; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf ); + + yyfree( (void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr ) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg ) +{ + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param _line_number line number + * + */ +void yyset_lineno (int _line_number ) +{ + + yylineno = _line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str ) +{ + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str ) +{ + yyout = _out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int _bdebug ) +{ + yy_flex_debug = _bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + /* We do not touch yylineno unless the option is enabled. */ + yylineno = 1; + + (yy_buffer_stack) = NULL; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = NULL; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n ) +{ + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 139 "../../../../src/xspice/cmpp/mod_lex.l" + + diff --git a/src/xspice/cmpp/mod_yacc.c b/src/xspice/cmpp/mod_yacc.c new file mode 100644 index 000000000..a4082503d --- /dev/null +++ b/src/xspice/cmpp/mod_yacc.c @@ -0,0 +1,2182 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* First part of user prologue. */ +#line 1 "../../../../src/xspice/cmpp/mod_yacc.y" + + +/*============================================================================ +FILE mod_yacc.y + +MEMBER OF process cmpp + +Copyright 1991 +Georgia Tech Research Corporation +Atlanta, Georgia 30332 +All Rights Reserved + +PROJECT A-8503 + +AUTHORS + + 9/12/91 Steve Tynor + +MODIFICATIONS + + + 20050420 Steven Borley Renamed strcmpi() to local_strcmpi() to avoid + clash with strcmpi() in a windows header file. + +SUMMARY + + This file contains a BNF specification of the translation of + cfunc.mod files to cfunc.c files, together with various support + functions. + +INTERFACES + + mod_yyparse() - Function 'yyparse()' is generated automatically + by UNIX 'yacc' utility. All yy* global names + are converted to mod_yy* by #define. + +REFERENCED FILES + + mod_lex.l + +============================================================================*/ + + +#include +#include +#include +#include +#include "mod_yacc_y.h" + +extern int mod_yylex(void); + +#define yymaxdepth mod_yymaxdepth +#define yyparse mod_yyparse +#define yylex mod_yylex +#define yyerror mod_yyerror +#define yylval mod_yylval +#define yychar mod_yychar +#define yydebug mod_yydebug +#define yypact mod_yypact +#define yyr1 mod_yyr1 +#define yyr2 mod_yyr2 +#define yydef mod_yydef +#define yychk mod_yychk +#define yypgo mod_yypgo +#define yyact mod_yyact +#define yyexca mod_yyexca +#define yyerrflag mod_yyerrflag +#define yynerrs mod_yynerrs +#define yyps mod_yyps +#define yypv mod_yypv +#define yys mod_yys +#define yy_yys mod_yyyys +#define yystate mod_yystate +#define yytmp mod_yytmp +#define yyv mod_yyv +#define yy_yyv mod_yyyyv +#define yyval mod_yyval +#define yylloc mod_yylloc +#define yyreds mod_yyreds +#define yytoks mod_yytoks +#define yylhs mod_yyyylhs +#define yylen mod_yyyylen +#define yydefred mod_yyyydefred +#define yydgoto mod_yyyydgoto +#define yysindex mod_yyyysindex +#define yyrindex mod_yyyyrindex +#define yygindex mod_yyyygindex +#define yytable mod_yyyytable +#define yycheck mod_yyyycheck +#define yyname mod_yyyyname +#define yyrule mod_yyyyrule + +Ifs_Table_t *mod_ifs_table; + +extern char *mod_yytext; +extern FILE* mod_yyout; + +#include +#include + +int mod_num_errors; + +#define BUFFER_SIZE 3000 +static char buffer [BUFFER_SIZE]; +static int buf_len; + +typedef enum {CONN, PARAM, STATIC_VAR} Id_Kind_t; + +/*--------------------------------------------------------------------------*/ +static char *subscript (Sub_Id_t sub_id) +{ + if (sub_id.has_subscript) { + return sub_id.subscript; + } else { + return "0"; + } +} + +/*--------------------------------------------------------------------------*/ +static int +local_strcmpi(char *s, char *t) + /* string compare - case insensitive */ +{ + for (; *s && t && tolower_c(*s) == tolower_c(*t); s++, t++) + ; + if (*s && !*t) { + return 1; + } + if (!*s && *t) { + return -1; + } + if (! (*s || *t)) { + return 0; + } + return tolower((unsigned char) *s) - tolower((unsigned char) *t); +} + +/*---------------------------------------------------------------------------*/ +static void put_type (FILE *fp, Data_Type_t type) +{ + char ch = ' '; + + switch (type) { + case CMPP_INTEGER: + ch = 'i'; + break; + case CMPP_REAL: + ch = 'r'; + break; + case CMPP_COMPLEX: + ch = 'c'; + break; + case CMPP_BOOLEAN: + ch = 'b'; + break; + case CMPP_STRING: + ch = 's'; + break; + case CMPP_POINTER: + ch = 'p'; + break; + } + fprintf (fp, ".%cvalue", ch); +} + +/*---------------------------------------------------------------------------*/ +static void put_conn_type (FILE *fp, Port_Type_t type) +{ + char ch; + + switch (type) { + case USER_DEFINED: + ch = 'p'; + break; + case DIGITAL: + ch = 'p'; + break; + default: + ch = 'r'; + break; + } + fprintf (fp, ".%cvalue", ch); +} + +/*---------------------------------------------------------------------------*/ +static void check_dir (int conn_number, Dir_t dir, char *context) +{ + Dir_t conn_dir; + + if (conn_number >= 0) { + /* + * If negative, this is an invalid port ID and we've already issued + * an error. + */ + conn_dir = mod_ifs_table->conn[conn_number].direction; + if ((conn_dir != dir) && (conn_dir != CMPP_INOUT)) { + char error_str[200]; + + sprintf (error_str, + "Direction of port `%s' in %s() is not %s or INOUT", + mod_ifs_table->conn[conn_number].name, context, + (dir == CMPP_IN) ? "IN" : "OUT"); + yyerror (error_str); + mod_num_errors++; + } + } +} + +/*---------------------------------------------------------------------------*/ +static void check_subscript (bool formal, bool actual, + bool missing_actual_ok, + char *context, char *id) +{ + char error_str[200]; + + if ((formal && !actual) && !missing_actual_ok) { + sprintf (error_str, + "%s `%s' is an array - subscript required", + context, id); + yyerror (error_str); + mod_num_errors++; + return; + } else if (!formal && actual) { + sprintf (error_str, + "%s `%s' is not an array - subscript prohibited", + context, id); + yyerror (error_str); + mod_num_errors++; + return; + } +} + +/*---------------------------------------------------------------------------*/ +static int check_id (Sub_Id_t sub_id, Id_Kind_t kind, bool do_subscript) +{ + int i; + char error_str[200]; + + switch (kind) { + case CONN: + for (i = 0; i < mod_ifs_table->num_conn; i++) { + if (0 == local_strcmpi (sub_id.id, mod_ifs_table->conn[i].name)) { + if (do_subscript) { + check_subscript (mod_ifs_table->conn[i].is_array, + sub_id.has_subscript, false, "Port", + sub_id.id); + } + return i; + } + } + break; + case PARAM: + for (i = 0; i < mod_ifs_table->num_param; i++) { + if (0 == local_strcmpi (sub_id.id, mod_ifs_table->param[i].name)) { + if (do_subscript) { + check_subscript (mod_ifs_table->param[i].is_array, + sub_id.has_subscript, false, "Parameter", + sub_id.id); + } + return i; + } + } + break; + case STATIC_VAR: + for (i = 0; i < mod_ifs_table->num_inst_var; i++) { + if (0 == local_strcmpi (sub_id.id, mod_ifs_table->inst_var[i].name)) { + if (do_subscript) { + check_subscript (mod_ifs_table->inst_var[i].is_array, + sub_id.has_subscript, true, + "Static Variable", + sub_id.id); + } + return i; + } + } + break; + } + + sprintf (error_str, "No %s named '%s'", + ((kind==CONN) + ? "port" + : ((kind==PARAM) + ? "parameter" + :"static variable")), + sub_id.id); + yyerror (error_str); + mod_num_errors++; + return -1; +} + +/*---------------------------------------------------------------------------*/ +static int valid_id (Sub_Id_t sub_id, Id_Kind_t kind) +{ + return check_id (sub_id, kind, false); +} + +/*---------------------------------------------------------------------------*/ +static int valid_subid (Sub_Id_t sub_id, Id_Kind_t kind) +{ + return check_id (sub_id, kind, true); +} + +/*---------------------------------------------------------------------------*/ +static void init_buffer (void) +{ + buf_len = 0; + buffer[0] = '\0'; +} + +/*---------------------------------------------------------------------------*/ +static void append (char *str) +{ + int len = (int) strlen (str); + if (len + buf_len > BUFFER_SIZE) { + yyerror ("Buffer overflow - try reducing the complexity of CM-macro array subscripts"); + exit (1); + } + (void)strcat (buffer,str); +} + + +#line 393 "mod_yacc.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#include "mod_yacc.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_TOK_ARGS = 3, /* TOK_ARGS */ + YYSYMBOL_TOK_INIT = 4, /* TOK_INIT */ + YYSYMBOL_TOK_CALLBACK = 5, /* TOK_CALLBACK */ + YYSYMBOL_TOK_ANALYSIS = 6, /* TOK_ANALYSIS */ + YYSYMBOL_TOK_NEW_TIMEPOINT = 7, /* TOK_NEW_TIMEPOINT */ + YYSYMBOL_TOK_TIME = 8, /* TOK_TIME */ + YYSYMBOL_TOK_RAD_FREQ = 9, /* TOK_RAD_FREQ */ + YYSYMBOL_TOK_TEMPERATURE = 10, /* TOK_TEMPERATURE */ + YYSYMBOL_TOK_T = 11, /* TOK_T */ + YYSYMBOL_TOK_PARAM = 12, /* TOK_PARAM */ + YYSYMBOL_TOK_PARAM_SIZE = 13, /* TOK_PARAM_SIZE */ + YYSYMBOL_TOK_PARAM_NULL = 14, /* TOK_PARAM_NULL */ + YYSYMBOL_TOK_PORT_SIZE = 15, /* TOK_PORT_SIZE */ + YYSYMBOL_TOK_PORT_NULL = 16, /* TOK_PORT_NULL */ + YYSYMBOL_TOK_PARTIAL = 17, /* TOK_PARTIAL */ + YYSYMBOL_TOK_AC_GAIN = 18, /* TOK_AC_GAIN */ + YYSYMBOL_TOK_CHANGED = 19, /* TOK_CHANGED */ + YYSYMBOL_TOK_OUTPUT_DELAY = 20, /* TOK_OUTPUT_DELAY */ + YYSYMBOL_TOK_STATIC_VAR = 21, /* TOK_STATIC_VAR */ + YYSYMBOL_TOK_STATIC_VAR_SIZE = 22, /* TOK_STATIC_VAR_SIZE */ + YYSYMBOL_TOK_STATIC_VAR_INST = 23, /* TOK_STATIC_VAR_INST */ + YYSYMBOL_TOK_INPUT = 24, /* TOK_INPUT */ + YYSYMBOL_TOK_INPUT_STRENGTH = 25, /* TOK_INPUT_STRENGTH */ + YYSYMBOL_TOK_INPUT_STATE = 26, /* TOK_INPUT_STATE */ + YYSYMBOL_TOK_INPUT_TYPE = 27, /* TOK_INPUT_TYPE */ + YYSYMBOL_TOK_OUTPUT = 28, /* TOK_OUTPUT */ + YYSYMBOL_TOK_OUTPUT_CHANGED = 29, /* TOK_OUTPUT_CHANGED */ + YYSYMBOL_TOK_OUTPUT_STRENGTH = 30, /* TOK_OUTPUT_STRENGTH */ + YYSYMBOL_TOK_OUTPUT_STATE = 31, /* TOK_OUTPUT_STATE */ + YYSYMBOL_TOK_OUTPUT_TYPE = 32, /* TOK_OUTPUT_TYPE */ + YYSYMBOL_TOK_COMMA = 33, /* TOK_COMMA */ + YYSYMBOL_TOK_LPAREN = 34, /* TOK_LPAREN */ + YYSYMBOL_TOK_RPAREN = 35, /* TOK_RPAREN */ + YYSYMBOL_TOK_LBRACKET = 36, /* TOK_LBRACKET */ + YYSYMBOL_TOK_RBRACKET = 37, /* TOK_RBRACKET */ + YYSYMBOL_TOK_MISC_C = 38, /* TOK_MISC_C */ + YYSYMBOL_TOK_IDENTIFIER = 39, /* TOK_IDENTIFIER */ + YYSYMBOL_TOK_LOAD = 40, /* TOK_LOAD */ + YYSYMBOL_TOK_TOTAL_LOAD = 41, /* TOK_TOTAL_LOAD */ + YYSYMBOL_TOK_MESSAGE = 42, /* TOK_MESSAGE */ + YYSYMBOL_TOK_CALL_TYPE = 43, /* TOK_CALL_TYPE */ + YYSYMBOL_YYACCEPT = 44, /* $accept */ + YYSYMBOL_mod_file = 45, /* mod_file */ + YYSYMBOL_c_code = 46, /* c_code */ + YYSYMBOL_buffered_c_code = 47, /* buffered_c_code */ + YYSYMBOL_48_1 = 48, /* $@1 */ + YYSYMBOL_buffered_c_code2 = 49, /* buffered_c_code2 */ + YYSYMBOL_buffered_c_char = 50, /* buffered_c_char */ + YYSYMBOL_51_2 = 51, /* $@2 */ + YYSYMBOL_52_3 = 52, /* $@3 */ + YYSYMBOL_c_char = 53, /* c_char */ + YYSYMBOL_54_4 = 54, /* $@4 */ + YYSYMBOL_55_5 = 55, /* $@5 */ + YYSYMBOL_macro = 56, /* macro */ + YYSYMBOL_subscriptable_id = 57, /* subscriptable_id */ + YYSYMBOL_id = 58 /* id */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_uint8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* !defined yyoverflow */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 2 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 230 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 44 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 15 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 65 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 153 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 298 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 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, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43 +}; + +#if YYDEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 377, 377, 378, 381, 382, 383, 384, 385, 388, + 388, 392, 393, 396, 397, 398, 400, 399, 404, 403, + 409, 410, 411, 412, 414, 413, 417, 419, 418, 424, + 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, + 450, 453, 456, 459, 462, 470, 479, 491, 495, 499, + 505, 511, 519, 525, 531, 540, 549, 557, 566, 575, + 580, 585, 590, 597, 598, 604 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "TOK_ARGS", "TOK_INIT", + "TOK_CALLBACK", "TOK_ANALYSIS", "TOK_NEW_TIMEPOINT", "TOK_TIME", + "TOK_RAD_FREQ", "TOK_TEMPERATURE", "TOK_T", "TOK_PARAM", + "TOK_PARAM_SIZE", "TOK_PARAM_NULL", "TOK_PORT_SIZE", "TOK_PORT_NULL", + "TOK_PARTIAL", "TOK_AC_GAIN", "TOK_CHANGED", "TOK_OUTPUT_DELAY", + "TOK_STATIC_VAR", "TOK_STATIC_VAR_SIZE", "TOK_STATIC_VAR_INST", + "TOK_INPUT", "TOK_INPUT_STRENGTH", "TOK_INPUT_STATE", "TOK_INPUT_TYPE", + "TOK_OUTPUT", "TOK_OUTPUT_CHANGED", "TOK_OUTPUT_STRENGTH", + "TOK_OUTPUT_STATE", "TOK_OUTPUT_TYPE", "TOK_COMMA", "TOK_LPAREN", + "TOK_RPAREN", "TOK_LBRACKET", "TOK_RBRACKET", "TOK_MISC_C", + "TOK_IDENTIFIER", "TOK_LOAD", "TOK_TOTAL_LOAD", "TOK_MESSAGE", + "TOK_CALL_TYPE", "$accept", "mod_file", "c_code", "buffered_c_code", + "$@1", "buffered_c_code2", "buffered_c_char", "$@2", "$@3", "c_char", + "$@4", "$@5", "macro", "subscriptable_id", "id", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-122) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-1) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + -122, 5, -122, -122, -122, 142, -122, -122, -122, -122, + -122, -122, -122, -122, -28, -3, 4, 7, 11, 18, + 20, 23, 24, 25, 26, 63, 102, 143, 145, 152, + 153, 154, 155, 156, 157, 158, -122, 159, 2, -122, + -122, 161, 162, 163, -122, -122, -122, -122, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, -122, + -1, -122, -1, 160, 160, 160, 165, -122, -122, 166, + 167, 169, 170, 171, 172, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 60, 101, 191, 192, 193, -122, 17, -122, -122, + -122, -122, -122, -122, 160, 160, -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, 173, 194, 195, -122, -122, -122, -122, -122, -6, + 10, -122, -122 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 2, 4, 1, 7, 8, 3, 31, 29, 30, 32, + 33, 35, 36, 37, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 22, 27, 24, 21, + 20, 0, 0, 0, 34, 5, 6, 9, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, + 4, 23, 4, 0, 0, 0, 0, 11, 65, 0, + 63, 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, 38, 10, 39, 9, + 40, 41, 42, 43, 0, 0, 50, 49, 46, 47, + 48, 51, 54, 55, 52, 56, 59, 57, 58, 53, + 28, 25, 60, 61, 62, 15, 18, 16, 14, 13, + 12, 0, 0, 0, 11, 11, 64, 44, 45, 0, + 0, 19, 17 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -122, -122, -35, 84, -122, -121, -122, -122, -122, -122, + -122, -122, -122, -53, -33 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_uint8 yydefgoto[] = +{ + 0, 1, 5, 76, 77, 107, 140, 145, 144, 45, + 72, 70, 46, 79, 80 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_uint8 yytable[] = +{ + 85, 86, 87, 88, 89, 2, 47, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 81, 82, 83, 84, + 103, 104, 105, 149, 150, 90, 91, 135, 136, 151, + 137, 48, 138, 139, 3, 101, 4, 102, 49, 71, + 3, 50, 4, 135, 136, 51, 137, 152, 138, 139, + 135, 136, 52, 137, 53, 138, 139, 54, 55, 56, + 57, 142, 143, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 130, 38, 58, 39, 40, + 41, 42, 43, 44, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 59, 38, 131, 39, + 40, 41, 42, 43, 44, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 60, 38, 61, + 39, 40, 41, 42, 43, 44, 62, 63, 64, 65, + 66, 67, 68, 141, 69, 73, 74, 75, 0, 78, + 106, 108, 0, 109, 110, 111, 112, 113, 114, 115, + 146, 0, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 132, 133, 134, 147, + 148 +}; + +static const yytype_int16 yycheck[] = +{ + 53, 54, 55, 56, 57, 0, 34, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 49, 50, 51, 52, + 73, 74, 75, 144, 145, 58, 59, 33, 34, 35, + 36, 34, 38, 39, 35, 70, 37, 72, 34, 37, + 35, 34, 37, 33, 34, 34, 36, 37, 38, 39, + 33, 34, 34, 36, 34, 38, 39, 34, 34, 34, + 34, 114, 115, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 34, 38, 39, + 40, 41, 42, 43, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 34, 36, 37, 38, + 39, 40, 41, 42, 43, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 34, 36, 34, + 38, 39, 40, 41, 42, 43, 34, 34, 34, 34, + 34, 34, 34, 109, 35, 34, 34, 34, -1, 39, + 35, 35, -1, 36, 35, 35, 35, 35, 33, 33, + 37, -1, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 45, 0, 35, 37, 46, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 36, 38, + 39, 40, 41, 42, 43, 53, 56, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, + 55, 37, 54, 34, 34, 34, 47, 48, 39, 57, + 58, 58, 58, 58, 58, 57, 57, 57, 57, 57, + 58, 58, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 46, 46, 57, 57, 57, 35, 49, 35, 36, + 35, 35, 35, 35, 33, 33, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 37, 35, 35, 35, 33, 34, 36, 38, 39, + 50, 47, 57, 57, 52, 51, 37, 35, 35, 49, + 49, 35, 37 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = +{ + 0, 44, 45, 45, 46, 46, 46, 46, 46, 48, + 47, 49, 49, 50, 50, 50, 51, 50, 52, 50, + 53, 53, 53, 53, 54, 53, 53, 55, 53, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 57, 57, 58 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 0, 2, 0, 2, 2, 1, 1, 0, + 2, 0, 2, 1, 1, 1, 0, 4, 0, 4, + 1, 1, 1, 2, 0, 4, 2, 0, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, + 4, 4, 4, 4, 6, 6, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 1, 4, 1 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + yy_symbol_value_print (yyo, yykind, yyvaluep); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + + + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) +{ + YY_USE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/* Lookahead token kind. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; +/* Number of syntax errors so far. */ +int yynerrs; + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void) +{ + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = YYEMPTY; /* Cause a token to be read. */ + + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (); + } + + if (yychar <= YYEOF) + { + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = YYEMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 7: /* c_code: TOK_RPAREN */ +#line 384 "../../../../src/xspice/cmpp/mod_yacc.y" + {yyerror ("Unmatched )"); YYERROR;} +#line 1551 "mod_yacc.c" + break; + + case 8: /* c_code: TOK_RBRACKET */ +#line 385 "../../../../src/xspice/cmpp/mod_yacc.y" + {yyerror ("Unmatched ]"); YYERROR;} +#line 1557 "mod_yacc.c" + break; + + case 9: /* $@1: %empty */ +#line 388 "../../../../src/xspice/cmpp/mod_yacc.y" + {init_buffer();} +#line 1563 "mod_yacc.c" + break; + + case 10: /* buffered_c_code: $@1 buffered_c_code2 */ +#line 389 "../../../../src/xspice/cmpp/mod_yacc.y" + {(yyval.str) = strdup (buffer);} +#line 1569 "mod_yacc.c" + break; + + case 13: /* buffered_c_char: TOK_IDENTIFIER */ +#line 396 "../../../../src/xspice/cmpp/mod_yacc.y" + {append (mod_yytext);} +#line 1575 "mod_yacc.c" + break; + + case 14: /* buffered_c_char: TOK_MISC_C */ +#line 397 "../../../../src/xspice/cmpp/mod_yacc.y" + {append (mod_yytext);} +#line 1581 "mod_yacc.c" + break; + + case 15: /* buffered_c_char: TOK_COMMA */ +#line 398 "../../../../src/xspice/cmpp/mod_yacc.y" + {append (mod_yytext);} +#line 1587 "mod_yacc.c" + break; + + case 16: /* $@2: %empty */ +#line 400 "../../../../src/xspice/cmpp/mod_yacc.y" + {append("[");} +#line 1593 "mod_yacc.c" + break; + + case 17: /* buffered_c_char: TOK_LBRACKET $@2 buffered_c_code2 TOK_RBRACKET */ +#line 402 "../../../../src/xspice/cmpp/mod_yacc.y" + {append("]");} +#line 1599 "mod_yacc.c" + break; + + case 18: /* $@3: %empty */ +#line 404 "../../../../src/xspice/cmpp/mod_yacc.y" + {append("(");} +#line 1605 "mod_yacc.c" + break; + + case 19: /* buffered_c_char: TOK_LPAREN $@3 buffered_c_code2 TOK_RPAREN */ +#line 406 "../../../../src/xspice/cmpp/mod_yacc.y" + {append(")");} +#line 1611 "mod_yacc.c" + break; + + case 20: /* c_char: TOK_IDENTIFIER */ +#line 409 "../../../../src/xspice/cmpp/mod_yacc.y" + {fputs (mod_yytext, mod_yyout);} +#line 1617 "mod_yacc.c" + break; + + case 21: /* c_char: TOK_MISC_C */ +#line 410 "../../../../src/xspice/cmpp/mod_yacc.y" + {fputs (mod_yytext, mod_yyout);} +#line 1623 "mod_yacc.c" + break; + + case 22: /* c_char: TOK_COMMA */ +#line 411 "../../../../src/xspice/cmpp/mod_yacc.y" + {fputs (mod_yytext, mod_yyout);} +#line 1629 "mod_yacc.c" + break; + + case 23: /* c_char: TOK_LBRACKET TOK_RBRACKET */ +#line 412 "../../../../src/xspice/cmpp/mod_yacc.y" + {fputs ("[]", mod_yyout);} +#line 1635 "mod_yacc.c" + break; + + case 24: /* $@4: %empty */ +#line 414 "../../../../src/xspice/cmpp/mod_yacc.y" + {putc ('[', mod_yyout);} +#line 1641 "mod_yacc.c" + break; + + case 25: /* c_char: TOK_LBRACKET $@4 c_code TOK_RBRACKET */ +#line 416 "../../../../src/xspice/cmpp/mod_yacc.y" + {putc (']', mod_yyout);} +#line 1647 "mod_yacc.c" + break; + + case 26: /* c_char: TOK_LPAREN TOK_RPAREN */ +#line 417 "../../../../src/xspice/cmpp/mod_yacc.y" + {fputs ("()", mod_yyout);} +#line 1653 "mod_yacc.c" + break; + + case 27: /* $@5: %empty */ +#line 419 "../../../../src/xspice/cmpp/mod_yacc.y" + {putc ('(', mod_yyout);} +#line 1659 "mod_yacc.c" + break; + + case 28: /* c_char: TOK_LPAREN $@5 c_code TOK_RPAREN */ +#line 421 "../../../../src/xspice/cmpp/mod_yacc.y" + {putc (')', mod_yyout);} +#line 1665 "mod_yacc.c" + break; + + case 29: /* macro: TOK_INIT */ +#line 425 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.init");} +#line 1671 "mod_yacc.c" + break; + + case 30: /* macro: TOK_CALLBACK */ +#line 427 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "*(mif_private->callback)");} +#line 1677 "mod_yacc.c" + break; + + case 31: /* macro: TOK_ARGS */ +#line 429 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "Mif_Private_t *mif_private");} +#line 1683 "mod_yacc.c" + break; + + case 32: /* macro: TOK_ANALYSIS */ +#line 431 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.anal_type");} +#line 1689 "mod_yacc.c" + break; + + case 33: /* macro: TOK_NEW_TIMEPOINT */ +#line 433 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.anal_init");} +#line 1695 "mod_yacc.c" + break; + + case 34: /* macro: TOK_CALL_TYPE */ +#line 435 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.call_type");} +#line 1701 "mod_yacc.c" + break; + + case 35: /* macro: TOK_TIME */ +#line 437 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.time");} +#line 1707 "mod_yacc.c" + break; + + case 36: /* macro: TOK_RAD_FREQ */ +#line 439 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.frequency");} +#line 1713 "mod_yacc.c" + break; + + case 37: /* macro: TOK_TEMPERATURE */ +#line 441 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.temperature");} +#line 1719 "mod_yacc.c" + break; + + case 38: /* macro: TOK_T TOK_LPAREN buffered_c_code TOK_RPAREN */ +#line 443 "../../../../src/xspice/cmpp/mod_yacc.y" + {fprintf (mod_yyout, "mif_private->circuit.t[%s]", (yyvsp[-1].str));} +#line 1725 "mod_yacc.c" + break; + + case 39: /* macro: TOK_PARAM TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 445 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), PARAM); + fprintf (mod_yyout, "mif_private->param[%d]->element[%s]", + i, subscript ((yyvsp[-1].sub_id))); + put_type (mod_yyout, mod_ifs_table->param[i].type); + } +#line 1735 "mod_yacc.c" + break; + + case 40: /* macro: TOK_PARAM_SIZE TOK_LPAREN id TOK_RPAREN */ +#line 451 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_id ((yyvsp[-1].sub_id), PARAM); + fprintf (mod_yyout, "mif_private->param[%d]->size", i);} +#line 1742 "mod_yacc.c" + break; + + case 41: /* macro: TOK_PARAM_NULL TOK_LPAREN id TOK_RPAREN */ +#line 454 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_id ((yyvsp[-1].sub_id), PARAM); + fprintf (mod_yyout, "mif_private->param[%d]->is_null", i);} +#line 1749 "mod_yacc.c" + break; + + case 42: /* macro: TOK_PORT_SIZE TOK_LPAREN id TOK_RPAREN */ +#line 457 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_id ((yyvsp[-1].sub_id), CONN); + fprintf (mod_yyout, "mif_private->conn[%d]->size", i);} +#line 1756 "mod_yacc.c" + break; + + case 43: /* macro: TOK_PORT_NULL TOK_LPAREN id TOK_RPAREN */ +#line 460 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_id ((yyvsp[-1].sub_id), CONN); + fprintf (mod_yyout, "mif_private->conn[%d]->is_null", i);} +#line 1763 "mod_yacc.c" + break; + + case 44: /* macro: TOK_PARTIAL TOK_LPAREN subscriptable_id TOK_COMMA subscriptable_id TOK_RPAREN */ +#line 464 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-3].sub_id), CONN); + int j = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "PARTIAL"); + check_dir (j, CMPP_IN, "PARTIAL"); + fprintf (mod_yyout, "mif_private->conn[%d]->port[%s]->partial[%d].port[%s]", + i, subscript((yyvsp[-3].sub_id)), j, subscript((yyvsp[-1].sub_id)));} +#line 1774 "mod_yacc.c" + break; + + case 45: /* macro: TOK_AC_GAIN TOK_LPAREN subscriptable_id TOK_COMMA subscriptable_id TOK_RPAREN */ +#line 472 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-3].sub_id), CONN); + int j = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "AC_GAIN"); + check_dir (j, CMPP_IN, "AC_GAIN"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->ac_gain[%d].port[%s]", + i, subscript((yyvsp[-3].sub_id)), j, subscript((yyvsp[-1].sub_id)));} +#line 1786 "mod_yacc.c" + break; + + case 46: /* macro: TOK_STATIC_VAR TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 480 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), STATIC_VAR); + fprintf (mod_yyout, + "mif_private->inst_var[%d]->element[%s]", + i, subscript((yyvsp[-1].sub_id))); + if (mod_ifs_table->inst_var[i].is_array + && !((yyvsp[-1].sub_id).has_subscript)) { + /* null - eg. for malloc lvalue */ + } else { + put_type (mod_yyout, + mod_ifs_table->inst_var[i].type); + } } +#line 1802 "mod_yacc.c" + break; + + case 47: /* macro: TOK_STATIC_VAR_SIZE TOK_LPAREN id TOK_RPAREN */ +#line 492 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), STATIC_VAR); + fprintf (mod_yyout, "mif_private->inst_var[%d]->size", + i);} +#line 1810 "mod_yacc.c" + break; + + case 48: /* macro: TOK_STATIC_VAR_INST TOK_LPAREN id TOK_RPAREN */ +#line 496 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), STATIC_VAR); + fprintf (mod_yyout, "mif_private->inst_var[%d]", + i);} +#line 1818 "mod_yacc.c" + break; + + case 49: /* macro: TOK_OUTPUT_DELAY TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 500 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "OUTPUT_DELAY"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->delay", i, + subscript((yyvsp[-1].sub_id)));} +#line 1828 "mod_yacc.c" + break; + + case 50: /* macro: TOK_CHANGED TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 506 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "CHANGED"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->changed", i, + subscript((yyvsp[-1].sub_id)));} +#line 1838 "mod_yacc.c" + break; + + case 51: /* macro: TOK_INPUT TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 512 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_IN, "INPUT"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->input", + i, subscript((yyvsp[-1].sub_id))); + put_conn_type (mod_yyout, + mod_ifs_table->conn[i].allowed_port_type[0]);} +#line 1850 "mod_yacc.c" + break; + + case 52: /* macro: TOK_INPUT_TYPE TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 520 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_IN, "INPUT_TYPE"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->type_str", + i, subscript((yyvsp[-1].sub_id))); } +#line 1860 "mod_yacc.c" + break; + + case 53: /* macro: TOK_OUTPUT_TYPE TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 526 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "OUTPUT_TYPE"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->type_str", + i, subscript((yyvsp[-1].sub_id))); } +#line 1870 "mod_yacc.c" + break; + + case 54: /* macro: TOK_INPUT_STRENGTH TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 532 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_IN, "INPUT_STRENGTH"); + fprintf (mod_yyout, + "((Digital_t*)(mif_private->conn[%d]->port[%s]->input", + i, subscript((yyvsp[-1].sub_id))); + put_conn_type (mod_yyout, + mod_ifs_table->conn[i].allowed_port_type[0]); + fprintf (mod_yyout, "))->strength");} +#line 1883 "mod_yacc.c" + break; + + case 55: /* macro: TOK_INPUT_STATE TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 541 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_IN, "INPUT_STATE"); + fprintf (mod_yyout, + "((Digital_t*)(mif_private->conn[%d]->port[%s]->input", + i, subscript((yyvsp[-1].sub_id))); + put_conn_type (mod_yyout, + mod_ifs_table->conn[i].allowed_port_type[0]); + fprintf (mod_yyout, "))->state");} +#line 1896 "mod_yacc.c" + break; + + case 56: /* macro: TOK_OUTPUT TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 550 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "OUTPUT"); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->output", + i, subscript((yyvsp[-1].sub_id))); + put_conn_type (mod_yyout, + mod_ifs_table->conn[i].allowed_port_type[0]);} +#line 1908 "mod_yacc.c" + break; + + case 57: /* macro: TOK_OUTPUT_STRENGTH TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 558 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "OUTPUT_STRENGTH"); + fprintf (mod_yyout, + "((Digital_t*)(mif_private->conn[%d]->port[%s]->output", + i, subscript((yyvsp[-1].sub_id))); + put_conn_type (mod_yyout, + mod_ifs_table->conn[i].allowed_port_type[0]); + fprintf (mod_yyout, "))->strength");} +#line 1921 "mod_yacc.c" + break; + + case 58: /* macro: TOK_OUTPUT_STATE TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 567 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + check_dir (i, CMPP_OUT, "OUTPUT_STATE"); + fprintf (mod_yyout, + "((Digital_t*)(mif_private->conn[%d]->port[%s]->output", + i, subscript((yyvsp[-1].sub_id))); + put_conn_type (mod_yyout, + mod_ifs_table->conn[i].allowed_port_type[0]); + fprintf (mod_yyout, "))->state");} +#line 1934 "mod_yacc.c" + break; + + case 59: /* macro: TOK_OUTPUT_CHANGED TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 576 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->changed", i, + subscript((yyvsp[-1].sub_id)));} +#line 1943 "mod_yacc.c" + break; + + case 60: /* macro: TOK_LOAD TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 581 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->load", i, + subscript((yyvsp[-1].sub_id)));} +#line 1952 "mod_yacc.c" + break; + + case 61: /* macro: TOK_TOTAL_LOAD TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 586 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->total_load", i, + subscript((yyvsp[-1].sub_id)));} +#line 1961 "mod_yacc.c" + break; + + case 62: /* macro: TOK_MESSAGE TOK_LPAREN subscriptable_id TOK_RPAREN */ +#line 591 "../../../../src/xspice/cmpp/mod_yacc.y" + {int i = valid_subid ((yyvsp[-1].sub_id), CONN); + fprintf (mod_yyout, + "mif_private->conn[%d]->port[%s]->msg", i, + subscript((yyvsp[-1].sub_id)));} +#line 1970 "mod_yacc.c" + break; + + case 64: /* subscriptable_id: id TOK_LBRACKET buffered_c_code TOK_RBRACKET */ +#line 599 "../../../../src/xspice/cmpp/mod_yacc.y" + {(yyval.sub_id) = (yyvsp[-3].sub_id); + (yyval.sub_id).has_subscript = true; + (yyval.sub_id).subscript = (yyvsp[-1].str);} +#line 1978 "mod_yacc.c" + break; + + case 65: /* id: TOK_IDENTIFIER */ +#line 605 "../../../../src/xspice/cmpp/mod_yacc.y" + {(yyval.sub_id).has_subscript = false; + (yyval.sub_id).id = strdup (mod_yytext);} +#line 1985 "mod_yacc.c" + break; + + +#line 1989 "mod_yacc.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + yyerror (YY_("syntax error")); + } + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + + return yyresult; +} + +#line 609 "../../../../src/xspice/cmpp/mod_yacc.y" + diff --git a/src/xspice/cmpp/mod_yacc.h b/src/xspice/cmpp/mod_yacc.h new file mode 100644 index 000000000..492170774 --- /dev/null +++ b/src/xspice/cmpp/mod_yacc.h @@ -0,0 +1,172 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_YY_MOD_YACC_H_INCLUDED +# define YY_YY_MOD_YACC_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token kinds. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + TOK_ARGS = 258, /* TOK_ARGS */ + TOK_INIT = 259, /* TOK_INIT */ + TOK_CALLBACK = 260, /* TOK_CALLBACK */ + TOK_ANALYSIS = 261, /* TOK_ANALYSIS */ + TOK_NEW_TIMEPOINT = 262, /* TOK_NEW_TIMEPOINT */ + TOK_TIME = 263, /* TOK_TIME */ + TOK_RAD_FREQ = 264, /* TOK_RAD_FREQ */ + TOK_TEMPERATURE = 265, /* TOK_TEMPERATURE */ + TOK_T = 266, /* TOK_T */ + TOK_PARAM = 267, /* TOK_PARAM */ + TOK_PARAM_SIZE = 268, /* TOK_PARAM_SIZE */ + TOK_PARAM_NULL = 269, /* TOK_PARAM_NULL */ + TOK_PORT_SIZE = 270, /* TOK_PORT_SIZE */ + TOK_PORT_NULL = 271, /* TOK_PORT_NULL */ + TOK_PARTIAL = 272, /* TOK_PARTIAL */ + TOK_AC_GAIN = 273, /* TOK_AC_GAIN */ + TOK_CHANGED = 274, /* TOK_CHANGED */ + TOK_OUTPUT_DELAY = 275, /* TOK_OUTPUT_DELAY */ + TOK_STATIC_VAR = 276, /* TOK_STATIC_VAR */ + TOK_STATIC_VAR_SIZE = 277, /* TOK_STATIC_VAR_SIZE */ + TOK_STATIC_VAR_INST = 278, /* TOK_STATIC_VAR_INST */ + TOK_INPUT = 279, /* TOK_INPUT */ + TOK_INPUT_STRENGTH = 280, /* TOK_INPUT_STRENGTH */ + TOK_INPUT_STATE = 281, /* TOK_INPUT_STATE */ + TOK_INPUT_TYPE = 282, /* TOK_INPUT_TYPE */ + TOK_OUTPUT = 283, /* TOK_OUTPUT */ + TOK_OUTPUT_CHANGED = 284, /* TOK_OUTPUT_CHANGED */ + TOK_OUTPUT_STRENGTH = 285, /* TOK_OUTPUT_STRENGTH */ + TOK_OUTPUT_STATE = 286, /* TOK_OUTPUT_STATE */ + TOK_OUTPUT_TYPE = 287, /* TOK_OUTPUT_TYPE */ + TOK_COMMA = 288, /* TOK_COMMA */ + TOK_LPAREN = 289, /* TOK_LPAREN */ + TOK_RPAREN = 290, /* TOK_RPAREN */ + TOK_LBRACKET = 291, /* TOK_LBRACKET */ + TOK_RBRACKET = 292, /* TOK_RBRACKET */ + TOK_MISC_C = 293, /* TOK_MISC_C */ + TOK_IDENTIFIER = 294, /* TOK_IDENTIFIER */ + TOK_LOAD = 295, /* TOK_LOAD */ + TOK_TOTAL_LOAD = 296, /* TOK_TOTAL_LOAD */ + TOK_MESSAGE = 297, /* TOK_MESSAGE */ + TOK_CALL_TYPE = 298 /* TOK_CALL_TYPE */ + }; + typedef enum yytokentype yytoken_kind_t; +#endif +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 +#define TOK_ARGS 258 +#define TOK_INIT 259 +#define TOK_CALLBACK 260 +#define TOK_ANALYSIS 261 +#define TOK_NEW_TIMEPOINT 262 +#define TOK_TIME 263 +#define TOK_RAD_FREQ 264 +#define TOK_TEMPERATURE 265 +#define TOK_T 266 +#define TOK_PARAM 267 +#define TOK_PARAM_SIZE 268 +#define TOK_PARAM_NULL 269 +#define TOK_PORT_SIZE 270 +#define TOK_PORT_NULL 271 +#define TOK_PARTIAL 272 +#define TOK_AC_GAIN 273 +#define TOK_CHANGED 274 +#define TOK_OUTPUT_DELAY 275 +#define TOK_STATIC_VAR 276 +#define TOK_STATIC_VAR_SIZE 277 +#define TOK_STATIC_VAR_INST 278 +#define TOK_INPUT 279 +#define TOK_INPUT_STRENGTH 280 +#define TOK_INPUT_STATE 281 +#define TOK_INPUT_TYPE 282 +#define TOK_OUTPUT 283 +#define TOK_OUTPUT_CHANGED 284 +#define TOK_OUTPUT_STRENGTH 285 +#define TOK_OUTPUT_STATE 286 +#define TOK_OUTPUT_TYPE 287 +#define TOK_COMMA 288 +#define TOK_LPAREN 289 +#define TOK_RPAREN 290 +#define TOK_LBRACKET 291 +#define TOK_RBRACKET 292 +#define TOK_MISC_C 293 +#define TOK_IDENTIFIER 294 +#define TOK_LOAD 295 +#define TOK_TOTAL_LOAD 296 +#define TOK_MESSAGE 297 +#define TOK_CALL_TYPE 298 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +union YYSTYPE +{ +#line 323 "../../../../src/xspice/cmpp/mod_yacc.y" + + char *str; + Sub_Id_t sub_id; + +#line 158 "mod_yacc.h" + +}; +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 +#endif + + +extern YYSTYPE yylval; + + +int yyparse (void); + + +#endif /* !YY_YY_MOD_YACC_H_INCLUDED */