Esempio n. 1
0
        private void  parse(SupportClass.Tokenizer tok, Message message, StructRef root, NuGenEncodingCharacters ec)
        {
            Terser t = new Terser(message);

            lock (root)
            {
                StructRef ref_Renamed = root.getSuccessor("MSH");

                int     field   = 0;
                Segment segment = null;
                int[]   fields  = new int[0];

                while (tok.HasMoreTokens())
                {
                    System.String token = tok.NextToken();
                    if (token[0] == ec.FieldSeparator)
                    {
                        field++;
                    }
                    else if (token[0] == ourSegmentSeparator)
                    {
                        field = 0;
                    }
                    else if (field == 0)
                    {
                        StructRef newref = drill(ref_Renamed, token);
                        if (newref == null)
                        {
                            segment = null;
                            fields  = new int[0];
                        }
                        else
                        {
                            ref_Renamed = newref;
                            segment     = t.getSegment(ref_Renamed.FullPath);
                            fields      = ref_Renamed.Fields;
                        }
                    }
                    else if (segment != null && System.Array.BinarySearch(fields, (System.Object)field) >= 0)
                    {
                        parse(token, segment, field, ec);
                    }
                }
                root.reset();
            }
        }
Esempio n. 2
0
		private void  parse(SupportClass.Tokenizer tok, Message message, StructRef root, NuGenEncodingCharacters ec)
		{
			
			Terser t = new Terser(message);
			
			lock (root)
			{
				StructRef ref_Renamed = root.getSuccessor("MSH");
				
				int field = 0;
				Segment segment = null;
				int[] fields = new int[0];
				
				while (tok.HasMoreTokens())
				{
					System.String token = tok.NextToken();
					if (token[0] == ec.FieldSeparator)
					{
						field++;
					}
					else if (token[0] == ourSegmentSeparator)
					{
						field = 0;
					}
					else if (field == 0)
					{
						StructRef newref = drill(ref_Renamed, token);
						if (newref == null)
						{
							segment = null;
							fields = new int[0];
						}
						else
						{
							ref_Renamed = newref;
							segment = t.getSegment(ref_Renamed.FullPath);
							fields = ref_Renamed.Fields;
						}
					}
					else if (segment != null && System.Array.BinarySearch(fields, (System.Object) field) >= 0)
					{
						parse(token, segment, field, ec);
					}
				}
				root.reset();
			}
		}