File: channel.l

package info (click to toggle)
clif 0.93-9.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 4,228 kB
  • sloc: ansic: 31,464; yacc: 5,067; lex: 819; makefile: 383; sh: 48
file content (109 lines) | stat: -rw-r--r-- 2,189 bytes parent folder | download | duplicates (7)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%{
/* 
 * channel.l
 *
 * lex source for channels
 * used as compiler for graphical interface
 *
 */

#include<string.h>
#ifdef input
#undef input
#undef yywrap
#endif
#include"mystdio.h"
#include"buf.h"
#include"ch-parser.h"
#include"init_ch.c"

#ifndef PROTO
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined(__STDC__)
#define PROTO(ARGS) ARGS
#else
#define PROTO(ARGS) ()
#endif 
#endif

#if 0
extern char *callocx PROTO((unsigned, unsigned));
#endif
extern char *string PROTO((char *));
extern void error_message PROTO((int));
%}
mes	["]
newline	[\n]
tab	[ \t]
cifra	[0-9]
exp	[Ee][-+]?{cifra}+
alfach	[A-Z_a-z0-9]+
numberi	[+-]?{cifra}+
numberd ([+-]?{cifra}*"."{cifra}+({exp})?)|([+-]?{cifra}+"."{cifra}*({exp})?)|([+-]?{cifra}+{exp})
%%
{tab}		{}
{newline} 	{;}
fields		{return (FIELDS);
			/* 
			 * Number of records per channel
                         */}
type    	{return (TYPE);
			/* 
			 * Channel type (graphic)
 			 * now implemented only graphic channel
			 */}
print_format	{return (PRINT_FORMAT);
			/* 
			 * point
			 * line
  			 */}
direction	{return (DIRECTION);
			/*
			 * input or output
			 * graphic channel implemented only as output channel
			 */}
start_time	{return (START_TIME);}
duration_time	{return (DURATION_TIME);
			/* 
			 * Length of the window in number of records
			 */}
w_resolution	{return (W_RESOLUTION);
			/* 
			 * Size of the windows
			 */}
lower		{return (LOWER);
			/* 
			 * Lower bound of the window
			 */}
upper		{return (UPPER);
			/* 
			 * Upper bound of the window
			 */}
style		{return (STYLE);
			/* 
			 * Line type 
			 * now implemented as color setting 
			 */}
OnLeaveW	{return (ON_LEAVE_WINDOW);
		 	/*
			 * Suspend output tto the window temporarily
			 * To continue press any key
			 */}
automatic	{return (AUTOMATIC);
			/*
			 * automatic for duration_time and start_time
			 */}
{numberi}	{sscanf (yytext, "%d", &yylval.myint); return (NUMBERI);
			/* 
			 * Integer number
			 */}
{numberd}	{sscanf (yytext, "%lf", &yylval.mydouble); return (NUMBERD);
			/* 
			 * Double number
			 */}
{alfach}	{yylval.mystring = string (yytext);
		 return(STRING);
			/*
			 * String
			 */}
.		{return(*yytext);}
%%