• News:
    • From 0.19 alpha6
      • added #include keyword


  • Useful information:
    From v0.15 is automaticaly defined macro DEBUG when DS=DEBUGSYM/S argument has been set. This simplifies special parts of code for debugging. From v0.14 is PowerD PreProcessor fully global, it means that You are not so limited like in older versions. Now can be macros used everywhere You like.
    From v0.12 You can't use macros inside strings. If You use it, the macro won't be recognized. If You need it use sth like: 'str1'+MACRO+'str2', where MACRO is sth like 'str'.

  • Syntax:
    All preprocessor keywords leads with '#' character. This character must be always at the beginning of the line. Rest of the keyword can continue everywhere you like on the line.

  • Description:
    • #define name data
      Each occurence of name will be replaced with data.
    • #define name(arguments) data with args
      Each occurence of name(args) will be replaced with data with args where all arguments found in data with args will be replaced with args.
    • #ifdef name
      If macro called name is NOT defined, everything between this #ifdef and next #endif/#else will be skipped.
    • #ifndef name
      If macro called name IS defined, everything between this #ifdef and next #endif/#else will be skipped.
    • #else
      Allowed only after one of #ifdef or #ifndef. This makes possible to use eg. one code for debugging and other code for pure code.
    • #endif
      Allowed and required only after one of #ifdef or #ifndef.
    • #undefine name
      This turns off macro called name. If the macro name already undefined nothing will happen.
    • #redefine name
      If macro called name undefined, this will again redefine it, if no nothing will happen.
    • #include 'file'
      Contents of file will be placed into source code instead of this command.
        #define Hello PrintF('Hello\n')
        PROC main()
           Hello
        ENDPROC
    

    is the same as:
        PROC main()
           PrintF('Hello\n')
        ENDPROC
    
    
        #define AddThree(a,b,c) (a*b*c)
        a:=AddThree(1,2,3)
    

    is the same as:
        a:=1*2*3
    
        PROC main()
        #ifdef DEBUG
          PrintF('Debugging!\n')
        #else
          PrintF('Yea!\n')
        #endif
        ENDPROC
    

    Compile this with and without the DEBUGSYM/S cli argument and launch it, I thing it is clear :)

  • Special:
    From v0.12 you are able to use shorted object member assignation. PreProcessor will replace all of x:=.y by x:=x.y. Where x is an object and y is the object's member, but it mustn't begin with number!!!.

  • Note:
    In macro definition (#define) aren't currently recognized any comments so when You use them, use /* and */ comments. // and -> may make some problems like here:
      #define hello 'Hello\n'       // hello string
    
      hello,hello
    

    will be processed as
      'Hello\n'       // hello string,'Hello\n'       // hello string