Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
research:software:secdart [2017/05/30 23:15] – [Security labels] racruzresearch:software:secdart [2017/12/05 13:58] – [Dart subset] racruz
Line 26: Line 26:
 SecDart covers a subset of the language and add security labels to language constructors SecDart covers a subset of the language and add security labels to language constructors
  
-==== Dart SubSet ==== +==== Dart subset ==== 
-//Details about the subset of Dart covers for SecDart will be placed here soon//+The following BNF notation represents the AST of the supported subset of Dart, so is not a grammar specification. We have code names of AST node to match those provided by the Dart Analyzer.
  
 +<code>
 + compilationUnitMember ::= 
 +       | [FunctionDeclaration]
 +  
 + functionDeclaration ::=
 +         'external' functionSignature
 +       | functionSignature [FunctionBody]
 + 
 + functionSignature ::=
 +         [Type]? ('get' | 'set')? [SimpleIdentifier] [FormalParameterList]
 +         
 + binaryExpression ::=
 +        [Expression] [Token] [Expression] 
 + 
 +         
 + functionBody ::=
 +         [BlockFunctionBody]
 +       | [EmptyFunctionBody]
 +       | [ExpressionFunctionBody]
 +       
 + blockFunctionBody ::= block
 +
 + expressionFunctionBody ::= '=>' [Expression] ';'
 +
 + block ::= '{' statement* '}
 +
 + statement ::=
 +         [Block]
 +       | [VariableDeclarationStatement]
 +       | [IfStatement]
 +       | [ReturnStatement]
 +       | [ExpressionStatement] 
 +       
 + variableDeclarationStatement ::= 
 +         [VariableDeclarationList] ';'
 +         
 + variableDeclarationList ::=
 +         finalConstVarOrType [VariableDeclaration] (',' [VariableDeclaration])*
 +         
 + variableDeclaration ::=
 +         [SimpleIdentifier] ('=' [Expression])?
 +         
 + ifStatement ::=
 +         'if' '(' [Expression] ')' [Statement] ('else' [Statement])?
 +         
 + returnStatement ::=
 +         'return' [Expression]? ';'
 +         
 + expressionStatement ::=
 +         [Expression]? ';'
 + 
 +
 + expression ::=
 +         [AssignmentExpression]
 +       | [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]
 +       
 + assignmentExpression ::=
 +         [Expression] assignmentOperator [Expression]
 +         
 + conditionalExpression ::=
 +         [Expression] '?' [Expression] ':' [Expression]      
 +</code>
 ==== Security labels ==== ==== Security labels ====
 SecDart uses annotations to specify security labels. We can specify security labels for the following entities: SecDart uses annotations to specify security labels. We can specify security labels for the following entities: