SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
PHP 関西勉強会 (2009/3/14)




PHP でメタプログラミング
 カスタム DSL 作成入門


               株式会社アイテマン
               Piece Project
               久保敦啓 <kubo@iteman.jp>
           Copyright © 2009 ITEMAN, Inc. All rights reserved.
  -1-
メタプログラミングとは?




「他のプログラムや自分自身を記述し
たり、操作するプログラムを記述す
る」
-- 「ジェネレーティブプログラミング」より




             Copyright © 2009 ITEMAN, Inc. All rights reserved.
      -2-
メタプログラムとは?




「他のプログラムを記述したり操作し
たりするプログラム」
-- 「ジェネレーティブプログラミング」より




                Copyright © 2009 ITEMAN, Inc. All rights reserved.
      -3-
メタプログラミング/メタプログラムの例

プログラムジェネレータ
コンパイラ
インタプリタ
リフレクション
アスペクト指向プログラミング
(Aspect Oriented Programming)
言語指向プログラミング
(Language Oriented Programming)

                Copyright © 2009 ITEMAN, Inc. All rights reserved.
       -4-
言語指向プログラミング




「言語指向プログラミングとは、ドメ
イン特化言語を使ってソフトウェア構
築を行う一般的な開発スタイルのこと
です。」
- http://capsctrl.que.jp/kdmsnr/wiki/bliki/?LanguageWorkbench より




                                Copyright © 2009 ITEMAN, Inc. All rights reserved.
               -5-
ドメイン特化言語




「ドメイン特化言語(DSL:Domain
Specific Language)とは、ある特
定の種類の問題に特化したコンピュー
タ言語のことです。」
- http://capsctrl.que.jp/kdmsnr/wiki/bliki/?LanguageWorkbench より




                                Copyright © 2009 ITEMAN, Inc. All rights reserved.
               -6-
ドメイン特化言語の例

TeX
SQL
Yacc
Lex
アクティブデータモデル
XML 設定ファイル
GUI ビルダ

                 Copyright © 2009 ITEMAN, Inc. All rights reserved.
       -7-
言語指向プログラミング

Intentional Software
 (Intentional Software)
MPS (JetBrains)
Software Factories (Microsoft)
Generative Programming
Language Workbenches
 (Martin Fowler)
Oslo (Microsoft)

                   Copyright © 2009 ITEMAN, Inc. All rights reserved.
        -8-
次期 Piece Framework のアーキテクチャ

 Eclipse

                                抽象形
   PHP
                                abstract representation
                                                                    DSL スクリプト
                                              保存 store
                                                                                保存形
                                                                                stored representation

                                                                   復元
   DSLの参照・編集
                                   Piece_IDE with TMF
                                                                          生成 generation



    ツリービュー         投影 projection
                                  PDT, The Language Toolkit, ...

                                Piece Framework Webサービス             Piece Framework ランタイムオブジェクト
     エディター

                                        双方向の変更の反映

グラフィカルエディター                                                                実行可能形
                                                                           executable representation

                          ソースコード、HTML ファイル、データベーススキーマ、...
編集可能形
editable representation




                                                   Copyright © 2009 ITEMAN, Inc. All rights reserved.
                          -9-
PHP でカスタム DSL を作成する



1. DSL の設計と Lexer および
Parser の実装
2. セマンティックモデル (ドメイン
モデル) の設計・実装
3. (オプション) Eclipse 上の DSL
エディタの設計・実装


              Copyright © 2009 ITEMAN, Inc. All rights reserved.
     - 10 -
トランスフォーメーション


                              セマンティックモデル
DSL スクリプト                                                    PHP スクリプト

  ----------                                                     ----------
  ----------                                                     ----------
  ----------                                                     ----------
  ----------                                                     ----------
  ------                                                         ------


                                                  Generate

                                                           オプション



    Parse                       Populate
                        AST




                                  Copyright © 2009 ITEMAN, Inc. All rights reserved.
               - 11 -
DSL の設計と Lexer および Parser の実装

1. 具体的な DSL スクリプトを書き
ながら、
2. 同時に Parser を定義し、
3. 必要に応じて Lexer に手を加え
て、
4. テストプログラムを実行する。
5. 以上を繰り返す

               Copyright © 2009 ITEMAN, Inc. All rights reserved.
      - 12 -
Lexer Generator と Parser Generator



Lexer Generator
 - PHP_LexerGenerator
Parser Generator
 - PHP_ParserGenerator
 - kmyacc + PHP 対応パッチ


                   Copyright © 2009 ITEMAN, Inc. All rights reserved.
        - 13 -
