mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2025-03-17 02:25:52 +00:00
Added classdiagramm for AST
This commit is contained in:
parent
ff248d357a
commit
844e1f2d33
173
Klassendiagramme/AST.md
Normal file
173
Klassendiagramme/AST.md
Normal file
@ -0,0 +1,173 @@
|
||||
```plantuml
|
||||
@startuml
|
||||
left to right direction
|
||||
|
||||
!theme plain
|
||||
top to bottom direction
|
||||
skinparam linetype ortho
|
||||
|
||||
entity Assignment << record >> {
|
||||
+ Assignment(FieldVarAccess, Expression):
|
||||
+ value(): Expression
|
||||
+ location(): FieldVarAccess
|
||||
}
|
||||
entity Binary << record >> {
|
||||
+ Binary(Expression, Operator, Expression):
|
||||
+ op(): Operator
|
||||
+ left(): Expression
|
||||
+ right(): Expression
|
||||
}
|
||||
entity Block << record >> {
|
||||
+ Block(List<Statement>):
|
||||
+ stmts(): List<Statement>
|
||||
}
|
||||
entity BoolLiteral << record >> {
|
||||
+ BoolLiteral(Boolean):
|
||||
+ value(): Boolean
|
||||
}
|
||||
entity Break << record >> {
|
||||
+ Break():
|
||||
}
|
||||
entity CharLiteral << record >> {
|
||||
+ CharLiteral(char):
|
||||
+ value(): char
|
||||
}
|
||||
entity Class << record >> {
|
||||
+ Class(String, Block, List<Declaration>, List<Method>, List<Constructor>):
|
||||
+ Class(String, List<Declaration>, List<Method>, List<Constructor>):
|
||||
+ mainmeth(): Block
|
||||
+ classname(): String
|
||||
+ methods(): List<Method>
|
||||
+ constructors(): List<Constructor>
|
||||
+ fieldDeclarations(): List<Declaration>
|
||||
}
|
||||
entity Constructor << record >> {
|
||||
+ Constructor(String, List<Parameter>, Block):
|
||||
+ params(): List<Parameter>
|
||||
+ block(): Block
|
||||
+ className(): String
|
||||
}
|
||||
entity Continue << record >> {
|
||||
+ Continue():
|
||||
}
|
||||
entity Declaration << record >> {
|
||||
+ Declaration(String, Type):
|
||||
+ type(): Type
|
||||
+ name(): String
|
||||
}
|
||||
entity DoWhile << record >> {
|
||||
+ DoWhile(Block, Expression):
|
||||
+ cond(): Expression
|
||||
+ block(): Block
|
||||
}
|
||||
interface Expression << interface >>
|
||||
entity FieldVarAccess << record >> {
|
||||
+ FieldVarAccess(Boolean, Expression, String):
|
||||
+ recursiveOwnerChain(): Expression
|
||||
+ field(): Boolean
|
||||
+ id(): String
|
||||
}
|
||||
entity For << record >> {
|
||||
+ For(Assignment, Expression, Assignment, Block):
|
||||
+ block(): Block
|
||||
+ cond(): Expression
|
||||
+ inc(): Assignment
|
||||
+ assign(): Assignment
|
||||
}
|
||||
entity IfElse << record >> {
|
||||
+ IfElse(Expression, Block, Block):
|
||||
+ elseBlock(): Block
|
||||
+ cond(): Expression
|
||||
+ ifBlock(): Block
|
||||
}
|
||||
entity IntLiteral << record >> {
|
||||
+ IntLiteral(Integer):
|
||||
+ value(): Integer
|
||||
}
|
||||
entity Method << record >> {
|
||||
+ Method(Type, String, List<Parameter>, Block):
|
||||
+ block(): Block
|
||||
+ methodName(): String
|
||||
+ type(): Type
|
||||
+ params(): List<Parameter>
|
||||
}
|
||||
entity MethodCall << record >> {
|
||||
+ MethodCall(FieldVarAccess, List<Expression>):
|
||||
+ recipient(): FieldVarAccess
|
||||
+ args(): List<Expression>
|
||||
}
|
||||
entity New << record >> {
|
||||
+ New(Type, List<Expression>):
|
||||
+ type(): Type
|
||||
+ args(): List<Expression>
|
||||
}
|
||||
interface Node << interface >>
|
||||
enum Operator << enumeration >> {
|
||||
+ Operator():
|
||||
+ values(): Operator[]
|
||||
+ valueOf(String): Operator
|
||||
}
|
||||
entity Parameter << record >> {
|
||||
+ Parameter(String, Type):
|
||||
+ type(): Type
|
||||
+ name(): String
|
||||
}
|
||||
entity Print << record >> {
|
||||
+ Print(Expression):
|
||||
+ value(): Expression
|
||||
}
|
||||
entity Program << record >> {
|
||||
+ Program(List<Class>):
|
||||
+ classes(): List<Class>
|
||||
}
|
||||
entity Return << record >> {
|
||||
+ Return(Expression):
|
||||
+ ret(): Expression
|
||||
}
|
||||
interface Statement << interface >>
|
||||
entity Unary << record >> {
|
||||
+ Unary(UnaryOperator, Expression):
|
||||
+ right(): Expression
|
||||
+ op(): UnaryOperator
|
||||
}
|
||||
enum UnaryOperator << enumeration >> {
|
||||
+ UnaryOperator():
|
||||
+ values(): UnaryOperator[]
|
||||
+ valueOf(String): UnaryOperator
|
||||
}
|
||||
entity While << record >> {
|
||||
+ While(Expression, Block):
|
||||
+ cond(): Expression
|
||||
+ block(): Block
|
||||
}
|
||||
|
||||
Assignment -[#008200,dashed]u-^ Statement
|
||||
Binary -[#008200,dashed]u-^ Expression
|
||||
Block -[#008200,dashed]u-^ Node
|
||||
BoolLiteral -[#008200,dashed]u-^ Expression
|
||||
Break -[#008200,dashed]u-^ Statement
|
||||
CharLiteral -[#008200,dashed]u-^ Expression
|
||||
Class -[#008200,dashed]u-^ Node
|
||||
Constructor -[#008200,dashed]u-^ Node
|
||||
Continue -[#008200,dashed]u-^ Statement
|
||||
Declaration -[#008200,dashed]u-^ Statement
|
||||
DoWhile -[#008200,dashed]u-^ Statement
|
||||
Expression -[#008200,plain]u-^ Node
|
||||
FieldVarAccess -[#008200,dashed]u-^ Expression
|
||||
For -[#008200,dashed]u-^ Statement
|
||||
IfElse -[#008200,dashed]u-^ Statement
|
||||
IntLiteral -[#008200,dashed]u-^ Expression
|
||||
Method -[#008200,dashed]u-^ Node
|
||||
MethodCall -[#008200,dashed]u-^ Expression
|
||||
MethodCall -[#008200,dashed]u-^ Statement
|
||||
New -[#008200,dashed]u-^ Expression
|
||||
New -[#008200,dashed]u-^ Statement
|
||||
Parameter -[#008200,dashed]u-^ Node
|
||||
Print -[#008200,dashed]u-^ Statement
|
||||
Program -[#008200,dashed]u-^ Node
|
||||
Return -[#008200,dashed]u-^ Statement
|
||||
Statement -[#008200,plain]u-^ Node
|
||||
Unary -[#008200,dashed]u-^ Expression
|
||||
While -[#008200,dashed]u-^ Statement
|
||||
@enduml
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user