Coverage for skema/program_analysis/CAST2FN/model/cast/__init__.py: 100%

27 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-30 17:15 +0000

1# coding: utf-8 

2 

3# flake8: noqa 

4""" 

5 SKEMA Common Abstract Syntax Tree (CAST) 

6 

7 This document outlines the structure of the CAST that will be used as a generic representation of the semantics of a program written in any language. This will be used when creating functions networks from programs using the SKEMA Program Analysis pipeline. __Generating Class Structure__ To automatically generate Python or Java models corresponding to this document, you can use [swagger-codegen](https://swagger.io/tools/swagger-codegen/). We can use this to generate client code based off of this spec that will also generate the class structure. 1. Install via the method described for your operating system [here](https://github.com/swagger-api/swagger-codegen#Prerequisites). Make sure to install a version after 3.0 that will support openapi 3. 2. Run swagger-codegen with the options in the example below. The URL references where the yaml for this documentation is stored on github. Make sure to replace CURRENT_VERSION with the correct version. To generate Java classes rather, change the `-l python` to `-l java`. Change the value to the `-o` option to the desired output location. ``` swagger-codegen generate -l python -o ./client -i https://raw.githubusercontent.com/ml4ai/automates-v2/master/docs/source/cast_v{CURRENT_VERSION}.yaml ``` 3. Once it executes, the client code will be generated at your specified location. For python, the classes will be located in `$OUTPUT_PATH/swagger_client/models/`. For java, they will be located in `$OUTPUT_PATH/src/main/java/io/swagger/client/model/` # noqa: E501 

8 

9 OpenAPI spec version: 1.2.6 

10  

11 Generated by: https://github.com/swagger-api/swagger-codegen.git 

12""" 

13 

14from __future__ import absolute_import 

15 

16# import models into model package 

17from skema.program_analysis.CAST2FN.model.cast.assignment import Assignment 

18from skema.program_analysis.CAST2FN.model.cast.ast_node import AstNode 

19from skema.program_analysis.CAST2FN.model.cast.attribute import Attribute 

20from skema.program_analysis.CAST2FN.model.cast.cast_literal_value import CASTLiteralValue 

21from skema.program_analysis.CAST2FN.model.cast.call import Call 

22from skema.program_analysis.CAST2FN.model.cast.function_def import FunctionDef 

23from skema.program_analysis.CAST2FN.model.cast.goto import Goto 

24from skema.program_analysis.CAST2FN.model.cast.label import Label 

25from skema.program_analysis.CAST2FN.model.cast.loop import Loop 

26from skema.program_analysis.CAST2FN.model.cast.model_break import ModelBreak 

27from skema.program_analysis.CAST2FN.model.cast.model_continue import ModelContinue 

28from skema.program_analysis.CAST2FN.model.cast.model_if import ModelIf 

29from skema.program_analysis.CAST2FN.model.cast.model_import import ModelImport 

30from skema.program_analysis.CAST2FN.model.cast.model_return import ModelReturn 

31from skema.program_analysis.CAST2FN.model.cast.module import Module 

32from skema.program_analysis.CAST2FN.model.cast.name import Name 

33from skema.program_analysis.CAST2FN.model.cast.operator import Operator 

34from skema.program_analysis.CAST2FN.model.cast.record_def import RecordDef 

35from skema.program_analysis.CAST2FN.model.cast.scalar_type import ScalarType 

36from skema.program_analysis.CAST2FN.model.cast.source_code_data_type import SourceCodeDataType 

37from skema.program_analysis.CAST2FN.model.cast.source_ref import SourceRef 

38from skema.program_analysis.CAST2FN.model.cast.structure_type import StructureType 

39from skema.program_analysis.CAST2FN.model.cast.value_constructor import ValueConstructor 

40from skema.program_analysis.CAST2FN.model.cast.var import Var 

41from skema.program_analysis.CAST2FN.model.cast.var_type import VarType