Download presentation
Presentation is loading. Please wait.
Published byEvelyn McCormick Modified over 9 years ago
1
School of Computer Science PDE 2005expressik1 expressik: an open source EXPRESS parser and application development kit Andy Carpenter Andy.Carpenter@manchester.ac.uk
2
School of Computer Science PDE 2005expressik2 EXPRESS Interface Kit (expressik) Funded by ESTEC TEC-MCV, ESA Focus unlicensed software for thermal analysis data As general as possible within timescales of project –test cases include AP203, AP209, AP214, AP233 Separate model analysis from SDAI generation Maximise application independent analysis Language bindings: –C++ (early bound), C (p24), –Python (pyEXPRESS), Fortran Preserve existing TASVerter and its API Part 21 (2002) import and export (class 1 and 2)
3
School of Computer Science PDE 2005expressik3 Model Analysis Process 10303-11 (1994) and some 10303-11 (2004) Single or multi-schema Always has a viewpoint schema Almost no semantic checking Reference resolution (can be multiple resolutions) Importation defined by model followed, includes –identifying dependent and independent objects Data type(s) of objects determined Possible CEDTs can be determined (sometimes) API in Java is read-only Source location transferred to API
4
School of Computer Science PDE 2005expressik4 Parser Architecture
5
School of Computer Science PDE 2005expressik5 Parser Passes 1 1.Make the scope tables 2.Resolve schema references (in USE and REFERENCE FROM clauses) 3.Import the objects specified by the USE and REFERENCE clauses 4.Import any enumeration ids that are visible 5.Resolve subtype/supertype references 6.Inherit attributes from supertypes down into subtypes (unless there are id clashes)
6
School of Computer Science PDE 2005expressik6 Parser Passes 2 7Resolve all references apart from where they are part of an attribute qualification; i.e. work out the starting bits of expressions, etc 8Then using the viewpoint schema do Annex C –Apply the Section 11 rules for importation –Prune the supertype graph (i.e. alter supertype expressions) to remove non-imported entities –Apply Annex B 9Load the API 1Depth first walk of AST 2Fixup qualifications within expressions, etc
7
School of Computer Science PDE 2005expressik7 API – Model Element public final class Model extends ExpressObject { public Schema[] getSchemas(); public Schema getViewpointSchema(); public ModelSpecificConstant[] getConstants(); public DefinedDatatype[] getDefinedDatatypes(); public EntityDatatype[] getEntityDatatypes(); public ModelSpecificFunction[] getFunctions(); public ModelSpecificProcedure[] getProcedures(); public Rule[] getRules(); public …[] getComplexEntityDatatypes(); public void visitorAccept(…); } // Model
8
School of Computer Science PDE 2005expressik8 API – Entity Datatype Element public final class EntityDatatype extends … { public Identifier getModelIdentifier(); public Identifier getOriginalIdentifier(); public Identification[] getIdentifications(); public EntityDatatype[] getImmediateSupertypes() public DomainRule[] getDomainRules(); public UniqueRule[] getUniqueRules(); public void visitorAccept(…); …
9
School of Computer Science PDE 2005expressik9 API – Entity Datatype Element (Attributes) … public Attribute[] getAllAttributes(); public …[] getExplicitAttributes(); public …[] getDerivedAttributes(); public …[] getInverseAttributes(); public …[] getAllAttributeRedeclarations(); public …[] getAttributeExplicitRedeclarations() public …[] getAttributeDerivedRedeclarations(); public …[] getAttributeInverseRedeclarations() } // EntityDatatype
10
School of Computer Science PDE 2005expressik10 API – Complex Entity Datatype public final class ComplexEntityDatatype extends ComplexDatatype { public …[] getComponentEntityDatatypes() public EntityDatatype getLeaf () public Attribute[] getAllAttributes() public …[] getAllExplicitAttributes() public AttributeRedeclaration[] getEffectiveRedeclarations (… attribute) public boolean isDependent() public boolean isNonSchema() public void visitorAccept(…); } // ComplexEntityDatatype
11
School of Computer Science PDE 2005expressik11 C++ (Early Bound) SDAI Binding Generated in, almost, single pass over API Uses templates to implement early bound aggregates Template functions deal with GENERIC and AGGREGATE parameters Implements EXPRESS assignment/copy semantics –copy unless entity; need entity reference concept Substantial use of overloaded operators –C++ parser determines correct implementation User deals with EDTs not CEDTs Not early bound when EXPRESS is not Implemented in Java
12
School of Computer Science PDE 2005expressik12 C++ Binding and Entity Instances C++ ‘believes’ that can make copies of instances Introduced entity reference object –one for each EDT Need to preserve inheritance in reference and referenced objects A (ABS) BC 1 A (ref) B (ref) C (ref) AB B C A AC
13
School of Computer Science PDE 2005expressik13 EXPRESS is not Always Early Bound … LOCAL a1, a2 : A; b1, b2 : B; END_LOCAL; … a1 := A(…) || B(…); a2 := A(…) || C(…); b1 := a1; b2 := a2; … A (ABS) BC 1
14
School of Computer Science PDE 2005expressik14 Current State Multiple internal project releases done –parser and C++ binding generator –parser needs to support reading CEDTs used –C++: soon all functional code and verification Python binding soon License allowing public access on-going –based on NASA Open Source Agreement Documentation of C++ binding out-of-date All to be sorted in the short-term
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.