Skip to content

Instantly share code, notes, and snippets.

@nokok
Last active August 29, 2015 14:11
Show Gist options
  • Save nokok/d5761ef52bcfca790f58 to your computer and use it in GitHub Desktop.
Save nokok/d5761ef52bcfca790f58 to your computer and use it in GitHub Desktop.
type HogeType : SuperType <- Interface1 Interface2 Interface3
#private
def zero : Int = 0
def addOne : Int -> Int = (x) -> x + 1
CompileUnit
TypeDeclaration
KaraffeIdentifier: HogeType
SuperType
KaraffeIdentifier: SuperType
Interfaces
KaraffeIdentifier: Interface1
KaraffeIdentifier: Interface2
KaraffeIdentifier: Interface3
NewLineToken
ModifierStatement
PrivateModifier: private
NewLineToken
VariableOrFunctionDeclaration
KaraffeIdentifier: zero
VarTypeDecl
KaraffeIdentifier: Int
Expression
IntLiteral: 0
NewLineToken
VariableOrFunctionDeclaration
KaraffeIdentifier: addOne
FuncTypeDecl
ArgumentTypes
KaraffeIdentifier: Int
ReturnType
KaraffeIdentifier: Int
Expression
FunctionLiteral
KaraffeIdentifier: x
SingleArrow
Expression
ExprNode
KaraffeIdentifier: x
Plus: +
IntLiteral: 1
NewLineToken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment