From a990164035840726f1c378407be8161aba25a660 Mon Sep 17 00:00:00 2001 From: niklasBr <104077966+bretzNiklas@users.noreply.github.com> Date: Wed, 28 Dec 2022 18:00:36 +0100 Subject: [PATCH] Added print while to main to print whole ausdruck --- Aufgabe4/main.java | 38 +++++++++++++++++++++++++++-- out/production/inf3_git/main.class | Bin 1429 -> 1419 bytes 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Aufgabe4/main.java b/Aufgabe4/main.java index 5c9c610..c31295b 100644 --- a/Aufgabe4/main.java +++ b/Aufgabe4/main.java @@ -20,12 +20,35 @@ public class main { AstExpression result = p.parse(lexer.lex(ausdruck)); + do { + + System.out.println( ((AstValue) result.astBinaryOp.binaryOp[0]).astNumber.astDigitWoz.astDigitWozContent ); + System.out.println( ((AstOperator) result.astBinaryOp.binaryOp[1]).astOperator ); + + if(result.astBinaryOp.binaryOp[2].getClass() == AstValue.class) { + + System.out.println( ((AstValue) result.astBinaryOp.binaryOp[2]).astNumber.astDigitWoz.astDigitWozContent ); + break; + + } else { + + result = (AstExpression) result.astBinaryOp.binaryOp[2]; + + } + + + + } while ( true ); + + +/* + System.out.println( ((AstValue) result.astBinaryOp.binaryOp[0]).astNumber.astDigitWoz.astDigitWozContent ); System.out.println( ((AstOperator) result.astBinaryOp.binaryOp[1]).astOperator ); - // System.out.println( ( result.astBinaryOp.binaryOp[2]).getClass() ); + //------------------- AstExpression root = (AstExpression) result.astBinaryOp.binaryOp[2]; @@ -33,8 +56,19 @@ public class main { System.out.println( ((AstOperator) root.astBinaryOp.binaryOp[1]).astOperator ); - System.out.println( ((AstValue) root.astBinaryOp.binaryOp[2]).astNumber.astDigitWoz.astDigitWozContent ); + //--------------------- + + AstExpression root2 = (AstExpression) root.astBinaryOp.binaryOp[2]; + + System.out.println( ((AstValue) root2.astBinaryOp.binaryOp[0]).astNumber.astDigitWoz.astDigitWozContent ); + + System.out.println( ((AstOperator) root2.astBinaryOp.binaryOp[1]).astOperator ); + + System.out.println( ((AstValue) root2.astBinaryOp.binaryOp[2]).astNumber.astDigitWoz.astDigitWozContent ); + + +*/ } } diff --git a/out/production/inf3_git/main.class b/out/production/inf3_git/main.class index 274c9dc70fb7124b56b29c31600ddfaac7e9ea12..34f015961d234aada263f437f97ce1152c741a42 100644 GIT binary patch delta 419 zcmYk1%}WAN6vcm|GfiqiX7)iTQ*9D4K@Gy7r9@C#_WeDYh-DUHE{m2CgkkMk*V-6d zx9GoWVRvj%@4<cVo_pRo=e>9yJdH*FP|S!JaU*Ob<eWDmF~bPQTT8DFr%t-*a(->~ zXKQBue8s%lFmvUC&bCfYVc^WHo6)jaDMqukYN=9GaAz;CtNB8zR4ypEF3eJ8)+RB@ zDh}-BKtZENYNn~E!|^r2><*l)OYQ64HL`3-=OWFf%>^YP3{9}-=CYc(9aAj=7Smd+ z&GKOAjj0bt{=iQ{7GaC1#ax?(cl`fn!KC`$d2Dq}?Eo>cg<dgm<H3thc92n$jEVI) zIRe}Wa>o=6W@u7e>ZVQnCSr^2uGkYhq$ID0dv@8A-}>ayJ_jNlq|PBns2mG-0%u1c YP3J_%)N$$b=>qUg&MOLe;W#+`0luL|ga7~l delta 423 zcmZ9I%}N4s6vclt&Qv<CvJfF{LIh1hu-a%C5fnwFY1)^4j23}Jf=H{N2M8jNcI|2% z7{jy+gI=ST=n1;&Lg~M_U+0|5x&M3P$#~3o+(~oJoHyg<Lc8#+Mm#K$^|DM(VKTZ^ zvu>=!m34iY$X03>)n+<Y8YSQQRljwuQLi^!Kd!0r4l3QJqM$P(u^?SSvLacZ{Xl8= z;9ZGb7+e%3diw-Q>`CV)&%R7VtZWElL}p*DqL#aR#~;vaf;M42>9FarJ?J}xQhJx6 z_ZhBahnP*=CSkMakRHM`!B%Wm9oC1Y`hUg1ZBjgP%b3{lU@(r42}1Zu5g<p9D$_KW z;ejx(MCcIhotEj_=YYfBxt|=dCdU~#lsT5a^6|zAr?NT33ujnpvMEbNDqWaW(W#vO E0c!S0-2eap -- GitLab