ispis parsera (pitanje za Profesora ili asistenta)
da li treba striktno da se drzimo toga da nam parser ispisuje onako kako je dato u primeru, ili se moze dodati jos poruka. Ne mislim na one koje svakako treba dodati, npr. nekorektna dodela, inkompatibilni tipovi i td, nego na poruke tipa Class ime_klase access, int varijable ime_prom access i slicno. ako ne treba "sarati izlaz" takvim porukama, recite mi, da bi ih izbacio.
u nastavku sledi primer izlaza:
D:\jcup>java parser 1.mj
Un not found
u1 is not Type
u1 already declared
Lookup at 251 (x) found Var x: int, 0, 1 int variable x access
Lookup at 261 (x) found Var x: int, 0, 1 int variable x access
Lookup at 261 (x) found Var x: int, 0, 1 int variable x access
Lookup at 271 (ch) found Var ch: char, 0, 1 char variable ch access
error, operand for ++ must be of integer type
Lookup at 281 (x) found Var x: int, 0, 1 int variable x access
Lookup at 281 (x) found Var x: int, 0, 1 int variable x access
Lookup at 281 (ch) found Var ch: char, 0, 1 char variable ch access
error, add operands must be of integer type
error, assignment of incompatible types
Lookup at 291 (x) found Var x: int, 0, 1 int variable x access
Lookup at 291 (x) found Var x: int, 0, 1 int variable x access
Lookup at 291 (ch) found Var ch: char, 0, 1 char variable ch access
error, mul operands must be of integer type
error, assignment of incompatible types
Lookup at 301 (nije_def) nije_def not found
found Var noObj: notype, 0, 0 error, assignment of incompatible types
Lookup at 311 (x) found Var x: int, 0, 1 int variable x access
Lookup at 311 (x) found Var x: int, 0, 1 int variable x access
Lookup at 311 (nije_def2) nije_def2 not found
found Var noObj: notype, 0, 0 error, add operands must be of integer type
error, assignment of incompatible types
Lookup at 321 (x) found Var x: int, 0, 1 int variable x access
Lookup at 321 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 321 (atribut1) found Fld atribut1: char, 0, 1
error, assignment of incompatible types
Lookup at 331 (x) found Var x: int, 0, 1 int variable x access
Lookup at 331 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 331 (i) i field not found
found Var noObj: notype, 0, 0
error, assignment of incompatible types
Lookup at 341 (x) found Var x: int, 0, 1 int variable x access
Lookup at 341 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 341 (atribut2) found Fld atribut2: int, 0, 1
Lookup at 351 (x) found Var x: int, 0, 1 int variable x access
Lookup at 351 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 351 (atribut3) found Fld atribut3: Arr of int, 0, 1
Lookup at 351 (x) found Var x: int, 0, 1 int variable x access
Array access
Lookup at 361 (ch) found Var ch: char, 0, 1 char variable ch access
Lookup at 361 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 361 (atribut3) found Fld atribut3: Arr of int, 0, 1
Lookup at 361 (x) found Var x: int, 0, 1 int variable x access
Array access
error, assignment of incompatible types
Lookup at 371 (fja1) found Meth fja1: int, 0, 1 [Var par1: int, 0, 1 ]Call to fj
a1()
Lookup at 381 (x) found Var x: int, 0, 1 int variable x access
error, Call to undefined method x()
Lookup at 391 (aa) aa not found
found Var noObj: notype, 0, 0 aa not found
error, Call to undefined method aa()
=====================SYMBOL TABLE DUMP=========================
(Level 0)
Type int: int, 0, 0
Type char: char, 0, 0
Con null: Class, 0, 0
Con eol: char, 10, 0
Meth chr: char, 0, 1 [Var i: int, 0, 1 ]
Meth ord: int, 0, 1 [Var ch: char, 0, 1 ]
Meth len: int, 0, 1 [Var arr: Arr of notype, 0, 1 ]
Prog P: notype, 0, 0
[Var a: int, 0, 1 ]
[Var b: int, 0, 1 ]
[Var c: Arr of int, 0, 1 ]
[Type Unutrasnja: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atribut2: int,
0, 1 ][Fld atribut3: Arr of int, 0, 1 ]]
[Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atribut2: int, 0, 1 ][F
ld atribut3: Arr of int, 0, 1 ]]
[Var u2: Arr of Class, 0, 1 ]
[Meth fja1: int, 0, 1 [Var par1: int, 0, 1 ]]
[Meth main: notype, 0, 1 [Var x: int, 0, 1 ][Var ch: char, 0, 1 ]]
[Meth metodaVracaIntParSuChariUnutrasnja: int, 0, 1 [Var par1: char, 0, 1 ][
Var par2: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atribut2: int, 0, 1 ][Fld
atribut3: Arr of int, 0, 1 ]][Var par3: Arr of int, 0, 1 ][Var par4: Arr of Clas
s, 0, 1 ]]
[Meth metodaVracaUnutrasnjaNemaPar: Class, 0, 1 [Fld atribut1: char, 0, 1 ][
Fld atribut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]]
u nastavku sledi primer izlaza:
D:\jcup>java parser 1.mj
Un not found
u1 is not Type
u1 already declared
Lookup at 251 (x) found Var x: int, 0, 1 int variable x access
Lookup at 261 (x) found Var x: int, 0, 1 int variable x access
Lookup at 261 (x) found Var x: int, 0, 1 int variable x access
Lookup at 271 (ch) found Var ch: char, 0, 1 char variable ch access
error, operand for ++ must be of integer type
Lookup at 281 (x) found Var x: int, 0, 1 int variable x access
Lookup at 281 (x) found Var x: int, 0, 1 int variable x access
Lookup at 281 (ch) found Var ch: char, 0, 1 char variable ch access
error, add operands must be of integer type
error, assignment of incompatible types
Lookup at 291 (x) found Var x: int, 0, 1 int variable x access
Lookup at 291 (x) found Var x: int, 0, 1 int variable x access
Lookup at 291 (ch) found Var ch: char, 0, 1 char variable ch access
error, mul operands must be of integer type
error, assignment of incompatible types
Lookup at 301 (nije_def) nije_def not found
found Var noObj: notype, 0, 0 error, assignment of incompatible types
Lookup at 311 (x) found Var x: int, 0, 1 int variable x access
Lookup at 311 (x) found Var x: int, 0, 1 int variable x access
Lookup at 311 (nije_def2) nije_def2 not found
found Var noObj: notype, 0, 0 error, add operands must be of integer type
error, assignment of incompatible types
Lookup at 321 (x) found Var x: int, 0, 1 int variable x access
Lookup at 321 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 321 (atribut1) found Fld atribut1: char, 0, 1
error, assignment of incompatible types
Lookup at 331 (x) found Var x: int, 0, 1 int variable x access
Lookup at 331 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 331 (i) i field not found
found Var noObj: notype, 0, 0
error, assignment of incompatible types
Lookup at 341 (x) found Var x: int, 0, 1 int variable x access
Lookup at 341 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 341 (atribut2) found Fld atribut2: int, 0, 1
Lookup at 351 (x) found Var x: int, 0, 1 int variable x access
Lookup at 351 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 351 (atribut3) found Fld atribut3: Arr of int, 0, 1
Lookup at 351 (x) found Var x: int, 0, 1 int variable x access
Array access
Lookup at 361 (ch) found Var ch: char, 0, 1 char variable ch access
Lookup at 361 (u1) found Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atr
ibut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]Class u1 access
Fiels lookup at 361 (atribut3) found Fld atribut3: Arr of int, 0, 1
Lookup at 361 (x) found Var x: int, 0, 1 int variable x access
Array access
error, assignment of incompatible types
Lookup at 371 (fja1) found Meth fja1: int, 0, 1 [Var par1: int, 0, 1 ]Call to fj
a1()
Lookup at 381 (x) found Var x: int, 0, 1 int variable x access
error, Call to undefined method x()
Lookup at 391 (aa) aa not found
found Var noObj: notype, 0, 0 aa not found
error, Call to undefined method aa()
=====================SYMBOL TABLE DUMP=========================
(Level 0)
Type int: int, 0, 0
Type char: char, 0, 0
Con null: Class, 0, 0
Con eol: char, 10, 0
Meth chr: char, 0, 1 [Var i: int, 0, 1 ]
Meth ord: int, 0, 1 [Var ch: char, 0, 1 ]
Meth len: int, 0, 1 [Var arr: Arr of notype, 0, 1 ]
Prog P: notype, 0, 0
[Var a: int, 0, 1 ]
[Var b: int, 0, 1 ]
[Var c: Arr of int, 0, 1 ]
[Type Unutrasnja: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atribut2: int,
0, 1 ][Fld atribut3: Arr of int, 0, 1 ]]
[Var u1: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atribut2: int, 0, 1 ][F
ld atribut3: Arr of int, 0, 1 ]]
[Var u2: Arr of Class, 0, 1 ]
[Meth fja1: int, 0, 1 [Var par1: int, 0, 1 ]]
[Meth main: notype, 0, 1 [Var x: int, 0, 1 ][Var ch: char, 0, 1 ]]
[Meth metodaVracaIntParSuChariUnutrasnja: int, 0, 1 [Var par1: char, 0, 1 ][
Var par2: Class, 0, 1 [Fld atribut1: char, 0, 1 ][Fld atribut2: int, 0, 1 ][Fld
atribut3: Arr of int, 0, 1 ]][Var par3: Arr of int, 0, 1 ][Var par4: Arr of Clas
s, 0, 1 ]]
[Meth metodaVracaUnutrasnjaNemaPar: Class, 0, 1 [Fld atribut1: char, 0, 1 ][
Fld atribut2: int, 0, 1 ][Fld atribut3: Arr of int, 0, 1 ]]
- References:
- Predaja domaceg
- From: "Jovan Popovic" <jovan@etf.bg.ac.yu>
- Re: Predaja domaceg
- From: mikee@isp.b92.net
- Predaja domaceg
- From: "Jovan Popovic" <jovan@etf.bg.ac.yu>
- Predaja domaceg
Previous by date: rok za predaju 3. domaceg zadatka...
Next by date: Re: rezultati 1. dela ispita
Previous by thread: DA NE BUDE NEJASNOCA! Next by thread: Re: Predaja domaceg
Previous by thread: DA NE BUDE NEJASNOCA! Next by thread: Re: Predaja domaceg