Skip to content

Coding Project. Compilers Lab course - 2016. Federal University of São Carlos - UFSCar Sorocaba.

License

Notifications You must be signed in to change notification settings

igorceridorio/LabCompiladores

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 

Repository files navigation

LabCompiladores

Coding Project. Compilers Lab course - 2016. Federal University of São Carlos - UFSCar Sorocaba.

Developers:

  • Igor Felipe Ferreira Ceridório
  • Rafael Zanetti

Grammar rules:

  • AssignExprLocalDec ::= Expression [ “=” Expression ] | LocalDec
  • BasicType ::= “void” | “int” | “boolean” | “String”
  • BasicValue ::= IntValue | BooleanValue | StringValue
  • BooleanValue ::= “true” | “false”
  • ClassDec ::= “class” Id [ “extends” Id ] “{” MemberList “}”
  • CompStatement ::= “{” { Statement } “}”
  • Digit ::= “0” | ... | “9”
  • DoWhileStat ::= “do” CompStatement “while” “(” Expression “)”
  • Expression ::= SimpleExpression [ Relation SimpleExpression ]
  • ExpressionList ::= Expression { “,” Expression }
  • Factor ::= BasicValue | “(” Expression “)” | “!” Factor | “null” | ObjectCreation | PrimaryExpr
  • FormalParamDec ::= ParamDec { “,” ParamDec }
  • HighOperator ::= “∗” | “/” | “&&”
  • Id ::= Letter { Letter | Digit | “ ” }
  • IdList ::= Id { “,” Id }
  • IfStat ::= “if” “(” Expression “)” Statement [ “else” Statement ]
  • InstVarDec ::= Type IdList “;”
  • IntValue ::= Digit { Digit }
  • LeftValue ::= [ (“this” | Id ) “.” ] Id
  • Letter ::= “A” | ... | “Z” | “a” | ... | “z”
  • LocalDec ::= Type IdList “;”
  • LowOperator ::= “+” | “−” | “||”
  • MemberList ::= { Qualifier Member }
  • Member ::= InstVarDec | MethodDec
  • MethodDec ::= Type Id “(” [ FormalParamDec ] “)” “{” StatementList “}”
  • MOCall ::= “@” Id [ “(” { MOParam } “)” ]
  • MOParam ::= IntValue | StringValue | Id
  • ObjectCreation ::= “new” Id “(” “)”
  • ParamDec ::= Type Id
  • Program ::= { MOCall } ClassDec { ClassDec }
  • Qualifier ::= [ "final" ] [ "static" ] ( “private” | “public”)
  • ReadStat ::= “read” “(” LeftValue { “,” LeftValue } “)”
  • PrimaryExpr ::= “super” “.” Id “(” [ ExpressionList ] “)” | Id | Id “.” Id | Id “.” Id “(” [ ExpressionList ] ”)” | Id “.” Id “.” Id “(” [ ExpressionList ] “)” | “this” | “this” “.” Id | “this” ”.” Id “(” [ ExpressionList ] “)” | “this” ”.” I “.” Id “(” [ ExpressionList ] “)”```
  • Relation ::= “==” | “<” | “>” | “<=” | “>=” | “! =”
  • ReturnStat ::= “return” Expression
  • RightValue ::= “this” [ “.” Id ] | Id [ “.” Id ]
  • Signal ::= “+” | “−”
  • SignalFactor ::= [ Signal ] Factor
  • SimpleExpression ::= Term { LowOperator Term }
  • Statement ::= AssignExprLocalDec “;” | IfStat | WhileStat | ReturnStat “;” | ReadStat “;” | WriteStat “;” | “break” “;” | “;” | CompStatement DoWhileStat
  • StatementList ::= { Statement }
  • Term ::= SignalFactor { HighOperator SignalFactor }
  • Type ::= BasicType | Id
  • WriteStat ::= “write” “(” ExpressionList “)”
  • WhileStat ::= “while” “(” Expression “)” Statement

genC files:

  • AsssignmentStatement
  • BreakStatement
  • CompositeExpr
  • CompositeStatement
  • DoWhileStatement
  • ExprList
  • IfStatement
  • InstanceVariableList
  • KraClass
  • LiteralBoolean
  • LiteralInt
  • LiteralString
  • LocalVariableList
  • Member
  • MemberList
  • MessageSendStatement
  • MessageSendToSelf
  • MessageSendToSuper
  • MessageSendToVariable
  • MethodDec
  • NullExpr
  • NullStatement
  • ObjectCreation
  • ParamList
  • ParenthesisExpr
  • Program
  • ReadStatement
  • ReturnStatement
  • SignalExpr
  • StatementAssert
  • StatementList
  • UnaryExpr
  • Variable
  • VariableExpr
  • VariableList
  • WhileStatement
  • WriteStatement

genC tests:

  • OK-GER01
  • OK-GER02
  • OK-GER03
  • OK-GER04
  • OK-GER05 - problemas na fase 1
  • OK-GER06
  • OK-GER07
  • OK-GER08
  • OK-GER09
  • OK-GER10
  • OK-GER11
  • OK-GER12
  • OK-GER13
  • OK-GER14
  • OK-GER15
  • OK-GER16
  • OK-GER17
  • OK-GER18
  • OK-GER19
  • OK-GER20
  • OK-GER21

About

Coding Project. Compilers Lab course - 2016. Federal University of São Carlos - UFSCar Sorocaba.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published