-
Notifications
You must be signed in to change notification settings - Fork 0
/
css.y
100 lines (75 loc) · 1.63 KB
/
css.y
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
%{
/*
** $Id: css.y,v 1.9 2001/07/02 19:43:43 owagner Exp $
*/
#include "voyager.h"
#include "classes.h"
#include "js.h"
#include <math.h>
#ifdef __GNUC__
#ifndef __MORPHOS__
#define _STDIO_H_ 1
#endif /* !__MORPHOS__ */
#else
#define _STDIO_H 1
#endif
static void __yy_memcpy (char *,char *to,int);
int cssparse (void);
void csserror(char *);
#define alloca js_alloca
extern void *js_alloca( int );
extern int lineno;
#define YYSTYPE struct yystype
#define YYPURE
#define YY_DECL int yylex ( YYSTYPE *yylval )
#define YYERROR_VERBOSE
// Fuck-o-Stdio trickery
#ifdef __SASC
typedef void *FILE;
#define EOF -1
#endif
#ifndef __MORPHOS__
#define stdin 0
#define stdout 0
#endif /* !__MORPHOS__ */
#include "css_scanner.h"
%}
%token CSSTOKEN_IDENT
%token CSSTOKEN_STRING CSSTOKEN_ATKEYWORD
%token CSSTOKEN_HASH
%token CSSTOKEN_NUMBER
%token CSSTOKEN_PERCENTAGE
%token CSSTOKEN_DIMENSION
%token CSSTOKEN_URI
%token CSSTOKEN_UNICODE_RANGE
%token CSSTOKEN_S
%token CSSTOKEN_FUNCTION
%token CSSTOKEN_INCLUDES
%token CSSTOKEN_DASHMATCH
%token CSSTOKEN_DELIM
%%
stylespec: sheet
| decllist
;
sheet: { }
| statementlist
;
statementlist: statement
| statement statementlist
;
statement: selector declblock
selector: CSSTOKEN_IDENT
| selector '.' CSSTOKEN_IDENT
;
decl: CSSTOKEN_IDENT
declstatement: decl ';'
| decl
| ';'
;
decllist: declstatement
| declstatement decllist
;
declblock: '{' '}'
| '{' decllist '}'
;
%%