12.07.2015 Views

Diapositive 1

Diapositive 1

Diapositive 1

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Behavior Annex UpdatesStandard, plugin, and usage insideRAMSESEtienne Bordeetienne.borde@telecom-paristech.fr


Behaviour Annex Errata• The aadl subcommittee wiki has been updated with thenew errata discussed in Toulouse in January 2012.• 100% of the 12 errata have been closed: an acceptedsolution was proposed for each of them.• A revised version of the Behavior Annex, in whichthese solutions are implemented, has been uploadedon the aadl subcommittee wiki.The wiki traces the issues, and rationales formodifications of the standard; thus it is possible toretrieve the reasons for these modifications.https://wiki.sei.cmu.edu/sae-aadlsubcommittee/index.php/Errata_from_the_Behavior_Annexpage 1 11/28/2012Behavior Annex, status of current actions


News about the BA plugin for OSATE• News about the Behavior Annex plugin developedat Telecom ParisTech:• Update site is available,seehttp://penelope.enst.fr/aadl/wiki for moreinformation• Syntax coloring and hyperlinking were added in theBA clauses (explanations hereafter)• Continuous integration of our plugins with OSATE,using RAMSES to launch the OSATE and the BAplugin with a command lineinterfacehttps://circe.enst.fr/hudson/page 2 11/28/2012Behavior Annex, status of current actions


OSATE - Syntax highlightingand hyperlinking• How to implement syntax coloring and hyperlinking in anAnnex plugin that is not based on Xtext?• OSATE provides 2 new extension points:• • page 3 11/28/2012Behavior Annex, status of current actions


OSATE - Syntax highlighting• Requires imlementing interface AnnexHighlighter, defining two methods:1. publ i c voi d hi ghl i ght AnnexLi br ar y( AnnexLi br ar y l i br ar y,AnnexHi ghl i ght er Posi t i onAccept or accept or )and2. publ i c voi d hi ghl i ght AnnexSubcl ause( AnnexSubcl ause subcl ause,AnnexHi ghl i ght er Posi t i onAccept or accept or ).• Basically, the idea is to use the following method, defined inAnnexHi ghl i ght er Posi t i onAccept or :publ i c voi d addPosi t i on( i nt offset, i nt l engt h, St r i ng i d)When calling addPosition, offset is the position (wrt the beginning ofthe file) of the first character to highlight, length is the number ofcharacters to highlight, and id is a predefined type of highlighting(comment, number, keyword, etc…). SeeAnnexHighlighterPositionAceptor for the complete list of valid Idpage 4 11/28/2012Behavior Annex, status of current actions


OSATE BA Plugin - Syntax highlighting• See plugin.xml file to have the configuration of extension point:• In the BA, we only have Annex Subclauses thus we implement:publ i c voi d hi ghl i ght AnnexSubcl ause( AnnexSubcl ause subcl ause,AnnexHi ghl i ght er Posi t i onAccept or accept or ).• Our implementation is straight forward:• when parsing the BA, the position of strings to highlight (offset, length, and id) arestored in a list, attribute of the BehaviorAnnex class.• When our implementation of highlightAnnexSubclause is called, subclause is ofclass BehaviorAnnex.• Our code go through this list of elements to highlight, retreive their offset, lenghtand id, call:accept or . addPosi t i on( offset, l engt h, i d) ;Where offset, length and id have been retreived from the list of elements to highlight.page 5 11/28/2012Behavior Annex, status of current actions


OSATE – HyperLinking• Requires imlementing interface AnnexTextPositionResolver , defining twomethods:1. publ i c voi d Text Posi t i onI nf o r esol veEl ement At ( EObj ect annexRoot ,i nt of f set )and2. publ i c voi d Text Posi t i onI nf or esol veCr ossRef er encedEl ement At ( EObj ect annexRoot , i nt offset)Offset is the position of the mouse, in the text, when one moves the mouse andpushes the « ctrl » key at the same time.• The constructor of TextPositionInfo is:Text Posi t i onI nf o( EObj ect model Obj ect , i nt of f set , i nt l engt h)• Basically, the idea is to create a TextPositionInfo, modelObject being the object thehyperlinking should « jump to » when one clicks on the hyperlink (resulting from« ctrl+click »); offset and length being the position wher the hyperlink is created as aresult of a « ctrl+mouse over the text ».page 6 11/28/2012Behavior Annex, status of current actions


OSATE BA Plugin – HyperLinkingSee plugin.xml file to have the configuration of extension point:


Current limitationsWe need to improve this implementation, since:• Syntax highlighting is turned off when the BA subclauseis not syntactically correct (parsing fails);• Hyperlinking is turned off when BA subclause is notsyntactically correct or when naming resolution of a BAelements failspage 8 11/28/2012Behavior Annex, status of current actions


Demopage 9 11/28/2012Behavior Annex, status of current actions


subpr ogr am Next _Val uepr ot ot ypesout put _t ype: dat a;f eat ur esfirst: r equi r es dat a access I nt eger _16;last: r equi r es dat a access I nt eger _16;buf f er : r equi r es dat a access Ar r ayDat aType;out put : r equi r es dat a access out put _t ype;annex behavi or _speci f i cat i on { * *statess: initial f i nal st at e;t r ansi t i onst : s - []- > s {out put : = buf f er [ f i r st ] ;if( f i r st Ar r ay;Dat a_Model : : Base_Type => ( cl assi f i er ( I nt eger _16) ) ;Dat a_Model : : Di mensi on =>( 0) ;end Ar r ayDat aType;page 10 11/28/2012Behavior Annex, status of current actions


Instantiation in a particular context• When instantiated in a particular context, we generate:subpr ogr am Next _Val ue_p_T3_p_i n ext ends Next _Val ue ( out put _t ype => dat a Int)f eat ur esbuf f er : r ef i ned to r equi r es dat a access Buf f er Ar r ayType_T3_p_i n;end Next _Val ue_p_T3_p_i n;dat a Buf f er Ar r ayType_T3_p_i npr oper t i esDat a_Model : : Di mensi on => ( 56) ;end Buf f er Ar r ayType_T3_p_i n;page 11 11/28/2012Behavior Annex, status of current actions


Continuous Integration with OSATE• Continuous integration on Hudson and Maven:• Download and build OSATE sources every night• Download and build the BA plugin sources every night• Execute some Junit tests (launching osate+BA ascommand line)• Let’s have a look at the websitehttps://circe.enst.fr/hudson/• Could be interesting to plug with the validationframework of Alexey Khoroshilov. What would be thebest way to proceed?page 12 11/28/2012Behavior Annex, status of current actions


Conclusion• Identified errata have all been implemented in therevised version of the Behavior Annex. They need to bechecked and updated.• The Behavior Annex Plugin has been significantlyimproved, and is used by two (declared) externalpartners (INRIA and Ellidiss).• The Behavior Annex is being used for code generationin RAMSES, taking advantage of “prototype” and“refinement” capabilities of AADL (more to come fornext meeting)page 13 11/28/2012Behavior Annex, status of current actions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!