+static void ifdef_directive(int is_ifndef)
+{
+ (void) is_ifndef;
+ lexer_next_preprocessing_token();
+ //expect_identifier();
+ //extect_newline();
+}
+
+static void endif_directive(void)
+{
+ //expect_newline();
+}
+
+static void parse_line_directive(void)
+{
+ if(pp_token.type != T_INTEGER) {
+ parse_error("expected integer");
+ } else {
+ lexer_token.source_position.linenr = pp_token.v.intvalue - 1;
+ next_pp_token();
+ }
+ if(pp_token.type == T_STRING_LITERAL) {
+ lexer_token.source_position.input_name = pp_token.v.string;
+ next_pp_token();
+ }
+
+ eat_until_newline();
+}
+
+static void parse_preprocessor_identifier(void)
+{
+ assert(pp_token.type == T_IDENTIFIER);
+ symbol_t *symbol = pp_token.v.symbol;
+
+ switch(symbol->pp_ID) {
+ case TP_include:
+ printf("include - enable header name parsing!\n");
+ break;
+ case TP_define:
+ define_directive();
+ break;
+ case TP_ifdef:
+ ifdef_directive(0);
+ break;
+ case TP_ifndef:
+ ifdef_directive(1);
+ break;
+ case TP_endif:
+ endif_directive();
+ break;
+ case TP_line:
+ next_pp_token();
+ parse_line_directive();
+ break;
+ case TP_if:
+ case TP_else:
+ case TP_elif:
+ case TP_undef:
+ case TP_error:
+ error_directive();
+ break;
+ case TP_pragma:
+ break;
+ }
+}
+
+static void parse_preprocessor_directive(void)
+{
+ next_pp_token();
+
+ switch(pp_token.type) {
+ case T_IDENTIFIER:
+ parse_preprocessor_identifier();
+ break;
+ case T_INTEGER:
+ parse_line_directive();
+ break;
+ default:
+ parse_error("invalid preprocessor directive");
+ eat_until_newline();
+ break;