The-OpenROAD-Project / OpenROAD

OpenROAD's unified application implementing an RTL-to-GDS Flow. Documentation at https://openroad.readthedocs.io/en/latest/
https://theopenroadproject.org/
BSD 3-Clause "New" or "Revised" License
1.62k stars 562 forks source link

Grammar railroad diagram #2488

Open mingodad opened 2 years ago

mingodad commented 2 years ago

Using this tool https://www.bottlecaps.de/convert/ to convert https://github.com/The-OpenROAD-Project/OpenROAD/blob/429a272dae6e384dcdc7ebc99bdc4ecb0f66f8a1/src/odb/src/lef/lef/lef.y and https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD/7f985d5e0a07ebb08ccff8c4453abec95d747a26/src/odb/src/def/def/def.y into an EBNF understood by https://www.bottlecaps.de/rr/ui and manually replacing the tokens (search & replace K_* by /*K_*/*) we can have a navigable railroad diagram.

Copy and paste one of the EBNF shown bellow on https://www.bottlecaps.de/rr/ui on the tab Edit Grammar then click the tab View Diagram:

/* converted on Sat Nov 12, 2022, 11:19 (UTC+01) by bison-to-w3c v0.61 which is Copyright (c) 2011-2022 by Gunther Rademacher <grd@gmx.net> */
//From https://github.com/The-OpenROAD-Project/OpenROAD/blob/429a272dae6e384dcdc7ebc99bdc4ecb0f66f8a1/src/odb/src/lef/lef/lef.y
lef_file ::= error? rule* extension_opt end_library
version  ::= /*K_*/"VERSION" T_STRING ';'
int_number
         ::= NUMBER
dividerchar
         ::= /*K_*/"DIVIDERCHAR" QSTRING ';'
busbitchars
         ::= /*K_*/"BUSBITCHARS" QSTRING ';'
end_library
         ::= ( /*K_*/"END" /*K_*/"LIBRARY" )?
rule     ::= version
           | busbitchars
           | case_sensitivity
           | units_section
           | layer_rule
           | via
           | viarule
           | viarule_generate
           | dividerchar
           | wireextension
           | msg_statement
           | spacing_rule
           | dielectric
           | minfeature
           | irdrop
           | site
           | macro
           | array
           | def_statement
           | nondefault_rule
           | prop_def_section
           | universalnoisemargin
           | edgeratethreshold1
           | edgeratescalefactor
           | edgeratethreshold2
           | noisetable
           | correctiontable
           | input_antenna
           | output_antenna
           | inout_antenna
           | antenna_input
           | antenna_inout
           | antenna_output
           | manufacturing
           | fixedmask
           | useminspacing
           | clearancemeasure
           | maxstack_via
           | create_file_statement
case_sensitivity
         ::= /*K_*/"NAMESCASESENSITIVE" ( /*K_*/"ON" | /*K_*/"OFF" ) ';'
wireextension
         ::= /*K_*/"NOWIREEXTENSIONATPIN" ( /*K_*/"ON" | /*K_*/"OFF" ) ';'
fixedmask
         ::= /*K_*/"FIXEDMASK" ';'
manufacturing
         ::= /*K_*/"MANUFACTURINGGRID" int_number ';'
useminspacing
         ::= /*K_*/"USEMINSPACING" spacing_type spacing_value ';'
clearancemeasure
         ::= /*K_*/"CLEARANCEMEASURE" clearance_type ';'
clearance_type
         ::= /*K_*/"MAXXY"
           | /*K_*/"EUCLIDEAN"
spacing_type
         ::= /*K_*/"OBS"
           | /*K_*/"PIN"
spacing_value
         ::= /*K_*/"ON"
           | /*K_*/"OFF"
units_section
         ::= start_units units_rule* /*K_*/"END" /*K_*/"UNITS"
start_units
         ::= /*K_*/"UNITS"
units_rule
         ::= ( ( /*K_*/"TIME" /*K_*/"NANOSECONDS" | /*K_*/"CAPACITANCE" /*K_*/"PICOFARADS" | /*K_*/"RESISTANCE" /*K_*/"OHMS" | /*K_*/"POWER" /*K_*/"MILLIWATTS" | /*K_*/"CURRENT" /*K_*/"MILLIAMPS" | /*K_*/"VOLTAGE" /*K_*/"VOLTS" | /*K_*/"DATABASE" /*K_*/"MICRONS" ) int_number | /*K_*/"FREQUENCY" /*K_*/"MEGAHERTZ" NUMBER ) ';'
layer_rule
         ::= start_layer layer_option* end_layer
start_layer
         ::= /*K_*/"LAYER" T_STRING
end_layer
         ::= /*K_*/"END" T_STRING
layer_option
         ::= /*K_*/"ARRAYSPACING" layer_arraySpacing_long layer_arraySpacing_width /*K_*/"CUTSPACING" int_number layer_arraySpacing_arraycut* ';'
           | /*K_*/"TYPE" layer_type ';'
           | /*K_*/"MASK" int_number ';'
           | /*K_*/"PITCH" int_number ';'
           | /*K_*/"PITCH" int_number int_number ';'
           | /*K_*/"DIAGPITCH" int_number ';'
           | /*K_*/"DIAGPITCH" int_number int_number ';'
           | /*K_*/"OFFSET" int_number ';'
           | /*K_*/"OFFSET" int_number int_number ';'
           | /*K_*/"DIAGWIDTH" int_number ';'
           | /*K_*/"DIAGSPACING" int_number ';'
           | /*K_*/"WIDTH" int_number ';'
           | /*K_*/"AREA" NUMBER ';'
           | /*K_*/"SPACING" int_number layer_spacing_opt* layer_spacing_cut_routing ';'
           | /*K_*/"SPACINGTABLE" /*K_*/"ORTHOGONAL" /*K_*/"WITHIN" int_number /*K_*/"SPACING" int_number layer_spacingtable_opt* ';'
           | /*K_*/"DIRECTION" layer_direction ';'
           | /*K_*/"RESISTANCE" /*K_*/"RPERSQ" int_number ';'
           | /*K_*/"RESISTANCE" /*K_*/"RPERSQ" /*K_*/"PWL" '(' res_point+ ')' ';'
           | /*K_*/"CAPACITANCE" /*K_*/"CPERSQDIST" int_number ';'
           | /*K_*/"CAPACITANCE" /*K_*/"CPERSQDIST" /*K_*/"PWL" '(' cap_point+ ')' ';'
           | /*K_*/"HEIGHT" int_number ';'
           | /*K_*/"WIREEXTENSION" int_number ';'
           | /*K_*/"THICKNESS" int_number ';'
           | /*K_*/"SHRINKAGE" int_number ';'
           | /*K_*/"CAPMULTIPLIER" int_number ';'
           | /*K_*/"EDGECAPACITANCE" int_number ';'
           | /*K_*/"ANTENNALENGTHFACTOR" int_number ';'
           | /*K_*/"CURRENTDEN" int_number ';'
           | /*K_*/"CURRENTDEN" /*K_*/"PWL" '(' current_density_pwl+ ')' ';'
           | /*K_*/"CURRENTDEN" '(' int_number int_number ')' ';'
           | /*K_*/"PROPERTY" layer_prop+ ';'
           | /*K_*/"ACCURRENTDENSITY" layer_table_type layer_frequency
           | /*K_*/"ACCURRENTDENSITY" layer_table_type int_number ';'
           | /*K_*/"DCCURRENTDENSITY" /*K_*/"AVERAGE" int_number ';'
           | /*K_*/"DCCURRENTDENSITY" /*K_*/"AVERAGE" /*K_*/"CUTAREA" NUMBER number_list ';' dc_layer_table
           | /*K_*/"DCCURRENTDENSITY" /*K_*/"AVERAGE" /*K_*/"WIDTH" int_number int_number_list ';' dc_layer_table
           | /*K_*/"ANTENNAAREARATIO" int_number ';'
           | /*K_*/"ANTENNADIFFAREARATIO" layer_antenna_pwl ';'
           | /*K_*/"ANTENNACUMAREARATIO" int_number ';'
           | /*K_*/"ANTENNACUMDIFFAREARATIO" layer_antenna_pwl ';'
           | /*K_*/"ANTENNAAREAFACTOR" int_number layer_antenna_duo ';'
           | /*K_*/"ANTENNASIDEAREARATIO" int_number ';'
           | /*K_*/"ANTENNADIFFSIDEAREARATIO" layer_antenna_pwl ';'
           | /*K_*/"ANTENNACUMSIDEAREARATIO" int_number ';'
           | /*K_*/"ANTENNACUMDIFFSIDEAREARATIO" layer_antenna_pwl ';'
           | /*K_*/"ANTENNASIDEAREAFACTOR" int_number layer_antenna_duo ';'
           | /*K_*/"ANTENNAMODEL" layer_oxide ';'
           | /*K_*/"ANTENNACUMROUTINGPLUSCUT" ';'
           | /*K_*/"ANTENNAGATEPLUSDIFF" int_number ';'
           | /*K_*/"ANTENNAAREAMINUSDIFF" int_number ';'
           | /*K_*/"ANTENNAAREADIFFREDUCEPWL" '(' pt pt layer_diffusion_ratios ')' ';'
           | /*K_*/"SLOTWIREWIDTH" int_number ';'
           | /*K_*/"SLOTWIRELENGTH" int_number ';'
           | /*K_*/"SLOTWIDTH" int_number ';'
           | /*K_*/"SLOTLENGTH" int_number ';'
           | /*K_*/"MAXADJACENTSLOTSPACING" int_number ';'
           | /*K_*/"MAXCOAXIALSLOTSPACING" int_number ';'
           | /*K_*/"MAXEDGESLOTSPACING" int_number ';'
           | /*K_*/"SPLITWIREWIDTH" int_number ';'
           | /*K_*/"MINIMUMDENSITY" int_number ';'
           | /*K_*/"MAXIMUMDENSITY" int_number ';'
           | /*K_*/"DENSITYCHECKWINDOW" int_number int_number ';'
           | /*K_*/"DENSITYCHECKSTEP" int_number ';'
           | /*K_*/"FILLACTIVESPACING" int_number ';'
           | /*K_*/"MAXWIDTH" int_number ';'
           | /*K_*/"MINWIDTH" int_number ';'
           | /*K_*/"MINENCLOSEDAREA" NUMBER layer_minen_width ';'
           | /*K_*/"MINIMUMCUT" int_number /*K_*/"WIDTH" int_number layer_minimumcut_within layer_minimumcut_from layer_minimumcut_length ';'
           | /*K_*/"MINSTEP" int_number layer_minstep_option* ';'
           | /*K_*/"PROTRUSIONWIDTH" int_number /*K_*/"LENGTH" int_number /*K_*/"WIDTH" int_number ';'
           | /*K_*/"SPACINGTABLE" sp_options ';'
           | /*K_*/"ENCLOSURE" layer_enclosure_type_opt int_number int_number layer_enclosure_width_opt ';'
           | /*K_*/"PREFERENCLOSURE" layer_enclosure_type_opt int_number int_number layer_preferenclosure_width_opt ';'
           | /*K_*/"RESISTANCE" int_number ';'
           | /*K_*/"DIAGMINEDGELENGTH" int_number ';'
           | /*K_*/"MINSIZE" firstPt otherPts ';'
