Presentation is loading. Please wait.

Presentation is loading. Please wait.

LK Informatik Operatorbäume 2

Similar presentations


Presentation on theme: "LK Informatik Operatorbäume 2"— Presentation transcript:

1 LK Informatik Operatorbäume 2
OpTree.java 2 + 3 * ( 4 - ) 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } public Element zahl() { return new Element(nextChar()); } Aktueller Baum wurzel null

2 LK Informatik Operatorbäume 2
OpTree.java 2 + 3 * ( 4 - ) 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } public Element zahl() { return new Element(nextChar()); } Aktueller Baum wurzel null

3 LK Informatik Operatorbäume 2
OpTree.java 2 + 3 * ( 4 - ) 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } public Element zahl() { return new Element(nextChar()); } Aktueller Baum wurzel null

4 LK Informatik Operatorbäume 2
OpTree.java 2 + 3 * ( 4 - ) 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } public Element zahl() { return new Element(nextChar()); } Aktueller Baum wurzel null

5 LK Informatik Operatorbäume 2
OpTree.java 2 2 + + 3 * ( 4 - 2 ) + 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } public Element zahl() { return new Element(nextChar()); } Aktueller Baum 2 wurzel null

6 LK Informatik Operatorbäume 2
OpTree.java 2 2 + + 3 3 * * ( ( 4 4 - - 2 2 ) ) + 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); while (<zeichen=+->{ op = nextChar(); Element re = summand(); w = new Element(op,li,re); } return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } Aktueller Baum 3 4 2 - * + 2 wurzel null Op = + 3*(4-2) re

7 LK Informatik Operatorbäume 2
OpTree.java 2 2 + + 3 3 * * ( ( 4 4 - - 2 2 ) ) + 1 public void MakeOpTree() { wurzel = term(); } public Element term() { Element w = summand(); while (<zeichen=+->{ op = nextChar(); Element re = summand(); w = new Element(op,li,re); } return w; } public Element summand() { Element w = faktor(); return w; } public Element faktor() { if (<zahl>) return zahl(); } Aktueller Baum 3 4 2 - * + 1 3 4 2 - * + wurzel Op = + re 1


Download ppt "LK Informatik Operatorbäume 2"

Similar presentations


Ads by Google