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

Allow for simple import of other files #21

Merged
merged 5 commits into from
Jun 8, 2016
Merged

Allow for simple import of other files #21

merged 5 commits into from
Jun 8, 2016

Conversation

nikklassen
Copy link
Collaborator

Basic implementation. Parses any files that are imported (regardless of position in the file since that doesn't really make sense) and combines their ExpressionGraphs together, then parses the file that included them. I may be able to make something similar to public/private work, but for now it's dumb.

@@ -241,6 +257,26 @@ public void reportContextSensitivity(@NotNull Parser recognizer, @NotNull DFA df
}
}

class ImportVisitor extends ManifoldBaseVisitor<Void> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we have a plan to remove visitor classes (including ExpressionContextVisitor) out of Main.java and into their own files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This seems as good a place to do it as any.

importExpr #ImportExpression
| rvalue #RValueExpression
// | declaration
;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need expression when it is only doing unit productions? Right now the semantics of expression are questionable. In what situations should we be treating import expressions and rvalue expressions interchangeably? For instance what is the meaning of using an import expression in a tuple value entry?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I thought expressions weren't nestable. I'll hoist it to a statement

@nikklassen
Copy link
Collaborator Author

I also added the option of not adding the .manifold extension when importing because why not

@psocha
Copy link
Collaborator

psocha commented Jun 4, 2016

LGTM 🚀 Should probably get a second opinion, though.

@nikklassen nikklassen merged commit ef3bfd1 into develop Jun 8, 2016
@nikklassen nikklassen deleted the import branch June 8, 2016 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants