Skip to content

Repository files navigation

tplusplus (Little Transpiler): TypeScript to C++ 😩

I have no idea why, but here it is! A transpiler that parses TypeScript-like code into an Abstract Syntax Tree (AST) and then converts it to C++ code. Cool, right? 💁

Example Input (Typescript-like)

const myName: string = 'RickaPrincy';

function idk(value: number): number {
  return value * 5;
}

Resulting C++ Code:

#include <string>

std::string myName = "RickaPrincy";

int idk(int value) {
  return value * 5;
}

Supported AST Node Types:

  • ProgramNode: Represents the entire program.

  • StringLiteral: Represents string literals.

  • NumericLiteral: Represents numeric literals.

  • Identifier: Represents variables.

  • FunctionDeclarationNode: Represents function declarations.

  • BinaryExpressionNode: Handles binary operations like *.

  • ReturnStatementNode: Handles return statements.

About

tplusplus (Little Transpiler): TypeScript to C++ 😩

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages