⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 編譯器的辭法分析器工具
💻
字号:
------------------------------------------------------------------------This is the 2.42 release of PRECCX  (README)                 August 1994Peter T. Breuer   <ptb@eng.cam.ac.uk,ptb@comlab.ox.ac.uk,ptb@dit.upm.es>------------------------------------------------------------------------ INTRODUCTION:  PRECCX is an infinite-lookahead compiler compiler for context  dependent attributed grammars. Copyright P.T. Breuer, 1989-1994.Compiler compilers aren't that easy to describe! You ought to havesome familiarity with the UNIX yacc utility, or GNU's bison under DOS,in order to figure out what to do with PRECCX and why. This documentwill genenerally assume that you know the basics, but still ... acompiler compiler converts a high-level script into low level sourcecode. The script defines a language and the source code implements aparser for that language. The parser may execute actions - in whichcase the compiler compiler has compiled an interpreter - or it maybuild complex structures such as further source code - in which casethe compiler compiler has compiled a compiler.So a compiler compiler provides an easy path to the construction of acomplex utility. Just specify the language and some associated actionsand structures and let the compiler compiler build the source for you.Why the new release of PRECCX?This release fixes a few bugs from the 2.40 alpha release of the 2.4xdevelopment line, and includes more technical improvements. The newfunctionality sketched in in 2.40 and beta-ed in 2.41 has finally beencompleted and tested successfully.  On the technical front, the backend has shifted from interpretation to compilation for the runtimemachine, resulting in increased robustness. As far as theory goes, theextra functionality of 2.42 over the 2.3x series now permits seamlessmixing of synthetic and inherited parameters. (This facility\x is apowerful(x) !!)          --------------------------------(README) CONTENTS:          INTRODUCTION ........  What you just read.          CONTENTS ............  Where you are.          DIFFERENCES .........  For those who are upgrading -          NEW .................  and those who are thinking of it.          TESTING .............  A word on operating systems.          INSTRUCTIONS ........  What to do next.          --------------------------------DIFFERENCES: This release should be upwardly compatible with the 2.3xline except in the following respects. The first three provisos relateto the yacc-style $1, $2, $3, ... numbered attribute referencesrequired by 2.3x and which are now obsoleted in favour of $foo namedreferences:1) use the -old switch while running precc over these old scripts;2) don't use $0 or lower references;3) don't use $$ (this is a _big_ change - see below);4) you now have to put { } tightly round actions. E.g.   @ foo = bar {: gum :}This is to avoid conflicts with C code ":"s in the gum part.          --------------------------------NEW:     1)  !{handler}                          ********* error handling         2)  sum = term\x <'+'> term\y {: printf("%d",$x+$y); :}                          ********* named attribute references         3)  prod = term\x term\y {@ $x*$y @}                          ********* inline attribute synthesis1) The backtracking  error handler construct tells precc where to branch to in case of an  attempt to  backtrack  across  the !  mark.  The handler parser  should  eat  tokens and branch to a standard  parser when it thinks it has found something standard.This is implemented extremely efficiently internally - no worriesabout C stack buildup, so use with impunity.2) The new attribute style has permitted the run-time attribute stackto be dispensed with (see the manual). This saves RAM. The call_modeparameter is now obsolete (it was anyway for users - the default wasnever changed in practice). I think the style also looks better!3) It is now generally impossible to make assignments to attributesfrom within actions along yacc lines using {: $$=foo; :} becauseattributes are now being built and used earlier: during the parse,when they can be most useful, and this takes place before actions areexecuted. So yacc-style writes to attributes from within actions haveno effect. You have to use the new {@ foo @} notation instead. The -old switch is an attempt to continue to support the yacc-style$1, $2, $3, etc. attribute dereferences as far as possible. Itgenerates nasty code and it is preferable to convert scripts to the newstyle of named attributes and dereferences instead! Note that there isno longer support for the $$ yacc-style attribute target in actions.          --------------------------------TESTING: I have done much preliminary testing on HP-UX with c89, sunOSUNIX with gcc and MSDOS with BorlandC/TurboC v2.0, building multi-stageprojects of various sizes. See history.txt. PRECCX is not certified foranything else but only because I do not have direct access to anythingelse. Reports say it seems to work on almost any system with ANSI C,modulo the occasional renaming of include files.          --------------------------------INSTRUCTIONS: If you are using UNIX, unpack the source code and makefiles(see the PACKING.LST), run `make', then read the preccx.1 manual in theusual way. That means, either `nroff -man preccx.1 |more' or put preccx.1in one of your manual directories (/usr/local/man/manl) and `man preccx'.If you are using DOS then place all the distribution files in one directoryand run INSTALL.EXE. Further instructions for DOS follow. -- Peter T. Breuer------------------------------------------------------------------------    This is the PRECCX distribution for DOS. Version 2.42.------------------------------------------------------------------------PRECCX is an infinite-lookahead compiler compiler for context dependentgrammars.To install, copy ALL the files in this directory or archive to a disketteor DOS directory and then run INSTALL.EXE. The install instructions areviewable in the install.001/CFG file.The choices you make in the install routines cause various targetdirectories to be built and some of the .ZIP archives to be copiedacross and `unzipped' to them. If you don't believe me, use a viruschecker, or do the unpacking yourself. PRECCX is packaged usingInfo-ZIP's compression utility and the installation program uses UnZipto read the archives. Info-ZIP's software (Zip, UnZip and relatedutilities) is free and can be obtained ubiquitously as source code orexecutables at anonymous-ftp sites, including ftp.uu.net in directory/pub/archiving/zip, and src.doc.ic.ac.uk in directory/computing/systems/msdos/simtel/zip (for example). The list of archived files is in PACKING.LST. This is the pattern:README      = this file                 -> HOME    directoryINDEX       = this list                 -> HOME    directoryPACKING.LST = a more detailed list      -> HOME    directorypreccxx.zip = executables               -> BIN     directorypreccxl.zip = compiled libraries        -> LIB     directorypreccxd.zip = manuals                   -> MAN     directorypreccxi.zip = C header files            -> INCLUDE directorypreccxe.zip = examples                  -> EXAMPLE directorypreccxn.zip = life cycle documentation  -> DOC     directorypreccxs.zip = source code and makefiles -> SRC     directoryIf automatic installation does not work, read INSTALL.INS.  In fact, youought to read it anyway to see exactly what should have been installed.After installation, you should run  README.EXE in the manuals directory.Then look at the example scripts & check that they compile.  See RUN.INSin the the root directory for some very direct advice.------------------------------------------------------------------------Peter T. Breuer   <ptb@eng.cam.ac.uk,ptb@comlab.ox.ac.uk,ptb@dit.upm.es>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -