<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Attributes</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>Recent changes to Attributes</description><atom:link href="https://sourceforge.net/p/asil/wiki/Attributes/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 16 Feb 2014 10:05:08 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/asil/wiki/Attributes/feed" rel="self" type="application/rss+xml"/><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -66,6 +66,7 @@
 When you apply an attribute to something, use the syntax below.  Note the "Attribute" part of the attribute's name is missing.  The parser should append that automatically.  This syntax is for everything but data members and parameters.  It  also assumes the Attribute doesn't need parameters.

 ~~~~
+:::text
 @[AttributeName]
 'declare something
 ~~~~
@@ -73,6 +74,7 @@
 The reason for the combination of @ and \[\] should be clear shortly.  Below is the syntax for data members and parameters.  This time, the attribute goes immediately before the member/parameter name.

 ~~~~
+:::text
 var String @[AttributeName] strValue
 var @[AttribueName] s$
 var ref int @[AttributeName] myInt
@@ -83,6 +85,7 @@
 If you need to apply several attributes, just use them one after the other, on the same line if needed.

 ~~~~
+:::text
 var String @[Attribute1]@[Attribute2] myString
 ~~~~

@@ -91,6 +94,7 @@
 Attributes that require parameters really aren't that much different from those that don't require parameters.  Below is a sample of code that declares such an attribute and then applies it to a member.

 ~~~~
+:::text
 class MyClass
   class CustomAttribute
     constructor var String param
@@ -105,6 +109,7 @@
 Take a look at the three lines of code below.

 ~~~~
+:::text
 command Sample1 var [AttributeName] s$ ' The parser might see the attribute as an optional section
 command Sample2 var @AttributeName s$ ' Not optional, but where does this attribute call end?
 command Sample3 var @[AttributesName] s$ ' Correct
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 16 Feb 2014 10:05:08 -0000</pubDate><guid>https://sourceforge.netef37c7a2b52b20795e96d114ecd441567d7de924</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -40,6 +40,7 @@
 Attributes in ASIL all derive from the class Attribute.  The compiler should require attribute classes to end with "Attribute".  You specify what the attribute can be applied to by passing a combination of values from the IdentifierTypes enum inside Attribute to the base class.  Using an attribute calls the attribute's constructor.  That constructor is just a normal constructor that can have any syntax needed.

 ~~~~
+:::text
 class Attribute
   ' Not a complete listing of the class, but showing the IdentifierTypes enum

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 16 Feb 2014 10:04:26 -0000</pubDate><guid>https://sourceforge.net5c9ac4704ebbeb763557cc91f1378cbbb925ea50</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -41,7 +41,7 @@

 ~~~~
 class Attribute
-  ' Note complete listing of the class, but showing the IdentifierTypes enum
+  ' Not a complete listing of the class, but showing the IdentifierTypes enum

   @[CombinableEnum]
   enum IdentifierType
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Fri, 14 Feb 2014 04:14:22 -0000</pubDate><guid>https://sourceforge.netdc02a37d190f4bbdfd116191a22d36fe37738e12</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -2,38 +2,38 @@

 Overview
 --------
-.NET attributes and Java annotations serve similar purposes.  However, .NET's attribute system is more powerful.  Java annotations can't take parameters.  They're implemented as a simple interface.  Attributes are actual classes which can take parameters.  Java has very few annotations while .NET has an extensive attribute ecosystem.  Hence, ASIL follows the .NET system with attributes.
+.NET attributes and Java annotations serve similar purposes.  However, .NET's attribute system is more powerful.  Java annotations just static data structures while .NET attributes are actual classes.  Java has very few annotations while .NET has an extensive attribute ecosystem.  Hence, ASIL follows the .NET system with attributes.

 Like in .NET, attributes can be applied to most identifiers when they are declared.  .NET allows attribute classes to specify restrictions on which types of identifiers the attribute being declared can applied to.  ASIL does the same.  The table below lists what identifier types attributes in general can be applied to.

 Identifier type | Can have attributes | Details
 ----------------|---------------------|--------
-[**conditional**] variable | ✗ | These only exist at compile-time
+**[conditional](keywords-conditional)** variable | ✗ | These only exist at compile-time
 constant member | ✗ | These also exist at compiler-type only, at least as a named constant
 custom keyword | ✗ | 
-[**namespace**] | ✗ |
+**[namespace](keywords-namespace)** | ✗ |
 local variable | ✗ | If you need to pass it to a procedure that needs attributes, put them on the parameter of the procedure
-[**creator**] | ✗ |
-[**destructor**] | ✗ |
-global variable (DASIL only) | ✗ |
+**[creator](keywords-creator)** | ✗ |
+**[destructor](keywords-destructor)** | ✗ |
+global variable ([DASIL](Derivatives-DASIL) only) | ✗ |
 primitve-based enum | ✓ | In fact, use an attribute to direct the compiler to allow values of your type to be combined
 entry inside a primitive-based enum | ✓ |
