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

📄 cocor.1

📁 COCO類似C的編譯器
💻 1
字号:
.TH COCOR 1 "local \- March 1996".SH NAMEcocor \- Compiler generator generator.SH SYNOPSIS.B cocor.I filename.atg[.I options]....br.SH DESCRIPTION.PP.I cocorreads a specification from.I filename.atgand generate a compiler (.I "scanner, parser and main module").SH OPTIONS.PP.B \-CGenerate complete compiler driving module, including source listingfeaturing interleaved error message reporting.  To use this option the file.I "COMPILER.FRM"(or.I "<grammar>.FRM") must be available..sp.B \-DGenerate Source line number .I "(#line)"for each semantic action. This causes the semantic actions in the generatedC program to be labelled with reference to the original .ATG file, so thatone can use a symbolic debugger on the .ATG file..sp.B \-L.I "(Listing)"Force listing (Normally the listing of the grammaris suppressed if the compilation is error free)..sp.B \-P.I "(Parser only)"Suppress generation of the scanner.As with the regeneration of the definition modules, regenerationof the scanner is often tedious, and results in no changes fromthe one first generated.  This option must be used with care.  It canalso be used if a hand crafted scanner is to be supplied (seethe notes on the use of hand crafted scanners in the file COCOL)..sp.B \-T.I "(Tests)"Suppress Generation of Scanner and Parser.  (If this optionis exercised, the generation of the scanner and parser is suppressed,but the attributed grammar is parsed and checked for grammaticalinconsistencies, LL(1) violations and so on)..sp 2The following options are really intended to help with debugging/teachingapplications.  Their effect may best be seen by judicious experimentation..sp 2.B \-ATrace automaton.sp.B \-FGive Start and Follower sets for each non-terminal in the grammar.sp.B \-GPrint top-down graph.sp.B \-SPrint symbol table.PPWhen using Coco/R, the frame files .I "SCAN_C.FRM"and.I "SCAN_H.FRM"and.I "PARSER_C.FRM"and.I "PARSER_H.FRM"must exist in the current directory, orin the directories specified by the environment variable.I CRFRAMES..SH GRAMMAR TESTS.PPCoco/R performs several tests to check if the grammar is well-formed.  If oneof the following error messages is produced, no compiler parts are generated..PP.B  NO PRODUCTION FOR X.brThe nonterminal.I X has been used, but there is no production for it..PP.B  X CANNOT BE REACHED.brThere is a production for nonterminal.I X,but.I X cannot be derived from the start symbol..PP.B  X CANNOT BE DERIVED TO TERMINALS.brFor example, if there is a production.br.sp.DS.I      X = "(" X ")" ..I      X = Y..I      Y = X..DE.sp.I Xand.I Yare nonterminals with circular derivations..PP.B "TOKENS X AND Y CANNOT BE DISTINGUISHED".brThe terminal symbols.I Xand.I Yare declared to have the same structure,.br.sp.DSe.g.:.I          integer = digit { digit } ..I          real = digit { digit } ["." { digit } ]..DE.spIn this example, a digit string appears ambiguously to be recognized asan integer or as a real..PPThe following messages are warnings.  They may indicate an error but they mayalso describe desired effects.  The generated compiler parts may still bevalid.  If an .I "LL(1) error" is reported for a construct.I "X", one must be aware thatthe generated parser will choose the first of several possible alternatives for.I X..PP.B "X NULLABLE".br.I Xcan be derived to the empty string, e.g..I "X = { Y }" ..PP.B "LL(1) ERROR IN X:Y IS START OF MORE THAN ONE ALTERNATIVE".brSeveral alternatives in the production of.I Xstart with the terminal.I Y.br.DSe.g.:.I       Statement = ident ":=" Expression.I                 | ident [ ActualParameters ] ..DE.PP.B "LL(1) ERROR IN X:Y IS START AND SUCCESSOR OF NULLABLE STRUCTURE".brNullable structures are .B "[ ... ]"and.B "{ ... }".br.DSe.g.:.I       qualident = [ ident "." ] ident ..I       Statement = "IF" Expression "THEN" Statement .I                   [ "ELSE" Statement ] ..DE.spThe.I ELSEat the start of the else part may also be a successor of astatement.  This LL(1) conflict is known under the name.I "dangling else"..SH "SEE ALSO"Moessenboeck, H., .I "A Generator for Fast Compiler Front-Ends."Report 127, Dept. Informatik, ETH Zurich.BR (1990).PPMoessenboeck, H., .I "A generator for production quality compilers."Proc 3rd Int'l Workshop on Compiler-Compilers, Schwerin FRG,.BR 1990.SH BUGSMail bug reports to:.spC Version:              Frankie Arzu (farzu@uvg.edu.gt)

⌨️ 快捷键说明

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