Package org.kigalisim.lang.program
Class ParsedProgram
java.lang.Object
org.kigalisim.lang.program.ParsedProgram
Result of parsing (interpreting / compiling) a QubecTalk program.
Can be used to evaluate all of the policies and scenarios found.
-
Constructor Summary
ConstructorsConstructorDescriptionParsedProgram(Iterable<ParsedPolicy> policies, Iterable<ParsedScenario> scenarios) Create a new record of a parsed program. -
Method Summary
Modifier and TypeMethodDescriptionGet the names of all policies defined in this program.Get a specific policy by name.getScenario(String name) Get a specific scenario by name.Get the names of all scenarios defined in this program.
-
Constructor Details
-
ParsedProgram
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
Get the names of all policies defined in this program.- Returns:
- Set of policy names.
-
getPolicy
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
Get the names of all scenarios defined in this program.- Returns:
- Set of scenario names.
-
getScenario
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.
-