Wiki

Changes between Version 3 and Version 4 of CompilerDirectives

Show
Ignore:
Timestamp:
10/14/12 22:24:17 (12 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CompilerDirectives

    v3 v4  
    1 Compiler directives are options, instructions, hints provided to compiler[[BR]] 
    2 from with in code files. especially in cobra they are much more than[[BR]] 
    3 #define,#if of c,c++,c#. In cobra one can pass arguments to compiler[[BR]] 
    4 from within code file. which otherwise needs to be passed from commandline.[[BR]] 
     1= Cobra Compiler Directives = 
     2 
     3Compiler directives are options, instructions or hints provided to compiler[[BR]] 
     4from within code files. These may be items also provided as commandline args. 
    55 
    66 
    7 various cobra Compiler directives are[[BR]] 
     7The various cobra Compiler directives are[[BR]] 
    88 
    99 @args[[BR]] 
    10  @number[[BR]] 
    1110 @ref[[BR]] 
    1211 @help[[BR]] 
    13  @throw       <---for internal use by cobra..[[BR]] 
     12 @number[[BR]] 
     13 @platform[[BR]] 
    1414 @error[[BR]] 
    1515 @warning[[BR]] 
    16 [[BR]] 
    17 [[BR]] 
    18 [[BR]] 
     16 @throw       <---for internal use by cobra..[[BR]] 
     17 
     18 
    1919 
    2020 
    2121 '''@args'''[[BR]] 
    22  1) @args -t:winexe [[BR]] 
    23      is a example of specifing that current assembly shouldbe compiled as[[BR]] 
     22 Specifies the provision of a (cobra compiler commandline) arg.[[BR]] 
     23 The option follows the @args as if given on the compiler commandline. 
     24 
     25 e.g.[[BR]] 
     26{{{ @args -t:winexe }}} 
     27     specify a compiler option giving a commandline arg that indicates that the current assembly should be compiled as a 
    2428     Windows Executable[[BR]] 
    25  2) @args -lib:'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0' 
    26      is a example of specifing search directory for assemblies by cobra compiler 
    27      to find the referenced assemblies.[[BR]] 
    28 [[BR]] 
    29 [[BR]] 
    30 [[BR]] 
     29{{{@args -lib:'C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0' }}} 
     30     specifies a search directory for the cobra compiler to look in  
     31     to find any referenced assemblies.[[BR]] 
     32 
     33 
     34 
    3135 
    3236'''@ref'''[[BR]] 
    33  1)@ref "PresentationFramework"[[BR]] 
    34          is a example of referencing  "PresentationFramework" assembly from GAC which [[BR]] 
    35          would otheriwse have been -ref:"PresentationFramework" on commandline[[BR]] 
    36  2) @ref 'c:\somedirectory\validAssembly.exe'[[BR]] 
    37  3) @ref 'c:\somedirectory\validAssembly.dll'[[BR]] 
    38          above two examples reference assemblies by giving absolute paths for both .exe and .dll[[BR]] 
    39 [[BR]] 
    40 [[BR]] 
    41 [[BR]] 
     37 Indicates explicitly an assembly filename for the resolution of (used) references.  
     38 
     39e.g.[[BR]] 
     40{{{ 
     41@ref "PresentationFramework" 
     42}}} 
     43   specifies referencing  "PresentationFramework" assembly from GAC which 
     44         could otherwise have been given as -ref:"PresentationFramework" on the commandline[[BR]] 
     45{{{ 
     46@ref 'c:\somedirectory\validAssembly.exe' 
     47@ref 'c:\somedirectory\validAssembly.dll' 
     48}}} 
     49   specifies referencing assemblies by giving absolute paths to both .exe and .dll files[[BR]] 
     50 
     51 
     52 
    4253'''@help'''[[BR]] 
    43  1)http://cobra-language.com/forums/viewtopic.php?f=4&t=810&p=4195#p4125 
    44 [[BR]] 
    45 [[BR]] 
    46 [[BR]] 
    47 [[BR]] 
     54Directive to generate an HTML help file for a given expression, statement or declaration.[[BR]] 
     55The output file is intended to give the developer: 
     56 * information about the topic in general 
     57 * interfaces to types 
     58 * a link to the Cobra wiki where appropriate 
     59 * a link to the specific type's documentation on the web, where determinable 
     60 * ready-made search links 
     61 
     62 See http://cobra-language.com/forums/viewtopic.php?f=4&t=810&p=4195#p4125 
     63 
     64 
     65 
     66 
     67 
     68 
    4869'''@number'''[[BR]] 
    49  1)http://cobra-language.com/trac/cobra/wiki/Troubleshooting 
     70 Set the actual numeric type for any uses of both the 'Number' type and the default numeric type for any fractional literals (such as '1.0').[[BR]] 
     71 
     72This usually defaults to Decimal. 
     73( see CommandLine option 'Number') 
     74 
     75 
     76 See http://cobra-language.com/trac/cobra/wiki/Troubleshooting 
     77 
     78 
     79 
     80'''@platform'''[[BR]] 
     81Directive to specify that this source is specifically intended (only) for a specific platform. 
     82Presumably the code uses libraries or API's only available on that platform.  
     83If the platform directive and the compiler option backend settings are not compatible compilation will be aborted. 
     84 
     85Values may be one of : 
     86 * any - default - build on any platform (explicitly)  
     87 * portable  - (future) build for a 'portable' platform 
     88 * clr - build for a CLR platform ( .Net - Windows and mono) 
     89 * jvm - build for a jvm platform 
     90 * objc - (future) build for an objective-C platform 
     91 
     92 
     93e.g. 
     94{{{ 
     95@platform jvm 
     96# build only on/for jvm platform  
     97 
     98@platform any 
     99# same as default 
     100}}} 
     101 
     102Additional (or different) platforms may be supported (or completed) in the future.