aboutsummaryrefslogtreecommitdiffhomepage
path: root/symbols-extract.tes
blob: 08ab2d739b2040cbe2e36ce14239cf859ceae96e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!./sciteco-minimal -m
! ./symbols-extract.tes <input file> <output file> <prefix> <array name> !

! <pos1,pos2>Mc - Compare string at pos1 with string at pos2 !
@^Uc{
  U.2U.1 -.%.1^[ -.%.2^[
  <Q.1A-(Q.2A)U.c Q.1A"A|Q.2A"A|;'' Q.c"N;' %.1^[%.2>
  Q.c
}

! <i,j>Mx - Exchange line at I with line at J (I < J), returning new J !
@^Ux{
  U.jU.i
  Q.jJ X.xK
  Q.iJ G.x .-Q.i%.j^[ .-(X.xL.)%.j^[ -K
  Q.jJ G.x
  Q.j
}

! <i,j>Mq - Sort lines beginning at I until J using Quicksort algorithm !
@^Uq{
  U.rU.l

  Q.l-Q.r"<
    Q.lU.i Q.rJB .U.j

    <
      Q.iJ <.,Q.rMc-1; .-Q.r;    L> .U.i
      Q.jJ <.,Q.rMc:;  .-Q.l-1:; B> .U.j

      Q.i-Q.j;

      Q.i,Q.jMxU.j
    >

    Q.i,Q.rMc"> Q.i,Q.rMxU.r '

    Q.l-Q.i"< Q.iJB Q.l,.Mq '
    Q.i-Q.r"< Q.iJL .,Q.rMq '
  '
}

! read commandline arguments !
LR 0Xi 2LR 0Xo 2LR 0Xp 2LR 0Xn HK

! copy all defines in input file beginning with prefix !
EBQi <S#define^SQp; :Xa> EF

! sort all defines !
Ga ZJB 0,.Mq J

! format as C/C++ array !
I/*
 * AUTOGENERATED - DO NOT EDIT
 */
#include <glib.h>

#include "Qi"
#include "symbols.h"

static const SymbolList::Entry entries[] = {

<
  .,W.Xa 0K
  I#ifdef QpQa

  ^I{"Qa", V I ^EQp^EQa},
#endif
  L .-Z;
>
I};

/* overwrites weak object in symbols.cpp */
SymbolList Symbols::Qn(entries, G_N_ELEMENTS(entries));


! write output file !
EWQo

EX