2 * Copyright (C) 2022 Nick Downing <nick@ndcode.org>
3 * SPDX-License-Identifier: GPL-2.0-only
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; version 2.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51
16 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 (?E{t_def.IntLiteral}(?E{t_def.Text.Char}[0-9])(\ *(?E{t_def.Text.Char}[0-9]))*) {
43 return y_tab.INT_LITERAL
45 (?E{t_def.VariableName}(?E{t_def.Text.Char}[A-Z])(\ *(?E{t_def.Text.Char}[A-Z0-9])(\ *[A-Z0-9])*)?(\ *(?E{t_def.Text.Char}[$%]))?) {
46 return y_tab.VARIABLE_NAME
48 (?E{t_def.IntLiteral}(?E{t_def.Text.Char}[0-9])(\ *(?E{t_def.Text.Char}[0-9]))*) {
49 return y_tab.INT_LITERAL
51 (?E{t_def.FloatLiteral}((?E{t_def.FloatLiteral.Integer}(?E{t_def.Text.Char}[0-9])(\ *(?E{t_def.Text.Char}[0-9]))*)(?E{t_def.FloatLiteral.Fraction}"")|(?E{t_def.FloatLiteral.Integer}((?E{t_def.Text.Char}[0-9])\ *)*)(?E{t_def.FloatLiteral.Fraction}\.(\ *(?E{t_def.Text.Char}[0-9]))*))(?E{t_def.FloatLiteral.Exponent}\ *E(?E{t_def.FloatLiteral.Sign}(\ *(?E{t_def.Text.Char}[+-]))?)\ *(?E{t_def.FloatLiteral.Integer}(?E{t_def.Text.Char}[0-9])(\ *(?E{t_def.Text.Char}[0-9]))*))?) {
52 return y_tab.FLOAT_LITERAL
56 \"(?E{t_def.StrLiteral}[^"\n]*)\" {
57 return y_tab.STR_LITERAL
59 \"(?E{t_def.StrLiteral}[^"\n]*)$ {
60 return y_tab.STR_LITERAL
64 \xcf\ *\xd0|\xd0\ *\xcf {
65 return y_tab.OPERATOR_GE
67 \xd1\ *\xd0|\xd0\ *\xd1 {
68 return y_tab.OPERATOR_LE
70 \xd1\ *\xcf|\xcf\ *\xd1 {
71 return y_tab.OPERATOR_NE
75 (?E{t_def.DataText}[^\n ",:][^\n,:]*) {
76 return y_tab.DATA_TEXT
90 (?E{t_def.RemText}.*) {