|Top Previous Next|
The menu item Import lets you import lists of scripts, which were exported in a previous session.
Depending on the actual page the export files will have different formats and extensions:
It isn't checked, whether the imported productions, tokens etc. are written in a correct TETRA syntax. On the contrary: the syntax for the import is designed as tolerant as possible. Most syntax elements are optional. So the import is made easier of grammars which were written with other parser-generators. It is a disproportionately big effort to write exact conversion programs for such grammars. The possibilities of the IDE simplify the adaptation to the TETRA syntax enormously.
The choice exists at the import to make a new project or to insert the imported scripts in the project already existing, if a project is already opened in the TextTransformer.
The small box "Overwrite options" determines, whether the project options are taken from the import file or not. If the option is activated, the current project options then are overwritten, even if no options are listed in the import file. The default options are then set.
If the option "Overwrite script of the same name" is not activated, only those scripts are added to the repository, which have names, that differ from the names of scripts, that already exists in the repository. Scripts will not be overwritten by the import then.
The import format for a complete project has the structure:
The formats for the export of the tokens, productions, interpreter scripts and the tests are identically with those of the respective productions of the complete format.
Tokens ::= "TOKENS" Token*
Productions ::= "PRODUCTIONS" Production*
Members ::= "MEMBERS" Member*
Tests ::= "TESTS" Test*
The details can be taken from the enclosed ImExport project. The structure of a production is given as an exemplary example here:
Text( ) : void
The definition of a production starts with its name. On this parameters in brackets follow optionally. A return value can again optionally follow behind a colon. The text of the production is included in the brackets "(>" and "<)". These tokens are chosen so that they might not appear within the text, The syntax for the other scripts is analogous. The number of the following texts corresponds to the number of respective entry fields is in the TextTransformer.
The mentioning of the options is also optional. For not mentioned options the respective default value is set.
This page belongs to the TextTransformer Documentation
|Home Content German|