19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

cube 2 = [1 0; 0 1; ; 1 − 1; 1 1 ]<br />

A restricted form of the pasting syntax can also be used on the left hand side of variable declarations to express<br />

both declaration and submatrix decomposition.<br />

[top<br />

bot ] = X<br />

[left right ] = Y<br />

Z = [top · left top · right;<br />

bot · left bot · right ]<br />

Section 6.5 describes matrix unpasting in detail and includes more examples.<br />

CompilationUnit ::= Component<br />

| Api<br />

Component ::= component DottedId Import ∗ Export ∗ Decl ∗ end<br />

Api ::= api DottedId Import ∗ AbsDecl ∗ end<br />

DottedId ::= Id ( . Id) ∗<br />

Import ::= import ImportFrom from DottedId<br />

| import AliasedDottedIds<br />

ImportFrom ::= * [except Names]<br />

| AliasedNames<br />

Names ::= Name<br />

| { NameList }<br />

Name ::= Id<br />

| opr Op<br />

NameList ::= Name ( , Name) ∗<br />

AliasedNames ::= AliasedName<br />

| { AliasedNameList }<br />

AliasedName ::= Id [as DottedId]<br />

| opr Op [as Op]<br />

| opr LeftEncloser RightEncloser [as LeftEncloser RightEncloser]<br />

AliasedNameList ::= AliasedName ( , AliasedName) ∗<br />

AliasedDottedIds ::= AliasedDottedId<br />

| { AliasedDottedIdList }<br />

AliasedDottedId ::= DottedId [as DottedId]<br />

AliasedDottedIdList ::= AliasedDottedId ( , AliasedDottedId) ∗<br />

Export ::= export DottedIds<br />

DottedIds ::= DottedId<br />

| { DottedIdList }<br />

DottedIdList ::= DottedId ( , DottedId) ∗<br />

Decl ::= TraitDecl<br />

| ObjectDecl<br />

| FnDecl<br />

| VarDecl<br />

| DimUnitDecl<br />

| TypeAlias<br />

| TestDecl<br />

| PropertyDecl<br />

| ExternalSyntax<br />

TraitDecl ::= TraitHeader (MdDecl | AbsFldDecl | PropertyDecl) ∗ end<br />

TraitHeader ::= TraitMod ∗ trait Id [StaticParams] [Extends] [Excludes] [Comprises] [Where]<br />

376

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

Saved successfully!

Ooh no, something went wrong!