layer_arraySpacing_long
         ::= /*K_*/"LONGARRAY"?
layer_arraySpacing_width
         ::= ( /*K_*/"WIDTH" int_number )?
layer_arraySpacing_arraycut
         ::= /*K_*/"ARRAYCUTS" int_number /*K_*/"SPACING" int_number
sp_options
         ::= /*K_*/"PARALLELRUNLENGTH" int_number int_number_list /*K_*/"WIDTH" int_number int_number_list layer_sp_parallel_width*
           | /*K_*/"TWOWIDTHS" /*K_*/"WIDTH" int_number layer_sp_TwoWidthsPRL int_number int_number_list layer_sp_TwoWidth*
           | /*K_*/"INFLUENCE" /*K_*/"WIDTH" int_number /*K_*/"WITHIN" int_number /*K_*/"SPACING" int_number layer_sp_influence_width*
layer_spacingtable_opt
         ::= /*K_*/"WITHIN" int_number /*K_*/"SPACING" int_number
layer_enclosure_type_opt
         ::= ( /*K_*/"ABOVE" | /*K_*/"BELOW" )?
layer_enclosure_width_opt
         ::= ( /*K_*/"WIDTH" int_number layer_enclosure_width_except_opt | /*K_*/"LENGTH" int_number )?
layer_enclosure_width_except_opt
         ::= ( /*K_*/"EXCEPTEXTRACUT" int_number )?
layer_preferenclosure_width_opt
         ::= ( /*K_*/"WIDTH" int_number )?
layer_minimumcut_within
         ::= ( /*K_*/"WITHIN" int_number )?
layer_minimumcut_from
         ::= ( /*K_*/"FROMABOVE" | /*K_*/"FROMBELOW" )?
layer_minimumcut_length
         ::= ( /*K_*/"LENGTH" int_number /*K_*/"WITHIN" int_number )?
layer_minstep_option
         ::= layer_minstep_type
           | ( /*K_*/"LENGTHSUM" | /*K_*/"MAXEDGES" ) int_number
layer_minstep_type
         ::= /*K_*/"INSIDECORNER"
           | /*K_*/"OUTSIDECORNER"
           | /*K_*/"STEP"
layer_antenna_pwl
         ::= int_number
           | /*K_*/"PWL" '(' pt pt layer_diffusion_ratios ')'
layer_diffusion_ratios
         ::= layer_diffusion_ratio*
layer_diffusion_ratio
         ::= pt
layer_antenna_duo
         ::= /*K_*/"DIFFUSEONLY"?
layer_table_type
         ::= /*K_*/"PEAK"
           | /*K_*/"AVERAGE"
           | /*K_*/"RMS"
layer_frequency
         ::= /*K_*/"FREQUENCY" NUMBER number_list ';' ac_layer_table_opt /*K_*/"TABLEENTRIES" NUMBER number_list ';'
ac_layer_table_opt
         ::= ( ( /*K_*/"CUTAREA" NUMBER number_list | /*K_*/"WIDTH" int_number int_number_list ) ';' )?
dc_layer_table
         ::= /*K_*/"TABLEENTRIES" int_number int_number_list ';'
int_number_list
         ::= int_number*
number_list
         ::= NUMBER*
layer_prop
         ::= T_STRING ( T_STRING | QSTRING | NUMBER )
current_density_pwl
         ::= '(' int_number int_number ')'
cap_point
         ::= '(' int_number int_number ')'
res_point
         ::= '(' int_number int_number ')'
layer_type
         ::= /*K_*/"ROUTING"
           | /*K_*/"CUT"
           | /*K_*/"OVERLAP"
           | /*K_*/"MASTERSLICE"
           | /*K_*/"VIRTUAL"
           | /*K_*/"IMPLANT"
layer_direction
         ::= /*K_*/"HORIZONTAL"
           | /*K_*/"VERTICAL"
           | /*K_*/"DIAG45"
           | /*K_*/"DIAG135"
layer_minen_width
         ::= ( /*K_*/"WIDTH" int_number )?
layer_oxide
         ::= /*K_*/"OXIDE1"
           | /*K_*/"OXIDE2"
           | /*K_*/"OXIDE3"
           | /*K_*/"OXIDE4"
layer_sp_parallel_width
         ::= /*K_*/"WIDTH" int_number int_number_list
layer_sp_TwoWidth
         ::= /*K_*/"WIDTH" int_number layer_sp_TwoWidthsPRL int_number int_number_list
layer_sp_TwoWidthsPRL
         ::= ( /*K_*/"PRL" int_number )?
layer_sp_influence_width
         ::= /*K_*/"WIDTH" int_number /*K_*/"WITHIN" int_number /*K_*/"SPACING" int_number
maxstack_via
         ::= /*K_*/"MAXVIASTACK" int_number ( /*K_*/"RANGE" T_STRING T_STRING )? ';'
via      ::= start_via via_option end_via
via_keyword
         ::= /*K_*/"VIA"
start_via
         ::= via_keyword T_STRING ( /*K_*/"DEFAULT" | /*K_*/"GENERATED" )?
via_viarule
         ::= /*K_*/"VIARULE" T_STRING ';' /*K_*/"CUTSIZE" int_number int_number ';' /*K_*/"LAYERS" T_STRING T_STRING T_STRING ';' /*K_*/"CUTSPACING" int_number int_number ';' /*K_*/"ENCLOSURE" int_number int_number int_number int_number ';' via_viarule_option*
via_viarule_option
         ::= ( ( /*K_*/"ROWCOL" | /*K_*/"ORIGIN" | /*K_*/"OFFSET" int_number int_number ) int_number int_number | /*K_*/"PATTERN" T_STRING ) ';'
via_option
         ::= via_viarule
           | via_other_options
via_other_options
         ::= via_other_option+
via_other_option
         ::= via_foreign
           | via_layer_rule
           | ( /*K_*/"RESISTANCE" int_number | /*K_*/"PROPERTY" via_name_value_pair+ ) ';'
           | /*K_*/"TOPOFSTACKONLY"
via_name_value_pair
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
via_foreign
         ::= start_foreign pt? orientation? ';'
start_foreign
         ::= /*K_*/"FOREIGN" T_STRING
orientation
         ::= /*K_*/"N"
           | /*K_*/"W"
           | /*K_*/"S"
           | /*K_*/"E"
           | /*K_*/"FN"
           | /*K_*/"FW"
           | /*K_*/"FS"
           | /*K_*/"FE"
           | /*K_*/"R0"
           | /*K_*/"R90"
           | /*K_*/"R180"
           | /*K_*/"R270"
           | /*K_*/"MY"
           | /*K_*/"MYR90"
           | /*K_*/"MX"
           | /*K_*/"MXR90"
via_layer_rule
         ::= via_layer via_geometry*
via_layer
         ::= /*K_*/"LAYER" T_STRING ';'
via_geometry
         ::= ( /*K_*/"RECT" maskColor pt pt | /*K_*/"POLYGON" maskColor firstPt nextPt nextPt otherPts ) ';'
end_via  ::= /*K_*/"END" T_STRING
viarule_keyword
         ::= /*K_*/"VIARULE" T_STRING
viarule  ::= viarule_keyword viarule_layer_list via_name* opt_viarule_props end_viarule
viarule_generate
         ::= viarule_keyword /*K_*/"GENERATE" viarule_generate_default viarule_layer_list opt_viarule_props end_viarule
viarule_generate_default
         ::= /*K_*/"DEFAULT"?
viarule_layer_list
         ::= viarule_layer+
opt_viarule_props
         ::= viarule_prop*
viarule_prop
         ::= /*K_*/"PROPERTY" viarule_prop+ ';'
           | T_STRING ( T_STRING | QSTRING | NUMBER )
viarule_layer
         ::= viarule_layer_name viarule_layer_option*
via_name ::= via_keyword T_STRING ';'
viarule_layer_name
         ::= /*K_*/"LAYER" T_STRING ';'
