5 * The contents of this file are subject to the terms of the
6 * Common Development and Distribution License (the "License").
7 * You may not use this file except in compliance with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
29 #include <sys/types.h>
37 symbol [_a-zA-Z][_a-zA-Z0-9]*
38 varstring \$[_a-zA-Z][_a-zA-Z0-9]* /* $<name> */
39 hexnumber 0[xX][0-9a-zA-Z]+
41 qstring \"[^\"\n]*[\"\n]
44 \#[^\n]* ; /* ignore comments */
45 \\\n ; /* perform line continuation... */
46 {ws} ; /* ignore whitespace */
47 {hexnumber} {yylval.addr = hexstr_to_num(yytext); return (NUMBER);}
48 {decnumber} {yylval.addr = atoi(yytext); return (NUMBER);}
50 ^{ws}*break {return (BREAK);}
51 ^{ws}*cont {return (CONT);}
52 ^{ws}*echo {return (ECHO_OUT);}
53 ^{ws}*event {return (EVENT);}
54 ^{ws}*delete {return (DELETE);}
55 ^{ws}*dis {return (DIS);}
56 ^{ws}*getmaps {return (GETMAPS);}
57 ^{ws}*help {return (HELP);}
58 ^{ws}*linkmaps {return (LINKMAPS);}
59 ^{ws}*maps {return (MAPS);}
60 ^{ws}*objpad {return (OBJPAD);}
61 ^{ws}*pltskip {return (PLTSKIP);}
62 ^{ws}*print {return (PRINT);}
63 ^{ws}*step {return (STEP);}
64 ^{ws}*value {return (VALUE);}
65 ^{ws}*where {return (WHERE);}
66 {symbol} {yylval.str = strdup(yytext); return (SYMBOL);}
68 yylval.str = strdup(yytext + 1);
72 yylval.str = strdup(yytext + 1);
73 if (yylval.str[yyleng - 2] == '"')
74 yylval.str[yyleng - 2] = '\0';
77 {nl} {return (NEWLINE);}