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

New "print" operator to dump the IA internal structure to standard output #10

Open
trinnguyen opened this issue Jul 16, 2021 · 1 comment
Labels
good-first-issue iac Xtext and interpreter

Comments

@trinnguyen
Copy link
Contributor

Syntax

  • Add new statement to init section: print that accept one argument of type sys
  • Example:
actions { a, b }
proc P {
  act { a?, b! }
}
proc Q{}
init {
  print(P())
  print(product(P(), Q()))
  sys q = Q()
  print(q)
}

Implementation

  • Update grammar:
    • Ia.xtext
    • Update rule: GSysExpr to support another option: GSysPrintExpr
    • Add new rule: GSysPrintExpr
  • Make sure valid type checking in init section:
    • ModelValidatorProxy
    • ModelInitTypeChecker
    • An example of invalid typing: sys t1 = print(P())
  • Update runtime
    • InternalSysRuntime: handle the new print expression
  • Implement new method in runtime provider for printing the IAM and MIA
    • RuntimeProviderInterface
    • IamRuntimeProvider
    • MiaRuntimeProvider
  • Implement the operator by just printing the data to standard output (use debugger variables section as reference)
@trinnguyen trinnguyen added iac Xtext and interpreter good-first-issue labels Jul 16, 2021
@trinnguyen
Copy link
Contributor Author

This is a good one to practice implementing new operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue iac Xtext and interpreter
Projects
None yet
Development

No branches or pull requests

1 participant