viarule_layer_option
         ::= ( /*K_*/"DIRECTION" ( /*K_*/"HORIZONTAL" | /*K_*/"VERTICAL" ) | ( /*K_*/"ENCLOSURE" int_number | /*K_*/"WIDTH" int_number /*K_*/"TO" | /*K_*/"SPACING" int_number /*K_*/"BY" | /*K_*/"RESISTANCE" | /*K_*/"OVERHANG" | /*K_*/"METALOVERHANG" ) int_number | /*K_*/"RECT" pt pt ) ';'
end_viarule
         ::= /*K_*/"END" T_STRING
spacing_rule
         ::= start_spacing spacing* end_spacing
start_spacing
         ::= /*K_*/"SPACING"
end_spacing
         ::= /*K_*/"END" /*K_*/"SPACING"
spacing  ::= samenet_keyword T_STRING T_STRING int_number /*K_*/"STACK"? ';'
samenet_keyword
         ::= /*K_*/"SAMENET"
maskColor
         ::= ( /*K_*/"MASK" int_number )?
irdrop   ::= start_irdrop ir_table* end_irdrop
start_irdrop
         ::= /*K_*/"IRDROP"
end_irdrop
         ::= /*K_*/"END" /*K_*/"IRDROP"
ir_table ::= ir_tablename ir_table_value* ';'
ir_table_value
         ::= int_number int_number
ir_tablename
         ::= /*K_*/"TABLE" T_STRING
minfeature
         ::= /*K_*/"MINFEATURE" int_number int_number ';'
dielectric
         ::= /*K_*/"DIELECTRIC" int_number ';'
nondefault_rule
         ::= /*K_*/"NONDEFAULTRULE" T_STRING nd_hardspacing nd_rule* end_nd_rule
end_nd_rule
         ::= /*K_*/"END" T_STRING?
nd_hardspacing
         ::= ( /*K_*/"HARDSPACING" ';' )?
nd_rule  ::= nd_layer
           | via
           | spacing_rule
           | nd_prop
           | usevia
           | useviarule
           | mincuts
usevia   ::= /*K_*/"USEVIA" T_STRING ';'
useviarule
         ::= /*K_*/"USEVIARULE" T_STRING ';'
mincuts  ::= /*K_*/"MINCUTS" T_STRING int_number ';'
nd_prop  ::= /*K_*/"PROPERTY" nd_prop+ ';'
           | T_STRING ( T_STRING | QSTRING | NUMBER )
nd_layer ::= /*K_*/"LAYER" T_STRING /*K_*/"WIDTH" int_number ';' nd_layer_stmt* /*K_*/"END" T_STRING
nd_layer_stmt
         ::= ( /*K_*/"SPACING" | /*K_*/"WIREEXTENSION" | /*K_*/"RESISTANCE" /*K_*/"RPERSQ" | /*K_*/"CAPACITANCE" /*K_*/"CPERSQDIST" | /*K_*/"EDGECAPACITANCE" | /*K_*/"DIAGWIDTH" ) int_number ';'
site     ::= start_site site_option* end_site
start_site
         ::= /*K_*/"SITE" T_STRING
end_site ::= /*K_*/"END" T_STRING
site_option
         ::= /*K_*/"SIZE" int_number /*K_*/"BY" int_number ';'
           | site_symmetry_statement
           | site_class
           | site_rowpattern_statement
site_class
         ::= /*K_*/"CLASS" ( /*K_*/"PAD" | /*K_*/"CORE" | /*K_*/"VIRTUAL" ) ';'
site_symmetry_statement
         ::= /*K_*/"SYMMETRY" site_symmetry* ';'
site_symmetry
         ::= /*K_*/"X"
           | /*K_*/"Y"
           | /*K_*/"R90"
site_rowpattern_statement
         ::= /*K_*/"ROWPATTERN" site_rowpattern* ';'
site_rowpattern
         ::= T_STRING orientation
pt       ::= int_number int_number
           | '(' int_number int_number ')'
macro    ::= start_macro macro_option* end_macro
start_macro
         ::= /*K_*/"MACRO" T_STRING
end_macro
         ::= /*K_*/"END" T_STRING
macro_option
         ::= macro_class
           | macro_generator
           | macro_generate
           | macro_source
           | macro_symmetry_statement
           | macro_fixedMask
           | macro_origin
           | macro_power
           | macro_foreign
           | macro_eeq
           | macro_leq
           | macro_size
           | macro_site
           | macro_pin
           | ( /*K_*/"FUNCTION" ( /*K_*/"BUFFER" | /*K_*/"INVERTER" ) | /*K_*/"PROPERTY" macro_name_value_pair+ ) ';'
           | macro_obs
           | macro_density
           | macro_clocktype
           | timing
macro_symmetry_statement
         ::= /*K_*/"SYMMETRY" macro_symmetry* ';'
macro_symmetry
         ::= /*K_*/"X"
           | /*K_*/"Y"
           | /*K_*/"R90"
macro_name_value_pair
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
macro_class
         ::= /*K_*/"CLASS" class_type ';'
class_type
         ::= /*K_*/"COVER" /*K_*/"BUMP"?
           | /*K_*/"RING"
           | /*K_*/"BLOCK" ( /*K_*/"BLACKBOX" | /*K_*/"SOFT" )?
           | /*K_*/"NONE"
           | /*K_*/"BUMP"
           | /*K_*/"PAD" pad_type?
           | /*K_*/"VIRTUAL"
           | /*K_*/"CORE" core_type?
           | /*K_*/"CORNER"
           | /*K_*/"ENDCAP" endcap_type
pad_type ::= /*K_*/"INPUT"
           | /*K_*/"OUTPUT"
           | /*K_*/"INOUT"
           | /*K_*/"POWER"
           | /*K_*/"SPACER"
           | /*K_*/"AREAIO"
core_type
         ::= /*K_*/"FEEDTHRU"
           | /*K_*/"TIEHIGH"
           | /*K_*/"TIELOW"
           | /*K_*/"SPACER"
           | /*K_*/"ANTENNACELL"
           | /*K_*/"WELLTAP"
endcap_type
         ::= /*K_*/"PRE"
           | /*K_*/"POST"
           | /*K_*/"TOPLEFT"
           | /*K_*/"TOPRIGHT"
           | /*K_*/"BOTTOMLEFT"
           | /*K_*/"BOTTOMRIGHT"
macro_generator
         ::= /*K_*/"GENERATOR" T_STRING ';'
macro_generate
         ::= /*K_*/"GENERATE" T_STRING T_STRING ';'
macro_source
         ::= /*K_*/"SOURCE" ( /*K_*/"USER" | /*K_*/"GENERATE" | /*K_*/"BLOCK" ) ';'
macro_power
         ::= /*K_*/"POWER" int_number ';'
macro_origin
         ::= /*K_*/"ORIGIN" pt ';'
macro_foreign
         ::= start_foreign pt? orientation? ';'
macro_fixedMask
         ::= /*K_*/"FIXEDMASK" ';'
macro_eeq
         ::= /*K_*/"EEQ" T_STRING ';'
macro_leq
         ::= /*K_*/"LEQ" T_STRING ';'
macro_site
         ::= macro_site_word ( T_STRING | sitePattern ) ';'
macro_site_word
         ::= /*K_*/"SITE"
site_word
         ::= /*K_*/"SITE"
macro_size
         ::= /*K_*/"SIZE" int_number /*K_*/"BY" int_number ';'
macro_pin
         ::= start_macro_pin macro_pin_option* end_macro_pin
start_macro_pin
         ::= /*K_*/"PIN" T_STRING
end_macro_pin
         ::= /*K_*/"END" T_STRING
macro_pin_option
         ::= ( start_foreign /*K_*/"STRUCTURE"? ( pt orientation? )? | ( /*K_*/"LEQ" | /*K_*/"MUSTJOIN" | /*K_*/"IV_TABLES" T_STRING | /*K_*/"TAPERRULE" | /*K_*/"SUPPLYSENSITIVITY" | /*K_*/"GROUNDSENSITIVITY" ) T_STRING | ( /*K_*/"POWER" | /*K_*/"LEAKAGE" | /*K_*/"RISETHRESH" | /*K_*/"FALLTHRESH" | /*K_*/"RISESATCUR" | /*K_*/"FALLSATCUR" | /*K_*/"VLO" | /*K_*/"VHI" | /*K_*/"TIEOFFR" | ( /*K_*/"OUTPUTNOISEMARGIN" | /*K_*/"OUTPUTRESISTANCE" | /*K_*/"INPUTNOISEMARGIN" ) int_number | /*K_*/"CAPACITANCE" | /*K_*/"MAXDELAY" | /*K_*/"MAXLOAD" | /*K_*/"RESISTANCE" | /*K_*/"PULLDOWNRES" | /*K_*/"RISEVOLTAGETHRESHOLD" | /*K_*/"FALLVOLTAGETHRESHOLD" | /*K_*/"RISESLEWLIMIT" | /*K_*/"FALLSLEWLIMIT" ) int_number | /*K_*/"USE" macro_pin_use | /*K_*/"SCANUSE" macro_scan_use | /*K_*/"SHAPE" pin_shape | /*K_*/"PROPERTY" pin_name_value_pair+ | ( ( /*K_*/"ANTENNASIZE" | /*K_*/"ANTENNAMETALLENGTH" ) int_number | ( /*K_*/"ANTENNAMETALAREA" | /*K_*/"ANTENNAPARTIALMETALAREA" | /*K_*/"ANTENNAPARTIALMETALSIDEAREA" | /*K_*/"ANTENNAPARTIALCUTAREA" | /*K_*/"ANTENNADIFFAREA" | /*K_*/"ANTENNAGATEAREA" ) NUMBER ) opt_layer_name | ( /*K_*/"ANTENNAMAXAREACAR" | /*K_*/"ANTENNAMAXSIDEAREACAR" | /*K_*/"ANTENNAMAXCUTCAR" ) NUMBER req_layer_name | /*K_*/"ANTENNAMODEL" pin_layer_oxide | /*K_*/"NETEXPR" QSTRING | /*K_*/"CURRENTSOURCE" ( /*K_*/"ACTIVE" | /*K_*/"RESISTIVE" ) ) ';'
           | electrical_direction
           | start_macro_port ( macro_port_class_option geometries )? /*K_*/"END"
