Last active
December 15, 2015 09:11
-
-
Save martijndwars/e04d759d9ef36b434fde to your computer and use it in GitHub Desktop.
NaBL required reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module names | |
namespaces | |
Global | |
binding rules | |
Class(c, _): | |
defines Global c | |
of type ClassType(c) | |
scopes Global | |
Method(t, m, _): | |
defines Global m | |
// This is required for Call(e, m) to resolve the method? Why?! | |
NewObject(c): | |
refers to Global c | |
Call(e, m): | |
refers to Global m in Global c | |
where e has type ClassType(c) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module dummy | |
imports | |
Common | |
context-free start-symbols | |
Start | |
context-free syntax | |
Start.Program = Class* | |
Class.Class = < | |
class <ID> { | |
<Method> | |
}> | |
Method.Method = < | |
<Type> <ID>() { | |
<Stmt*> | |
}> | |
Type.ClassType = <<ID>> | |
Stmt.Call = <<Exp>.<ID>();> | |
Exp.NewObject = <new <ID>()> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test [[ | |
class Foo { | |
int [[m]]() { | |
} | |
} | |
class Bar { | |
int n() { | |
new Foo().[[m]](); | |
} | |
} | |
]] resolve #2 to #1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment