Example #1
0
 public ArgumentDeclarationList(Parser yyp, ArgumentDeclarationList adl, Declaration d)
     : base(((LSLSyntax
         )yyp))
 {
     while (0 < adl.kids.Count) kids.Add(adl.kids.Pop());
     kids.Add(d);
 }
Example #2
0
 public Tools.Parser getParser()
 {
     if (enParser == null)
     {
         enParser = new CogniPy.CNL.EN.endl(new yyendl(), new ErrorHandler(false));
     }
     return(enParser);
 }
Example #3
0
/// <summary/>
/// <param name='yyq'></param>
  public OptionalSegment_2_1(Parser yyq):base(yyq){
				((PhonEnvParser
)yyq).CreateErrorMessage(PhonEnvParser.SyntaxErrType.missingClosingParen.ToString(),
	((TOKEN)(yyq.StackAt(2).m_value))
	.yytext,
	((error)(yyq.StackAt(0).m_value))
	.pos);
					((PhonEnvParser
)yyq).SyntaxErrorType = PhonEnvParser.SyntaxErrType.missingClosingParen;
					((PhonEnvParser
)yyq).Position =
	((error)(yyq.StackAt(0).m_value))
	.pos;
					}}
Example #4
0
		public ParseStackEntry(Parser yyp,int state,SYMBOL value) 
		{
			yyps = yyp; m_state = state; m_value = value;
		}
Example #5
0
		// support for actions
		public virtual object Action(Parser yyp,SYMBOL yysym, int yyact) { return null; } // will be generated for the generated parser
Example #6
0
		public virtual SYMBOL Action(Parser yyp) 
		{
			SYMBOL s = (SYMBOL)Sfactory.create(m_sym.yytext,yyp);
			if (s.yyname==m_sym.yytext) 
			{  // provide for the default $$ = $1 action if possible
				SYMBOL t = yyp.StackAt(m_len-1).m_value;
				s.m_dollar = (m_len==0 || t==null)? null : t.m_dollar;
			}
			return s;
		}
Example #7
0
 public Null(Parser yyp, int proxy) : base(yyp) { num = proxy; }
Example #8
0
		public error(Parser yyp,ParseStackEntry s):base(yyp) { state=s.m_state; sym=s.m_value; } //4.4c
		public error(Parser yyp):base(yyp) {}
 /// <summary>
 ///     Resets various counters and metadata.
 /// </summary>
 void ResetCounters()
 {
     //NOTE: This takes a VERY long time to rebuild. Ideally, this should be reset, but interesting errors are happening when it is reset..
     p = new LSLSyntax(_LSLSyntax, new ErrorHandler(true));
     MethodVariables.Clear();
     VariablesToRename.Clear();
     GlobalVariables.Clear();
     m_braceCount = 0;
     m_CSharpLine = 15;
     m_CSharpCol = 1;
     m_positionMap = new Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>>();
     LocalMethods.Clear();
     IsParentEnumerable = false;
     OriginalScript = "";
     lock (FuncCalls)
         FuncCalls.Clear();
     FuncCntr = false;
     IsaGlobalVar = false;
     MethodsToAdd.Clear();
     LocalMethodArguements.Clear();
     m_allMethods.Clear();
 }
Example #10
0
		public DoWhileStatement_2(Parser yyq):base(yyq,
		                                           ((SimpleAssignment)(yyq.StackAt(2).m_value))
		                                           ,
		                                           ((Statement)(yyq.StackAt(5).m_value))
		                                          ){}}
Example #11
0
		public Statement_11(Parser yyq):base(yyq,
		                                     ((DoWhileStatement)(yyq.StackAt(0).m_value))
		                                    ){}}
Example #12
0
		public Statement_9(Parser yyq):base(yyq,
		                                    ((IfStatement)(yyq.StackAt(0).m_value))
		                                   ){}}
Example #13
0
		public Statement_8(Parser yyq):base(yyq,
		                                    ((StateChange)(yyq.StackAt(1).m_value))
		                                   ){}}
Example #14
0
		public Statement_7(Parser yyq):base(yyq,
		                                    ((JumpStatement)(yyq.StackAt(1).m_value))
		                                   ){}}
Example #15
0
		public Statement_6(Parser yyq):base(yyq,
		                                    ((JumpLabel)(yyq.StackAt(1).m_value))
		                                   ){}}
Example #16
0
		public State(Parser yyp):base(yyp){}}
Example #17
0
		public Statement_12(Parser yyq):base(yyq,
		                                     ((ForLoop)(yyq.StackAt(0).m_value))
		                                    ){}}
Example #18
0
		public ForLoop_1(Parser yyq):base(yyq,
		                                  ((ForLoopStatement)(yyq.StackAt(6).m_value))
		                                  ,
		                                  ((Expression)(yyq.StackAt(4).m_value))
		                                  ,
		                                  ((ForLoopStatement)(yyq.StackAt(2).m_value))
		                                  ,
		                                  ((Statement)(yyq.StackAt(0).m_value))
		                                 ){}}
Example #19
0
		public Statement_13(Parser yyq):base(yyq,
		                                     ((CompoundStatement)(yyq.StackAt(0).m_value))
		                                    ){}}
