Blame | Last modification | View Log | Download
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 everythingafter the last space for the identifier, and the rest is the type. If there are no internal spaces after the default value isstripped, it's all identifier.Note that internal parenthesis, brackets, braces, and angle brackets should be parsed out. They may be present in defaultvalues 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 commentsis 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 arespecified with colon-equals.> FunctionName @identifier type, @dentifier modifier type, @identifier type = valueMicrosoft'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 theidentifier. 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.htmlC# - 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/,<http://www.cs.umb.edu/cs634/ora9idocs/appdev.920/a96624/13_elems.htm>, or<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_tsqlcon_6lyk.asp?frame=true> (open in IE).JavaScript - http://academ.hvcc.edu/~kantopet/javascript/index.phpPython - http://www.python.org/doc/2.3.4/ref/ref.htmlPHP - http://www.php.net/manual/en/langref.phpVisual Basic - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbls7/html/vbspecstart.asp. Open in IE.Pascal - <http://pages.cpsc.ucalgary.ca/~becker/231/SyntaxDiagrams/pascal-syntax_files/frame.htm>. Open in IE.Ruby - http://www.rubycentral.com/book/ActionScript 2 - <http://download.macromedia.com/pub/documentation/en/flash/fl8/fl8_as2lr.pdf>ActionScript 3 - <http://download.macromedia.com/pub/documentation/en/flex/2/prog_actionscript30.pdf>E2X - http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdfR - Somewhere on http://www.r-project.org.ColdFusion - <http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/contents.htm>Eiffel - http://www.gobosoft.com/eiffel/syntax/