Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| research:software:secdart [2017/05/30 23:03] – racruz | research:software:secdart [2017/12/05 18:05] (current) – [Dart subset] racruz | ||
|---|---|---|---|
| Line 23: | Line 23: | ||
| {{: | {{: | ||
| + | ===== SecDart : Language features ===== | ||
| + | SecDart covers a subset of the language and add security labels to language constructors | ||
| + | |||
| + | ==== Dart subset ==== | ||
| + | The following BNF notation represents the AST of the supported subset of Dart, so is not a grammar specification. We use brackets in the BNF rules to refer to the name of the class of the Ast node provided by the Dart Analyzer. | ||
| + | |||
| + | < | ||
| + | | ||
| + | | [FunctionDeclaration] | ||
| + | | ||
| + | | ||
| + | ' | ||
| + | | functionSignature [FunctionBody] | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | [Expression] [Token] [Expression] | ||
| + | |||
| + | |||
| + | | ||
| + | | ||
| + | | [EmptyFunctionBody] | ||
| + | | [ExpressionFunctionBody] | ||
| + | |||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | block ::= ' | ||
| + | |||
| + | | ||
| + | | ||
| + | | [VariableDeclarationStatement] | ||
| + | | [IfStatement] | ||
| + | | [ReturnStatement] | ||
| + | | [ExpressionStatement] | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | ' | ||
| + | |||
| + | | ||
| + | ' | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | |||
| + | | ||
| + | | ||
| + | | [ConditionalExpression] cascadeSection* | ||
| + | //the Dart grammar does not include the followings nodes here to avoid left recursion, however for the sake of presentation we inline them here. | ||
| + | | [BinaryExpression] | ||
| + | | [InvocationExpression] | ||
| + | | [Literal] | ||
| + | | [ParenthesizedExpression] | ||
| + | | [Identifier] | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | </ | ||
| + | ==== Security labels ==== | ||
| + | SecDart uses annotations to specify security labels. We can specify security labels for the following entities: | ||
| + | * parameters of functions < | ||
| + | int min(@high int a,@high int b) | ||
| + | </ | ||
| + | * variable definition < | ||
| + | void sendToFacebook(){ | ||
| + | ... | ||
| + | @low String message = .... | ||
| + | ... | ||
| + | } | ||
| + | </ | ||
| + | * function declarations < | ||
| + | @latent(" | ||
| + | @low int max(@low int a,@high int b){ | ||
| + | | ||
| + | } | ||
| + | </ | ||

