3
#***************************************************************************
4
#* Copyright (c) 2012 Keith Sloan <keith@sloan-home.co.uk> *
6
#* This program is free software; you can redistribute it and/or modify *
7
#* it under the terms of the GNU Lesser General Public License (LGPL) *
8
#* as published by the Free Software Foundation; either version 2 of *
9
#* the License, or (at your option) any later version. *
10
#* for detail see the LICENCE text file. *
12
#* This program is distributed in the hope that it will be useful, *
13
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
#* GNU Library General Public License for more details. *
17
#* You should have received a copy of the GNU Library General Public *
18
#* License along with this program; if not, write to the Free Software *
19
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
22
#***************************************************************************
23
__title__ = "FreeCAD OpenSCAD Workbench - CSG importer Version 0.5c"
24
__author__ = "Keith Sloan <keith@sloan-home.co.uk>"
25
__url__ = ["http://www.sloan-home.co.uk/ImportCSG"]
64
# List of token names. This is always required
86
# Regular expression rules for simple tokens
87
t_WORD = r'[$]?[a-zA-Z_]+[0-9]*'
88
t_NUMBER = r'[-]?[0-9]*[\.]*[0-9]+([eE][+-]?[0-9]+)*'
100
#t_STRING = r'["]+[a-zA-Z.]+["]+'
102
t_MODIFIERDEBUG = r'\#'
104
t_MODIFIERDISABLE = r'\*'
105
# Deal with Reserved words
108
reserved_map[r.lower()] = r
113
r'//[^\r\n]*((\r\n)|<<EOF>>)'
118
r'//[^\n]*((\n)|<<EOF>>)'
123
r'[$]?[a-zA-Z_]+[0-9]*'
124
t.type = reserved_map.get(t.value, "ID")
128
# Define a rule so we can track line numbers
131
t.lexer.lineno += len(t.value)
134
# A string containing ignored characters (spaces and tabs)
140
print("Illegal character '%s'" % t.value[0])