summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Concurrency/CC_command.l
blob: 57ff98ea2220bb57e27ba696e5997170c4ed9d67 (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
/* $id$
 * ============================================================================
 *
 * = LIBRARY
 *    TAO/orbsvcs/tests
 *
 * = FILENAME
 *    CC_command.l
 *
 * = DESCRIPTION
 *   This is the lex file for the concurrency service script language.
 *
 * = AUTHORS
 *	Torben Worm <tworm@cs.wustl.edu>
 *
 * ============================================================================
 */
%option noyywrap nounput noinput always-interactive
%{
#include "CC_command.h"
#include "CC_command.tab.h"
#include "ace/ACE.h"

extern int line_no;
extern char line_buf[500];
%}

%%

;		       return T_TERM;
start                  return T_START_CMD;
create                 return T_CREATE_CMD;
lock                   return T_LOCK_CMD;
unlock                 return T_UNLOCK_CMD;
try_lock               return T_TRYLOCK_CMD;
change_mode	       return T_CHANGEMODE_CMD;
sleep                  return T_SLEEP_CMD;
wait                   return T_WAIT_CMD;
print                  return T_PRINT_CMD;
repeat                 return T_REPEAT_CMD;
exception	       return T_EXCEP_CMD;
lookup		       return T_LOOKUP_CMD;
read		       return T_READ;
intention_read         return T_IREAD;
upgrade		       return T_UPGRADE;
write		       return T_WRITE;
intention_write	       return T_IWRITE;
\".*\"		       { yylval.id = ACE_OS::strdup(&yytext[1]);
			 yylval.id[yyleng-2]='\0';
			 return Q_STRING; }
[0-9]+                 { yylval.num = atoi(yytext); return T_NUM; }
[A-Za-z][A-Za-z_0-9\.:/]*  { yylval.id = ACE_OS::strdup(yytext);
                           return T_IDENT; }
^\/\/.*\n			{ }
[ ]+			{ }
\n.*                     { line_no ++;
                           ACE_OS::strcpy(line_buf, yytext+1);
                           yyless(1); }