80 likes | 106 Views
Smalltalk / Squeak Trait Declaration Alias,Exclusion by method/selector-signature Trait Requirements by method/selector-signature Trait Processing dynamic linking. C# 1.0/2.0 (C-like) Alias,Exclusion --> enhanced with argument-types --> enhanced with argument- and return types
E N D
Smalltalk / Squeak Trait Declaration Alias,Exclusion by method/selector-signature Trait Requirements by method/selector-signature Trait Processing dynamic linking C# 1.0/2.0 (C-like) Alias,Exclusion --> enhanced with argument-types --> enhanced with argument- and return types recursive flattening / preprocessing
Enhancements for C# 1.0/2.0 (C-like) • Automatic library extraction/insertion (-->) • PreCompiler Checks for override/virtual/new (simplified) • Generic boundaries/constraints tests valid if: constraints(class) >= sum(constraints(used traits)) • Generic types/placeholder tests valif if: gtypes(class) >= sum(gtypes(used traits)) • Trait-Interface propagation(-->)
Done so far • Modular Generic Parser (understands most code-features of C-like languages, eg. Java) • Detailed object-data extraction by the parser • Extendable code flattening (mostly language independant) • Code manipulation outside the ST image ("external environment") • Code covered by approx. 400 tests
Currently "Missing" • Lookup of classes / traits / methods / libraries / ... ignore the namespaces (eg. Csharp)Current simplified lookup is done by first-match in the environment • Interface propagation does no existence-check in the current environment (developer responsibility) • Parsing of method body • Csharp only: Rel-expressions in Constructor-call not supported, eg public myconstructor(int i1, int i2) : base(i1<i2) {... }
Future Extensions • Aliasing for generic types/placeholders in trait, declaration and requirements with a followed code tranformation • Constraints for requirements (generic methods only) • More restrictive parser (code correctness) • better Precompiler checks (eg. return types) • ...
xCompilationUnit, eg: CSharp code-repository internal/external Environment read/init and parse xCompilationUnit generation TraitPreprocessor Flattening, ... mirrored code-repository Flattened Environment mirror & write (only if no errors occured) flattened code-repository
Environment (singleton) InternalEnvironment (singleton) (included by default) ExternalEnvironmentS ... LOOKUP CodeObjects / TraitFlattener / ...
xCompilationUnit [ or PathElement, ... ] TraitFlattener (Visitor) [ or: FileReader, FileWriter, FileMirror, ... ]