pin_layer_oxide
         ::= /*K_*/"OXIDE1"
           | /*K_*/"OXIDE2"
           | /*K_*/"OXIDE3"
           | /*K_*/"OXIDE4"
pin_name_value_pair
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
electrical_direction
         ::= /*K_*/"DIRECTION" ( /*K_*/"INPUT" | /*K_*/"INOUT" | /*K_*/"FEEDTHRU" | /*K_*/"OUTPUT" /*K_*/"TRISTATE"? ) ';'
start_macro_port
         ::= /*K_*/"PORT"
macro_port_class_option
         ::= ( /*K_*/"CLASS" class_type ';' )?
macro_pin_use
         ::= /*K_*/"SIGNAL"
           | /*K_*/"ANALOG"
           | /*K_*/"POWER"
           | /*K_*/"GROUND"
           | /*K_*/"CLOCK"
           | /*K_*/"DATA"
macro_scan_use
         ::= /*K_*/"INPUT"
           | /*K_*/"OUTPUT"
           | /*K_*/"START"
           | /*K_*/"STOP"
pin_shape
         ::= ( /*K_*/"ABUTMENT" | /*K_*/"RING" | /*K_*/"FEEDTHRU" )?
geometries
         ::= geometry+
geometry ::= ( /*K_*/"LAYER" T_STRING layer_exceptpgnet layer_spacing | /*K_*/"WIDTH" int_number | /*K_*/"PATH" maskColor ( firstPt otherPts | /*K_*/"ITERATE" firstPt otherPts stepPattern ) | /*K_*/"RECT" maskColor ( pt pt | /*K_*/"ITERATE" pt pt stepPattern ) | /*K_*/"POLYGON" maskColor ( firstPt nextPt nextPt otherPts | /*K_*/"ITERATE" firstPt nextPt nextPt otherPts stepPattern ) ) ';'
           | via_placement
layer_exceptpgnet
         ::= /*K_*/"EXCEPTPGNET"?
layer_spacing
         ::= ( ( /*K_*/"SPACING" | /*K_*/"DESIGNRULEWIDTH" ) int_number )?
firstPt  ::= pt
nextPt   ::= pt
otherPts ::= nextPt*
via_placement
         ::= /*K_*/"VIA" ( maskColor pt T_STRING | /*K_*/"ITERATE" maskColor pt T_STRING stepPattern ) ';'
stepPattern
         ::= /*K_*/"DO" int_number /*K_*/"BY" int_number /*K_*/"STEP" int_number int_number
sitePattern
         ::= T_STRING int_number int_number orientation ( /*K_*/"DO" int_number /*K_*/"BY" int_number /*K_*/"STEP" int_number int_number )?
trackPattern
         ::= ( /*K_*/"X" | /*K_*/"Y" ) int_number /*K_*/"DO" int_number /*K_*/"STEP" int_number ( /*K_*/"LAYER" trackLayers )?
trackLayers
         ::= layer_name*
layer_name
         ::= T_STRING
gcellPattern
         ::= ( /*K_*/"X" | /*K_*/"Y" ) int_number /*K_*/"DO" int_number /*K_*/"STEP" int_number
macro_obs
         ::= start_macro_obs geometries? /*K_*/"END"
start_macro_obs
         ::= /*K_*/"OBS"
macro_density
         ::= /*K_*/"DENSITY" density_layer+ /*K_*/"END"
density_layer
         ::= /*K_*/"LAYER" T_STRING ';' density_layer_rect+
density_layer_rect
         ::= /*K_*/"RECT" pt pt int_number ';'
macro_clocktype
         ::= /*K_*/"CLOCKTYPE" T_STRING ';'
timing   ::= start_timing timing_option* end_timing
start_timing
         ::= /*K_*/"TIMING"
end_timing
         ::= /*K_*/"END" /*K_*/"TIMING"
timing_option
         ::= ( ( /*K_*/"FROMPIN" | /*K_*/"TOPIN" ) T_STRING+ | /*K_*/"TABLEAXIS" int_number+ | /*K_*/"TABLEENTRIES" table_entry+ | ( /*K_*/"RISERS" | /*K_*/"FALLRS" | /*K_*/"RISECS" | /*K_*/"FALLCS" | /*K_*/"RISESATT1" | /*K_*/"FALLSATT1" | /*K_*/"RISET0" | /*K_*/"FALLT0" | ( two_pin_trigger from_pin_trigger to_pin_trigger | one_pin_trigger ) /*K_*/"TABLEDIMENSION" int_number | risefall ( /*K_*/"INTRINSIC" int_number int_number slew_spec /*K_*/"VARIABLE" | delay_or_transition /*K_*/"UNATENESS" unateness /*K_*/"TABLEDIMENSION" int_number ) ) int_number int_number | /*K_*/"UNATENESS" unateness | /*K_*/"STABLE" /*K_*/"SETUP" int_number /*K_*/"HOLD" int_number risefall | ( /*K_*/"SDFCONDSTART" | /*K_*/"SDFCONDEND" | /*K_*/"SDFCOND" ) QSTRING | /*K_*/"EXTENSION" ) ';'
one_pin_trigger
         ::= /*K_*/"MPWH"
           | /*K_*/"MPWL"
           | /*K_*/"PERIOD"
two_pin_trigger
         ::= /*K_*/"SETUP"
           | /*K_*/"HOLD"
           | /*K_*/"RECOVERY"
           | /*K_*/"SKEW"
from_pin_trigger
         ::= /*K_*/"ANYEDGE"
           | /*K_*/"POSEDGE"
           | /*K_*/"NEGEDGE"
to_pin_trigger
         ::= /*K_*/"ANYEDGE"
           | /*K_*/"POSEDGE"
           | /*K_*/"NEGEDGE"
delay_or_transition
         ::= /*K_*/"DELAY"
           | /*K_*/"TRANSITIONTIME"
table_entry
         ::= '(' int_number int_number int_number ')'
slew_spec
         ::= ( int_number int_number int_number int_number ( int_number int_number int_number )? )?
risefall ::= /*K_*/"RISE"
           | /*K_*/"FALL"
unateness
         ::= /*K_*/"INVERT"
           | /*K_*/"NONINVERT"
           | /*K_*/"NONUNATE"
array    ::= start_array array_rule* end_array
start_array
         ::= /*K_*/"ARRAY" T_STRING
end_array
         ::= /*K_*/"END" T_STRING
array_rule
         ::= ( ( site_word | /*K_*/"CANPLACE" | /*K_*/"CANNOTOCCUPY" ) sitePattern | /*K_*/"TRACKS" trackPattern | /*K_*/"GCELLGRID" gcellPattern ) ';'
           | floorplan_start floorplan_element* /*K_*/"END" T_STRING
           | /*K_*/"DEFAULTCAP" int_number one_cap* /*K_*/"END" /*K_*/"DEFAULTCAP"
           | def_statement
floorplan_start
         ::= /*K_*/"FLOORPLAN" T_STRING
floorplan_element
         ::= ( /*K_*/"CANPLACE" | /*K_*/"CANNOTOCCUPY" ) sitePattern ';'
one_cap  ::= /*K_*/"MINPINS" int_number /*K_*/"WIRECAP" int_number ';'
msg_statement
         ::= /*K_*/"MESSAGE" T_STRING '=' s_expr dtrm
create_file_statement
         ::= /*K_*/"CREATEFILE" T_STRING '=' s_expr dtrm
def_statement
         ::= ( /*K_*/"DEFINE" T_STRING '=' expression | /*K_*/"DEFINES" T_STRING '=' s_expr | /*K_*/"DEFINEB" T_STRING '=' b_expr ) dtrm
dtrm     ::= ( ';' | '\n' )?
then     ::= '\n'? /*K_*/"THEN"
else     ::= '\n'? /*K_*/"ELSE"
expression
         ::= ( expression ( '+' | '-' | '*' | '/' ) | '-' | /*K_*/"IF" b_expr then expression else ) expression
           | '(' expression ')'
           | int_number
b_expr   ::= expression ( relop | /*K_*/"AND" | /*K_*/"OR" ) expression
           | s_expr ( relop | /*K_*/"AND" | /*K_*/"OR" ) s_expr
           | ( b_expr ( /*K_*/"EQ" | /*K_*/"NE" | /*K_*/"AND" | /*K_*/"OR" ) | /*K_*/"NOT" | /*K_*/"IF" b_expr then b_expr else ) b_expr
           | '(' b_expr ')'
           | /*K_*/"TRUE"
           | /*K_*/"FALSE"
s_expr   ::= ( s_expr '+' | /*K_*/"IF" b_expr then s_expr else ) s_expr
           | '(' s_expr ')'
           | QSTRING
relop    ::= /*K_*/"LE"
           | /*K_*/"LT"
           | /*K_*/"GE"
           | /*K_*/"GT"
           | /*K_*/"EQ"
           | /*K_*/"NE"
           | '='
           | '<'
           | '>'
prop_def_section
         ::= /*K_*/"PROPDEF" prop_stmt* /*K_*/"END" /*K_*/"PROPDEF"
prop_stmt
         ::= ( /*K_*/"LIBRARY" | /*K_*/"COMPONENTPIN" | /*K_*/"PIN" | /*K_*/"MACRO" | /*K_*/"VIA" | /*K_*/"VIARULE" | /*K_*/"LAYER" | /*K_*/"NONDEFAULTRULE" ) T_STRING prop_define ';'
