Gentee Programming Language > Documentation > GT language | Download documentation |
Language objects are described in the following way:
<name [attributes]>
[Child objects]
[Object text]
</name>
The name of an object must start from a letter character and may include digits and '_'. All names in GT are case-insensitive. name and NAME represent the same name.
Attributes are additional fields for this object. They can contain a value enclosed by single or double quotes.
<name1 attr1 attr2 = no
attr3 = "Last Name">
</name1>
The text of an object starts from the first character other than a space and not equal to '<'. It may also be enclosed by single or double quotes. All child objects must be enumerated before the text and they also may have embedded objects. All spaces and line breaks before </name> will be ignored. If you wish, you may specify no name and close such an object with </>.
If an object has no child objects, it can be described in the following way:
<name = "object text" [attributes]>
Text must be enclosed by single or double quotes.
The following structure is used for comments:
<- Comment ->
Each object is a macro and you can put it into the text of other objects or attributes. The service character '#' is used for that. Let us take an example:
<name1>
<name2 field = 'Attribute of "name2"'>
<name3 = "Text of name3">
"Text of name2"
</name2>
"Text of name1"
</name1>
#name1# - the substitution of Text of name1
#name1/name2/name3# - the substitution of Text of name3
#name1/name2.field# - the substitution of Attribute of "name2"
As you can see from the example, the character '/' is used to specify the embedment while the character '.' is used to get the value of the attribute.
While inserting an attribute into the text of its own object, you can omit the name of the object - #.object_name#
<name field1 = "attribute 1" field2 = "attribute 2">
Text = #.field1# + #name.field2#
</name>
The result of #name# will be Text = attribute 1 + attribute 2.
If you need to use a name that already contains a macro, it must be enclosed by square brackets.
#name[#subname#]#
In this case the value of #subname# will be obtained and substituted first and then the resulting name will be found.
The following combinations of the service character are possible:## Displaying a service character #; Line break and carriage return #0XX Displaying any character with this code #- Deleting previous characters like tab, space,carriage return and line feed #<- -> Comment #" Double quotes #' Single quotes
The service character can be redefined. To do it, describe it before the name of the object. The redefinition of a service character also affects child objects. It means that the service characters of child objects will coincide with the service characters of their parent object.
<$objname field = Атрибут>
Text = $.field$
</name>
It is possible to use the following service characters: '#', '$', '&', '%', '!', '@', '^'. The character '*' before the name of an object means no service character.
You can specify parameters in the text of objects. In this case it will look like this:
#objname( parameters )
Parameters are divided with a comma and can be enclosed by single or double quotes. Use numerical macros to include parameters in the text.
#i# - where i is the number of parameters starting from 1. If a non-existing parameter is specified, an empty string will be inserted.
<name1>
<name2 = "Hello, #1#!">
Text = #name1/name2( world )
</name1>
The full name of an object is its name with the complete embedment path. It is impossible to define two objects with the same full name.
Such a description is possible:
<name1>
<name2 = "Object name1/name2">
Object name1
</name1>
<name2>
<name2 = "Object name2/name2">
Object name2
</name2>
and this one will result in an error:
<name1>
Object name1
</name1>
<name1>
Object name1
</name1>
If you want to redefine an already existing object, you should place the character '|' before its name. All child objects will also be redefined in this case.
<name1>
Object name1
</name1>
<|name1>
Redefined object name1
</name1>
If you have objects with the same content, you can describe them with one object by enumerating their name in parentheses.
<(name1, name2, name3)>
</>
You can also create objects without specifying their names. To do it, you should use '_' as the name of the object.
<_>
Parent object
<_ = "The first child object">
<_>
"The second child object"
</>
</>
See also
Commands of the GT language Predefined features
![]() |
![]() Copyright © 2004-2006 Gentee Inc. All rights reserved. ![]() |