カスタム DSL の例
Employees.mapper - Piece_ORM マッパー DSL

association skills {
    table skills
    type manyToMany
    property skills
}

association computer {
    table computers
    type oneToOne
    property computer
}

method findByIdAndNote {
    query quot;SELECT * FROM $__table WHERE id = $id AND note = $notequot;
}

method findAllWithSkills1 {
    association skills
}
...



                                     Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 14 -
Lexer 定義の例
MapperLexer.plex - Piece_ORM マッパー DSL の Lexer 定義

...
/*!lex2php
%input $this->_input
%counter $this->_counter
%token $this->token
%value $this->value
%line $this->line
ID = /[a-zA-Z_][a-zA-Z_0-9]*/
WS = /[ trn]+/
STRING = /quot;[^[quot;]+quot;/
LCURLY = quot;{quot;
RCURLY = quot;}quot;
METHOD = quot;methodquot;
...
SL_COMMENT = !//[^nr]*r?n!
ML_COMMENT = !/*[^*]**+([^*/][^*]**+)*/!
*/
/*!lex2php
%statename INITIAL
...



                                     Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 15 -
Lexer 定義の例
MapperLexer.plex - Piece_ORM マッパー DSL の Lexer 定義

...
/*!lex2php
%statename INITIAL

METHOD {
    if ($this->_debug) echo quot;found METHOD [ {$this->value} ]nquot;;
    $this->token = MapperParser::METHOD;
}

QUERY {
    if ($this->_debug) echo quot;found QUERY [ {$this->value} ]nquot;;
    $this->token = MapperParser::QUERY;
}

ORDER_BY {
    if ($this->_debug) echo quot;found ORDER_BY [ {$this->value} ]nquot;;
    $this->token = MapperParser::ORDER_BY;
}
...




                                     Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 16 -
Parser 定義の例
MapperParser.y - Piece_ORM マッパー DSL の Parser 定義

...
start ::= topStatementList.

topStatementList ::= topStatementList topStatement.
topStatementList ::= .

topStatement ::= method.
topStatement ::= association.

method ::= METHOD ID(A) LCURLY methodStatementList(B) RCURLY. {
        if (array_key_exists(strtolower(A), $this->_methodDeclarations)) {
            throw new Exception(quot;Cannot redeclare the method [ {A} ] (previously
declared on line quot; .
                                $this->_methodDeclarations[ strtolower(A) ] .
                                ')'
                                );
        }

        $this->_methodDeclarations[ strtolower(A) ] = $this->_mapperLexer->line;
        $this->_ast->addMethod(A, @B['query'], @B['orderBy'], @B['associations']);
}
...


                                        Copyright © 2009 ITEMAN, Inc. All rights reserved.
                  - 17 -
DSL ローダの実装
DSL ローダの制御フロー

...
public function load()
{
    $this->_initializeAST();
    $this->_loadAST();
    $this->_loadSymbols();
    $this->_createMapper();
}
...




                               Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 18 -
DSL ローダの実装
AST (Abstract Syntax Tree) の初期化

...
private function _initializeAST()
{
    $this->_ast = new Ast();

      foreach ($this->_metadata->getFieldNames() as $fieldName) {
          ...
      }

      $this->_ast->addMethod('findAll', 'SELECT * FROM $__table');
      $this->_ast->addMethod('insert');
      $this->_ast->addMethod('update');
      $this->_ast->addMethod('delete');
}
...




                                       Copyright © 2009 ITEMAN, Inc. All rights reserved.
                   - 19 -
DSL ローダの実装
Lexer と Parser を実行し、DSL を AST に変換する

...
private function _loadAST()
{
    $mapperLexer = new MapperLexer(file_get_contents($this->_configFile));
    $mapperParser = new MapperParser($mapperLexer, $this->_ast, $this-
>_configFile);

    try {
        while ($mapperLexer->yylex()) {
            $mapperParser->doParse($mapperLexer->token, $mapperLexer->value);
        }
    } catch (Exception $e) {
        throw new Exception($e->getMessage() .
                             quot; in {$this->_configFile} on line {$mapperLexer-
>line}quot;
                             );
    }

      $mapperParser->doParse(0, 0);
}
...



                                        Copyright © 2009 ITEMAN, Inc. All rights reserved.
                    - 20 -
DSL ローダの実装
シンボルテーブルの作成とセマンティックモデルの作成

...
private function _loadSymbols()
{
    try {
        $this->_loadMethods();
    } catch (Exception $e) {
        throw new Exception($e->getMessage() . quot; in {$this->_configFile}quot;);
    }
}

private function _createMapper()
{
    $this->_mapper = new Mapper($this->_mapperID);
    foreach ($this->_methods as $method) {
        $this->_mapper->addMethod($method);
    }
}
...




                                     Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 21 -
セマンティックモデル
Operational Interface と Population Interface

...
// A operational interface
public function executeQueryWithCriteria($methodName, $criteria, $isManip =
false)
{
    if (!$this->hasMethod($methodName)) {
        throw new Exception(quot;The method [ $methodName ] was not definedquot;);
    }

    $queryExecutor = new QueryExecutor($this, $isManip);
    return $queryExecutor->executeWithCriteria($this-
>_getMethod($methodName)->getName(), $criteria);
}

// A population interface
public function addMethod(Method $method)
{
    $this->_methods[ strtolower($method->getName()) ] = $method;
}
...



                                     Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 22 -
AST クラスの実装
AST extends DOMDocument

...
class AST extends DOMDocument
{
    public function addMethod($name, $query = null, $orderBy = null,
$associations = null)
    {
        $id = strtolower($name);
        $xpath = new DOMXPath($this);
        $methodNodeList = $xpath->query(quot;//method[@id='$id']quot;);
        if (!$methodNodeList->length) {
            $methodElement = $this->appendChild(new DOMElement('method'));
            $methodElement->setAttribute('id', $id);
            $methodElement->setAttribute('name', $name);
        } else {
            $methodElement = $methodNodeList->item(0);
        }
        ...
    }
    ...




                                     Copyright © 2009 ITEMAN, Inc. All rights reserved.
                 - 23 -
トランスフォーメーション


                              セマンティックモデル
DSL スクリプト                                                    PHP スクリプト

  ----------                                                     ----------
  ----------                                                     ----------
  ----------                                                     ----------
  ----------                                                     ----------
  ------                                                         ------


                                                  Generate

                                                           オプション



    Parse                       Populate
                        AST




                                  Copyright © 2009 ITEMAN, Inc. All rights reserved.
               - 24 -
Eclipse 上の DSL エディタの設計・実装

1. TMF (Textual Modeling Framework) にDSL
グラマーを移植する。 (グラマー言語は選択可能)
2. 補完、バリデーション、リファクタリングなどを
実装する。




DSL エディタとツリービューの完成


                   Copyright © 2009 ITEMAN, Inc. All rights reserved.
         - 25 -
Eclipse 上の DSL エディタの設計・実装


3. ページフローやワークフローのように可視化が効
果的であればグラフィカルエディタも実装、TMF と
統合する。




   2 Way モデリングの完成



               Copyright © 2009 ITEMAN, Inc. All rights reserved.
      - 26 -
Eclipse 上の DSL エディタの設計・実装


4. PDT, Aptana など他のプラグインと協調できる
ように拡張する。




       双方向の変更の反映



                Copyright © 2009 ITEMAN, Inc. All rights reserved.
       - 27 -
おわりに




          Copyright © 2009 ITEMAN, Inc. All rights reserved.
- 28 -
参考文献
Krzysztof Czarnecki, Ulrich Eisenecker, Generative Programming:
Methods, Tools, and Applications, Addison-Wesley Pub (Sd), 2000, ISBN
978-0201309775 津田 義史、今関 剛、朝比奈 勲訳、『ジェネレーティブプロ
グラミング』、翔泳社、2008年、ISBN 978-4798113319
http://capsctrl.que.jp/kdmsnr/wiki/bliki/?DomainSpecificLanguage
http://www.martinfowler.com/articles/languageWorkbench.html
http://capsctrl.que.jp/kdmsnr/wiki/bliki/?LanguageWorkbench
http://martinfowler.com/dslwip/index.html




                                  Copyright © 2009 ITEMAN, Inc. All rights reserved.
                - 29 -

Weitere ähnliche Inhalte

Was ist angesagt?

基于WordNet的英语词语相似度计算
基于WordNet的英语词语相似度计算基于WordNet的英语词语相似度计算
基于WordNet的英语词语相似度计算qiyadeng
 
090608-TogoWS REST
090608-TogoWS REST090608-TogoWS REST
090608-TogoWS RESTocha_kaneko
 
Open Source Type Pad Mobile
Open Source Type Pad MobileOpen Source Type Pad Mobile
Open Source Type Pad MobileHiroshi Sakai
 
Cloud Computing - クラウドコンピューティング(会津産学懇話会)
Cloud Computing - クラウドコンピューティング(会津産学懇話会)Cloud Computing - クラウドコンピューティング(会津産学懇話会)
Cloud Computing - クラウドコンピューティング(会津産学懇話会)Yusuke Kawasaki
 
Windows 7兼容性系列课程(1):Windows 7兼容性概述
Windows 7兼容性系列课程(1):Windows 7兼容性概述Windows 7兼容性系列课程(1):Windows 7兼容性概述
Windows 7兼容性系列课程(1):Windows 7兼容性概述Chui-Wen Chiu
 
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編mochiko AsTech
 
オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 RubyKitajiro Kitayama
 

Was ist angesagt? (8)

SEASR and UIMA
SEASR and UIMASEASR and UIMA
SEASR and UIMA
 
基于WordNet的英语词语相似度计算
基于WordNet的英语词语相似度计算基于WordNet的英语词语相似度计算
基于WordNet的英语词语相似度计算
 
090608-TogoWS REST
090608-TogoWS REST090608-TogoWS REST
090608-TogoWS REST
 
Open Source Type Pad Mobile
Open Source Type Pad MobileOpen Source Type Pad Mobile
Open Source Type Pad Mobile
 
Cloud Computing - クラウドコンピューティング(会津産学懇話会)
Cloud Computing - クラウドコンピューティング(会津産学懇話会)Cloud Computing - クラウドコンピューティング(会津産学懇話会)
Cloud Computing - クラウドコンピューティング(会津産学懇話会)
 
Windows 7兼容性系列课程(1):Windows 7兼容性概述
Windows 7兼容性系列课程(1):Windows 7兼容性概述Windows 7兼容性系列课程(1):Windows 7兼容性概述
Windows 7兼容性系列课程(1):Windows 7兼容性概述
 
20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編20090418 イケテルRails勉強会 第1部Rails編
20090418 イケテルRails勉強会 第1部Rails編
 
オブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Rubyオブジェクト指向スクリプト言語 Ruby
オブジェクト指向スクリプト言語 Ruby
 

Ähnlich wie How To Create Custom DSLs By PHP

20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編mochiko AsTech
 
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...devsumi2009
 
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTracterada
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909Yusuke Wada
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SDJesse Vincent
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For RailsKoichi ITO
 
テンプレート管理ツール r3
テンプレート管理ツール r3テンプレート管理ツール r3
テンプレート管理ツール r3Ippei Ogiwara
 
20090313 Cakephpstudy
20090313 Cakephpstudy20090313 Cakephpstudy
20090313 CakephpstudyYusuke Ando
 
090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing090309seminar talk about Cloud Computing
090309seminar talk about Cloud ComputingKohei Nishikawa
 
Dynamic Language による Silverlight2 アプリケーション開発
Dynamic Language による Silverlight2 アプリケーション開発Dynamic Language による Silverlight2 アプリケーション開発
Dynamic Language による Silverlight2 アプリケーション開発terurou
 
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法devsumi2009
 
20090410 Gree Opentech Main
20090410 Gree Opentech Main20090410 Gree Opentech Main
20090410 Gree Opentech MainHideki Yamane
 
ブラウザでMap Reduce風味の並列分散処理
ブラウザでMap Reduce風味の並列分散処理ブラウザでMap Reduce風味の並列分散処理
ブラウザでMap Reduce風味の並列分散処理Shinya Miyazaki
 
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionRuby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionLibin Pan
 

Ähnlich wie How To Create Custom DSLs By PHP (20)

20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編20090418 イケテルRails勉強会 第2部Air編
20090418 イケテルRails勉強会 第2部Air編
 
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
【13-A-2】 「Delphi for PHP のエバンジェリストが、日本の PHP エバンジェリストと、 PHP と IDE の今と未来を語る」~Em...
 
技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac技術トレンディセミナー フレームワークとしてのTrac
技術トレンディセミナー フレームワークとしてのTrac
 
XS Japan 2008 Xen Mgmt Japanese
XS Japan 2008 Xen Mgmt JapaneseXS Japan 2008 Xen Mgmt Japanese
XS Japan 2008 Xen Mgmt Japanese
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SD
 
What Can Compilers Do for Us?
What Can Compilers Do for Us?What Can Compilers Do for Us?
What Can Compilers Do for Us?
 
Apache Tapestry
Apache TapestryApache Tapestry
Apache Tapestry
 
Five Minutes Introduction For Rails
Five Minutes Introduction For RailsFive Minutes Introduction For Rails
Five Minutes Introduction For Rails
 
Revisited
RevisitedRevisited
Revisited
 
テンプレート管理ツール r3
テンプレート管理ツール r3テンプレート管理ツール r3
テンプレート管理ツール r3
 
20090313 Cakephpstudy
20090313 Cakephpstudy20090313 Cakephpstudy
20090313 Cakephpstudy
 
090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing090309seminar talk about Cloud Computing
090309seminar talk about Cloud Computing
 
Dynamic Language による Silverlight2 アプリケーション開発
Dynamic Language による Silverlight2 アプリケーション開発Dynamic Language による Silverlight2 アプリケーション開発
Dynamic Language による Silverlight2 アプリケーション開発
 
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
【12-D-6】 Silverlight によるハイグレードなLOB/BI実現のためのコンポーネント活用法
 
Ruby Postgres
Ruby PostgresRuby Postgres
Ruby Postgres
 
S2Flex2
S2Flex2S2Flex2
S2Flex2
 
20090410 Gree Opentech Main
20090410 Gree Opentech Main20090410 Gree Opentech Main
20090410 Gree Opentech Main
 
ブラウザでMap Reduce風味の並列分散処理
ブラウザでMap Reduce風味の並列分散処理ブラウザでMap Reduce風味の並列分散処理
ブラウザでMap Reduce風味の並列分散処理
 
Ruby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese VersionRuby on Rails 2.1 What's New Chinese Version
Ruby on Rails 2.1 What's New Chinese Version
 

Mehr von Atsuhiro Kubo

Enaction, Not Design on MPD Osaka Extra 1
Enaction, Not Design on MPD Osaka Extra 1Enaction, Not Design on MPD Osaka Extra 1
Enaction, Not Design on MPD Osaka Extra 1Atsuhiro Kubo
 
Enaction, Not Design on Symfony Meetup Kansai 2
Enaction, Not Design on Symfony Meetup Kansai 2Enaction, Not Design on Symfony Meetup Kansai 2
Enaction, Not Design on Symfony Meetup Kansai 2Atsuhiro Kubo
 
The Birth of FormalBears - A new META for BEAR.Sunday applications
The Birth of FormalBears - A new META for BEAR.Sunday applicationsThe Birth of FormalBears - A new META for BEAR.Sunday applications
The Birth of FormalBears - A new META for BEAR.Sunday applicationsAtsuhiro Kubo
 
Lean Architecture / DCI Evening Report
Lean Architecture / DCI Evening ReportLean Architecture / DCI Evening Report
Lean Architecture / DCI Evening ReportAtsuhiro Kubo
 
Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...Atsuhiro Kubo
 
Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...Atsuhiro Kubo
 
ジェネレーティブプログラミングの世界
ジェネレーティブプログラミングの世界ジェネレーティブプログラミングの世界
ジェネレーティブプログラミングの世界Atsuhiro Kubo
 
意図を表現するプログラミング
意図を表現するプログラミング意図を表現するプログラミング
意図を表現するプログラミングAtsuhiro Kubo
 
Software Development with Symfony
Software Development with SymfonySoftware Development with Symfony
Software Development with SymfonyAtsuhiro Kubo
 
Introduction to Continuous Test Runner MakeGood
Introduction to Continuous Test Runner MakeGoodIntroduction to Continuous Test Runner MakeGood
Introduction to Continuous Test Runner MakeGoodAtsuhiro Kubo
 
Getting Started with Testing using PHPUnit
Getting Started with Testing using PHPUnitGetting Started with Testing using PHPUnit
Getting Started with Testing using PHPUnitAtsuhiro Kubo
 
Introduction to Continuous Testing
Introduction to Continuous TestingIntroduction to Continuous Testing
Introduction to Continuous TestingAtsuhiro Kubo
 
Symfony2でより良いソフトウェアを作るために
Symfony2でより良いソフトウェアを作るためにSymfony2でより良いソフトウェアを作るために
Symfony2でより良いソフトウェアを作るためにAtsuhiro Kubo
 
MakeGoodで快適なテスト駆動開発を
MakeGoodで快適なテスト駆動開発をMakeGoodで快適なテスト駆動開発を
MakeGoodで快適なテスト駆動開発をAtsuhiro Kubo
 
Eclipse PDT + MakeGoodによるPHPコードのテスト
Eclipse PDT + MakeGoodによるPHPコードのテストEclipse PDT + MakeGoodによるPHPコードのテスト
Eclipse PDT + MakeGoodによるPHPコードのテストAtsuhiro Kubo
 
Eclipse PDT + MakeGood による PHP コードのテスト
Eclipse PDT + MakeGood による PHP コードのテストEclipse PDT + MakeGood による PHP コードのテスト
Eclipse PDT + MakeGood による PHP コードのテストAtsuhiro Kubo
 
Piece Framework 2.0 Background
Piece Framework 2.0 BackgroundPiece Framework 2.0 Background
Piece Framework 2.0 BackgroundAtsuhiro Kubo
 

Mehr von Atsuhiro Kubo (18)

MPD Osaka Extra 5
MPD Osaka Extra 5MPD Osaka Extra 5
MPD Osaka Extra 5
 
Enaction, Not Design on MPD Osaka Extra 1
Enaction, Not Design on MPD Osaka Extra 1Enaction, Not Design on MPD Osaka Extra 1
Enaction, Not Design on MPD Osaka Extra 1
 
Enaction, Not Design on Symfony Meetup Kansai 2
Enaction, Not Design on Symfony Meetup Kansai 2Enaction, Not Design on Symfony Meetup Kansai 2
Enaction, Not Design on Symfony Meetup Kansai 2
 
The Birth of FormalBears - A new META for BEAR.Sunday applications
The Birth of FormalBears - A new META for BEAR.Sunday applicationsThe Birth of FormalBears - A new META for BEAR.Sunday applications
The Birth of FormalBears - A new META for BEAR.Sunday applications
 
Lean Architecture / DCI Evening Report
Lean Architecture / DCI Evening ReportLean Architecture / DCI Evening Report
Lean Architecture / DCI Evening Report
 
Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...
 
Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...Frameworks We Live By: Design by day-to-day framework development: Multi-para...
Frameworks We Live By: Design by day-to-day framework development: Multi-para...
 
ジェネレーティブプログラミングの世界
ジェネレーティブプログラミングの世界ジェネレーティブプログラミングの世界
ジェネレーティブプログラミングの世界
 
意図を表現するプログラミング
意図を表現するプログラミング意図を表現するプログラミング
意図を表現するプログラミング
 
Software Development with Symfony
Software Development with SymfonySoftware Development with Symfony
Software Development with Symfony
 
Introduction to Continuous Test Runner MakeGood
Introduction to Continuous Test Runner MakeGoodIntroduction to Continuous Test Runner MakeGood
Introduction to Continuous Test Runner MakeGood
 
Getting Started with Testing using PHPUnit
Getting Started with Testing using PHPUnitGetting Started with Testing using PHPUnit
Getting Started with Testing using PHPUnit
 
Introduction to Continuous Testing
Introduction to Continuous TestingIntroduction to Continuous Testing
Introduction to Continuous Testing
 
Symfony2でより良いソフトウェアを作るために
Symfony2でより良いソフトウェアを作るためにSymfony2でより良いソフトウェアを作るために
Symfony2でより良いソフトウェアを作るために
 
MakeGoodで快適なテスト駆動開発を
MakeGoodで快適なテスト駆動開発をMakeGoodで快適なテスト駆動開発を
MakeGoodで快適なテスト駆動開発を
 
Eclipse PDT + MakeGoodによるPHPコードのテスト
Eclipse PDT + MakeGoodによるPHPコードのテストEclipse PDT + MakeGoodによるPHPコードのテスト
Eclipse PDT + MakeGoodによるPHPコードのテスト
 
Eclipse PDT + MakeGood による PHP コードのテスト
Eclipse PDT + MakeGood による PHP コードのテストEclipse PDT + MakeGood による PHP コードのテスト
Eclipse PDT + MakeGood による PHP コードのテスト
 
Piece Framework 2.0 Background
Piece Framework 2.0 BackgroundPiece Framework 2.0 Background
Piece Framework 2.0 Background
 

Kürzlich hochgeladen

Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

How To Create Custom DSLs By PHP

  • 1. PHP 関西勉強会 (2009/3/14) PHP でメタプログラミング カスタム DSL 作成入門 株式会社アイテマン Piece Project 久保敦啓 <kubo@iteman.jp> Copyright © 2009 ITEMAN, Inc. All rights reserved. -1-
  • 8. 言語指向プログラミング Intentional Software (Intentional Software) MPS (JetBrains) Software Factories (Microsoft) Generative Programming Language Workbenches (Martin Fowler) Oslo (Microsoft) Copyright © 2009 ITEMAN, Inc. All rights reserved. -8-
  • 9. 次期 Piece Framework のアーキテクチャ Eclipse 抽象形 PHP abstract representation DSL スクリプト 保存 store 保存形 stored representation 復元 DSLの参照・編集 Piece_IDE with TMF 生成 generation ツリービュー 投影 projection PDT, The Language Toolkit, ... Piece Framework Webサービス Piece Framework ランタイムオブジェクト エディター 双方向の変更の反映 グラフィカルエディター 実行可能形 executable representation ソースコード、HTML ファイル、データベーススキーマ、... 編集可能形 editable representation Copyright © 2009 ITEMAN, Inc. All rights reserved. -9-
  • 10. PHP でカスタム DSL を作成する 1. DSL の設計と Lexer および Parser の実装 2. セマンティックモデル (ドメイン モデル) の設計・実装 3. (オプション) Eclipse 上の DSL エディタの設計・実装 Copyright © 2009 ITEMAN, Inc. All rights reserved. - 10 -
  • 11. トランスフォーメーション セマンティックモデル DSL スクリプト PHP スクリプト ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------ ------ Generate オプション Parse Populate AST Copyright © 2009 ITEMAN, Inc. All rights reserved. - 11 -
  • 12. DSL の設計と Lexer および Parser の実装 1. 具体的な DSL スクリプトを書き ながら、 2. 同時に Parser を定義し、 3. 必要に応じて Lexer に手を加え て、 4. テストプログラムを実行する。 5. 以上を繰り返す Copyright © 2009 ITEMAN, Inc. All rights reserved. - 12 -
  • 13. Lexer Generator と Parser Generator Lexer Generator - PHP_LexerGenerator Parser Generator - PHP_ParserGenerator - kmyacc + PHP 対応パッチ Copyright © 2009 ITEMAN, Inc. All rights reserved. - 13 -
  • 14. カスタム DSL の例 Employees.mapper - Piece_ORM マッパー DSL association skills { table skills type manyToMany property skills } association computer { table computers type oneToOne property computer } method findByIdAndNote { query quot;SELECT * FROM $__table WHERE id = $id AND note = $notequot; } method findAllWithSkills1 { association skills } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 14 -
  • 15. Lexer 定義の例 MapperLexer.plex - Piece_ORM マッパー DSL の Lexer 定義 ... /*!lex2php %input $this->_input %counter $this->_counter %token $this->token %value $this->value %line $this->line ID = /[a-zA-Z_][a-zA-Z_0-9]*/ WS = /[ trn]+/ STRING = /quot;[^[quot;]+quot;/ LCURLY = quot;{quot; RCURLY = quot;}quot; METHOD = quot;methodquot; ... SL_COMMENT = !//[^nr]*r?n! ML_COMMENT = !/*[^*]**+([^*/][^*]**+)*/! */ /*!lex2php %statename INITIAL ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 15 -
  • 16. Lexer 定義の例 MapperLexer.plex - Piece_ORM マッパー DSL の Lexer 定義 ... /*!lex2php %statename INITIAL METHOD { if ($this->_debug) echo quot;found METHOD [ {$this->value} ]nquot;; $this->token = MapperParser::METHOD; } QUERY { if ($this->_debug) echo quot;found QUERY [ {$this->value} ]nquot;; $this->token = MapperParser::QUERY; } ORDER_BY { if ($this->_debug) echo quot;found ORDER_BY [ {$this->value} ]nquot;; $this->token = MapperParser::ORDER_BY; } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 16 -
  • 17. Parser 定義の例 MapperParser.y - Piece_ORM マッパー DSL の Parser 定義 ... start ::= topStatementList. topStatementList ::= topStatementList topStatement. topStatementList ::= . topStatement ::= method. topStatement ::= association. method ::= METHOD ID(A) LCURLY methodStatementList(B) RCURLY. { if (array_key_exists(strtolower(A), $this->_methodDeclarations)) { throw new Exception(quot;Cannot redeclare the method [ {A} ] (previously declared on line quot; . $this->_methodDeclarations[ strtolower(A) ] . ')' ); } $this->_methodDeclarations[ strtolower(A) ] = $this->_mapperLexer->line; $this->_ast->addMethod(A, @B['query'], @B['orderBy'], @B['associations']); } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 17 -
  • 18. DSL ローダの実装 DSL ローダの制御フロー ... public function load() { $this->_initializeAST(); $this->_loadAST(); $this->_loadSymbols(); $this->_createMapper(); } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 18 -
  • 19. DSL ローダの実装 AST (Abstract Syntax Tree) の初期化 ... private function _initializeAST() { $this->_ast = new Ast(); foreach ($this->_metadata->getFieldNames() as $fieldName) { ... } $this->_ast->addMethod('findAll', 'SELECT * FROM $__table'); $this->_ast->addMethod('insert'); $this->_ast->addMethod('update'); $this->_ast->addMethod('delete'); } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 19 -
  • 20. DSL ローダの実装 Lexer と Parser を実行し、DSL を AST に変換する ... private function _loadAST() { $mapperLexer = new MapperLexer(file_get_contents($this->_configFile)); $mapperParser = new MapperParser($mapperLexer, $this->_ast, $this- >_configFile); try { while ($mapperLexer->yylex()) { $mapperParser->doParse($mapperLexer->token, $mapperLexer->value); } } catch (Exception $e) { throw new Exception($e->getMessage() . quot; in {$this->_configFile} on line {$mapperLexer- >line}quot; ); } $mapperParser->doParse(0, 0); } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 20 -
  • 21. DSL ローダの実装 シンボルテーブルの作成とセマンティックモデルの作成 ... private function _loadSymbols() { try { $this->_loadMethods(); } catch (Exception $e) { throw new Exception($e->getMessage() . quot; in {$this->_configFile}quot;); } } private function _createMapper() { $this->_mapper = new Mapper($this->_mapperID); foreach ($this->_methods as $method) { $this->_mapper->addMethod($method); } } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 21 -
  • 22. セマンティックモデル Operational Interface と Population Interface ... // A operational interface public function executeQueryWithCriteria($methodName, $criteria, $isManip = false) { if (!$this->hasMethod($methodName)) { throw new Exception(quot;The method [ $methodName ] was not definedquot;); } $queryExecutor = new QueryExecutor($this, $isManip); return $queryExecutor->executeWithCriteria($this- >_getMethod($methodName)->getName(), $criteria); } // A population interface public function addMethod(Method $method) { $this->_methods[ strtolower($method->getName()) ] = $method; } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 22 -
  • 23. AST クラスの実装 AST extends DOMDocument ... class AST extends DOMDocument { public function addMethod($name, $query = null, $orderBy = null, $associations = null) { $id = strtolower($name); $xpath = new DOMXPath($this); $methodNodeList = $xpath->query(quot;//method[@id='$id']quot;); if (!$methodNodeList->length) { $methodElement = $this->appendChild(new DOMElement('method')); $methodElement->setAttribute('id', $id); $methodElement->setAttribute('name', $name); } else { $methodElement = $methodNodeList->item(0); } ... } ... Copyright © 2009 ITEMAN, Inc. All rights reserved. - 23 -
  • 24. トランスフォーメーション セマンティックモデル DSL スクリプト PHP スクリプト ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------ ------ Generate オプション Parse Populate AST Copyright © 2009 ITEMAN, Inc. All rights reserved. - 24 -
  • 25. Eclipse 上の DSL エディタの設計・実装 1. TMF (Textual Modeling Framework) にDSL グラマーを移植する。 (グラマー言語は選択可能) 2. 補完、バリデーション、リファクタリングなどを 実装する。 DSL エディタとツリービューの完成 Copyright © 2009 ITEMAN, Inc. All rights reserved. - 25 -
  • 26. Eclipse 上の DSL エディタの設計・実装 3. ページフローやワークフローのように可視化が効 果的であればグラフィカルエディタも実装、TMF と 統合する。 2 Way モデリングの完成 Copyright © 2009 ITEMAN, Inc. All rights reserved. - 26 -
  • 27. Eclipse 上の DSL エディタの設計・実装 4. PDT, Aptana など他のプラグインと協調できる ように拡張する。 双方向の変更の反映 Copyright © 2009 ITEMAN, Inc. All rights reserved. - 27 -
  • 28. おわりに Copyright © 2009 ITEMAN, Inc. All rights reserved. - 28 -
  • 29. 参考文献 Krzysztof Czarnecki, Ulrich Eisenecker, Generative Programming: Methods, Tools, and Applications, Addison-Wesley Pub (Sd), 2000, ISBN 978-0201309775 津田 義史、今関 剛、朝比奈 勲訳、『ジェネレーティブプロ グラミング』、翔泳社、2008年、ISBN 978-4798113319 http://capsctrl.que.jp/kdmsnr/wiki/bliki/?DomainSpecificLanguage http://www.martinfowler.com/articles/languageWorkbench.html http://capsctrl.que.jp/kdmsnr/wiki/bliki/?LanguageWorkbench http://martinfowler.com/dslwip/index.html Copyright © 2009 ITEMAN, Inc. All rights reserved. - 29 -