2024-09-15 03:38:38 +02:00
2024-09-14 02:57:13 +02:00
2024-09-14 21:29:49 +02:00
2024-09-14 01:56:14 +02:00
2024-09-12 22:22:23 +02:00
2024-09-15 03:38:38 +02:00
2024-09-15 02:19:58 +02:00
2024-09-14 21:29:34 +02:00

TBSP

Tree-Based Source-Processing language

XXX: sort out the name situation

Language semantics

Flex/Bison like.

<declaration-section>
%%
<rule-section>
%%
<code-section>

Declaration section

%top { <...> }    // code to be pasted at the top of the source file
%language <lang>  // tree-sitter langauge name (for the right includes)

Rule section

[enter|leave]+ <node-type> { <...> } // code to run when tree-sitter node-type <node-type> is encountered/popped from

Code

The code section is verbatim pasted to the end of the output file.

Globals

int tbtraverse(const char * const code);    // master function; rules are evaluated here

In tbtraverse

GET_TBTEXT;              // macro that returns a `char *` to the current node's text value (not ts_node_string); its the programmers responsibility to free() it
GET_TBTEXT_FROM_NODE(x); // macro that returns a `char *` to the passed in node's text value (not ts_node_string); its the programmers responsibility to free() it
// XXX: these should probably be renamed
TSNode current_node;    // node corresponding to the rule
// XXX need a macro bool for leave/enter
Description
No description provided
Readme 102 KiB
Languages
C 79.4%
Lex 7.5%
C++ 4.6%
Yacc 3.7%
Ruby 2.7%
Other 2.1%