Tp/python generator dev by tpaviot · Pull Request #145 · stepcode/stepcode · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
2 changes: 2 additions & 0 deletions include/express/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define TYPEis_identifier(t) ((t)->u.type->body->type == identifier_)
#define TYPEis_logical(t) ((t)->u.type->body->type == logical_)
#define TYPEis_boolean(t) ((t)->u.type->body->type == boolean_)
#define TYPEis_real(t) ((t)->u.type->body->type == real_)
#define TYPEis_integer(t) ((t)->u.type->body->type == integer_)
#define TYPEis_string(t) ((t)->u.type->body->type == string_)
#define TYPEis_expression(t) ((t)->u.type->body->type == op_)
#define TYPEis_oneof(t) ((t)->u.type->body->type == oneof_)
Expand Down
44 changes: 44 additions & 0 deletions src/fedex_python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
if(PYTHON_GENERATOR)

include_directories(
${SCL_SOURCE_DIR}/include
${SCL_SOURCE_DIR}/include/exppp
${SCL_SOURCE_DIR}/include/express
${SCL_SOURCE_DIR}/src/fedex_plus
)

add_definitions( -DHAVE_CONFIG_H )

IF(MSVC)
set(fedex_plus_MSVC_SOURCES
${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc
)
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
add_definitions( -DSCL_EXPPP_DLL_IMPORTS )
ENDIF(MSVC)

set(fedex_python_SOURCES
src/classes_misc_python.c
${SCL_SOURCE_DIR}/src/express/fedex.c
src/fedex_main_python.c
src/classes_wrapper_python.cc
src/classes_python.c
src/selects_python.c
src/multpass_python.c
${SCL_SOURCE_DIR}/src/fedex_plus/collect.cc
${SCL_SOURCE_DIR}/src/fedex_plus/complexlist.cc
${SCL_SOURCE_DIR}/src/fedex_plus/entlist.cc
${SCL_SOURCE_DIR}/src/fedex_plus/multlist.cc
${SCL_SOURCE_DIR}/src/fedex_plus/orlist.cc
${SCL_SOURCE_DIR}/src/fedex_plus/entnode.cc
${SCL_SOURCE_DIR}/src/fedex_plus/expressbuild.cc
${SCL_SOURCE_DIR}/src/fedex_plus/non-ors.cc
${SCL_SOURCE_DIR}/src/fedex_plus/match-ors.cc
${SCL_SOURCE_DIR}/src/fedex_plus/trynext.cc
${SCL_SOURCE_DIR}/src/fedex_plus/write.cc
${SCL_SOURCE_DIR}/src/fedex_plus/print.cc
)
SCL_ADDEXEC(fedex_python "${fedex_python_SOURCES} ${fedex_plus_MSVC_SOURCES}" "libexppp express")

add_dependencies( fedex_python version_string )
endif(PYTHON_GENERATOR)
1 change: 1 addition & 0 deletions src/fedex_python/REAMDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Howto
19 changes: 19 additions & 0 deletions src/fedex_python/examples/unitary_schemas/gcc_incomplete_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file was generated by fedex_python. You probably don't want to edit
# it since your modifications will be lost if fedex_plus is used to
# regenerate it.
from SCL.SCLBase import *
from SCL.SimpleDataTypes import *
from SCL.ConstructedDataTypes import *
from SCL.AggregationDataTypes import *
from SCL.TypeChecker import check_type
from SCL.Expr import *
maths_number = NUMBER
# SELECT TYPE atom_based_value_
if (not 'maths_number' in globals().keys()):
maths_number = 'maths_number'
if (not 'atom_based_tuple' in globals().keys()):
atom_based_tuple = 'atom_based_tuple'
atom_based_value = SELECT(
'maths_number',
'atom_based_tuple')
atom_based_tuple = LIST(0,None,'atom_based_value')
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__doc__= ''' This script runs fedex_python over each EXPRESS schema in the test/unitary_schemas folder'''

unitary_schemas_path = '../../../../test/unitary_schemas'
fedex_python_path = '../../../../cmake-build/bin/fedex_python'

import subprocess
import glob
import os

unitary_schemas = glob.glob(os.path.join(unitary_schemas_path,'*.exp'))

for unitary_schema in unitary_schemas:
subprocess.call([fedex_python_path,unitary_schema])
117 changes: 117 additions & 0 deletions src/fedex_python/examples/unitary_schemas/index_attribute.py
Loading