prop_define
         ::= /*K_*/"INTEGER" opt_def_range opt_def_dvalue
           | /*K_*/"REAL" opt_def_range opt_def_value
           | /*K_*/"STRING" QSTRING?
           | /*K_*/"NAMEMAPSTRING" T_STRING
opt_range_second
         ::= ( /*K_*/"INFLUENCE" int_number )? ( /*K_*/"RANGE" int_number int_number )?
           | /*K_*/"USELENGTHTHRESHOLD"
opt_endofline
         ::= ( /*K_*/"PARALLELEDGE" int_number /*K_*/"WITHIN" int_number opt_endofline_twoedges )?
opt_endofline_twoedges
         ::= /*K_*/"TWOEDGES"?
opt_samenetPGonly
         ::= /*K_*/"PGONLY"?
opt_def_range
         ::= ( /*K_*/"RANGE" int_number int_number )?
opt_def_value
         ::= NUMBER?
opt_def_dvalue
         ::= int_number?
layer_spacing_opt
         ::= /*K_*/"CENTERTOCENTER"
           | /*K_*/"SAMENET" opt_samenetPGonly
           | /*K_*/"PARALLELOVERLAP"
layer_spacing_cut_routing
         ::= ( /*K_*/"LAYER" T_STRING spacing_cut_layer_opt | /*K_*/"ADJACENTCUTS" int_number /*K_*/"WITHIN" int_number opt_adjacentcuts_exceptsame | /*K_*/"AREA" NUMBER | /*K_*/"RANGE" int_number int_number opt_range_second | ( /*K_*/"LENGTHTHRESHOLD" ( int_number /*K_*/"RANGE" int_number )? | ( /*K_*/"ENDOFNOTCHWIDTH" int_number /*K_*/"NOTCHSPACING" int_number )? /*K_*/"NOTCHLENGTH" ) int_number | /*K_*/"ENDOFLINE" int_number /*K_*/"WITHIN" int_number opt_endofline )?
spacing_cut_layer_opt
         ::= /*K_*/"STACK"?
opt_adjacentcuts_exceptsame
         ::= /*K_*/"EXCEPTSAMEPGNET"?
opt_layer_name
         ::= ( /*K_*/"LAYER" T_STRING )?
req_layer_name
         ::= /*K_*/"LAYER" T_STRING
universalnoisemargin
         ::= /*K_*/"UNIVERSALNOISEMARGIN" int_number int_number ';'
edgeratethreshold1
         ::= /*K_*/"EDGERATETHRESHOLD1" int_number ';'
edgeratethreshold2
         ::= /*K_*/"EDGERATETHRESHOLD2" int_number ';'
edgeratescalefactor
         ::= /*K_*/"EDGERATESCALEFACTOR" int_number ';'
noisetable
         ::= /*K_*/"NOISETABLE" int_number ';' noise_table_entry+ end_noisetable dtrm
end_noisetable
         ::= /*K_*/"END" /*K_*/"NOISETABLE"
noise_table_entry
         ::= /*K_*/"EDGERATE" int_number ';'
           | output_resistance_entry
output_resistance_entry
         ::= /*K_*/"OUTPUTRESISTANCE" int_number+ ';' victim+
victim   ::= /*K_*/"VICTIMLENGTH" int_number ';' /*K_*/"VICTIMNOISE" int_number+ ';'
correctiontable
         ::= /*K_*/"CORRECTIONTABLE" int_number ';' correction_table_item+ end_correctiontable dtrm
end_correctiontable
         ::= /*K_*/"END" /*K_*/"CORRECTIONTABLE"
correction_table_item
         ::= /*K_*/"EDGERATE" int_number ';'
           | output_list
output_list
         ::= /*K_*/"OUTPUTRESISTANCE" int_number+ ';' corr_victim+
corr_victim
         ::= /*K_*/"VICTIMLENGTH" int_number ';' /*K_*/"CORRECTIONFACTOR" int_number+ ';'
input_antenna
         ::= /*K_*/"INPUTPINANTENNASIZE" int_number ';'
output_antenna
         ::= /*K_*/"OUTPUTPINANTENNASIZE" int_number ';'
inout_antenna
         ::= /*K_*/"INOUTPINANTENNASIZE" int_number ';'
antenna_input
         ::= /*K_*/"ANTENNAINPUTGATEAREA" NUMBER ';'
antenna_inout
         ::= /*K_*/"ANTENNAINOUTDIFFAREA" NUMBER ';'
antenna_output
         ::= /*K_*/"ANTENNAOUTPUTDIFFAREA" NUMBER ';'
extension_opt
         ::= extension?
extension
         ::= /*K_*/"BEGINEXT"
/* converted on Sat Nov 12, 2022, 11:29 (UTC+01) by bison-to-w3c v0.61 which is Copyright (c) 2011-2022 by Gunther Rademacher <grd@gmx.net> */
//From https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD/7f985d5e0a07ebb08ccff8c4453abec95d747a26/src/odb/src/def/def/def.y
def_file ::= version_stmt case_sens_stmt error? rule* end_design
version_stmt
         ::= ( /*K_*/"VERSION" T_STRING ';' )?
case_sens_stmt
         ::= ( /*K_*/"NAMESCASESENSITIVE" ( /*K_*/"ON" | /*K_*/"OFF" ) ';' )?
rule     ::= design_section
           | assertions_section
           | blockage_section
           | comps_section
           | constraint_section
           | extension_section
           | fill_section
           | comps_maskShift_section
           | floorplan_contraints_section
           | groups_section
           | iotiming_section
           | nets_section
           | nondefaultrule_section
           | partitions_section
           | pin_props_section
           | regions_section
           | scanchains_section
           | slot_section
           | snets_section
           | styles_section
           | timingdisables_section
           | via_section
design_section
         ::= array_name
           | bus_bit_chars
           | canplace
           | cannotoccupy
           | design_name
           | die_area
           | divider_char
           | floorplan_name
           | gcellgrid
           | history
           | pin_cap_rule
           | pin_rule
           | prop_def_section
           | row_rule
           | tech_name
           | tracks_rule
           | units
design_name
         ::= /*K_*/"DESIGN" T_STRING ';'
end_design
         ::= /*K_*/"END" /*K_*/"DESIGN"
tech_name
         ::= /*K_*/"TECH" T_STRING ';'
array_name
         ::= /*K_*/"ARRAY" T_STRING ';'
floorplan_name
         ::= /*K_*/"FLOORPLAN" T_STRING ';'
history  ::= /*K_*/"HISTORY"
prop_def_section
         ::= /*K_*/"PROPERTYDEFINITIONS" property_def* /*K_*/"END" /*K_*/"PROPERTYDEFINITIONS"
property_def
         ::= ( ( /*K_*/"DESIGN" | /*K_*/"NET" | /*K_*/"SNET" | /*K_*/"REGION" | /*K_*/"GROUP" | /*K_*/"COMPONENT" | /*K_*/"ROW" | /*K_*/"COMPONENTPIN" | /*K_*/"NONDEFAULTRULE" ) T_STRING property_type_and_val | error ) ';'
property_type_and_val
         ::= ( /*K_*/"INTEGER" | /*K_*/"REAL" ) opt_range opt_num_val
           | /*K_*/"STRING" QSTRING?
           | /*K_*/"NAMEMAPSTRING" T_STRING
opt_num_val
         ::= NUMBER?
units    ::= /*K_*/"UNITS" /*K_*/"DISTANCE" /*K_*/"MICRONS" NUMBER ';'
divider_char
         ::= /*K_*/"DIVIDERCHAR" QSTRING ';'
bus_bit_chars
         ::= /*K_*/"BUSBITCHARS" QSTRING ';'
canplace ::= /*K_*/"CANPLACE" T_STRING NUMBER NUMBER orient /*K_*/"DO" NUMBER /*K_*/"BY" NUMBER /*K_*/"STEP" NUMBER NUMBER ';'
cannotoccupy
         ::= /*K_*/"CANNOTOCCUPY" T_STRING NUMBER NUMBER orient /*K_*/"DO" NUMBER /*K_*/"BY" NUMBER /*K_*/"STEP" NUMBER NUMBER ';'
orient   ::= /*K_*/"N"
           | /*K_*/"W"
           | /*K_*/"S"
           | /*K_*/"E"
           | /*K_*/"FN"
           | /*K_*/"FW"
           | /*K_*/"FS"
           | /*K_*/"FE"
die_area ::= /*K_*/"DIEAREA" firstPt nextPt otherPts ';'
pin_cap_rule
         ::= start_def_cap pin_cap* end_def_cap
start_def_cap
         ::= /*K_*/"DEFAULTCAP" NUMBER
pin_cap  ::= /*K_*/"MINPINS" NUMBER /*K_*/"WIRECAP" NUMBER ';'
end_def_cap
         ::= /*K_*/"END" /*K_*/"DEFAULTCAP"
pin_rule ::= start_pins pin* end_pins
start_pins
         ::= /*K_*/"PINS" NUMBER ';'
