AST node definition DSL #24

Open
opened 2025-10-22 14:16:41 +02:00 by alexander.nutz · 0 comments
group ast
group pp_ast : ast

/// identifier used by other preprocess ast nodes
type pp_ident : pp_ast {}

/// maps 1:1 to `#define var val`
type pp_define_var : pp_ast {
  name: pp_ident,
  value: pp_ast
}

type pp_ifdef : pp_ast {
  what: pp_ident,
  /// note that cases that were not chosen might be incorrect
  was_defined: bool,
  then: pp_ast,
  otherwise: ?pp_ast
}

the implementation for that DSL should be a self contained 100% standard c89 compliant file

```d group ast group pp_ast : ast /// identifier used by other preprocess ast nodes type pp_ident : pp_ast {} /// maps 1:1 to `#define var val` type pp_define_var : pp_ast { name: pp_ident, value: pp_ast } type pp_ifdef : pp_ast { what: pp_ident, /// note that cases that were not chosen might be incorrect was_defined: bool, then: pp_ast, otherwise: ?pp_ast } ``` the implementation for that DSL should be a self contained 100% standard c89 compliant file
alexander.nutz stopped working 2025-11-03 16:18:15 +01:00
48 minutes 22 seconds
alexander.nutz added reference feat/24-ast-dsl 2025-11-03 16:19:18 +01:00
alexander.nutz added spent time 2025-11-04 07:06:35 +01:00
30 minutes
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 1 hour 18 minutes
alexander.nutz
1 hour 18 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
click-project/click#24
No description provided.