Title: Language Notes _______________________________________________________________________________ This is more for my personal reference than anything else. ___________________________________________________________________________ Topic: Prototype Parameter Styles ___________________________________________________________________________ Parameters via Commas, Typed via Spaces: > FunctionName ( type indentifier, type identifier = value, modifier type identifier ) > FunctionName ( indentifier, identifier = value ) The general idea is that parameters are separated by commas. Identifiers cannot contain spaces. Types and modifiers, if available, are separated from the identifiers with spaces. There may be an equals sign to set the default value. So parsing means splitting by commas, stripping everything past an equals sign for the default value, stripping everything after the last space for the identifier, and the rest is the type. If there are no internal spaces after the default value is stripped, it's all identifier. Note that internal parenthesis, brackets, braces, and angle brackets should be parsed out. They may be present in default values or types and any commas and equal signs in them should not be included. Applies to C++, Java, C#, JavaScript, Python, PHP, Ruby. Applies to Perl as well, even though it doesn't have any real parameter declaration structure. Just adding it with comments is fine. Parameters via Semicolons and Commas, Typed via Colons: > FunctionName ( identifier: type; identifier, identifier: type; identifier: type := value ) Parameters via semicolons, types via colons. However, there can be more than one parameter per type via commas. Default values via colon-equals. Applies to Pascal, Ada. SQL: > FunctionName ( identifier type, identifier modifier type, identifier type := value ) Parameters separated by commas. Identifiers come before the types and are separated by a space. Default values are specified with colon-equals. > FunctionName @identifier type, @dentifier modifier type, @identifier type = value Microsoft's SQL uses equals instead of colon-equals, doesn't need parenthesis, and starts its parameter names with an @ symbol. Visual Basic: > FunctionName ( modifiers identifier as type, identifier = value ) Parameters separated by commas. Default values via equals. However, any number of modifiers may appear before the identifier. Those modifiers are ByVal, ByRef, Optional, and ParamArray. Tcl: > FunctionName { identifier identifier { whatever } } { code } Identifiers are specified in the first set of braces and have no commas. However, they can be broken out into sub-braces. ___________________________________________________________________________ Topic: Syntax References ___________________________________________________________________________ C++ - http://www.csci.csusb.edu/dick/c++std/syntax.html C# - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/CSharpSpecStart.asp. Open in IE. Java - http://cui.unige.ch/db-research/Enseignement/analyseinfo/ Ada - http://cui.unige.ch/db-research/Enseignement/analyseinfo/ SQL - http://cui.unige.ch/db-research/Enseignement/analyseinfo/, , or (open in IE). JavaScript - http://academ.hvcc.edu/~kantopet/javascript/index.php Python - http://www.python.org/doc/2.3.4/ref/ref.html PHP - http://www.php.net/manual/en/langref.php Visual Basic - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbls7/html/vbspecstart.asp. Open in IE. Pascal - . Open in IE. Ruby - http://www.rubycentral.com/book/ ActionScript 2 - ActionScript 3 - E2X - http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdf R - Somewhere on http://www.r-project.org. ColdFusion - Eiffel - http://www.gobosoft.com/eiffel/syntax/