pin      ::= '-' T_STRING '+' /*K_*/"NET" T_STRING pin_option* ';'
pin_option
         ::= '+' ( /*K_*/"SPECIAL" | ( /*K_*/"DIRECTION" | /*K_*/"SUPPLYSENSITIVITY" | /*K_*/"GROUNDSENSITIVITY" | ( /*K_*/"ANTENNAPINMAXAREACAR" | /*K_*/"ANTENNAPINMAXSIDEAREACAR" | /*K_*/"ANTENNAPINMAXCUTCAR" ) NUMBER /*K_*/"LAYER" ) T_STRING | /*K_*/"NETEXPR" QSTRING | /*K_*/"USE" use_type | /*K_*/"PORT" | /*K_*/"LAYER" T_STRING pin_layer_mask_opt pin_layer_spacing_opt pt pt | /*K_*/"POLYGON" T_STRING pin_poly_mask_opt pin_poly_spacing_opt firstPt nextPt nextPt otherPts | /*K_*/"VIA" T_STRING pin_via_mask_opt '(' NUMBER NUMBER ')' | ( /*K_*/"ANTENNAPINPARTIALMETALAREA" | /*K_*/"ANTENNAPINPARTIALMETALSIDEAREA" | /*K_*/"ANTENNAPINGATEAREA" | /*K_*/"ANTENNAPINDIFFAREA" | /*K_*/"ANTENNAPINPARTIALCUTAREA" ) NUMBER pin_layer_opt | /*K_*/"ANTENNAMODEL" pin_oxide )
           | extension_stmt
           | placement_status pt orient
pin_layer_mask_opt
         ::= ( /*K_*/"MASK" NUMBER )?
pin_via_mask_opt
         ::= ( /*K_*/"MASK" NUMBER )?
pin_poly_mask_opt
         ::= ( /*K_*/"MASK" NUMBER )?
pin_layer_spacing_opt
         ::= ( ( /*K_*/"SPACING" | /*K_*/"DESIGNRULEWIDTH" ) NUMBER )?
pin_poly_spacing_opt
         ::= ( ( /*K_*/"SPACING" | /*K_*/"DESIGNRULEWIDTH" ) NUMBER )?
pin_oxide
         ::= /*K_*/"OXIDE1"
           | /*K_*/"OXIDE2"
           | /*K_*/"OXIDE3"
           | /*K_*/"OXIDE4"
use_type ::= /*K_*/"SIGNAL"
           | /*K_*/"POWER"
           | /*K_*/"GROUND"
           | /*K_*/"CLOCK"
           | /*K_*/"TIEOFF"
           | /*K_*/"ANALOG"
           | /*K_*/"SCAN"
           | /*K_*/"RESET"
pin_layer_opt
         ::= ( /*K_*/"LAYER" T_STRING )?
end_pins ::= /*K_*/"END" /*K_*/"PINS"
row_rule ::= /*K_*/"ROW" T_STRING T_STRING NUMBER NUMBER orient row_do_option row_option* ';'
row_do_option
         ::= ( /*K_*/"DO" NUMBER /*K_*/"BY" NUMBER row_step_option )?
row_step_option
         ::= ( /*K_*/"STEP" NUMBER NUMBER )?
row_option
         ::= '+' /*K_*/"PROPERTY" row_prop*
row_prop ::= T_STRING ( NUMBER | QSTRING | T_STRING )
tracks_rule
         ::= track_start NUMBER /*K_*/"DO" NUMBER /*K_*/"STEP" NUMBER track_opts ';'
track_start
         ::= /*K_*/"TRACKS" track_type
track_type
         ::= /*K_*/"X"
           | /*K_*/"Y"
track_opts
         ::= track_mask_statement track_layer_statement
track_mask_statement
         ::= ( /*K_*/"MASK" NUMBER same_mask )?
same_mask
         ::= /*K_*/"SAMEMASK"?
track_layer_statement
         ::= ( /*K_*/"LAYER" track_layer+ )?
track_layer
         ::= T_STRING
gcellgrid
         ::= /*K_*/"GCELLGRID" track_type NUMBER /*K_*/"DO" NUMBER /*K_*/"STEP" NUMBER ';'
extension_section
         ::= /*K_*/"BEGINEXT"
extension_stmt
         ::= '+' /*K_*/"BEGINEXT"
via_section
         ::= via via_declaration* via_end
via      ::= /*K_*/"VIAS" NUMBER ';'
via_declaration
         ::= '-' T_STRING layer_stmt* ';'
layer_stmt
         ::= '+' ( /*K_*/"RECT" T_STRING mask pt pt | /*K_*/"POLYGON" T_STRING mask firstPt nextPt nextPt otherPts | /*K_*/"PATTERNNAME" T_STRING | /*K_*/"VIARULE" T_STRING '+' /*K_*/"CUTSIZE" NUMBER NUMBER '+' /*K_*/"LAYERS" T_STRING T_STRING T_STRING '+' /*K_*/"CUTSPACING" NUMBER NUMBER '+' /*K_*/"ENCLOSURE" NUMBER NUMBER NUMBER NUMBER )
           | layer_viarule_opts
           | extension_stmt
layer_viarule_opts
         ::= '+' ( ( /*K_*/"ROWCOL" | /*K_*/"ORIGIN" | /*K_*/"OFFSET" NUMBER NUMBER ) NUMBER NUMBER | /*K_*/"PATTERN" T_STRING )
firstPt  ::= pt
nextPt   ::= pt
otherPts ::= nextPt*
pt       ::= '(' ( NUMBER | '*' ) ( NUMBER | '*' ) ')'
mask     ::= ( '+' /*K_*/"MASK" NUMBER )?
via_end  ::= /*K_*/"END" /*K_*/"VIAS"
regions_section
         ::= regions_start regions_stmt* /*K_*/"END" /*K_*/"REGIONS"
regions_start
         ::= /*K_*/"REGIONS" NUMBER ';'
regions_stmt
         ::= '-' T_STRING ( pt pt )+ region_option* ';'
region_option
         ::= '+' ( /*K_*/"PROPERTY" region_prop* | /*K_*/"TYPE" region_type )
region_prop
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
region_type
         ::= /*K_*/"FENCE"
           | /*K_*/"GUIDE"
comps_maskShift_section
         ::= /*K_*/"COMPSMASKSHIFT" maskLayer* ';'
comps_section
         ::= start_comps comp* end_comps
start_comps
         ::= /*K_*/"COMPS" NUMBER ';'
maskLayer
         ::= T_STRING
comp     ::= comp_start comp_option* ';'
comp_start
         ::= comp_id_and_name ( '*' | T_STRING )*
comp_id_and_name
         ::= '-' T_STRING T_STRING
comp_option
         ::= comp_generate
           | comp_source
           | comp_type
           | weight
           | maskShift
           | comp_foreign
           | comp_region
           | comp_eeq
           | comp_halo
           | comp_routehalo
           | comp_property
           | comp_extension_stmt
comp_extension_stmt
         ::= extension_stmt
comp_eeq ::= '+' /*K_*/"EEQMASTER" T_STRING
comp_generate
         ::= '+' /*K_*/"COMP_GEN" T_STRING opt_pattern
opt_pattern
         ::= T_STRING?
comp_source
         ::= '+' /*K_*/"SOURCE" source_type
source_type
         ::= /*K_*/"NETLIST"
           | /*K_*/"DIST"
           | /*K_*/"USER"
           | /*K_*/"TIMING"
comp_region
         ::= comp_region_start ( ( pt pt )+ | T_STRING )
comp_halo
         ::= '+' /*K_*/"HALO" halo_soft NUMBER NUMBER NUMBER NUMBER
halo_soft
         ::= /*K_*/"SOFT"?
comp_routehalo
         ::= '+' /*K_*/"ROUTEHALO" NUMBER T_STRING T_STRING
comp_property
         ::= '+' /*K_*/"PROPERTY" comp_prop+
comp_prop
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
comp_region_start
         ::= '+' /*K_*/"REGION"
comp_foreign
         ::= '+' /*K_*/"FOREIGN" T_STRING opt_paren orient
opt_paren
         ::= pt
           | NUMBER NUMBER
comp_type
         ::= placement_status pt orient
           | '+' /*K_*/"UNPLACED" ( pt orient )?
maskShift
         ::= '+' /*K_*/"MASKSHIFT" T_STRING
placement_status
         ::= '+' ( /*K_*/"FIXED" | /*K_*/"COVER" | /*K_*/"PLACED" )
weight   ::= '+' /*K_*/"WEIGHT" NUMBER
end_comps
         ::= /*K_*/"END" /*K_*/"COMPS"
nets_section
         ::= start_nets one_net* end_nets
start_nets
         ::= /*K_*/"NETS" NUMBER ';'
one_net  ::= net_and_connections net_option* ';'
net_and_connections
         ::= net_start
net_start
         ::= '-' net_name
net_name ::= T_STRING net_connection*
           | /*K_*/"MUSTJOIN" '(' T_STRING T_STRING ')'
net_connection
         ::= '(' ( T_STRING | '*' | /*K_*/"PIN" ) T_STRING conn_opt ')'
conn_opt ::= ( extension_stmt | '+' /*K_*/"SYNTHESIZED" )?
net_option
         ::= '+' ( ( net_type | /*K_*/"NOSHIELD" ) paths | /*K_*/"SOURCE" netsource_type | /*K_*/"FIXEDBUMP" | ( /*K_*/"FREQUENCY" | /*K_*/"WEIGHT" | /*K_*/"XTALK" | /*K_*/"ESTCAP" | /*K_*/"STYLE" ) NUMBER | ( /*K_*/"ORIGINAL" | /*K_*/"NONDEFAULTRULE" | /*K_*/"SHIELDNET" ) T_STRING | /*K_*/"PATTERN" pattern_type | /*K_*/"USE" use_type | /*K_*/"SUBNET" T_STRING comp_name* subnet_option* | /*K_*/"PROPERTY" net_prop+ )
           | vpin_stmt
           | extension_stmt
net_prop ::= T_STRING ( NUMBER | QSTRING | T_STRING )
netsource_type
         ::= /*K_*/"NETLIST"
           | /*K_*/"DIST"
           | /*K_*/"USER"
           | /*K_*/"TIMING"
           | /*K_*/"TEST"
vpin_stmt
         ::= vpin_begin vpin_layer_opt pt pt vpin_options
