1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
2021-01-15 17:50:28 +11:00

137 lines
2.7 KiB
Plaintext

==========
Annotation
==========
annotation simple;
annotation redirect = simple;
annotation funclike(int, int);
annotation funcdef(int: x, int: y) = other(x, y);
---
(source_file
(annotation (identifier))
(annotation (identifier) (identifier))
(annotation (identifier) (type_base (primitive_type)) (type_base (primitive_type)))
(annotation (identifier) (type_base (primitive_type)) (identifier) (type_base (primitive_type)) (identifier) (call (identifier) (identifier) (identifier))))
==========
Assignment
==========
this = that;
---
(source_file
(assignment (identifier) (identifier)))
==========
Constraint
==========
constraint true;
---
(source_file
(constraint (boolean_literal)))
===========
Declaration
===========
var int: simple_decl;
array[X, 1..23] of var int: simple_decl = some_call(X);
---
(source_file
(declaration (type_base (primitive_type)) (identifier))
(declaration (array_type (type_base (identifier)) (type_base (infix_operator (integer_literal) (integer_literal))) (type_base (primitive_type))) (identifier) (call (identifier) (identifier))))
===========
Enumeration
===========
enum in_dzn;
enum empty = {};
enum with_members = {a, b, c};
---
(source_file
(enumeration name: (identifier))
(enumeration name: (identifier))
(enumeration name: (identifier) members: (identifier) members: (identifier) members: (identifier)))
========
Function
========
function int: this();
function var int: that() = this();
function X: with_args(int, float);
function X: with_named_args(X: x, bool: b) = something(b, x);
---
(source_file
(function_item (type_base (primitive_type)) (identifier))
(function_item (type_base (primitive_type)) (identifier) (call (identifier)))
(function_item (type_base (identifier)) (identifier) (type_base (primitive_type)) (type_base (primitive_type)))
(function_item (type_base (identifier)) (identifier) (type_base (identifier)) (identifier) (type_base (primitive_type)) (identifier) (call (identifier) (identifier) (identifier))))
====
Goal
====
solve satisfy;
solve maximize this;
solve minimize that;
---
(source_file
(goal)
(goal (identifier))
(goal (identifier)))
=======
Include
=======
include "globals.mzn";
---
(source_file
(include (string_literal)))
=======
Output
=======
output ["something"];
---
(source_file
(output (array_literal (string_literal))))
=========
Predicate
=========
test pred();
predicate redirecht() = pred();
predicate with_args(1..10: x, var bool: b) = pred();
---
(source_file
(predicate (identifier))
(predicate (identifier) (call (identifier)))
(predicate (identifier) (type_base (infix_operator (integer_literal) (integer_literal))) (identifier) (type_base (primitive_type)) (identifier) (call (identifier))))