2022-08-03 14:55:04 +00:00
|
|
|
#!/usr/bin/env sh
|
2022-07-18 13:59:47 +00:00
|
|
|
cd "$(dirname $0)"/../src/AST
|
|
|
|
|
|
|
|
if [ "$1" == "" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
touch $1.cpp
|
|
|
|
touch $1.h
|
|
|
|
|
|
|
|
cat << EOF > $1.h
|
|
|
|
#pragma once
|
|
|
|
#include "ExprNode.h"
|
|
|
|
|
|
|
|
class $1 final : public ExprNode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
$1();
|
|
|
|
~$1();
|
|
|
|
|
|
|
|
llvm::Value* codegen(IRBuilder* generator) override;
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat << EOF > $1.cpp
|
|
|
|
#include "$1.h"
|
|
|
|
|
|
|
|
$1::$1()
|
|
|
|
: ExprNode()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
$1::~$1()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
llvm::Value* $1::codegen(IRBuilder* generator)
|
|
|
|
{
|
|
|
|
return llvm::ConstantInt::getSigned(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()),
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
EOF
|