vpin_begin
         ::= '+' /*K_*/"VPIN" T_STRING
vpin_layer_opt
         ::= ( /*K_*/"LAYER" T_STRING )?
vpin_options
         ::= ( vpin_status pt orient )?
vpin_status
         ::= /*K_*/"PLACED"
           | /*K_*/"FIXED"
           | /*K_*/"COVER"
net_type ::= /*K_*/"FIXED"
           | /*K_*/"COVER"
           | /*K_*/"ROUTED"
paths    ::= path new_path*
new_path ::= /*K_*/"NEW" path
path     ::= T_STRING opt_taper_style* path_pt path_item_list
virtual_statement
         ::= /*K_*/"VIRTUAL" virtual_pt
rect_statement
         ::= /*K_*/"RECT" rect_pts
path_item_list
         ::= path_item*
path_item
         ::= T_STRING orient? ( /*K_*/"DO" NUMBER /*K_*/"BY" NUMBER /*K_*/"STEP" NUMBER NUMBER )?
           | /*K_*/"MASK" NUMBER ( T_STRING orient? ( /*K_*/"DO" NUMBER /*K_*/"BY" NUMBER /*K_*/"STEP" NUMBER NUMBER )? | /*K_*/"RECT" '(' NUMBER NUMBER NUMBER NUMBER ')' | path_pt )
           | virtual_statement
           | rect_statement
           | path_pt
path_pt  ::= '(' ( NUMBER | '*' ) ( NUMBER | '*' ) NUMBER? ')'
virtual_pt
         ::= '(' ( NUMBER | '*' ) ( NUMBER | '*' ) ')'
rect_pts ::= '(' NUMBER NUMBER NUMBER NUMBER ')'
opt_taper_style
         ::= opt_style
           | opt_taper
opt_taper
         ::= /*K_*/"TAPER"
           | /*K_*/"TAPERRULE" T_STRING
opt_style
         ::= /*K_*/"STYLE" NUMBER
opt_shape_style
         ::= '+' ( /*K_*/"SHAPE" shape_type | /*K_*/"STYLE" NUMBER )
end_nets ::= /*K_*/"END" /*K_*/"NETS"
shape_type
         ::= /*K_*/"RING"
           | /*K_*/"STRIPE"
           | /*K_*/"FOLLOWPIN"
           | /*K_*/"IOWIRE"
           | /*K_*/"COREWIRE"
           | /*K_*/"BLOCKWIRE"
           | /*K_*/"FILLWIRE"
           | /*K_*/"FILLWIREOPC"
           | /*K_*/"DRCFILL"
           | /*K_*/"BLOCKAGEWIRE"
           | /*K_*/"PADRING"
           | /*K_*/"BLOCKRING"
snets_section
         ::= start_snets snet_rule* end_snets
snet_rule
         ::= net_and_connections snet_option* ';'
snet_option
         ::= snet_width
           | snet_voltage
           | snet_spacing
           | snet_other_option
snet_other_option
         ::= '+' ( net_type spaths? | /*K_*/"SHIELD" T_STRING shield_layer | /*K_*/"SHAPE" shape_type | ( /*K_*/"MASK" | /*K_*/"FREQUENCY" | /*K_*/"WEIGHT" | /*K_*/"ESTCAP" | /*K_*/"STYLE" ) NUMBER | ( /*K_*/"POLYGON" T_STRING firstPt nextPt nextPt | /*K_*/"VIA" T_STRING orient_pt firstPt ) otherPts | /*K_*/"RECT" T_STRING pt pt | /*K_*/"SOURCE" source_type | /*K_*/"FIXEDBUMP" | /*K_*/"ORIGINAL" T_STRING | /*K_*/"PATTERN" pattern_type | /*K_*/"USE" use_type | /*K_*/"PROPERTY" snet_prop+ )
           | extension_stmt
orient_pt
         ::= ( /*K_*/"N" | /*K_*/"W" | /*K_*/"S" | /*K_*/"E" | /*K_*/"FN" | /*K_*/"FW" | /*K_*/"FS" | /*K_*/"FE" )?
shield_layer
         ::= spaths?
snet_width
         ::= '+' /*K_*/"WIDTH" T_STRING NUMBER
snet_voltage
         ::= '+' /*K_*/"VOLTAGE" T_STRING
snet_spacing
         ::= '+' /*K_*/"SPACING" T_STRING NUMBER opt_snet_range
snet_prop
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
opt_snet_range
         ::= ( /*K_*/"RANGE" NUMBER NUMBER )?
opt_range
         ::= ( /*K_*/"RANGE" NUMBER NUMBER )?
pattern_type
         ::= /*K_*/"BALANCED"
           | /*K_*/"STEINER"
           | /*K_*/"TRUNK"
           | /*K_*/"WIREDLOGIC"
spaths   ::= spath snew_path*
snew_path
         ::= /*K_*/"NEW" spath
spath    ::= T_STRING width opt_shape_style* path_pt path_item_list
width    ::= NUMBER
start_snets
         ::= /*K_*/"SNETS" NUMBER ';'
end_snets
         ::= /*K_*/"END" /*K_*/"SNETS"
groups_section
         ::= groups_start group_rule* groups_end
groups_start
         ::= /*K_*/"GROUPS" NUMBER ';'
group_rule
         ::= start_group group_member* group_option* ';'
start_group
         ::= '-' T_STRING
group_member
         ::= T_STRING
group_option
         ::= '+' ( /*K_*/"SOFT" group_soft_option* | /*K_*/"PROPERTY" group_prop* | /*K_*/"REGION" group_region )
           | extension_stmt
group_region
         ::= pt pt
           | T_STRING
group_prop
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
group_soft_option
         ::= ( /*K_*/"MAXX" | /*K_*/"MAXY" | /*K_*/"MAXHALFPERIMETER" ) NUMBER
groups_end
         ::= /*K_*/"END" /*K_*/"GROUPS"
assertions_section
         ::= assertions_start constraint_rules assertions_end
constraint_section
         ::= constraints_start constraint_rules constraints_end
assertions_start
         ::= /*K_*/"ASSERTIONS" NUMBER ';'
constraints_start
         ::= /*K_*/"CONSTRAINTS" NUMBER ';'
constraint_rules
         ::= constraint_rule*
constraint_rule
         ::= operand_rule
           | wiredlogic_rule
operand_rule
         ::= '-' operand delay_spec* ';'
operand  ::= ( /*K_*/"NET" | /*K_*/"PATH" T_STRING T_STRING T_STRING ) T_STRING
           | ( /*K_*/"SUM" | /*K_*/"DIFF" ) '(' operand_list ')'
operand_list
         ::= operand ( ','? operand )*
wiredlogic_rule
         ::= '-' /*K_*/"WIREDLOGIC" T_STRING opt_plus /*K_*/"MAXDIST" NUMBER ';'
opt_plus ::= '+'?
delay_spec
         ::= '+' ( /*K_*/"RISEMIN" | /*K_*/"RISEMAX" | /*K_*/"FALLMIN" | /*K_*/"FALLMAX" ) NUMBER
constraints_end
         ::= /*K_*/"END" /*K_*/"CONSTRAINTS"
assertions_end
         ::= /*K_*/"END" /*K_*/"ASSERTIONS"
scanchains_section
         ::= scanchain_start scan_rule* scanchain_end
scanchain_start
         ::= /*K_*/"SCANCHAINS" NUMBER ';'
scan_rule
         ::= start_scan scan_member* ';'
start_scan
         ::= '-' T_STRING
opt_pin  ::= T_STRING?
scan_member
         ::= '+' ( ( /*K_*/"START" | /*K_*/"STOP" ) T_STRING opt_pin | /*K_*/"FLOATING" one_floating_inst* | /*K_*/"ORDERED" one_ordered_inst* | /*K_*/"COMMONSCANPINS" opt_common_pins | /*K_*/"PARTITION" T_STRING partition_maxbits )
           | extension_stmt
opt_common_pins
         ::= ( '(' T_STRING T_STRING ')' ( '(' T_STRING T_STRING ')' )? )?
one_floating_inst
         ::= T_STRING floating_pins
floating_pins
         ::= ( '(' T_STRING T_STRING ')' ( '(' T_STRING T_STRING ')' ( '(' T_STRING T_STRING ')' )? )? )?
one_ordered_inst
         ::= T_STRING ordered_pins
ordered_pins
         ::= ( '(' T_STRING T_STRING ')' ( '(' T_STRING T_STRING ')' ( '(' T_STRING T_STRING ')' )? )? )?
partition_maxbits
         ::= ( /*K_*/"MAXBITS" NUMBER )?
scanchain_end
         ::= /*K_*/"END" /*K_*/"SCANCHAINS"
iotiming_section
         ::= iotiming_start iotiming_rule* iotiming_end
iotiming_start
         ::= /*K_*/"IOTIMINGS" NUMBER ';'
iotiming_rule
         ::= start_iotiming iotiming_member* ';'
start_iotiming
         ::= '-' '(' T_STRING T_STRING ')'
iotiming_member
         ::= '+' ( ( risefall ( /*K_*/"VARIABLE" | /*K_*/"SLEWRATE" ) NUMBER | /*K_*/"CAPACITANCE" ) NUMBER | /*K_*/"DRIVECELL" T_STRING iotiming_drivecell_opt )
           | extension_stmt
iotiming_drivecell_opt
         ::= iotiming_frompin /*K_*/"TOPIN" T_STRING iotiming_parallel
iotiming_frompin
         ::= ( /*K_*/"FROMPIN" T_STRING )?
iotiming_parallel
         ::= ( /*K_*/"PARALLEL" NUMBER )?
risefall ::= /*K_*/"RISE"
           | /*K_*/"FALL"
