source: PSPA/madxPSPA/src/mad_macro.h @ 445

Last change on this file since 445 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.3 KB
Line 
1#ifndef MAD_MACRO_H
2#define MAD_MACRO_H
3
4// types
5
6struct char_array;
7struct char_p_array;
8struct name_list;
9struct in_cmd;
10
11struct macro     /* stores one line or macro definition */
12{
13  char name[NAME_L];
14  int n_formal;                 /* no. of formal parameters */
15  int dead;                     /* set to 1 to prevent line from expansion */
16  struct char_p_array* formal;  /* list of formal parameters */
17  struct char_p_array* tokens;  /* token pointers into body if split (line) */
18  struct char_array* body;      /* contains all statements */
19  int stamp;
20};
21
22struct macro_list
23{
24  int stamp;
25  char name[NAME_L];
26  int  max,                     /* max. pointer array size */
27       curr;                    /* current occupation */
28  struct name_list* list;
29  struct macro** macros;
30};
31
32// interface
33
34int           make_macro(char* statement);
35struct macro* new_macro(int n_formal, int length, int p_length);
36
37struct macro_list* new_macro_list(int length);
38void               add_to_macro_list(struct macro*, struct macro_list*);
39int                remove_from_name_list(char* name, struct name_list*);
40
41void  disable_line(char* name, struct macro_list*);
42void  replace_lines(struct macro*, int replace, char** reps);
43
44void  exec_macro(struct in_cmd*, int pos);
45
46#endif // MAD_MACRO_H
47
Note: See TracBrowser for help on using the repository browser.