Pan (programming Language)
   HOME

TheInfoList



OR:

The pan
configuration language Configuration or configurations may refer to: Computing * Computer configuration or system configuration * Configuration file, a software file used to configure the initial settings for a computer program * Configurator, also known as choice board ...
allows the definition of machine configuration information and an associated schema with a simple, human-accessible syntax. A pan language compiler transforms the configuration information contained within a set of pan templates to a machine-friendly XML or JSON format. The pan language is used within the
Quattor Quattor is a generic open-source tool-kit used to install, configure, and manage computers. Quattor was originally developed in the framework of European Data Grid project (2001-2004). Since its first release in 2003, Quattor has been maintained an ...
toolkit to define the desired configuration for one or more machines. The language is primarily a
declarative language In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow. Many languages that a ...
where elements in a hierarchical tree are set to particular values. The pan syntax is human-friendly and fairly simple, yet allows system administrators to simultaneously set configuration values, define an overall configuration schema, and validate the final configuration against the schema.


Implementation

The compiler panc serves as the de facto reference implementation of the language and is implemented in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
, though at present it is not possible to execute the compiler with
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only wi ...
. A configuration is defined by a set of files, called templates, written in the pan language. These templates define simultaneously the configuration parameters, the configuration schema, and validation functions. Each template is named and is contained in a file having the same name. The syntax of a template file is simple: declaration , unique , structure template template-name; statement … These files may contain comments that start with the hash sign ('#') and terminate with the next new line or end of file.


Types

There are five primitive, atomic types in the pan language: * boolean * long * double * string * link There are two primitive collection types: * list (an ordered list/array of elements) * nlist (Named list associates a string key with a value, similar to hashes, dictionaries or associative arrays) Users can create new types built up from the primitive types with optional validation functions to enforce specific constraints for particular fields.


Template types

There are five different types of templates that are identified by the template modifier:


Ordinary templates

An ordinary template uses no template modifier in the declaration. These templates may contain any pan statement, but statements must operate only on absolute paths.


Object templates

Object templates can be thought of as the root of each generated XML configuration profile. The pan compiler will generate an XML profile for each processed object template. In all other respects, they are the same as ordinary templates.


Declaration templates

These templates may contain only those pan statements that do not modify the machine profile. A declaration template will only be executed once for each processed object template no matter how many times it is included.


Unique templates

A template defined with the unique modifier behaves like an ordinary template except that it will only be included once for each processed object template.


Structure templates

Structure templates are a convenient alternative for creating nlists and are used via the create function. A template declared with the structure modifier may only contain include statements and assignment statements that operate on relative paths. Any include statements may only reference other structure templates.


External links


pan configuration language compiler

pan language compiler documentation

Old pan documentation and compiler files
Cross-platform free software Declarative programming languages