|
| 1 | +# Symbols |
| 2 | + |
| 3 | +This document / folder is for tracking all the available symbols, and documenting what creation of one entails. |
| 4 | + |
| 5 | +## Relation to SymbolVisitor |
| 6 | + |
| 7 | +In general each symbol listed below should have a corresponding method `VisitMySymbol` the only exception being `UnresolvedTypeReference` as only few visitors should ever interact with it. |
| 8 | + |
| 9 | +## List |
| 10 | + |
| 11 | +(Order alphabetically please!) |
| 12 | + |
| 13 | +Parent Symbols (Unlisted, abstract): |
| 14 | +| Name | See Also | |
| 15 | +| ---- | -------- | |
| 16 | +| MemberSymbol | | |
| 17 | +| Symbol | | |
| 18 | +| TypeReference | [here](../type-references.md) | |
| 19 | +| TypeSymbol | | |
| 20 | + |
| 21 | +| Name | Symbol Layer File | Symbol Layer Tests | Emitter Tests | |
| 22 | +| ----------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | |
| 23 | +| ExternalTypeReference | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/ExternalTypeReference.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/ExternalTypeReferenceTests.cs) | TODO!!! | |
| 24 | +| FieldSymbol | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/FieldSymbol.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/FieldTests.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Emitter.Tests/EmitterFieldTests.cs) | |
| 25 | +| IdentifierSymbol | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/IdentifierSymbol.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/IdentifierTests.cs) | TODO!!! | |
| 26 | +| InternalTypeReference | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/InternalTypeReference.cs) | TODO!!! | TODO!!! | |
| 27 | +| NamespaceSymbol | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/NamespaceSymbol.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/NamespaceTests.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Emitter.Tests/EmitterNamespaceTests.cs) | |
| 28 | +| PointerTypeReference | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/PointerTypeReference.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/PointerTypeReferenceTests.cs) | TODO!!! | |
| 29 | +| StructSymbol | [here](../../../../../src/generators/Silk.NET.SilkTouch.Symbols/StructSymbol.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/StructTests.cs) | [here](../../../../../tests/Silk.NET.SilkTouch.Emitter.Tests/EmitterStructTests.cs) | |
| 30 | +| UnresolvedTypeReference | [here](src/generators/Silk.NET.SilkTouch.Symbols/UnresolvedTypeReference.cs) | [here](tests/Silk.NET.SilkTouch.Symbols.Tests/SymbolVisitorTests/UnresolvedTypeReferenceTests.cs) | - | |
| 31 | + |
| 32 | +## How to create a symbol |
| 33 | + |
| 34 | +Checklist: |
| 35 | + |
| 36 | +- [ ] Write a short description of what this symbol does in the above list. |
| 37 | +- [ ] Add the symbol to Silk.NET.SilkTouch.Symbols |
| 38 | +- [ ] Add a partial of SymbolVisitor to below the definition, and add visiting method in there. |
| 39 | +- [ ] Call the new visiting method either from |
| 40 | + - The root Visit(Symbol) method, this should rarely be needed |
| 41 | + - The parent's visit method |
| 42 | +- [ ] Add Tests to Silk.NET.SilkTouch.Symbols.Tests for |
| 43 | + - [ ] The type being visited with it's own visiting method |
| 44 | + - [ ] The type being visited with it's parent (not needed if this is a new root type, with no parent) |
| 45 | + - [ ] Each part being visited correctly. Only shallowly check this, don't check parts of parts. |
| 46 | +- [ ] Handle symbol in Silk.NET.SilkTouch.Emitter |
| 47 | +- [ ] Add Tests to Silk.NET.SilkTouch.Emitter.Tests |
| 48 | + - [ ] Transforming a sample Symbol matching a specific string |
| 49 | + - [ ] Other tests, this is highly dependend on how complex the C# output looks like |
| 50 | + - [ ] More is better! |
| 51 | +- [ ] You're done. Feel free to use the symbol wherever needed. Prefer to add usages in a separate PR. |
0 commit comments