This module defines the generic structure of the list of words that shape the concrete form of a
Gobstones program, allows the internationalization of the Gobstones Language, and opens the
possibility of having different domains (besides the Standard one, the board and stones).
The main interface, WordsDef, is used by the Gobstones Lexer to
establish the strings to use for each Gobstones concrete word
(keyword, primitive identifier, and other elements).
In order to achieve generalization, characters and identifiers are organized according to
the function they have in the language, thus allowing easy identification of their roles.
Characters are divided in three groups: whitespaces, symbol char, and regular chars.
Then, sequences of those characters define special identifiers and keywords, and other tokens.
This interface is parametric in the domain specific primitives, thus allowing to build
different instances of Gobstones, with different domains, without modifying the structural part
of the language.
Additional specification of the behavior of those domain specific primitives has also to be
provided to the Gobstones Compiler for full customization of the language.
The prefix Base is used to indicate the parametric nature, to differentiate it from the
instances; for example, the Standard Gobstones definition uses the prefix Standard.
The main interface is WordsDef, a generic interface accepting as parameter an
interface for domain specific primitives.
This parameter has to be han extension of DomainSpecificPrimitives, to organize
domain specific primitives according to Gobstones language categories.
See the documentation for WordsDef and its parts for a detailed explanation of the
organization of symbols and identifiers.
Locales for porting different versions of Gobstones Language to different languages have to be
instances of particular instantiations of WordsDef.
They can be constructed with the function genWordsDef.
In addition to the base definition, a type for the standard definition of Gobstones, by defining
the standard, historical Gobstones domain, the Standard Board, expressing the interface
operations to manipulate the Board, Stones, etc., and instantiating the generic interface and
creation function defined at WordsDef.
The definition of the StandardDomain has to be completed by defining the behavior of
its primitives for the compiler.
The locales were constructed with the function genStandardWordsDef,
an instance of genWordsDef, by providing it with the corresponding
parameters.
Other locales for Standard Gobstones can be constructed with this same function.
This module defines the generic structure of the list of words that shape the concrete form of a Gobstones program, allows the internationalization of the Gobstones Language, and opens the possibility of having different domains (besides the Standard one, the board and stones).
The main interface, WordsDef, is used by the Gobstones Lexer to establish the strings to use for each Gobstones concrete word (keyword, primitive identifier, and other elements). In order to achieve generalization, characters and identifiers are organized according to the function they have in the language, thus allowing easy identification of their roles. Characters are divided in three groups: whitespaces, symbol char, and regular chars. Then, sequences of those characters define special identifiers and keywords, and other tokens.
This interface is parametric in the domain specific primitives, thus allowing to build different instances of Gobstones, with different domains, without modifying the structural part of the language. Additional specification of the behavior of those domain specific primitives has also to be provided to the Gobstones Compiler for full customization of the language. The prefix
Base
is used to indicate the parametric nature, to differentiate it from the instances; for example, the Standard Gobstones definition uses the prefixStandard
.The main interface is WordsDef, a generic interface accepting as parameter an interface for domain specific primitives. This parameter has to be han extension of DomainSpecificPrimitives, to organize domain specific primitives according to Gobstones language categories. See the documentation for WordsDef and its parts for a detailed explanation of the organization of symbols and identifiers.
Locales for porting different versions of Gobstones Language to different languages have to be instances of particular instantiations of WordsDef. They can be constructed with the function genWordsDef.
In addition to the base definition, a type for the standard definition of Gobstones, by defining the standard, historical Gobstones domain, the Standard Board, expressing the interface operations to manipulate the Board, Stones, etc., and instantiating the generic interface and creation function defined at WordsDef. The definition of the StandardDomain has to be completed by defining the behavior of its primitives for the compiler.
The interface StandardWordsDef is an instance of WordsDef with a definition for the StandardDomain, and the constants StandardWordsDefEN, StandardWordsDefES, and StandardWordsDefPT provide locales for English, Spanish, and Portuguese. These constants can be provided to the language manager to parse Gobstones programs in different languages.
The locales were constructed with the function genStandardWordsDef, an instance of genWordsDef, by providing it with the corresponding parameters. Other locales for Standard Gobstones can be constructed with this same function.
Author
Pablo E. --Fidel-- Martínez López fidel.ml@gmail.com