Literals, Operators, Expressions, and Statements

Literals, operators, expressions, and statements are language elements that found imperative approach in Paml.


Paml defines built-in literals only for values, and the literal syntax is similar to JSON. The feature is that there are no built-in data types (and corresponding keywords) and literals are just tokens that Paml distinguishes. Actual data types are specified from a domain and are targets for transformations or passed to output code as is.

  1. Number: 123.5
  2. String: "This is a text."
  3. Bool: false, true
  4. Composite value: {}
  5. Collection: []
  6. Routine

I'm not sure that missing built-in data types is possible to define proper language grammar and parser, so for now the feature is in research mode and can be changed in future when other language features will be designed.

val integer = 200;
val decimal = 12.45;
val text = "This is a text.";
val visible = true;
val time = { Hours: 15, Minutes: 40, Seconds: 33 }; Composite value
val numbers = [ 1, 2, 3, 4, 5 ]; Collection of numbers


Since no explicit built-in data types are defined in Paml, there is no explicit arithmetic or any other operators, all operators are symbolic operators.

A symbolic operator is a "free text" token of some syntax from a domain. Paml models do not distinguish the semantics of a symbolic operator until a transformation applied to the operator defines its implementation, and as result its semantics.

A symbolic operator is a join point, so a transformation can (and probably should) be applied to the operator.

The operands of symbolic operators can be objects and values. The actual syntax and semantics are verified by the compiler of the output language like C#.

For symbolic operators, round braces and comma characters are important, so these characters cannot be used in symbolic operators (as well as other Paml reserved keywords and symbols).

Symbolic operators are an abstraction for any operations on any values and objects. Actual syntax of a symbolic operator can be a token. The idea is that styling features also can be available for operator syntax, like superscripts or anything else.

Symbolic operators can be of 3 types: unary prefix and postfix operators, binary operators, and N-nary prefix operators.

  • Symbolic operators can consist of (almost) any characters and should be marked via text styling.
  • Variable names can also have rich font styling.
  • In IDE, hovering symbolic operators should highlight its operands. The code below simulates the highlighting only operators themselves.
val a = -3;
val b = 5;
val v0 = ae; Unary postfix operator
val v1 = a2 + b2;
val v2 = (a + b)2;
val v3 = a < b; Binary operator
val length = length("This is a text."); n-ary prefix operator with actual one operand


An expression is a something that has a type and can be put into the right part of an assignment operator.

Expressions can be arguments for messages and routines parameters.

  1. Object variable
  2. Value variable
  3. Reading (accessing) a value item of value or object
  4. "object instance" expression
  5. Value literal
  6. Sending a message with returning a value
  7. Calling a shared routine with returning value or object
  8. Symbolic operators
  9. Routines


So far it seems that in models only "if" statement for control flow is required, so explicit cycle statements such as "for" or "while" can be redundant.

Missing explicit cycle statements is also in research mode.

  1. Object variable declaration
  2. Object variable declaration and initialization with "object instance" expression
  3. Value variable declaration
  4. Value variable declaration and initialization with value literal
  5. Sending a message to an object
  6. Reading a value item
  7. Shared routine call
  8. Assignment object variable
  9. Assignment value variable or value item
  10. Return statement
  11. If statement
  12. Expression statement
val s1 = "abc";
val s2 = "xyz";
if ( s1 > s2 )

Write a comment

Comments: 0

Pallada project, Copyright © 2015 - 2021.

For any mentions and citations of the site materials, a link to the Pallada project site is obligatory.