get Ada language syntax highlight

get Ada language syntax highlight

4
NewbieNewbie
4

    Apr 21, 2005#1

    Hi,

    i wonder here is someone using Ada95 or Ada83.

    i just finished the edit of syntax highlight of Ada language. and i am not sure it perfectly works.

    i will be happy if anyone happy to do it, or some feedback like as non proper function or working.

    Copy below and paste your wordfile.txt file. check the language number. it is number 12. see /L12

    C. H. Koo :lol:

    --------------------------------------------------------------- start
    /L12"Ada" ADA_LANG Nocase Block Comment On = -- String Chars = " File Extensions = ADA ADB ADS SPC BDY
    /Delimiters = :;*-+/= <> => () '' , .
    /Function String = "%[a-zA-Z_]*:=*);'"
    /Open Brace Strings = "("
    /Close Brace Strings = ")"
    /C1"Keywords"
    abort abs abstract accept access aliased all and array at
    begin body
    case constant
    declare delay delta digits do
    else elsif end entry exception exit
    for function
    generic goto
    if in is
    limited loop
    mod
    new not null
    of or others out
    package pragma private procedure protected
    raise range record rem renames requeue return reverse
    select separate subtype
    tagged task terminate then type
    until
    use
    when while with xor
    /C2"Ada Data Types"
    boolean
    character
    integer
    float
    wide_character
    /C3"Ada Directives"
    pragma
    /C4"Ada Attributes"
    'access 'address 'adjacent 'aft 'alignment
    'base 'bit_order 'body_version
    'callable 'caller 'ceiling 'class 'component_size 'compose 'constrained 'copy_sign 'count
    'definite 'delta 'denorm 'digits
    'exponent 'external_tag
    'first 'first_bit 'floor 'fore 'fraction
    'identity 'image 'input
    'last 'last_bit 'leading_part 'length
    'machine 'machine_emax 'machine_emin 'machine_mantissa 'machine_overflows 'machine_radix 'machine_rounds 'max 'max_size_in_storage_elements 'min 'model 'model_emin 'model_epsilon 'model_mantissa 'model_small 'modulus
    'output
    'partition_id 'pos 'position 'pred
    'range 'read 'remainder 'round 'rounding
    'safe_first 'safe_last 'scale 'scaling 'signed_zeros 'size 'small 'storage_pool 'storage_size 'succ
    'tag 'terminated 'truncation
    'unbiased_rounding 'unchecked_access
    'val 'valid 'value 'version
    'wide_image 'wide_value 'width 'write
    /C5"Operators"
    +
    -
    = =>
    * **
    // /
    < <= <>
    > >=
    : :=
    . ..

    --------------------------------------------------------------- end

    119
    Power UserPower User
    119

      Apr 21, 2005#2

      Here are a couple of additions/tweaks from my Ada entry:

      Code: Select all

      /Function String = "%[ ^t]++function[ ^t]+^([a-zA-Z0-9_]+^)"
      /Function String 1 = "%[ ^t]++procedure[ ^t]+^([a-zA-Z0-9_]+^)"
      /Indent Strings = "then" "is" "loop" "begin" "record" "=>" "else"
      /Unindent Strings = "end" "begin" "record" "when" "else"

      4
      NewbieNewbie
      4

        Apr 22, 2005#3

        thanks, mjcarman.

        i added some fix, and included your suggestion!

        Code: Select all

        /L2"Ada" ADA_LANG Nocase Line Comment = -- String Chars = " File Extensions = ADA ADB ADS SPC BDY
        /Delimiters = :;*-+/=	<>	=>	()	''	,	.
        /Function String = "%[ ^t]++function[ ^t]+^([a-zA-Z0-9_]+^)" 
        /Function String 1 = "%[ ^t]++procedure[ ^t]+^([a-zA-Z0-9_]+^)" 
        /Indent Strings = "then" "is" "do" "loop" "begin" "record" "=>" "else" 
        /Unindent Strings = "end" "begin" "record" "when" "else"
        /Open Brace Strings =  "("
        /Close Brace Strings = ")"
        /C1"Keywords"
        abort abs abstract accept access aliased all and array at
        begin body
        case constant
        declare delay delta digits do
        else elsif end entry exception exit
        for function
        generic goto
        if in is
        limited loop
        mod
        new not null
        of or others out
        package pragma private procedure protected
        raise range record rem renames requeue return reverse
        select separate subtype
        tagged task terminate then type
        until use
        when while with xor
        /C2"Ada Data Types"
        boolean
        character
        duration
        float
        integer
        long_integer long_float
        natural
        positive
        string
        wide_character wide_string
        /C3"Ada Directives"
        pragma
        /C4"Ada Attributes"
        'access 'address 'adjacent 'aft 'alignment
        'base 'bit_order 'body_version
        'callable 'caller 'ceiling 'class 'component_size 'compose 'constrained 'copy_sign 'count
        'definite 'delta 'denorm 'digits
        'exponent 'external_tag
        'first 'first_bit 'floor 'fore 'fraction
        'identity 'image 'input
        'last 'last_bit 'leading_part 'length
        'machine 'machine_emax 'machine_emin 'machine_mantissa 'machine_overflows 'machine_radix 'machine_rounds 'max 'max_size_in_storage_elements 'min 'model 'model_emin 'model_epsilon 'model_mantissa 'model_small 'modulus
        'output
        'partition_id 'pos 'position 'pred
        'range 'read 'remainder 'round 'rounding
        'safe_first 'safe_last 'scale 'scaling 'signed_zeros 'size 'small 'storage_pool 'storage_size 'succ
        'tag 'terminated 'truncation
        'unbiased_rounding 'unchecked_access
        'val 'valid 'value 'version
        'wide_image 'wide_value 'width 'write
        /C5"Operators"
        +
        -
        = => 
        * **
        // /
        < <= <>
        > >=
        : :=
        . ..
        

          Apr 22, 2005#4

          hi,

          it's final. indention is fixed.

          have a nice weekend!

          Code: Select all

          /L2"Ada" ADA_LANG Nocase Line Comment = -- String Chars = " File Extensions = ADA ADB ADS SPC BDY
          /Delimiters = :;*-+/=	<>	=>	()	''	,	.
          /Function String = "%[ ^t]++function[ ^t]+^([a-zA-Z0-9_]+^)" 
          /Function String 1 = "%[ ^t]++procedure[ ^t]+^([a-zA-Z0-9_]+^)" 
          /Indent Strings = "begin" "declare" "do" "else" "exception" "is" "loop" "private" "record" "=>" "or" "select" "then"
          /Unindent Strings =  "begin" "declare" "else" "end" "exception" "or" "private"
          /Open Brace Strings =  "("
          /Close Brace Strings = ")"
          /C1"Keywords"
          abort abs abstract accept access aliased all and array at
          begin body
          case constant
          declare delay delta digits do
          else elsif end entry exception exit
          for function
          generic goto
          if in is
          limited loop
          mod
          new not null
          of or others out
          package pragma private procedure protected
          raise range record rem renames requeue return reverse
          select separate subtype
          tagged task terminate then type
          until use
          when while with xor
          /C2"Ada Data Types"
          boolean
          character
          duration
          float
          integer
          long_integer long_float
          natural
          positive
          string
          wide_character wide_string
          /C3"Ada Directives"
          pragma
          /C4"Ada Attributes"
          'access 'address 'adjacent 'aft 'alignment
          'base 'bit_order 'body_version
          'callable 'caller 'ceiling 'class 'component_size 'compose 'constrained 'copy_sign 'count
          'definite 'delta 'denorm 'digits
          'exponent 'external_tag
          'first 'first_bit 'floor 'fore 'fraction
          'identity 'image 'input
          'last 'last_bit 'leading_part 'length
          'machine 'machine_emax 'machine_emin 'machine_mantissa 'machine_overflows 'machine_radix 'machine_rounds 'max 'max_size_in_storage_elements 'min 'model 'model_emin 'model_epsilon 'model_mantissa 'model_small 'modulus
          'output
          'partition_id 'pos 'position 'pred
          'range 'read 'remainder 'round 'rounding
          'safe_first 'safe_last 'scale 'scaling 'signed_zeros 'size 'small 'storage_pool 'storage_size 'succ
          'tag 'terminated 'truncation
          'unbiased_rounding 'unchecked_access
          'val 'valid 'value 'version
          'wide_image 'wide_value 'width 'write
          /C5"Operators"
          +
          -
          = => 
          * **
          // /
          < <= <>
          > >=
          : :=
          . ..
          

          261
          Basic UserBasic User
          261

            Apr 25, 2005#5

            Great work!

            I have a couple of comments/suggestions:

            1. Delimiters - I don't think so many spaces make any difference as long as there is one space. I had to add <tab>, but that may be due to cut-paste.

            2. If you have "or" as an indent string, why not "and"?

            3. I suggest you remove pragma from keywords (C1) since it has its own group (/C3"Ada Directives").

            4. Move xor to its own line in the C1 group.

            5. I thought words had to be sorted, but I sorted the operators, and didn't see any difference.

            6. I added two new groups of keywords. 1) Switches, for #ifdef style compiler switches, and 2) pragmas. I only use import and export, but you could add others as well.

            These are all minor issues. I found your overall effort to be excellent!

            Thanks,
            Dave
            ASTTMan
            I'm not a Texan, I just live here.

            4
            NewbieNewbie
            4

              Apr 26, 2005#6

              Thanks for your comments, ASTTMan.

              you pointed out the useful suggestion.

              i added "or" as an indent string because "or" is used at "select .. or statement" not logical operator "or" like "and". For the same reason, "and" is not appropriate for indent string.

              sorting is just for nice reading!

              Thanks ASTTMan. i fixed the content as your comment.

              Code: Select all

              /L2"Ada" ADA_LANG Nocase Line Comment = -- String Chars = " File Extensions = ADA ADB ADS SPC BDY
              /Delimiters = :;*-+/=	<>	=>	()	''	,	.
              /Function String = "%[ ^t]++function[ ^t]+^([a-zA-Z0-9_]+^)" 
              /Function String 1 = "%[ ^t]++procedure[ ^t]+^([a-zA-Z0-9_]+^)" 
              /Indent Strings = "begin" "declare" "do" "else" "exception" "is" "loop" "private" "record" "=>" "or" "select" "then" "use"
              /Unindent Strings =  "begin" "declare" "else" "end" "exception" "loop;" "or" "private" "record;"
              /Open Brace Strings =  "("
              /Close Brace Strings = ")"
              /C1"Keywords"
              abort abs abstract accept access aliased all and array at
              begin body
              case constant
              declare delay delta digits do
              else elsif end entry exception exit
              for function
              generic goto
              if in is
              limited loop
              mod
              new not null
              of or others out
              package pragma private procedure protected
              raise range record rem renames requeue return reverse
              select separate subtype
              tagged task terminate then type
              until use
              when while with
              xor
              /C2"Ada Data Types"
              boolean
              character
              duration
              float
              integer
              long_integer long_float
              natural
              positive
              string
              wide_character wide_string
              /C3"Ada Attributes"
              'access 'address 'adjacent 'aft 'alignment
              'base 'bit_order 'body_version
              'callable 'caller 'ceiling 'class 'component_size 'compose 'constrained 'copy_sign 'count
              'definite 'delta 'denorm 'digits
              'exponent 'external_tag
              'first 'first_bit 'floor 'fore 'fraction
              'identity 'image 'input
              'last 'last_bit 'leading_part 'length
              'machine 'machine_emax 'machine_emin 'machine_mantissa 'machine_overflows 'machine_radix 'machine_rounds 'max 'max_size_in_storage_elements 'min 'model 'model_emin 'model_epsilon 'model_mantissa 'model_small 'modulus
              'output
              'partition_id 'pos 'position 'pred
              'range 'read 'remainder 'round 'rounding
              'safe_first 'safe_last 'scale 'scaling 'signed_zeros 'size 'small 'storage_pool 'storage_size 'succ
              'tag 'terminated 'truncation
              'unbiased_rounding 'unchecked_access
              'val 'valid 'value 'version
              'wide_image 'wide_value 'width 'write
              /C4"Operators"
              +
              -
              = => 
              * **
              // /
              < <= <>
              > >=
              : :=
              . ..