P-Lingua format
From The P-Lingua Website
Line 5: | Line 5: | ||
a b c d e f g h i j k l m n o p q r s t u v w x y z | a b c d e f g h i j k l m n o p q r s t u v w x y z | ||
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | ||
- | 0 1 2 3 4 5 6 7 8 9 | + | 0 1 2 3 4 5 6 7 8 9 _ |
Valid identifiers are widely used in the language: to define module names, parameters, indexes, membrane labels, alphabet objects and strings. | Valid identifiers are widely used in the language: to define module names, parameters, indexes, membrane labels, alphabet objects and strings. | ||
+ | |||
+ | The following text strings are reserved words in the language: ''def, call, @mu, @ms, @model, @lambda, @d, let, @inf, @debug, main, -->, #'' and they cannot be used as valid identifiers. | ||
+ | |||
+ | == Variables == | ||
+ | Four kind of variables are permitted in P-Lingua: | ||
+ | |||
+ | * Global variables | ||
+ | * Local variables | ||
+ | * Indexes | ||
+ | * [[#Indexes and parameters | Parameters]] | ||
+ | |||
+ | Variables are used to store numeric values and their names are valid identifiers. We use 64 bits (signed) in double precision. | ||
+ | |||
+ | ===Global variables definition=== | ||
+ | Global variables must be declared out of any program module and they can be accessed from all of the program modules (see ref{subsec:modules_definition}). The name of a global variable '''global_variable_name''' must be a valid identifier. The syntax to define a global variable is the following: | ||
+ | |||
+ | global_variable_name = numeric_expression; | ||
+ | |||
+ | === Local variables definition === | ||
+ | |||
+ | Local variables can only be accessed from the module in which they were declared and they must only be defined inside module definitions. The name of | ||
+ | a local variable '''local_variable_name''' must be a valid identifier. The syntax to define a local variable is the following: | ||
+ | |||
+ | let local_variable_name = numeric_expression; | ||
+ | |||
+ | === Indexes and parameters === | ||
+ | |||
+ | Indexes and parameters can be consider local variables used in \ref{subsec:parametric_sentences} and \ref{subsec:modules_definition} respectively. |
Revision as of 09:45, 4 April 2010
Contents |
Valid identifiers
We say that a sequence of characters forms a valid identifier if it does not begin with a numeric character and it is composed by characters from the following:
a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 _
Valid identifiers are widely used in the language: to define module names, parameters, indexes, membrane labels, alphabet objects and strings.
The following text strings are reserved words in the language: def, call, @mu, @ms, @model, @lambda, @d, let, @inf, @debug, main, -->, # and they cannot be used as valid identifiers.
Variables
Four kind of variables are permitted in P-Lingua:
- Global variables
- Local variables
- Indexes
- Parameters
Variables are used to store numeric values and their names are valid identifiers. We use 64 bits (signed) in double precision.
Global variables definition
Global variables must be declared out of any program module and they can be accessed from all of the program modules (see ref{subsec:modules_definition}). The name of a global variable global_variable_name must be a valid identifier. The syntax to define a global variable is the following:
global_variable_name = numeric_expression;
Local variables definition
Local variables can only be accessed from the module in which they were declared and they must only be defined inside module definitions. The name of a local variable local_variable_name must be a valid identifier. The syntax to define a local variable is the following:
let local_variable_name = numeric_expression;
Indexes and parameters
Indexes and parameters can be consider local variables used in \ref{subsec:parametric_sentences} and \ref{subsec:modules_definition} respectively.