Debugger - Stage 2 (artf511247)
[deliverable/titan.core.git] / core / simplify.pl
CommitLineData
970ed795 1###############################################################################
d44e3c4f 2# Copyright (c) 2000-2016 Ericsson Telecom AB
970ed795
EL
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
d44e3c4f 7#
8# Contributors:
9# Balasko, Jeno
10# Raduly, Csaba
11#
970ed795
EL
12###############################################################################
13#! /usr/bin/perl -w
14use strict;
15
16my $is_enum = 0;
17
18print <<HEAD;
19#ifndef TITAN_LOGGER_API_SIMPLE_HH
20#define TITAN_LOGGER_API_SIMPLE_HH
21namespace TitanLoggerApiSimple {
22
23HEAD
24
25while (<>) {
26 if ($is_enum) { # already found the start of an enum
27 if (/enum\s*enum_type\s*{\s*([^}]+)};/) {
28 print $_; # copy enum_type
29 }
30 elsif (/^};$/) {
31 print $_; # copy the closing brace
32 $is_enum = 0;
33 }
34 }
35 else {
36 if (my ($class, $base) = /class\s*(\w+)\s*:\s*public\s*(\w+)\s*{\s*\/\/\s*enum/) {
37 print "\nclass $class {\npublic:\n";
38 $is_enum = 1;
39 }
40 }
41}
42
43print <<TAIL;
44} // end namespace
45#endif
46TAIL
This page took 0.040418 seconds and 5 git commands to generate.