Class ParsedProgram

java.lang.Object
org.kigalisim.lang.program.ParsedProgram

public class ParsedProgram extends Object
Result of parsing (interpreting / compiling) a QubecTalk program.

Can be used to evaluate all of the policies and scenarios found.

  • Constructor Details

    • ParsedProgram

      public ParsedProgram(Iterable<ParsedPolicy> policies, Iterable<ParsedScenario> scenarios)
      Create a new record of a parsed program.
      Parameters:
      policies - The policies parsed from the source of this program.
      scenarios - The scenarios parsed from the source of this program.
  • Method Details

    • getPolicies

      public Set<String> getPolicies()
      Get the names of all policies defined in this program.
      Returns:
      Set of policy names.
    • getPolicy

      public ParsedPolicy getPolicy(String name)
      Get a specific policy by name.
      Parameters:
      name - The name of the policy to retrieve.
      Returns:
      The policy with the specified name.
      Throws:
      IllegalArgumentException - if no policy with the given name exists.
    • getScenarios

      public Set<String> getScenarios()
      Get the names of all scenarios defined in this program.
      Returns:
      Set of scenario names.
    • getScenario

      public ParsedScenario getScenario(String name)
      Get a specific scenario by name.
      Parameters:
      name - The name of the scenario to retrieve.
      Returns:
      The scenario with the specified name.
      Throws:
      IllegalArgumentException - if no scenario with the given name exists.