-[**struct**] | ✓ |
-[**interface**] | ✓ |
-[**class**] | ✓ |
+**[struct](keywords-struct)** | ✓ |
+**[interface](keywords-interface)** | ✓ |
+**[class](keywords-class)** | ✓ |
 struct-based enum | ✓ |
 entry inside a struct-based enum | ✓ | These are just instances of the type
-global procedure (DASIL only) | ✓ |
+global procedure ([DASIL(Derivatives-DASIL) only) | ✓ |
 data member | ✓ |
-[**constructor**] | ✓ |
-[**command**] | ✓ |
-[**function**] | ✓ |
+**[constructor](keywords-constructor)** | ✓ |
+**[command](keywords-command)** | ✓ |
+**[function](keywords-function)** | ✓ |
 complex statement | ✓ |
-[**property**] | ✓ |
-accessor of a [**property**] | ✓ |
-[**delegate**] | ✓ |
-[**event**] | ✓ |
-parameter to procedure or [**property**] | ✓ | Apply the attribute immediately before the parameter's identifier
+**[property](keywords-property)** | ✓ |
+accessor of a **[property](keywords-property)** | ✓ |
+**[delegate](keywords-delegate)** | ✓ |
+**[event](keywords-event)** | ✓ |
+parameter to procedure or **[property](keywords-property)** | ✓ | Apply the attribute immediately before the parameter's identifier

 Declaring custom attribute types
 --------------------------------
@@ -47,7 +47,7 @@
   enum IdentifierType
     @enum
     @struct
-    enumValue
+    enumStruct
     @interface
     @class
     structBasedEnum
@@ -58,7 +58,7 @@
     dataMember ' includes values inside a struct-based enum type
 ~~~~

-Note: You saw mention of the CombinableEnumAttribute type in the discussion on [Enums].
+Note: You saw mention of the CombinableEnumAttribute type in the discussion on [Enums].  It's an attribute class that passes &lt;code&gt;Identifier.@enum&lt;/code&gt; to it's base class constructor.

 Using simple attributes
 -----------------------
@@ -74,7 +74,7 @@
 ~~~~
 var String @[AttributeName] strValue
 var @[AttribueName] s$
-var &amp; int @[AttributeName] myInt
+var ref int @[AttributeName] myInt
 ~~~~

 Applying  multiple attributes
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Fri, 14 Feb 2014 04:12:13 -0000</pubDate><guid>https://sourceforge.net61b3ade6e4b381ff0c0bb073e7744904f55a632d</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -58,7 +58,7 @@
     dataMember ' includes values inside a struct-based enum type
 ~~~~

-Note: You saw usage of the CombinableEnumAttribute type in the discussion on [Enums].
+Note: You saw mention of the CombinableEnumAttribute type in the discussion on [Enums].

 Using simple attributes
 -----------------------
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 03:10:13 -0000</pubDate><guid>https://sourceforge.net4d999afa3f038d7c3dd39ba1d20363a950e9c991</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -84,3 +84,29 @@
 ~~~~
 var String @[Attribute1]@[Attribute2] myString
 ~~~~
+
+Attributes that take parameters
+-------------------------------
+Attributes that require parameters really aren't that much different from those that don't require parameters.  Below is a sample of code that declares such an attribute and then applies it to a member.
+
+~~~~
+class MyClass
+  class CustomAttribute
+    constructor var String param
+      base IdentifierType.dataMember
+      'Do something with the param
+
+  var String @[Custom "this is a parameter for an attribute"] myString
+~~~~
+
+Why the strange syntax?
+-----------------------
+Take a look at the three lines of code below.
+
+~~~~
+command Sample1 var [AttributeName] s$ ' The parser might see the attribute as an optional section
+command Sample2 var @AttributeName s$ ' Not optional, but where does this attribute call end?
+command Sample3 var @[AttributesName] s$ ' Correct
+~~~~
+
+ASIL needs the brackets to be combined with the at sign to clarify what's needed.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 03:08:25 -0000</pubDate><guid>https://sourceforge.netb15b033ae3ae2f7c773051591ae55ad03bc9c500</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,3 +1,7 @@
+[TOC]
+
+Overview
+--------
 .NET attributes and Java annotations serve similar purposes.  However, .NET's attribute system is more powerful.  Java annotations can't take parameters.  They're implemented as a simple interface.  Attributes are actual classes which can take parameters.  Java has very few annotations while .NET has an extensive attribute ecosystem.  Hence, ASIL follows the .NET system with attributes.

 Like in .NET, attributes can be applied to most identifiers when they are declared.  .NET allows attribute classes to specify restrictions on which types of identifiers the attribute being declared can applied to.  ASIL does the same.  The table below lists what identifier types attributes in general can be applied to.
@@ -11,6 +15,7 @@
 local variable | ✗ | If you need to pass it to a procedure that needs attributes, put them on the parameter of the procedure
 [**creator**] | ✗ |
 [**destructor**] | ✗ |
+global variable (DASIL only) | ✗ |
 primitve-based enum | ✓ | In fact, use an attribute to direct the compiler to allow values of your type to be combined
 entry inside a primitive-based enum | ✓ |
 [**struct**] | ✓ |
@@ -18,7 +23,6 @@
 [**class**] | ✓ |
 struct-based enum | ✓ |
 entry inside a struct-based enum | ✓ | These are just instances of the type
-global variable (DASIL only) | ✓ |
 global procedure (DASIL only) | ✓ |
 data member | ✓ |
 [**constructor**] | ✓ |
@@ -29,4 +33,54 @@
 accessor of a [**property**] | ✓ |
 [**delegate**] | ✓ |
 [**event**] | ✓ |
+parameter to procedure or [**property**] | ✓ | Apply the attribute immediately before the parameter's identifier

+Declaring custom attribute types
+--------------------------------
+Attributes in ASIL all derive from the class Attribute.  The compiler should require attribute classes to end with "Attribute".  You specify what the attribute can be applied to by passing a combination of values from the IdentifierTypes enum inside Attribute to the base class.  Using an attribute calls the attribute's constructor.  That constructor is just a normal constructor that can have any syntax needed.
+
+~~~~
+class Attribute
+  ' Note complete listing of the class, but showing the IdentifierTypes enum
+
+  @[CombinableEnum]
+  enum IdentifierType
+    @enum
+    @struct
+    enumValue
+    @interface
+    @class
+    structBasedEnum
+    @procedure
+    @parameter
+    @property
+    @constructor
+    dataMember ' includes values inside a struct-based enum type
+~~~~
+
+Note: You saw usage of the CombinableEnumAttribute type in the discussion on [Enums].
+
+Using simple attributes
+-----------------------
+When you apply an attribute to something, use the syntax below.  Note the "Attribute" part of the attribute's name is missing.  The parser should append that automatically.  This syntax is for everything but data members and parameters.  It  also assumes the Attribute doesn't need parameters.
+
+~~~~
+@[AttributeName]
+'declare something
+~~~~
+
+The reason for the combination of @ and \[\] should be clear shortly.  Below is the syntax for data members and parameters.  This time, the attribute goes immediately before the member/parameter name.
+
+~~~~
+var String @[AttributeName] strValue
+var @[AttribueName] s$
+var &amp; int @[AttributeName] myInt
+~~~~
+
+Applying  multiple attributes
+-----------------------------
+If you need to apply several attributes, just use them one after the other, on the same line if needed.
+
+~~~~
+var String @[Attribute1]@[Attribute2] myString
+~~~~
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 02:46:06 -0000</pubDate><guid>https://sourceforge.netf197bedc9c5be487663592eea08d386571d3abdc</guid></item><item><title>Attributes modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Attributes/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;.NET attributes and Java annotations serve similar purposes.  However, .NET's attribute system is more powerful.  Java annotations can't take parameters.  They're implemented as a simple interface.  Attributes are actual classes which can take parameters.  Java has very few annotations while .NET has an extensive attribute ecosystem.  Hence, ASIL follows the .NET system with attributes.&lt;/p&gt;
&lt;p&gt;Like in .NET, attributes can be applied to most identifiers when they are declared.  .NET allows attribute classes to specify restrictions on which types of identifiers the attribute being declared can applied to.  ASIL does the same.  The table below lists what identifier types attributes in general can be applied to.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Identifier type&lt;/th&gt;
&lt;th&gt;Can have attributes&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;conditional&lt;/strong&gt;]&lt;/span&gt; variable&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;These only exist at compile-time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;constant member&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;These also exist at compiler-type only, at least as a named constant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;custom keyword&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;namespace&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;local variable&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;If you need to pass it to a procedure that needs attributes, put them on the parameter of the procedure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;creator&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;destructor&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;primitve-based enum&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;In fact, use an attribute to direct the compiler to allow values of your type to be combined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;entry inside a primitive-based enum&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;struct&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;interface&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;class&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;struct-based enum&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;entry inside a struct-based enum&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;These are just instances of the type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;global variable (DASIL only)&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;global procedure (DASIL only)&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;data member&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;constructor&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;command&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;function&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;complex statement&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;property&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;accessor of a &lt;span&gt;[&lt;strong&gt;property&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;delegate&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span&gt;[&lt;strong&gt;event&lt;/strong&gt;]&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 09 Feb 2014 02:07:59 -0000</pubDate><guid>https://sourceforge.netebc56f560496c08cfffbb8b3ab223e75fc0a608f</guid></item></channel></rss>