Textantrieb | UText/1 | UText/1.2 Manual
types add-in
This add-in module is meant to provide parsers for common text structures. It currently supports tables.
Tables
To scan a table you define once such a structure:
^ <table definition name> : table {
^ name : string
~ type <type of the whole table>
~ line <type of each row>
~ ID <column containing the row key>
~ column <name of the first column>
~ column <name of the second column>
~ column ...
~ hide <name of a column not to be output>
~ hide ...
~ separator <separation char between each column>
}
After that you can set up a particular table entering a row in each line separating columns with the choosen character:
~ <table definition name> <table name> [
<columns of first row>
<columns of second row>
...
]
Example:
Suppose you have a structure such as:
^ Books {
^ Book {
^ Title : string
}
}
Then you can set this definition:
^ Booklist : table {
^ name : string
~ type Books
~ line Book
~ ID ISBN
~ column ISBN
~ column Title
~ hide ISBN
~ separator ' '
}
You can now enter a book list with this lines:
~ Booklist BooksOnKant [
0820422525 Imagination and Depth in Kant's Critique of Pure Reason
3050023163 Nachforschungen zu Briefen und Handschriften Immanuel Kants
]
The parser will then register the following units:
=BooksOnKant ~Books {
=0820422525 ~Book {
~Title Imagination and Depth in Kant's Critique of Pure Reason
}
=3050023163 ~Book {
~Title Nachforschungen zu Briefen und Handschriften Immanuel Kants
}
}