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

Lexer class flattening causes spurious MDA warnings about references to an external symbol #853

Open
krame505 opened this issue Sep 4, 2024 · 0 comments

Comments

@krame505
Copy link
Member

krame505 commented Sep 4, 2024

I finally traced down why the MDA for silver-ableC has a bunch of warnings of the form

edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation/Terminals.sv:25.0 [parser edu_umn_cs_melt_ableC_silverconstruction_mda_test_testAntiquote] [grammar host]: The host grammar of an extended parser may not contain a reference to external symbol '$Decl' (edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation:AntiquoteDecl_t)
edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation/Terminals.sv:26.0 [parser edu_umn_cs_melt_ableC_silverconstruction_mda_test_testAntiquote] [grammar host]: The host grammar of an extended parser may not contain a reference to external symbol '$Stmt' (edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation:AntiquoteStmt_t)
edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation/Terminals.sv:27.0 [parser edu_umn_cs_melt_ableC_silverconstruction_mda_test_testAntiquote] [grammar host]: The host grammar of an extended parser may not contain a reference to external symbol '$Initializer'
edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation/Terminals.sv:28.0 [parser edu_umn_cs_melt_ableC_silverconstruction_mda_test_testAntiquote] [grammar host]: The host grammar of an extended parser may not contain a reference to external symbol '$Exprs'
edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation/Terminals.sv:29.0 [parser edu_umn_cs_melt_ableC_silverconstruction_mda_test_testAntiquote] [grammar host]: The host grammar of an extended parser may not contain a reference to external symbol '$Expr' (edu:umn:cs:melt:ableC:silverconstruction:concretesyntax:antiquotation:AntiquoteExpr_t)

This is apparently because when the dominates/submits relationships involving lexer classes are being flattened, we end up with terminals in the host grammar that dominate/submit to extension terminals.

Low priority, but wanted to make a note of this for posterity. I think the solution requires a change to how flattening works, to ensure that dominates/submits to relationships between host and extension terminals are only ever specified in the extension grammar in the MDA spec we give to Copper.

This error is only showing up here at all because we have extension terminals that dominate host terminals. That should in itself be a warning or error in the MDA.

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

1 participant