Import

Top  Previous  Next

User interface > Script management and parsing > Import

 

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:

 

 

Type of script

extension

All

tti

Tokens

ttx

Productions

ttr

Interpreter

tte

Tests

ttt

 

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.

 

Import_en

 

 

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:

 

ImExport ::=

"TextTransformer"

ProjectOptions

 

(

Tokens

| Productions

| Members

| Tests

)*

 

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:

 

Production ::=

Comment?

IDENT 

Params?

ReturnType?

"::="

LocalOptions?

Field

 

Example:

 

/*

*/

Text(  ) : void 

[LocalOptions]

CaseSensitive=1

CommentToCode=0

CreateInterface=0

Exportable=1

GlobalLiteralScanner=1

GlobalRegexScanner=0

IgnoreChars=IGNORE

IgnoreWhiteSpace=1

InclusionProd=

Interpretable=1

IsNullableWarning=1

Separated=1

StartSuccNullableWarning=1

TestAllLiterals=0

UseIgnoreRegex=1

UseLocalOptions=1

 

(>

"(>"

(

   SKIP

| STRING

)*

"<)"

<)

 

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