Add conformance checking example

This commit is contained in:
Joeri Exelmans 2024-10-08 22:35:47 +02:00
parent b69efc9af0
commit 17bff66e8e
8 changed files with 227 additions and 16 deletions

View file

@ -1,14 +1,12 @@
grammar = r"""
%import common.WS_INLINE
%ignore WS_INLINE
%import common.WS
%ignore WS
%ignore COMMENT
%declare _INDENT _DEDENT
?start: (_NL | object )*
?start: object*
IDENTIFIER: /[A-Za-z_][A-Za-z_0-9]*/
COMMENT: /#.*/
COMMENT: /#[^\n]*\n/
# newline
_NL: /(\r?\n[\t ]*)+/

View file

@ -46,8 +46,8 @@ class _Code:
self.code = code
# given a concrete syntax text string, and a meta-model, parses the CS
def parse_od(state, cs_text, mm):
tree = parser.parse(cs_text)
def parse_od(state, m_text, mm):
tree = parser.parse(m_text)
m = state.create_node()
od = OD(mm, m, state)