Java虚拟机的说明书.docx
《Java虚拟机的说明书.docx》由会员分享,可在线阅读,更多相关《Java虚拟机的说明书.docx(25页珍藏版)》请在课桌文档上搜索。
1、renewcommandsectionnamePftA1phsectionXrenewcommandXsectionformatflushleft)Xsetcountersection0%newpage%appendixsection语法图beginfigurehtpbXincludegraphicsDiasProgram)caption主程序endfigurebeginfigurehtpbXincludegraphicsDiasConstantsDeclcaption定义常量endfigure)beginfigurehtpbincludegraphicsDias/ConstantDecl)c
2、aption定义一个常量endfigurebeginfigurehtpbXincludegraphicsDiasVarsDeclcaption变量定义)endfigure)beginfigurehtpbXincludegraphicsDiasVarsDeclOneType)caption卜一种类型变量定义endfigurebeginfigurehtpbXincludegraphicsDiasVar1.istcaption变量列表endfigure)beginfigurehtpbinc1udegraphicsDiasType)caption类型endfigurebeginfigurehtpbXi
3、ncludegraphicsDiasProcsDeclcaption过程/函数定义endfigure)beginfigurehtpbincludegraphicsDias/ProcedurcDec1)caption过程定义endfigurebeginfigure)htpbincludegraphicsDias/FunctionDecl)caption函数定义endfigure)beginfigurehtpbXincludegraphics(DiasZStatementBlock)caption语句块endfigurebeginfigurehtpbXincludegraphicsDiasFnct
4、ionCallcaption函数调用XincludegraphicsDiasIfStatement)captiontextttif语句endfigure)beginfigurehtpbXincludegraphicsDiasWhiIeStatement)captiontextttwhile语句endfigurebeginfigurehtpbincludegraphicsDiasForStatemcnt)captiontextttfor语句endfigure)beginfigurehtpbXincludegraphicsDiasNewarraycaptiontextttNewarray)语句en
5、dfigurebeginfigurehtpbXincludegraphicsDiasRetUrnStatement)captiontextttreturn)语句endfigure)beginfigure)htpbXincludegraphicsDiasSystemCall)caption系统调用endfigure)beginfigure)htpbincludegraphicsDias/Statement)caption语句)endfigure)newpagesection属性翻译文法)先阅读时请参阅用BNF描述的JP1.z语法bcgintabularhtbpccccclhline语法成分&属性
6、&来自&类型&语义动作&位置hline主程序&程序名&标识符&综合&填入全局表&标识符之后Wcline2-6&主代码&语句块&综合&填入全局表&语句块之后hline常量定义)&名称&标识符&综合&填入全局表&识别出字面cline2_4&类型&Type&综合&量之后cline2-4&值&1.iteral&综合&hline变量定义&变量数量&一类变量定义&综合&根据是否全局)&全部识别完后W&相加&填符号表&OWcline2-4&各变量&一类变量定义&综合&)W&含类型&Wcline2-4&是否全局&上层结构&继承&Whline一类变量&变量列表&(Var1.ist)&综合&(cline(2-4定
7、义&类型&Type&综合&hline变量列表&变量名列表&标识符&综合&Whline多个过程&代码&一个过程定义&综合&完成代码&识别出一个&过程定义之后hline过程定义&名称&标识符&综合&填全局表&识别出右括号后Wcline2-4&参数&前一个变量定义&综合&Wcline26)&参数个数&前一个变量定义&综合&续填全局表&识别出后一个cline2-4)&本地变量&后一个变量定义&综合&变量定义之后Wcline2-4&本地变量个数&两个变量定义&综合&变量数量之和&cline2-6&代码&语句块&综合&填表&识别出语句块后hline函数定义&名称&标识符&综合&填全局表&识别出类型后Wcl
8、ine2_4&参数&前一个变量定义&综合&Wcline2-4&参数个数&前一个变量定义&综合&1&cline(2-4&返回值类型&Type&综合&cline2-6)&本地变量&后一个变量定义&综合&续填全局表&识别出后一个Wcline2_4&本地变量个数&两个变量定义&综合&变量定义之后&变量数量之和&Wcline(2-6&代码&语句块&综合&填表&识别出语句块后hline语句块&代码&语句&综合&hline语句&代码&下层结构&综合&W&表达式、子语句&W&textttifwhilefor语句&)&是由它们的子&W&语句拼装起来的。&Whline表达式&代码&分析过程&综合&Whlineen
9、dtabular)section错误信息表bcgindescription)itemtextttNeeda在处理赋值时,没有发现:=;)itemtextttTypeConfliCt.某项类型检查没有通过;!itemtextttUsearraywithindex.在赋值语句中,发现数组没有下标;itemtextttIthinkyouwantdeclareaconst,butwhat,sitname?在应当出现常量定义时,没有发现标识符;itemtextttYoushoulduse,=,insteds.试图用赋值号定义常量;这个错误不会导致跳过;itemtextttYoushoulduse=.在常
10、量定义中,没有发现等号或赋值号;)itemtextttThisisnotatypeiveeverknown:XXXXXX不是一个类型名称;itcmtextttifthereisnoIdontknowwhatyouwanttodo.在常量定义中没有发现冒号;itemtextttifitISaconst,declareitbefore:XXXXXX这个标识符不是预先定义过的常量;)itemtextttIwantaliteral,notaTYPE等号后的不是标识符,也不是字面量;itemtexttt1thinkyourconstantdecishouldbeendhere.常量定义不正确的结束;it
11、emtexttttypenotsame:wantTYPElfound:TYPE2欲定义常量的值与刚才声名的不同,应为TYPEl,实为TYPE2;itemtextttWehaveaNAMEalready.名字冲突;itemtextttXXXisnotaConStand.欲用一个非常量的标识符给常量定义。在约定先定义常量后,这个信息已不可能出现;itemtextttConstsDeclendincorrectly.全部常量定义不正确的结束;itemtextttNeedFilCnamC.(没有在命令行给出欲编译的文件名;itemtextttUnknownargument:XXXXXX不是合法的参数。
12、目前只有textttdebug可以作为合法的参数。itemtextttExpressionfailed.(表达式处理失败。这将导致编译过程中止;)itemtextttArrayindexmuststartWith在表达式中使用数组而不带下标;)itemtextttIndexmustbeinteger.数组下标不是整数;itemtextttIndexmustbeendWith下标应以结束itemtextttTheremustbeaintegerorfloatexpression.在FOr循环中循环变量应该是整型、初值、终值应该是整型或符点型f。UlOte一般情况下,将符点型表达式赋值给整形变量是
13、不被允许的,但在For语句中符点型的循环初值与终值会自动转换成整型;itemtextttForstatementneedanIntegerVariabIe.循环变量必须是整型footnote不能是数组元素;itemtextttNotavalidnameofafunction.函数名不合法;将为它指定一个texttt*nothisProCedUre*的名字使分析继续;itemtextttIcannotseea(,thatcantellmeyouwi11startaparamlist.)itemtextttputa()eventhereisnoParamter.需要参数列表;JP1.z和Pasca
14、l不同,即使没有参数也要带有左右括号;itemtextttIwanta,),toendyourparalistbutfoundaTYPE没有找到标识参数列表结束的右括号,值找到了TYPE;itemtextttFunctiondeciendincorrectly.函数定义不正确的结束;itemtextttProceduredeciendincorrectly.过程定义不正确的结束;itemtextttIneedareuturntype.函数定义需要返回值类型;itemtextttTheremustbeabeforereturntype.返回值类型前应有、:;itemtextttCannotret
15、urnString不能返回String、类型,字符串都是常量;itemtextttIwantabooleanexpression.(If表达式需要布尔型的条件表达式;itemtextttThenwhat?)找到了Then,但Then后面没有语句;itemtextttIfStatmcntendincurrectly.If”语句不正确的结束;itemtextttTheremayshouldbeanelse.编译器判定需要有Else子句;itemtextttTheremustbeaintegerexpressioninindex.Newarray一语句需要一个整型表达式;itemtextttarra
16、ynameinvalid.Newarray”语句中数组名非法;itemtextttnewarrayxx:=integer3.中间的符号应该是赋值号;itemtextttXXXNotavalidtype.XXX”不是合法的类型;itemtextttNeeda.(需要左方括号;itemtextttNeeda.需要右方括号;itemtextttXXXnotanarray.XXX不是一个数组;)itcmtextttProgrmshouldbeginwithmain.(程序应该以main开始;)itemtextttWhat,syourprogram,sname?没有程序名;itemtexttt1.ost
17、SeIniCOlon.丢失分号;itemtextttConstandvarsmustdeclarebeforefuncsandprocs.应该按常量、全局变量、函数/过程的顺序;itemtexttt1thinkthereshouldhaveaBEGINtobeginmainprogram.)S有标识主程序开始的BEGIN;itemtextttprocorfuncdeciendincurrectlywithXXX)(全部过程/函数的定义以XXX结束,不正确;itemtextttReturntypeisdifferentfromdeclaraed.返回值类型和定义的不符;itemtextttGiv
18、emeareturnVaIUe.函数返回没有返回值;itemtexttt1DontknowthisIdentifier:XXX在语句中出现了未定义的标识符;)itemtextttHaveyouforgetthatisaCOnStant?试图给常量赋值;itemtextttStatementstartincorrectly.语句开始不正确;itemtextttStatementendincorrectly.语句以不正确的符号结束;itemtextttUsearraywithindex.赋值中使用数组而不带下标;itemtextttFunctionorproceduremuststartwithb
19、eginnotXXX(必须出现语句块的地方出现了XXX而不是BEGINfootnote出现这个错误,编译将终止,否则会出现大量无意义的错误报告。;itemtextttWant,end,toendstatementblock.语句块没有以、END结束;itemtextttUse:JP1.o.PRINTINT(x).使用系统调用的格式不正确;ilemtextttVarDeclOneTypeEndIncorrectly.一类变量的定义结束不正确;itemtexttt,z,exceptedbutXXXfound.定义变量需要itemtextttIwantyoutellmethetypebutfound
20、XXX应该出现类型的位置出现了XXX;itemtextttThereisnoStringvarinjp】O.试图定义字符串变量;itemtextttInvalidVar1.ist)(非法的变量列表;itemtexttt,)for,expectedbut+Type+FOUnd.变量列表结束不正确;!itemtextttyouwantdeclareVarsbutidon,tknowhowtostartwithXXX找到了Var关键字,但后续符号不是标识符;itemtextttVarsdeciendincorrectly.变量的定义不正确的结束;itemtextttyourvar,sNameshou
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Java 虚拟机 说明书

链接地址:https://www.desk33.com/p-1415105.html