iotiming_end
         ::= /*K_*/"END" /*K_*/"IOTIMINGS"
floorplan_contraints_section
         ::= fp_start fp_stmt* /*K_*/"END" /*K_*/"FPC"
fp_start ::= /*K_*/"FPC" NUMBER ';'
fp_stmt  ::= '-' T_STRING h_or_v constraint_type constrain_what* ';'
h_or_v   ::= /*K_*/"HORIZONTAL"
           | /*K_*/"VERTICAL"
constraint_type
         ::= /*K_*/"ALIGN"
           | ( /*K_*/"MAX" | /*K_*/"MIN" | /*K_*/"EQUAL" ) NUMBER
constrain_what
         ::= '+' ( /*K_*/"BOTTOMLEFT" | /*K_*/"TOPRIGHT" ) row_or_comp_list
row_or_comp_list
         ::= row_or_comp*
row_or_comp
         ::= '(' ( /*K_*/"ROWS" | /*K_*/"COMPS" ) T_STRING ')'
timingdisables_section
         ::= timingdisables_start timingdisables_rule* timingdisables_end
timingdisables_start
         ::= /*K_*/"TIMINGDISABLES" NUMBER ';'
timingdisables_rule
         ::= '-' ( ( /*K_*/"FROMPIN" T_STRING T_STRING /*K_*/"TOPIN" | /*K_*/"THRUPIN" ) T_STRING T_STRING | /*K_*/"MACRO" T_STRING td_macro_option | /*K_*/"REENTRANTPATHS" ) ';'
td_macro_option
         ::= ( /*K_*/"FROMPIN" T_STRING /*K_*/"TOPIN" | /*K_*/"THRUPIN" ) T_STRING
timingdisables_end
         ::= /*K_*/"END" /*K_*/"TIMINGDISABLES"
partitions_section
         ::= partitions_start partition_rule* partitions_end
partitions_start
         ::= /*K_*/"PARTITIONS" NUMBER ';'
partition_rule
         ::= start_partition partition_member* ';'
start_partition
         ::= '-' T_STRING turnoff
turnoff  ::= ( /*K_*/"TURNOFF" turnoff_setup turnoff_hold )?
turnoff_setup
         ::= ( /*K_*/"SETUPRISE" | /*K_*/"SETUPFALL" )?
turnoff_hold
         ::= ( /*K_*/"HOLDRISE" | /*K_*/"HOLDFALL" )?
partition_member
         ::= '+' ( ( /*K_*/"FROMCLOCKPIN" | /*K_*/"TOCLOCKPIN" ) T_STRING T_STRING risefall minmaxpins | ( /*K_*/"FROMCOMPPIN" | /*K_*/"TOCOMPPIN" ) T_STRING T_STRING risefallminmax2_list | ( /*K_*/"FROMIOPIN" | /*K_*/"TOIOPIN" ) T_STRING risefallminmax1_list )
           | extension_stmt
minmaxpins
         ::= min_or_max_member* /*K_*/"PINS" T_STRING*
min_or_max_member
         ::= ( /*K_*/"MIN" | /*K_*/"MAX" ) NUMBER NUMBER
risefallminmax1_list
         ::= risefallminmax1*
risefallminmax1
         ::= ( /*K_*/"RISEMIN" | /*K_*/"FALLMIN" | /*K_*/"RISEMAX" | /*K_*/"FALLMAX" ) NUMBER
risefallminmax2_list
         ::= risefallminmax2+
risefallminmax2
         ::= ( /*K_*/"RISEMIN" | /*K_*/"FALLMIN" | /*K_*/"RISEMAX" | /*K_*/"FALLMAX" ) NUMBER NUMBER
partitions_end
         ::= /*K_*/"END" /*K_*/"PARTITIONS"
comp_name
         ::= '(' T_STRING T_STRING subnet_opt_syn ')'
subnet_opt_syn
         ::= ( '+' /*K_*/"SYNTHESIZED" )?
subnet_option
         ::= subnet_type paths
           | /*K_*/"NONDEFAULTRULE" T_STRING
subnet_type
         ::= /*K_*/"FIXED"
           | /*K_*/"COVER"
           | /*K_*/"ROUTED"
           | /*K_*/"NOSHIELD"
pin_props_section
         ::= begin_pin_props pin_prop_terminal* end_pin_props
begin_pin_props
         ::= /*K_*/"PINPROPERTIES" NUMBER opt_semi
opt_semi ::= ';'?
end_pin_props
         ::= /*K_*/"END" /*K_*/"PINPROPERTIES"
pin_prop_terminal
         ::= '-' T_STRING T_STRING pin_prop* ';'
pin_prop ::= '+' /*K_*/"PROPERTY" pin_prop_name_value*
pin_prop_name_value
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
blockage_section
         ::= blockage_start blockage_def* blockage_end
blockage_start
         ::= /*K_*/"BLOCKAGES" NUMBER ';'
blockage_end
         ::= /*K_*/"END" /*K_*/"BLOCKAGES"
blockage_def
         ::= blockage_rule rectPoly_blockage+ ';'
blockage_rule
         ::= '-' ( /*K_*/"LAYER" T_STRING layer_blockage_rule* | /*K_*/"PLACEMENT" placement_comp_rule* )
layer_blockage_rule
         ::= '+' ( /*K_*/"SPACING" | /*K_*/"DESIGNRULEWIDTH" ) NUMBER
           | mask_blockage_rule
           | comp_blockage_rule
mask_blockage_rule
         ::= '+' /*K_*/"MASK" NUMBER
comp_blockage_rule
         ::= '+' ( /*K_*/"COMPONENT" T_STRING | /*K_*/"SLOTS" | /*K_*/"FILLS" | /*K_*/"PUSHDOWN" | /*K_*/"EXCEPTPGNET" )
placement_comp_rule
         ::= '+' ( /*K_*/"COMPONENT" T_STRING | /*K_*/"PUSHDOWN" | /*K_*/"SOFT" | /*K_*/"PARTIAL" NUMBER )
rectPoly_blockage
         ::= /*K_*/"RECT" pt pt
           | /*K_*/"POLYGON" firstPt nextPt nextPt otherPts
slot_section
         ::= slot_start slot_def* slot_end
slot_start
         ::= /*K_*/"SLOTS" NUMBER ';'
slot_end ::= /*K_*/"END" /*K_*/"SLOTS"
slot_def ::= slot_rule geom_slot* ';'
slot_rule
         ::= '-' /*K_*/"LAYER" T_STRING geom_slot
geom_slot
         ::= /*K_*/"RECT" pt pt
           | /*K_*/"POLYGON" firstPt nextPt nextPt otherPts
fill_section
         ::= fill_start fill_def* fill_end
fill_start
         ::= /*K_*/"FILLS" NUMBER ';'
fill_end ::= /*K_*/"END" /*K_*/"FILLS"
fill_def ::= ( fill_rule geom_fill* | '-' /*K_*/"VIA" T_STRING opt_mask_opc* fill_via_pt ) ';'
fill_rule
         ::= '-' /*K_*/"LAYER" T_STRING opt_mask_opc_l* geom_fill
geom_fill
         ::= /*K_*/"RECT" pt pt
           | /*K_*/"POLYGON" firstPt nextPt nextPt otherPts
opt_mask_opc_l
         ::= fill_layer_opc
           | fill_mask
fill_layer_opc
         ::= '+' /*K_*/"OPC"
fill_via_pt
         ::= firstPt otherPts
opt_mask_opc
         ::= fill_via_opc
           | fill_viaMask
fill_via_opc
         ::= '+' /*K_*/"OPC"
fill_mask
         ::= '+' /*K_*/"MASK" NUMBER
fill_viaMask
         ::= '+' /*K_*/"MASK" NUMBER
nondefaultrule_section
         ::= nondefault_start nondefault_def+ nondefault_end
nondefault_start
         ::= /*K_*/"NONDEFAULTRULES" NUMBER ';'
nondefault_end
         ::= /*K_*/"END" /*K_*/"NONDEFAULTRULES"
nondefault_def
         ::= '-' T_STRING nondefault_option* ';'
nondefault_option
         ::= '+' ( /*K_*/"HARDSPACING" | /*K_*/"LAYER" T_STRING /*K_*/"WIDTH" NUMBER nondefault_layer_option* | ( /*K_*/"VIA" | /*K_*/"VIARULE" ) T_STRING | /*K_*/"MINCUTS" T_STRING NUMBER )
           | nondefault_prop_opt
nondefault_layer_option
         ::= ( /*K_*/"DIAGWIDTH" | /*K_*/"SPACING" | /*K_*/"WIREEXT" ) NUMBER
nondefault_prop_opt
         ::= '+' /*K_*/"PROPERTY" nondefault_prop*
nondefault_prop
         ::= T_STRING ( NUMBER | QSTRING | T_STRING )
styles_section
         ::= styles_start styles_rule* styles_end
styles_start
         ::= /*K_*/"STYLES" NUMBER ';'
styles_end
         ::= /*K_*/"END" /*K_*/"STYLES"
styles_rule
         ::= '-' /*K_*/"STYLE" NUMBER firstPt nextPt otherPts ';'
maliberty commented 2 years ago

That's clever. What do you propose we do with it?

There are places where it would be nice to inline the rules in the diagram, e.g. image image image

mingodad commented 2 years ago

I hope it'll help document the language and also debug/develop the grammar, you can download the railroad diagram and add to the documentation.

mingodad commented 2 years ago

Also notice that the railroad diagram is navigable so we can click on [spacing_type] to jump to it's definition, if the definition is not singular it always appear separated.

maliberty commented 2 years ago

If you compare the diagrams on https://www.json.org/json-en.html they are more readable. In general the reference manual gives a fuller definition and description.