if statement - Matching up Curly Brackets -
I have a hard time matching curly brackets in this code. This indicates an "other" error without an "if" error, but it is not certain how to read the syntax. If someone can help, it would be most appreciated here:
Private Zero Collection Factor () {Boolean its_a_variable = theInfo.isVar (); If (iDent (token)) {string identity = token; TheToken = t.token (); // var and const handle matters! IdentInfo theInfo = symTable.lookup (identity); } Boolean its_a_variable = theInfo.isVar (); Int theAddr = theInfo.getAddr (); Boolean isGlobal = theInfo.getIsGlobal (); Int constValue = theInfo.getValue (); If (its_A_V) {// pld12: Make this change !! Int theAddr = theInfo.getAddr (); Boolean isGlobal = theInfo.getIsGlobal (); If (theAddr == -1) T. Terror ("unannounced identifier is used in expr:" + similar); If (isGlobal) cs.emit (Machine.LOAD, theAddr); Else cs.emit (machine.load, AadR); } And {int constValue = theInfo.getValue (); If (costvalue = empty) t. Terror ("unannounced identifier is used in expr:" + ident); Else {cs.emitLOADI (theNumber); } And if (isNumber (theToken)) {int theNumber = new integer (theToken) .intValue (); Cs.emitLOADINT (thenumber); TheToken = t.token (); ) CompileExpr (;; else) (equal (theToken, "(")) {// Nothing to accept code to do so ("(")! Accept (")");} }
after it Edit: fixed and reindented another
a : <>
any other (ISNUMBER (theToken)) {int thenumber = new integer (theToken) .intValue (); cs.emitLOADINT (thenumber ); TheToken = t.token ();}
private zeros compileFactor () {if (isIdent (theToken )) {String Speaker = theToken; theToken = t .token (); / var and constants case handles IdentInfo theInfo = symTable.lookup (speaker); boolean its_a_variable = theInfo.isVar (); integer theAddr = theInfo.getAddr (); boolean isGlobal = theInfo.getIsGlobal (); Integer constValue = theInfo.getValue (); if (its_a_evable) {// pld12: change it !! Int theAddr = theInfo.getAddr (); boolean isGlobal = theInfo.getIsGlobal (); If (theAddr == -1) T. Terror ("unannounced identifier is used in expr:" + similar); If (isGlobal) cs.emit (Machine.LOAD, theAddr); Else cs.emit (machine.load, AadR); } And {int constValue = theInfo.getValue (); If (costvalue = empty) {t. Terror ("unannounced identifier is used in expr:" + ident); } And {cs.emitLOADI (theNumber); }}} And if (incarnation (token)) {int theNumber = NewToken ()} .intValue (); Cs.emitLOADINT (thenumber); TheToken = t.token (); ) CompileExpr (;; else) (equal (theToken, "(")) {// Nothing to accept code to do so ("(")! Accept (")");} }
Comments
Post a Comment