mirror of
https://github.com/nasa/trick.git
synced 2025-06-09 10:51:49 +00:00
Some checks failed
Linux Python 2 / build (clang-devel gcc gcc-c++ java-11-openjdk-devel libxml2-devel llvm-devel llvm-static ncurses-devel openmotif openmotif-devel perl perl-Digest-MD5 udunits2 udunits2-devel which zlib-devel python2-devel python3-devel, map[arch:rhel]) (push) Has been cancelled
Linux Python 2 / build (map[], echo package manager already configured, bison clang flex git llvm make maven cmake zip, install -y, echo gtest already installed) (push) Has been cancelled
Linux Python 2 / build (map[arch:debian arch_ver:12 os:ubuntu tag:22.04], 2) (push) Has been cancelled
Linux Python 2 / build (map[arch:rhel arch_ver:7], yum -y install epel-release
yum -y update
, libX11-devel libXt-devel swig3 gtest-devel, yum) (push) Has been cancelled
Linux Python 2 / build (map[arch:rhel arch_ver:8 os:oraclelinux tag:8], 2) (push) Has been cancelled
Linux Python 2 / build (map[arch:rhel arch_ver:8 os:rockylinux tag:8], 2) (push) Has been cancelled
Linux Python 2 / build (map[arch:rhel arch_ver:8], dnf -y install epel-release
dnf -y update
dnf install -y 'dnf-command(config-manager)'
, dnf config-manager --enable powertools
dnf install -y gtest-devel
, dnf, swig diffutils) (push) Has been cancelled
Linux Python 2 / build (map[os:oraclelinux], dnf config-manager --enable ol8_codeready_builder
dnf install -y gtest-devel
) (push) Has been cancelled
Linux Python 2 / build (swig curl g++ libx11-dev libxml2-dev libxt-dev libmotif-common libmotif-dev zlib1g-dev llvm-dev libclang-dev libudunits2-dev libgtest-dev default-jdk python2.7-dev python3-dev python3-pip python3-venv, map[arch:debian], apt-get update, apt-get i… (push) Has been cancelled
32-bit Oracle / trick_32bit_oracle (push) Has been cancelled
Test Docker Hub Images / latest (trick_ubuntu1804) (push) Has been cancelled
More Linux / build (clang-devel gcc gcc-c++ java-11-openjdk-devel libxml2-devel llvm-devel llvm-static ncurses-devel openmotif openmotif-devel perl perl-Digest-MD5 udunits2 udunits2-devel which zlib-devel python2-devel python3-devel, map[arch:rhel]) (push) Has been cancelled
More Linux / build (map[], echo package manager already configured, bison clang flex git llvm make maven cmake zip, install -y, echo gtest already installed) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:10 os:debian tag:10], 2) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:10 os:debian tag:10], 3) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:10], apt-get install -y libgtest-dev
cd /usr/src/gtest
cmake .
make
cp libgtest* /usr/lib/
) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:11 os:debian tag:11], 2) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:11 os:debian tag:11], 3) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:11 os:ubuntu tag:20.04], 2) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:11 os:ubuntu tag:20.04], 3) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:11], export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y tzdata
) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:12 os:debian tag:bookworm], 2) (push) Has been cancelled
More Linux / build (map[arch:debian arch_ver:12 os:debian tag:bookworm], 3) (push) Has been cancelled
More Linux / build (map[arch:debian], 2, python2.7-dev) (push) Has been cancelled
More Linux / build (map[arch:rhel arch_ver:8 os:almalinux tag:8], 2) (push) Has been cancelled
More Linux / build (map[arch:rhel arch_ver:8 os:almalinux tag:8], 3) (push) Has been cancelled
More Linux / build (map[arch:rhel arch_ver:8], dnf -y install epel-release
dnf -y update
dnf install -y 'dnf-command(config-manager)'
, dnf config-manager --enable powertools
dnf install -y gtest-devel
, dnf, swig diffutils) (push) Has been cancelled
More Linux / build (swig curl g++ libx11-dev libxml2-dev libxt-dev libmotif-common libmotif-dev zlib1g-dev llvm-dev libclang-dev libudunits2-dev libgtest-dev default-jdk python3-dev python3-pip python3-venv, map[arch:debian], apt-get update, apt-get install -y libg… (push) Has been cancelled
* Added non regex comment detection solution * Remove comments correctly * Final iteration before debugging * Stopped reinventing the wheel * . * . * Fixed preprocessor handling * Updated tests * Added support for multiline comments * Expanded test * Refactor * Preprocessor context reset bug
235 lines
4.8 KiB
Plaintext
235 lines
4.8 KiB
Plaintext
#include "sim_objects//default_trick_sys.sm"
|
|
##include "Classes.hh"
|
|
|
|
// not sim objects, no namespace
|
|
class A : public Normal {
|
|
};
|
|
class B : public Template1<int> {};
|
|
class C : public Template2<int, Template1<Normal> > {};
|
|
|
|
// no namespace, sim object last
|
|
class D : public Normal, public Trick::SimObject {
|
|
public:
|
|
D() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromD : public D {
|
|
public:
|
|
DerivedFromD() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class E : public Template1<int>, public Trick::SimObject {
|
|
public:
|
|
E() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromE : public E {
|
|
public:
|
|
DerivedFromE() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class F : public Template2<int, Template1<Normal> >, public Trick::SimObject {
|
|
public:
|
|
F() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromF : public F {
|
|
public:
|
|
DerivedFromF() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
|
|
// no namespace, sim object first
|
|
class G : public Trick::SimObject, public Normal {
|
|
public:
|
|
G() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromG : public G {
|
|
public:
|
|
DerivedFromG() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class H : public Trick::SimObject, public Template1<int> {
|
|
public:
|
|
H() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromH : public H {
|
|
public:
|
|
DerivedFromH() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class I : public Trick::SimObject, public Template2<int, Template1<Normal> > {
|
|
public:
|
|
I() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromI : public I {
|
|
public:
|
|
DerivedFromI() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
|
|
// not sim objects, namespace
|
|
class J : public Foo::FooNormal {};
|
|
class K : public Foo::FooTemplate1<int> {};
|
|
class L : public Foo::FooTemplate2<int, Foo::FooTemplate1<Foo::FooNormal> > {};
|
|
|
|
// namespace, sim object last
|
|
class M : public Foo::FooNormal, public Trick::SimObject {
|
|
public:
|
|
M() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromM : public M {
|
|
public:
|
|
DerivedFromM() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class N : public Foo::FooTemplate1<int>, public Trick::SimObject {
|
|
public:
|
|
N() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromN : public N {
|
|
public:
|
|
DerivedFromN() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class O : public Foo::FooTemplate2<int, Foo::FooTemplate1<Foo::FooNormal> >, public Trick::SimObject {
|
|
public:
|
|
O() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromO : public O {
|
|
public:
|
|
DerivedFromO() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
|
|
// namespace, sim object first
|
|
class P : public Trick::SimObject, public Foo::FooNormal {
|
|
public:
|
|
P() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromP : public P {
|
|
public:
|
|
DerivedFromP() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class Q : public Trick::SimObject, public Foo::FooTemplate1<int> {
|
|
public:
|
|
Q() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromQ : public Q {
|
|
public:
|
|
DerivedFromQ() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class R : public Trick::SimObject, public Foo::FooTemplate2<int, Foo::FooTemplate1<Foo::FooNormal> > {
|
|
public:
|
|
R() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromR : public R {
|
|
public:
|
|
DerivedFromR() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
|
|
// SimObject templates!
|
|
template <class T>
|
|
class S : public Trick::SimObject {
|
|
public:
|
|
S() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromS : public S<int> {
|
|
public:
|
|
DerivedFromS() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
template <class U, class V>
|
|
class T : public S<int> {
|
|
public:
|
|
T() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromT : public T<int, Foo::FooTemplate1<Foo::FooNormal> > {
|
|
public:
|
|
DerivedFromT() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
|
|
// crazy stuff
|
|
class Crazy1 : Foo::FooNormal, virtual Normal, private Template1<short*>, protected virtual Template2<Normal, Foo::FooTemplate2<int, char&> >, public Trick::SimObject, virtual public Foo::FooTemplate1<Foo::FooNormal> {
|
|
public:
|
|
Crazy1() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
class DerivedFromCrazy1 : public Crazy1 {
|
|
public:
|
|
DerivedFromCrazy1() {
|
|
("initialization") foo();
|
|
}
|
|
};
|
|
|
|
//Comment parsing
|
|
class PT1 {
|
|
ParseTest pt1;
|
|
ParseTest pt2;
|
|
ParseTest pt3;
|
|
|
|
PT1():
|
|
pt1("TEST COM//MENT PARSING"),
|
|
pt2("TEST /*COMMENT PARSING"),
|
|
pt3("TEST COMMENT*/ PARSING")
|
|
{
|
|
char c = '"';
|
|
std::string s = "//";
|
|
c = '"';
|
|
|
|
s = "\"";
|
|
s = "//";
|
|
s = "\"";
|
|
}
|
|
|
|
bool angle_bracket_function() {
|
|
bool tmp = true;
|
|
tmp = 1 < 2; // > /*
|
|
return 1 < 2;
|
|
}
|
|
};
|