Gentee Programming Language > Documentation > Syntax Download documentation

The program structure

A Gentee program may consist of one or several files. Actually, the Gentee program has a primary element - a command. A command begins in a new line, furthermore, most commands have blocks enclosed by curly braces { }.

<program> ::= <command> {<end-of-line><command>}

You can use the following commands in a Gentee program:
 
includeFiles incorporation.
importImporting functions from DLL.
defineThe definition of macros.
ifdefConditional compilation.
funcDeclaring function.
methodMethod declaration.
operatorOperator redefinition.
textText function declaration.
typeDeclaring type.
globalGlobal variable declaration.
externPredefined functions, methods and operations.

<command> ::= <define> | <func> | <method> | <text> | <operator function> | <include> | <type> | <global> | <extern> | <import>

An executable source code is located only in the blocks of the following commands: func, method, operator, text. A block of the above mentioned commands is considered to be called a function body. Nested blocks and statement blocks are likely to occur within the function. The function body and the nested blocks are considered to be function blocks. In addition, function blocks include Expressions, statements and local variable declaration.

<block contents> ::= <block command> {<end-of-line><block command>}
<block> ::= '{'<block contents>'}'
<block command> ::= {<label>} (<block> | <expression> | <variables declaration> | <if> | <for> | <fornum> | <while> | <dowhile> | <foreach> | <switch> | break | continue | <return>)


 Copyright © 2004-2006 Gentee Inc. All rights reserved.