The idply API reference

Copyright 2020 Simon Vandevelde, Bram Aerts, Joost Vennekens This code is licensed under GNU GPLv3 license (see LICENSE) for more information. This file is part of the cDMN solver.

class idply.Parser(i: <sphinx.ext.autodoc.importer._MockObject object at 0x7f38e1fb7690>, target_lang: str)[source]

The parser is used to parse cDMN strings and find out their underlying secrets. This is a complex part of the solver, and works on magic and hope.

p_compare(t)[source]

statement : expression EQUALS expression | expression COMPARE expression

p_domain_size(t)[source]

expression : HASHTAG expression

p_dontcare(t)[source]

statement : expression EQUALS MINUS | expression EQUALS

p_dot(t)[source]

expression : NUMBER DOT NUMBER

p_eqlist(t)[source]

statement : expression EQUALS list

p_eqnot(t)[source]

statement : expression EQUALS NOT LPAREN list RPAREN

p_eqnotlist(t)[source]

statement : expression EQUALS NOT LPAREN expression RPAREN

p_expression_abs(t)[source]

expression : ABS expression

p_expression_binop(t)[source]
expression : expression PLUS expression
expression MINUS expression
expression TIMES expression
expression DIVIDE DIVIDE expression
expression DIVIDE expression
expression PERCENT expression
p_expression_group(t)[source]

expression : LPAREN expression RPAREN

p_expression_name(t)[source]

expression : ID

p_expression_number(t)[source]

expression : NUMBER

p_expression_uminus(t)[source]

expression : MINUS expression %prec UMINUS

p_lbound(t)[source]

lbound : LPAREN | LBRACK | RBRACK

p_list(t)[source]

list : expression COMMA expression | list COMMA expression

p_no(t)[source]

statement : expression EQUALS NO

p_nrange(t)[source]

statement : expression EQUALS NOT LPAREN lbound expression COMMA expression rbound RPAREN

p_prange(t)[source]

statement : expression EQUALS LPAREN expression UNTIL expression RPAREN

p_quotes(t)[source]
expression : LQUOTE expression RQUOTE
STRAIGHTQUOTE expression STRAIGHTQUOTE
p_range(t)[source]
statement : expression EQUALS lbound expression UNTIL expression rbound
expression EQUALS lbound expression COMMA expression rbound
p_rbound(t)[source]

rbound : RPAREN | RBRACK | LBRACK

p_returnval(t)[source]

return : statement

p_rrange(t)[source]

statement : expression EQUALS LPAREN expression UNTIL expression RBRACK

p_yes(t)[source]

statement : expression EQUALS YES

parse_val(column_header: str, value: str, variables) → str[source]

Parse a cDMN notation inside a cell.

Parameters:
  • column_header – the column header of the cell
  • value – the value inside the cell
  • variables – no idea
Returns str:

the parsed notation.

t_ID(t)[source]

[a-zA-Z_][a-zA-Z_0-9s]*

t_NUMBER(t)[source]

d+

t_newline(t)[source]

n+