From d95794d05c8e98877189c9c6b306110a9fc2df59 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 23 Sep 2008 13:28:17 +0000 Subject: Refactor XEngine parser as per suggestions from mikem --- .../ScriptEngine/Shared/CodeTools/lsl.parser.cs | 43 ++++------------------ 1 file changed, 8 insertions(+), 35 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs index 2f9a829..bfc1afc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/lsl.parser.cs @@ -1,30 +1,3 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - using System;using Tools; namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { //%+LSLProgramRoot+95 @@ -1304,24 +1277,24 @@ public class ReturnStatement_2 : ReturnStatement { public ReturnStatement_2(Parser yyq):base(yyq){}} public class Constant_1 : Constant { - public Constant_1(Parser yyq):base(yyq,"integer", "new LSL_Types.LSLInteger("+ + public Constant_1(Parser yyq):base(yyq,"integer", ((INTEGER_CONSTANT)(yyq.StackAt(0).m_value)) - .yytext+")"){}} + .yytext){}} public class Constant_2 : Constant { - public Constant_2(Parser yyq):base(yyq,"integer", "new LSL_Types.LSLInteger("+ + public Constant_2(Parser yyq):base(yyq,"integer", ((HEX_INTEGER_CONSTANT)(yyq.StackAt(0).m_value)) - .yytext+")"){}} + .yytext){}} public class Constant_3 : Constant { - public Constant_3(Parser yyq):base(yyq,"float", "new LSL_Types.LSLFloat("+ + public Constant_3(Parser yyq):base(yyq,"float", ((FLOAT_CONSTANT)(yyq.StackAt(0).m_value)) - .yytext+")"){}} + .yytext){}} public class Constant_4 : Constant { - public Constant_4(Parser yyq):base(yyq,"string", "new LSL_Types.LSLString(\""+ + public Constant_4(Parser yyq):base(yyq,"string", ((STRING_CONSTANT)(yyq.StackAt(0).m_value)) - .yytext+"\")"){}} + .yytext){}} public class ListConstant_1 : ListConstant { public ListConstant_1(Parser yyq):base(yyq, -- cgit v1.1