finished 1c 1d
This commit is contained in:
36
index.typ
36
index.typ
@@ -104,3 +104,39 @@ We have the following Recursion:
|
||||
|
||||
=== Task c
|
||||
|
||||
#question[
|
||||
Wie sieht der konkrete Syntaxbaum für folgenden Satz aus? (Achtung, kann groß werden)
|
||||
|
||||
```java
|
||||
program P int i; { void main(){ read(a[~i]); }}
|
||||
```
|
||||
|
||||
- Geben Sie für Symbole der Terminalklassen ident und charConst im Baum auch die zugehörigen Werte an. Beispiel: ident (“main”)
|
||||
- Sie dürfen den Syntaxbaum auch handschriftlich erstellen und abfotografieren. Achten Sie dabei bitte darauf, dass die Diagramme sauber gezeichnet und gut lesbar sind.
|
||||
- Wenn Sie das Diagramm digital zeichnen wollen, dann bieten sich Zeichentools wie beispielsweise draw.io, LibreOffice Draw oder auch Microsoft PowerPoint an
|
||||
|
||||
]
|
||||
|
||||
#figure(
|
||||
image("task1c.svg"),
|
||||
)
|
||||
|
||||
=== Task d
|
||||
|
||||
#question[
|
||||
Welche terminalen Anfänge und Nachfolger haben die Regeln MethodDecl, AssignOp und Cond- Term? Bitte die finalen Antworten komplett ausschreiben (i.e., jeweils ein Set an TS)
|
||||
]
|
||||
|
||||
==== First Sets
|
||||
|
||||
- MethodDecl: { void , Type }
|
||||
- AsignOp: { "=" , "+=" , "-=" , "\*=" , "/=" , "%=" }
|
||||
- CondTerm: { CondFact }
|
||||
|
||||
==== Follow Sets
|
||||
|
||||
- MethodDecl: { "}", "void", Follow(Type) } = { "}", "void", ident }
|
||||
- AsignOp: { ";" }
|
||||
- CondTerm: { "&&", Follow(CondTerm) } = { "&&", CondFact }
|
||||
|
||||
|
||||
|
||||
3511
task1c.excalidraw
Normal file
3511
task1c.excalidraw
Normal file
File diff suppressed because it is too large
Load Diff
4
task1c.svg
Normal file
4
task1c.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 48 KiB |
Reference in New Issue
Block a user