25using namespace tao::pegtl;
50template <
typename... EXCLUSION_RULES>
52 EXCLUSION_RULES...>>, any>{};
57template <
typename... EXCLUSION_RULES>
59 opt<LINE_CONTINUATION>> {};
65template <
char... CHAR_TO_FIND>
66struct spaced_ch : seq<star<WHITESPACE>, one<CHAR_TO_FIND...>>{};
71struct QUOTED_STRING : seq<one<'"'>, STRING_EXCLUDING<one<'"'>>, one<'"'>> {};
88 STRING_EXCLUDING<one<')'>>
103 STRING_EXCLUDING<seq<one<')'>, eolf>>
122 TAO_PEGTL_ISTRING( "FORMAT" ),
124 CURRENT_FORMAT_NUMBER,
146 HIERARCHY_CURRENT_NODE,
147 plus<WHITESPACE_OR_CONTINUATION>,
148 opt<HIERARCHY_PARENT_NODE>,
149 star<WHITESPACE_OR_CONTINUATION>,
151 star<WHITESPACE_OR_CONTINUATION>,
152 star<HIERARCHY_PART_NAME, star<WHITESPACE_OR_CONTINUATION>>,
184 opt<seq<spaced_ch<':'>, PART_VERSION>>,
185 opt<seq<spaced_ch<';'>, PART_DESCRIPTION>>,
220 TAO_PEGTL_ISTRING( "*VALUE"),
236 plus<WHITESPACE_OR_CONTINUATION>,
247 TAO_PEGTL_ISTRING( "*PNM"),
255struct PINLABEL : sor<QUOTED_STRING, STRING_EXCLUDING<WHITESPACE>> {};
259 plus<WHITESPACE_OR_CONTINUATION>,
270 TAO_PEGTL_ISTRING( "*PLB"),
271 plus<PINLABEL_ENTRY>,
282 plus<WHITESPACE_OR_CONTINUATION>,
284 plus<one<'='>, star<WHITESPACE_OR_CONTINUATION>, EQUIVALENT_PIN>
292 TAO_PEGTL_ISTRING( "*EQU"),
293 EQUIVALENT_PINS_GROUP,
294 star<one<','>, EQUIVALENT_PINS_GROUP>,
307 TAO_PEGTL_ISTRING( "*SYM"),
309 opt<SYM_ELEMENT_NAME>,
321 plus<WHITESPACE_OR_CONTINUATION>,
332 TAO_PEGTL_ISTRING( "*INT"),
343 TAO_PEGTL_ISTRING( "*EXT"),
357 plus<INTERNAL_SWAP_GATE>
369 plus<EXTERNAL_SWAP_GATE>
381 TAO_PEGTL_ISTRING( "*DFN"),
393 TAO_PEGTL_ISTRING( "*NGS"),
403 TAO_PEGTL_ISTRING( "*NPV"),
414 TAO_PEGTL_ISTRING( "*STM"),
427 TAO_PEGTL_ISTRING( "*MXP"),
441 TAO_PEGTL_ISTRING( "*SPI"),
443 opt<SPICE_PART_NAME>,
458 TAO_PEGTL_ISTRING( "*PAC"),
460 opt<ACCEPTANCE_PART_NAME>,
477 USER_PART_ATTRIBUTE_NAME,
479 USER_PART_ATTRIBUTE_VALUE,
492template<
char START_TOKEN>
521struct SCH_NAME : sor<QUOTED_STRING, STRING_EXCLUDING<spaced_ch<'('>>> {};
537 opt< one<'!'>, PIN_TYPE>,
538 opt< one<':'>, PIN_LOADING>
542struct PIN_LIST : plus<PIN_ENTRY, star<WHITESPACE>, opt<LINE_CONTINUATION>> {};
586 star<HIDDEN_PIN_ENTRY>
598 star<star<EMPTY_LINE>, HIERARCHY_NODE_ENTRY>,
608 opt<TAO_PEGTL_ISTRING( ".END"), opt<eol>>,
623struct VALID_HEADER : sor<FORMAT, seq< rep_max<5,EMPTY_LINE>, PART_HEADER>>{};
Empty line with whitespaces.
Grammar for CADSTAR Parts Library file format (*.lib).
Any text in the format can span multiple lines using '&'.
String inside quotation marks.
String inside single quotation marks.
String with optional line continuation and exclusion rules.
String inside brackets with preceding spaces, ending with EOL or EOF.
String inside brackets with preceding spaces.
String segment( no line continuation ), with exclusion rules.
Needed, because PEGTL "space" includes newline characters.
Control character with or without preceding whitespace.