Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
More parser cleanup, added generic argument support for parent classe…
…s, started looking into implementing model support and successfully adding method statements in the class breakdown. Some attempt for internal/anonymous functions
- Loading branch information
Amanda Hinchman-Dominguez
committed
May 18, 2019
1 parent
8412ebd
commit 25a2909
Showing
7 changed files
with
330 additions
and
179 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Notes on AST Parsing | ||
|
||
### Generics | ||
|
||
Generics will always look like this: | ||
AST Parsing for ItemViewModel<SomeGenericClass> | ||
```$xslt | ||
CallConstructor(type=Simple(pieces=[Piece(name=ItemViewModel, typeParams=[Type(mods=[], ref=Simple(pieces=[Piece(name=CatSchedule, typeParams=[])]))])]), typeArgs=[Type(mods=[], ref=Simple(pieces=[Piece(name=CatSchedule, typeParams=[])]))], args=[], lambda=null) | ||
``` | ||
|
||
|
||
Getting the generic type: | ||
```$xslt | ||
"List<" + node.expr().typeArgs().getObject(0).ref().getType() + ">" | ||
``` | ||
|
||
|
||
##### Difference between Type Parameter and Type Argument | ||
|
||
**Type parameter** is blueprint or placeholder for a type declared in generic. | ||
|
||
**Type argument** is actual type used to parametrize generic. |
This file contains 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
Oops, something went wrong.