0

Nodes:

  • building a gcc_tree_node for a custom prograimming language

  • compile and base on C++26

  • the modules are avilable

  • the language using tab-block system

  • every keyword start with '/'

I want to build programming language base on GCC compiler, I had search and find no information about how to use GCC source code, but all I need is know how to turning the parsed Nodes or parse them direct to C++26 AST and processe as C++ code without make a buffer.cpp, can anyone help?

here an example (just for illustration):

/get /cpp std;

/fn println(str text)
    /ret /cpp
        std::cout << __sk_uceanlang_funarg_name__text;
/-> $
    println("Hi ") << $1 << '\n';

which read as following c++ nodes

  • '/get' -> 'import'
  • '/fn' -> create an auto/void function as return or not
  • '/ret' -> 'return'
  • '/->' -> 'main function'
  • '$' after '/->' for using args
1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Sep 20 at 23:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.