Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse TDL environments other than :type and :instance #391

Open
goodmami opened this issue Jul 4, 2024 · 2 comments
Open

Parse TDL environments other than :type and :instance #391

goodmami opened this issue Jul 4, 2024 · 2 comments

Comments

@goodmami
Copy link
Member

goodmami commented Jul 4, 2024

In anticipation of parsing a unified config file (https://github.com/delph-in/docs/wiki/GrammarConfigurationRfc#proposal), PyDelphin needs to be able to parse TDL environments that are not just :type or :instance. Beyond :config, there may be a need for various places to store metadata or project information, such as things currently stored in grammar METADATA files.

@arademaker
Copy link
Member

arademaker commented Jul 4, 2024

Maybe something to add in the proposal, but commenting here first to antecipate any problem. Trying to avoid the if/endif. In Lisp the annotation applies only to the next form. We can test for positive and negative presence of a feature.

:#+ACE.
quickcheck-code           := "../ace/ace-erg-qc.txt".

:#+LKB.
maximum-number-of-edges   := 4000.

:#+(or ACE LKB)
some-thing := 100.

#-ACE
ace-doesnt-know := 100.

#+(and ACE LKB)
both-ace-lkb-knows := 100.

Inspirred by Lisp *features*, see http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_1-5-2-1-1.html. But we can surely limited the available keywords and possible boolean expressions.

@goodmami
Copy link
Member Author

goodmami commented Jul 4, 2024

I think I would like to avoid booleans altogether to keep things simple. Instead I'm leaning toward the sub-proposal #2 using :include and maybe the optional parameter of :begin :config [...].. For example:

; config.tdl
:begin :config.
...
  :begin :config ace.
  :include "ace/config".
  :end :config.
...
:end :config.

or just:

; ace-config.tdl
:begin :config.
:include "config".
:include "ace/config".
:end :config.

I agree that we should avoid any kind of :if/:endif.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants