1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2006-2011 Apple Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 #include "dnsextd_parser.h"
24 extern YYSTYPE yylval;
37 dup = strdup( string + 1);
39 dup[ strlen( dup ) - 1 ] = '\0';
50 options return OPTIONS;
51 listen-on return LISTEN_ON;
52 nameserver return NAMESERVER;
54 address return ADDRESS;
57 private return PRIVATE;
59 allow-update return ALLOWUPDATE;
60 allow-query return ALLOWQUERY;
61 algorithm return ALGORITHM;
70 \* yylval.string = strdup(yytext); return WILDCARD;
71 [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ yylval.string = strdup(yytext); return DOTTED_DECIMAL_ADDRESS;
72 [0123456789]+ yylval.number = atoi(yytext); return NUMBER;
73 [a-zA-Z0-9]+(\.[a-zA-Z0-9]+)* yylval.string = strdup(yytext); return HOSTNAME;
74 [a-zA-Z0-9\.]+([a-zA-Z0-9\.]+)* yylval.string = strdup(yytext); return DOMAINNAME;
75 \"([^"\\\r\n]*(\\.[^"\\\r\n]*)*)\" yylval.string = StripQuotes(yytext); return QUOTEDSTRING;
76 [\/][\/].* /* ignore C++ style comments */;
77 \n yylineno++; /* ignore EOL */;
78 [ \t]+ /* ignore whitespace */;