Closed mingodad closed 1 year ago
The diagrams look really nice and useful! Thanks for your contribution! I will adapt it (with due credit). You also wrote:
Noticed that the EBNF shown bellow came from a copy/paste/format/cleanup from https://logtalk.org/manuals/refman/grammar.html and there was several dubious rules that I used my judgement to fix then.
Do you remember which rules you found dubious?
There is some .
dots at the end of some rules :
object ::=
begin_object_directive [ object_terms ] end_object_directive.
...
category ::=
begin_category_directive [ category_terms ] end_category_directive.
And some |
alternations on the middle of what seems to be one rule:
...
alias_directive ::=
“:- alias(”
entity_identifier “,”
predicate_indicator_alias_list | non_terminal_indicator_alias_list
“).”
...
uses_directive ::=
“:- uses(”
object_identifier | parameter_variable “,”
predicate_indicator_alias_list | non_terminal_indicator_alias_list | operator_list
“).”
...
“provides(” predicate_indicator “,” object_identifier | category_identifier “,” predicate_definition_property_list “)”
...
And maybe straw quotes ?:
line_count ::=
integer”
And some missing quotes ?:
compiler_flag ::=
flag(flag_value)
Thanks. In the case of the alias/2
, uses/2
directives (and a few others) there are parenthesis missing. I'm fixing those and the typos.
Pushed a first commit with the changes:
https://github.com/LogtalkDotOrg/logtalk3/commit/06acfe54733a5b752ee0db8364255cd6d82ca2af
I still need to find how best to provide the generated diagram. Several Handbook sections link to different parts of grammar and thus the diagram cannot be included as-is.
I'm trying to adapt your grammar to use here https://mingodad.github.io/parsertl-playground/playground/ but there is this rules that are not referenced anywhere:
'category_directives' is an unused rule.
'category_identifiers' is an unused rule.
'category_property' is an unused rule.
'compiler_flag' is an unused rule.
'entity_identifiers' is an unused rule.
'goal' is an unused rule.
'lambda_expression' is an unused rule.
'non_terminal_indicator_term' is an unused rule.
'object_directives' is an unused rule.
'object_identifiers' is an unused rule.
'object_property' is an unused rule.
'predicate_indicator_alias_list' is an unused rule.
'predicate_property' is an unused rule.
'predicate_template_alias_list' is an unused rule.
'protocol_identifiers' is an unused rule.
'protocol_property' is an unused rule.
'source_file_directives' is an unused rule.
'source_file_names' is an unused rule.
There is something missing ?
Just pushed 0f19b1c711c383f41dd7781a1d7149763a947799 simplifying and removing several rules. You will still find some reported as unused as they are referenced from other Handbook sections.
Thank you ! But I'll give up for now because it doesn't describe a valid grammar as it is now.
I assume that a main issue is that Prolog non-terminals (e.g. callable
or integer
) are implicit defined?
Diagram published at:
If you change the
EBNF
used to describe the grammar by the one understood by https://www.bottlecaps.de/rr/ui (see bellow) you can get a nice navigable railroad diagram for it.Noticed that the
EBNF
shown bellow came from a copy/paste/format/cleanup from https://logtalk.org/manuals/refman/grammar.html and there was several dubious rules that I used my judgement to fix then.