XYACC(1)

πŸ“¦
version 2.18.1 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– XYACC(1) β€” the IRAF commands girlie πŸ’–

okay so bestie, welcome to xyacc, aka the SPP modified yacc compiler compiler from the IRAF fam. yes it's a compiler compiler. yes that's a real job title. she's giving toolchain royalty and honestly? she earned it. πŸ‘‘


✨ SYNOPSIS ✨

xyacc [options] file

πŸŽ€ OPTIONS πŸŽ€

  • -b file_prefix β€” tells her what file_prefix to use for the output files. like a little name tag for your babies. 🏷️
  • -d β€” she'll also pop out a header file called y.tab.h. bonus content, no cap.
  • -l β€” pls do NOT generate '#line' directives. she's on a diet. πŸ™ˆ
  • -P parser β€” pick your parser file. default is boot$xyacc/yaccpar.x if you don't say anything.
  • -Q(y/n) β€” the version stamping flag, bestie. -Qy puts the version stamping info into y.tab.c, so you can always know exactly which version of yacc built that file (receipts! 🧾). -Qn β€” which is the default, fyi β€” writes no version info at all. mysterious. elusive. she said no paparazzi.
  • -t β€” compiles runtime debugging code by default. debugging mode: ON, always, 24/7. πŸ’…
  • -v β€” prepares the file y.output, which contains a description of the parsing tables plus a whole report on conflicts generated by ambiguities in the grammar. it's giving drama recap. πŸ“
  • -V β€” outputs version information and dips. bye!! πŸ‘‹
  • -Y dir β€” specify the location of yaccpar.x. default is boot$xyacc.

🌸 DESCRIPTION 🌸

So the yacc command converts a context-free grammar into a set of tables for a simple automaton that executes an LALR(1) parsing algorithm. the grammar is allowed to be ambiguous β€” she's not judging β€” and specified precedence rules are what get used to break those ambiguities. slay.

This particular one is a version of yacc that has been modified to produce SPP language parsers. for the most part she should follow the operation of standard yacc, with the differences noted below. (yes, the DIFFERENCES section. we're getting there. patience, babe. 🧘)

Input files should follow the yacc convention of ending in .y. that's the vibe check. βœ…


πŸ’€ DIFFERENCES πŸ’€

  1. The Yacc input syntax is unmodified, except that the comment convention is now as in SPP rather than C β€” so use #, rather than /*..*/. (iconic honestly. C comments could never.) All defines, actions, etc. are of course given in the SPP language.
  2. The Yacc output file is "ytab.x", rather than "y.tab.c". the token defs file "y.tab.h" now contains SPP defines rather than C #defines. and the states file "y.output" is completely unmodified β€” untouched, unbothered, in her own lane. 🌈
  3. The global declarations section %{ .. %} had to be changed somewhat because SPP does not have global variables. so the section is now divided into two subsections. the first is for global defines, includes, etc. which go into the header area of the ytab.x file. then follows a %L, telling Yacc that the local declarations for the parser procedure follow. this second section should contain variable and function declarations required for the user supplied actions (those are the code fragments to be executed when a rule of the grammar is recognized) in the yyparse procedure.
  4. The global declarations section MUST contain the following two defines. like, mandatory. non-negotiable. periodt.
    • YYMAXDEPTH β€” the depth of the parser stacks; determines the maximum complexity of a language construct which can be parsed. a typical value is 150.
    • YYOPLEN β€” the length, in struct units, of a token operand value structure. you define the operand structure to be whatever you wish; all the parser needs to know is how big an element is. the lexical analyzer and the actions β€” both of which are supplied by the user β€” use the operand structure for communications. Operand structures are always referred to by a Mem pointer.
🫢 heads up bestie: those two defines aren't optional, they're the whole personality of the global declarations section. skip them and she simply will not function.

πŸ‘€ SEE ALSO πŸ‘€

yacc(1), xpp(1), rpp(1). the whole friend group. go say hi. πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

This manual page was written by Zed Pobre <zed@debian.org>, for the Debian GNU/Linux system (but may be used by others). it includes text from the README file for xyacc in the IRAF sources. credit where credit is due, always. πŸŽ€


and that's the whole page, bestie!! this one's from IRAF 2.17, dated June 2021 β€” so go forth, build those SPP parsers, and remember: # comments only, YYMAXDEPTH and YYOPLEN in the global declarations, no cap. you're gonna eat this grammar up fr fr βœ¨πŸ’–β­

πŸ“¦ where this page comes from