• Acolyte of the Butterfly
    Acolyte of the Butterfly
    Posts: 138 from 2015/3/31
    Quote:

    asrael22 wrote:
    Basically my question is, is there a precompiled Pascal parser required, or can it be done using the generic parser with filling in some syntax dictionary keywords?
    It should work under m68k, too.



    This should be possible, Pascal has a more clear syntax than C for example. But if it is possible to do via your generic parser, depends on your parser ;-)
    I use in EdiSyn such a generic Parser which supports many formats which can be introduced via a text file
    https://github.com/alb42/fpc-tests/blob/master/lcl/SynUniHighlighter/Highlighters/

    for example: for Delphi/Object Pascal:
    https://github.com/alb42/fpc-tests/blob/master/lcl/SynUniHighlighter/Highlighters/Delphi.hgl

    This should already help, you can find the most keywords in there. In principle it would be enough to highlight the keywords (take care: Pascal is not case sensitive!)
    <KW Name="Pascal Terms"> Keywords see the list there
    <KW Name="Standard types"> available basic types see the list there

    Comments:
    <Range Name="Remarks {...}"> allows nesting
    <Range Name="Remarks //"> line comment like c
    <Range Name="Remarks (*...*)"> no Nesting!

    Strings:
    <Range Name="Strings"> -> 'string'

    Compiler directives:
    <Range Name="Directives"> {$...}

    and Numbers 0..9 e.g. 13232
    HexNumbers $0..F e.g. $DEADBEEF
    Chars #0..#255 e.g. #13#10 (CRLF on windows) #10 (LF on Unix/Amiga ;-))
  • »01.03.18 - 08:20
    Profile Visit Website