tccgen1.nim 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. type
  2. Feature = tuple[name: string, version: string]
  3. PDOMImplementation* = ref DOMImplementation
  4. DOMImplementation = object
  5. Features: seq[Feature] # Read-Only
  6. PNode* = ref Node
  7. Node {.inheritable.} = object
  8. attributes*: seq[PAttr]
  9. childNodes*: seq[PNode]
  10. FLocalName: string # Read-only
  11. FNamespaceURI: string # Read-only
  12. FNodeName: string # Read-only
  13. nodeValue*: string
  14. FNodeType: int # Read-only
  15. FOwnerDocument: PDocument # Read-Only
  16. FParentNode: PNode # Read-Only
  17. prefix*: string # Setting this should change some values... TODO!
  18. PElement* = ref Element
  19. Element = object of Node
  20. FTagName: string # Read-only
  21. PCharacterData = ref CharacterData
  22. CharacterData = object of Node
  23. data*: string
  24. PDocument* = ref Document
  25. Document = object of Node
  26. FImplementation: PDOMImplementation # Read-only
  27. FDocumentElement: PElement # Read-only
  28. PAttr* = ref Attr
  29. Attr = object of Node
  30. FName: string # Read-only
  31. FSpecified: bool # Read-only
  32. value*: string
  33. FOwnerElement: PElement # Read-only
  34. PDocumentFragment* = ref DocumentFragment
  35. DocumentFragment = object of Node
  36. PText* = ref Text
  37. Text = object of CharacterData
  38. PComment* = ref Comment
  39. Comment = object of CharacterData
  40. PCDataSection* = ref CDataSection
  41. CDataSection = object of Text
  42. PProcessingInstruction* = ref ProcessingInstruction
  43. ProcessingInstruction = object of Node
  44. data*: string
  45. FTarget: string # Read-only
  46. proc `namespaceURI=`*(n: var PNode, value: string) =
  47. n.FNamespaceURI = value
  48. proc main =
  49. var n: PNode
  50. new(n)
  51. n.namespaceURI = "test"
  52. main()