I suggest you ...

add a "ignore keyword" option/list for quick diff/merge compiler adaption without a full parser

think of a C compiler for an embedded target that has some special keywords that lead to parsing errors

5 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    ChristianChristian shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Piotr MisPiotr Mis commented  ·   ·  Flag as inappropriate

        I personally would imagine this as kind of preprocessor.

        You could list set of #defines and before semantic parse all defines would be replaced.

        Imagine following example:

        interrupt void int_handler(void);

        To "semantic_c.conf" you could put:
        #define interrupt

        Than the code seen by semantic parser will look like:
        void int_handler(void);

        Other example:
        FUNC(void, AUTOMATIC) foo( VAR(uint8, AUTOMATIC) bar);

        put to semantic_c.conf:
        #define FUNC(rettype, memclass) rettype
        #define VAR(type, memclass) type

        And voila:
        final code will be seen as:
        void foo( uint8 bar);

      Feedback and Knowledge Base