Cleenewerck'Thomascs'kuleuven'ac'be - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Cleenewerck'Thomascs'kuleuven'ac'be

Description:

Extending languages using compiler plug-ins implementing single keywords ... Lexer & parser (backtracking left recursion descent) Generator. Interkeyword communication ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 15
Provided by: Thom336
Category:

less

Transcript and Presenter's Notes

Title: Cleenewerck'Thomascs'kuleuven'ac'be


1
Capturing and using emergent knowledgeby keyword
based programming
  • Cleenewerck.Thomas_at_cs.kuleuven.ac.be
  • Katholieke Universiteit Leuven
  • June-??, 2002

2
Talk
  • Terminology
  • Building DSLs/Technology
  • Experience (problems)
  • Other approaches
  • Macros, Java Syntactic Extender
  • Jakarta Tool Suite
  • Intentional Programming
  • Future work

3
Terminology
  • ...elements which do not start out with a
    keyword, like expressions, orstatements...Can
    be ANY linguistic component
  • 26653
  • TYPE VAR
  • for( ... ... ....) ...

4
Terminology (2)
  • Keyword based programming
  • atomistic programmming / language design
  • contemporary
  • ALC programming (Atomic Linguistic Component
    programming)
  • Tool oriented programming
  • Human oriented programmming
  • Emergent

5
DSL
  • Extending languages using compiler plug-ins
    implementing single keywords
  • Plug play components for a language
  • Modularized
  • Re-usable
  • Same DSL
  • Cross DSLs
  • Stand alone
  • Realize their effects
  • Active
  • Composable language
  • Language specificiationComposing configuring
    L-components
  • Vertical Linguistic components
  • Lexer parser (backtracking left recursion
    descent)
  • Generator
  • Interkeyword communication

6
Keyword
  • keyword time
  • AST
  • public class AST
  • keyword body
  • RecognitionPattern
  • ( time, , keyword body, )
  • generator
  • public JavaStatements generate()
  • JavaStatements js generate body
  •  
  • gtgt long aXX System.currentTMillis()
  • gtgt js
  • gtgt System.out.println(action has taken
    (System.currentTimeMillis() aXX))

7
Language specification
  • Reusability
  • Parametrisation
  • Relations with other keywords
  • Fixed
  • Repository
  • Choice between what is fixed and what is variable
  • Syntax of the parent public TYPE(id TYPE, ...)
    STATEMENTS
  • Generator of the child TYPE returns a
    String STATEMENTS returns a
    java.ast.Statement
  • ltkeyword type"keywords.java.MethodDeclaration"
    id"methoddecl"gt
  • ltparam name "type"gt
  • ltkeyword refid"packageof"/gt
  • ltkeyword refid"astclass"/gt
  • ltkeyword refid"class"/gt
  • lt/paramgt
  • ltparam name "statements"gt
  • ....
  • lt/paramgt
  • lt/keywordgt
  • Auto-transformations keywords without or
    optional syntax

8
Generator
  • Does not replace AST nodes! (parametrisation)
  • ? keyword ?? a generator
  • Targetting (Anything)
  • Active
  • Passive (code generators)
  • Walking the target AST
  • Local Non-local Effects (observing target AST
    AST member with empty binding)
  • After parsing
  • Root keyword generator is created, and initiated
  • Keyword K with parameters (P1, ... , Pn)
  • Generators are created
  • A method is called to initiate generation
  • Keyword child restrictions
  • Return type
  • Parameters (property bags)
  • MethodName

9
Related workJakarta Tool Suite
  • Language ContextInteraction between linguistic
    componentsis embedded in the keyword itself
  • Communication via source AST
  • Via target tree
  • Syntax dependentSyntax dependent retrieval of
    information in generatorarg0 en arg1
  • Non-direct effects
  • Encapsulation of the syntax of a linguistic
    component
  • Fielddeclaration public type() var()
  • Whole language extensions

10
Related workMacros, Java Syntactic Extender
  • Language
  • Context in which keywors can be used
  • Context in which their effect is semantically
    valid
  • Scheduling of language components
  • Syntax
  • freedom vs limited and simple ASTs
  • shared syntax/information sharing
  • New languages/Legacy languages
  • Reuse of linguistic components
  • Acces to other context information

11
Related workExplicit Programming
  • Syntax Tagging of language constructs
  • Semantics java methods using reflection
  • Sheduling
  • requiresltnamegt gets executed after
    satisfiedltnamegt
  • Closely related to macros

12
Experience
  • Languages
  • Installer 57 keywords
  • EJava 45 keywords
  • Java 36 keywords
  • Implicit model
  • How code is emmited
  • Target model (tree, outputstream, ...)
  • constraints
  • Interrelations/Parametrisations
  • Encapsulation of interoperabilities
  • Behaviour, initialisation, etc.
  • Non direct transformations
  • Special support
  • Relocating
  • Dummy ReturnValues
  • Manual composition

13
Future work
  • Language specifications keywords
  • Composability
  • Management
  • Generating quotation language extentions int
    a out of language specification
  • Interpreteded Templates
  • Compiled Templates
  • Keyword dependencies

14
Comments
  • "Making choices between languages (AspectJ,
    MacroJ, C, SmallTalk, Self, ...) supporting
    different features is no longer." - This sentence
    makes little sense. The differences between these
    languages are more than just syntactic ones! You
    can only have translation from a DSL to any of
    them.
  • but argues for thelanguage as a domain modelling
    issue as well.
Write a Comment
User Comments (0)
About PowerShow.com