Example #20
0
		public error(Parser yyp,ParseStackEntry s):base(yyp) { state=s.m_state; sym=s.m_value; } //4.4c
Example #21
0
		public JumpStatement_1(Parser yyq):base(yyq,
		                                        ((IDENT)(yyq.StackAt(0).m_value))
		                                        .yytext){}}
Example #22
0
		public recoveredError(Parser yyp,ParseStackEntry s):base(yyp,s) {}
Example #23
0
		public StateChange_1(Parser yyq):base(yyq,
		                                      ((IDENT)(yyq.StackAt(0).m_value))
		                                      .yytext){}}
Example #24
0
		public static object create(string cls_name,Parser yyp) 
		{
			SCreator cr = (SCreator)yyp.m_symbols.types[cls_name];
			// Console.WriteLine("TCreating {0} <{1}>",cls_name,yyl.yytext);
			if (cr==null) 
				yyp.m_symbols.erh.Error(new CSToolsException(16,yyp.m_lexer,"no factory for {"+cls_name+")"));
			try 
			{
				return cr(yyp);
			}
			catch (CSToolsException e)
			{
				yyp.m_symbols.erh.Error(e);
			}
			catch (Exception e) 
			{
				yyp.m_symbols.erh.Error(new CSToolsException(17,yyp.m_lexer,string.Format("Create of {0} failed ({1})",cls_name,e.Message)));
			}
			int j = cls_name.LastIndexOf('_');
			if (j>0) 
			{
				cr = (SCreator)yyp.m_symbols.types[cls_name.Substring(0,j)];
				if (cr!=null) 
				{
					SYMBOL s = (SYMBOL)cr(yyp);
					s.m_dollar = 0;
					return s;
				}
			}
			return null;
		}
Example #25
0
		public StateChange_2(Parser yyq):base(yyq,
		                                      ((DEFAULT_STATE)(yyq.StackAt(0).m_value))
		                                      .yytext){}}
Example #26
0
		public override SYMBOL Action(Parser yyp) 
		{
			SYMBOL s = base.Action(yyp);
			object ob = yyp.m_symbols.Action(yyp,s,m_action);
			if (ob!=null)
				s.m_dollar = ob;
			return s;
		}
Example #27
0
		public IfStatement_2(Parser yyq):base(yyq,
		                                      ((Expression)(yyq.StackAt(4).m_value))
		                                      ,
		                                      ((Statement)(yyq.StackAt(2).m_value))
		                                      ,
		                                      ((Statement)(yyq.StackAt(0).m_value))
		                                     ){}}
Example #28
0
		public ParseStackEntry(Parser yyp) {yyps = yyp; }
Example #29
0
		public IfStatement_4(Parser yyq):base(yyq,
		                                      ((SimpleAssignment)(yyq.StackAt(4).m_value))
		                                      ,
		                                      ((Statement)(yyq.StackAt(2).m_value))
		                                      ,
		                                      ((Statement)(yyq.StackAt(0).m_value))
		                                     ){}}
Example #30
0
 /// <summary>
 /// Generates the node structure required to generate a default
 /// initialization.
 /// </summary>
 /// <param name="p">
 /// Tools.Parser instance to use when instantiating nodes.
 /// </param>
 /// <param name="constantType">String describing the datatype.</param>
 /// <returns>
 /// A SYMBOL node conaining the appropriate structure for intializing a
 /// constantType.
 /// </returns>
 private SYMBOL GetZeroConstant(Parser p, string constantType)
 {
     switch (constantType)
     {
     case "integer":
         return new Constant(p, constantType, "0");
     case "float":
         return new Constant(p, constantType, "0.0");
     case "string":
     case "key":
         return new Constant(p, constantType, "");
     case "list":
         ArgumentList al = new ArgumentList(p);
         return new ListConstant(p, al);
     case "vector":
         Constant vca = new Constant(p, "float", "0.0");
         Constant vcb = new Constant(p, "float", "0.0");
         Constant vcc = new Constant(p, "float", "0.0");
         ConstantExpression vcea = new ConstantExpression(p, vca);
         ConstantExpression vceb = new ConstantExpression(p, vcb);
         ConstantExpression vcec = new ConstantExpression(p, vcc);
         return new VectorConstant(p, vcea, vceb, vcec);
     case "rotation":
         Constant rca = new Constant(p, "float", "0.0");
         Constant rcb = new Constant(p, "float", "0.0");
         Constant rcc = new Constant(p, "float", "0.0");
         Constant rcd = new Constant(p, "float", "0.0");
         ConstantExpression rcea = new ConstantExpression(p, rca);
         ConstantExpression rceb = new ConstantExpression(p, rcb);
         ConstantExpression rcec = new ConstantExpression(p, rcc);
         ConstantExpression rced = new ConstantExpression(p, rcd);
         return new RotationConstant(p, rcea, rceb, rcec, rced);
     default:
         return null; // this will probably break stuff
     }
 }
Example #31
0
		public DoWhileStatement_1(Parser yyq):base(yyq,
		                                           ((Expression)(yyq.StackAt(2).m_value))
		                                           ,
		                                           ((Statement)(yyq.StackAt(5).m_value))
		                                          ){}}