Parses the given sentence. BASIC commands must be
        types UPPERCASE and as SEEN in ZX BASIC. e.g. GO SUB for gosub, etc...
430540
def parse_sentence(self, string):
        

        result = []

        def shift(string_):
            """ Returns first word of a string, and remaining
            """
            string_ = string_.strip()  # Remove spaces and tabs

            if not string_:  # Avoid empty strings
                return '', ''

            i = string_.find(' ')
            if i == -1:
                command_ = string_
                string_ = ''
            else:
                command_ = string_[:i]
                string_ = string_[i:]

            return command_, string_

        command, string = shift(string)
        while command != '':
            result += self.token(command)
145654
static ULocale[] parseAcceptLanguage(String acceptLanguage, boolean isLenient)
            throws ParseException {
        class ULocaleAcceptLanguageQ implements Comparable<ULocaleAcceptLanguageQ> {
            private double q;
            private double serial;
            public ULocaleAcceptLanguageQ(double theq, int theserial) {
                q = theq;
                serial = theserial;
            }
            @Override
            public int compareTo(ULocaleAcceptLanguageQ other) {
                if (q > other.q) { // reverse - to sort in descending order
                    return -1;
                } else if (q < other.q) {
                    return 1;
                }
                if (serial < other.serial) {
                    return -1;
                } else if (serial > other.serial) {
                    return 1;
                } else {
                    return 0; // same object
                }
            }
        }

        // parse out the acceptLanguage into an array
        TreeMap<ULocaleAcceptLanguageQ, ULocale> map =
                new TreeMap<ULocaleAcceptLanguageQ, ULocale>();
        StringBuilder languageRangeBuf = new StringBuilder();
        StringBuilder qvalBuf = new StringBuilder();
        int state = 0;
        acceptLanguage += ","; // append comma to simplify the parsing code
        int n;
        boolean subTag = false;
        boolean q1 = false;
        for (n = 0; n < acceptLanguage.length(); n++) {
            boolean gotLanguageQ = false;
            char c = acceptLanguage.charAt(n);
            switch (state) {
            case 0: // before language-range start
                if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) {
                    // in language-range
                    languageRangeBuf.append(c);
                    state = 1;
                    subTag = false;
                } else if (c == '*') {
                    languageRangeBuf.append(c);
                    state = 2;
                } else if (c != ' ' && c != '\t') {
                    // invalid character
                    state = -1;
                }
                break;
            case 1: // in language-range
                if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) {
                    languageRangeBuf.append(c);
                } else if (c == '-') {
                    subTag = true;
                    languageRangeBuf.append(c);
                } else if (c == '_') {
                    if (isLenient) {
                        subTag = true;
                        languageRangeBuf.append(c);
                    } else {
                        state = -1;
                    }
                } else if ('0' <= c && c <= '9') {
                    if (subTag) {
                        languageRangeBuf.append(c);
                    } else {
                        // DIGIT is allowed only in language sub tag
                        state = -1;
                    }
                } else if (c == ',') {
                    // language-q end
                    gotLanguageQ = true;
                } else if (c == ' ' || c == '\t') {
                    // language-range end
                    state = 3;
                } else if (c == ';') {
                    // before q
                    state = 4;
                } else {
                    // invalid character for language-range
                    state = -1;
                }
                break;
            case 2: // saw wild card range
                if (c == ',') {
                    // language-q end
                    gotLanguageQ = true;
                } else if (c == ' ' || c == '\t') {
                    // language-range end
                    state = 3;
                } else if (c == ';') {
                    // before q
                    state = 4;
                } else {
                    // invalid
                    state = -1;
                }
                break;
            case 3: // language-range end
                if (c == ',') {
                    // language-q end
                    gotLanguageQ = true;
                } else if (c == ';') {
                    // before q
                    state =4;
                } else if (c != ' ' && c != '\t') {
                    // invalid
                    state = -1;
                }
                break;
            case 4: // before q
                if (c == 'q') {
                    // before equal
                    state = 5;
                } else if (c != ' ' && c != '\t') {
                    // invalid
                    state = -1;
                }
                break;
            case 5: // before equal
                if (c == '=') {
                    // before q value
                    state = 6;
                } else if (c != ' ' && c != '\t') {
                    // invalid
                    state = -1;
                }
                break;
            case 6: // before q value
                if (c == '0') {
                    // q value start with 0
                    q1 = false;
                    qvalBuf.append(c);
                    state = 7;
                } else if (c == '1') {
                    // q value start with 1
                    qvalBuf.append(c);
                    state = 7;
                } else if (c == '.') {
                    if (isLenient) {
                        qvalBuf.append(c);
                        state = 8;
                    } else {
                        state = -1;
                    }
                } else if (c != ' ' && c != '\t') {
                    // invalid
                    state = -1;
                }
                break;
            case 7: // q value start
                if (c == '.') {
                    // before q value fraction part
                    qvalBuf.append(c);
                    state = 8;
                } else if (c == ',') {
                    // language-q end
                    gotLanguageQ = true;
                } else if (c == ' ' || c == '\t') {
                    // after q value
                    state = 10;
                } else {
                    // invalid
                    state = -1;
                }
                break;
            case 8: // before q value fraction part
                if ('0' <= c && c <= '9') {
                    if (q1 && c != '0' && !isLenient) {
                        // if q value starts with 1, the fraction part must be 0
                        state = -1;
                    } else {
                        // in q value fraction part
                        qvalBuf.append(c);
                        state = 9;
                    }
                } else {
                    // invalid
                    state = -1;
                }
                break;
            case 9: // in q value fraction part
                if ('0' <= c && c <= '9') {
                    if (q1 && c != '0') {
                        // if q value starts with 1, the fraction part must be 0
                        state = -1;
                    } else {
                        qvalBuf.append(c);
                    }
                } else if (c == ',') {
                    // language-q end
                    gotLanguageQ = true;
                } else if (c == ' ' || c == '\t') {
                    // after q value
                    state = 10;
                } else {
                    // invalid
                    state = -1;
                }
                break;
            case 10: // after q value
                if (c == ',') {
                    // language-q end
                    gotLanguageQ = true;
                } else if (c != ' ' && c != '\t') {
                    // invalid
                    state = -1;
                }
                break;
            }
            if (state == -1) {
                // error state
                throw new ParseException("Invalid Accept-Language", n);
            }
            if (gotLanguageQ) {
                double q = 1.0;
                if (qvalBuf.length() != 0) {
                    try {
                        q = Double.parseDouble(qvalBuf.toString());
                    } catch (NumberFormatException nfe) {
                        // Already validated, so it should never happen
                        q = 1.0;
                    }
                    if (q > 1.0) {
                        q = 1.0;
                    }
                }
                if (languageRangeBuf.charAt(0) != '*') {
                    int serial = map.size();
                    ULocaleAcceptLanguageQ entry = new ULocaleAcceptLanguageQ(q, serial);
                    // sort in reverse order..   1.0, 0.9, 0.8 .. etc
                    map.put(entry, new ULocale(canonicalize(languageRangeBuf.toString())));
                }

                // reset buffer and parse state
                languageRangeBuf.setLength(0);
                qvalBuf.setLength(0);
                state = 0;
            }
        }
        if (state != 0) {
            // Well, the parser should handle all cases.  So just in case.
            throw new ParseException("Invalid AcceptlLanguage", n);
        }

        // pull out the map
        ULocale acceptList[] = map.values().toArray(new ULocale[map.size()]);
        return acceptList;
    }
1258533
def parse_commands(command)
      case command
      when Array
        command.map { |line| line.to_s }
      when String
        command.enum_for(:each_line).map { |line| line.chomp }
      else
        raise(InvalidConfig,"commands must be an Array or a String")
      end
    end
252368
public <T> T parse(String input, Class<T> clazz) {
		try {
			if (String.class.equals(clazz)) {
				return (T) input;
			}

			StringParser<T> parser = getParser(clazz, input);
			if (parser == null) {
				throw new ParserException(String.format("Cannot parse to %s : %s", clazz.getName(), input));
			}

			return parser.parse(input);
		}
		catch (NumberFormatException e) {
			throw new ParserException(e.getMessage());
		}
	}
625595
def parse(cls, s, **kwargs):
        

        pb2_obj = cls._get_cmsg()
        pb2_obj.ParseFromString(s)

        return cls.parse_from_cmessage(pb2_obj, **kwargs)
1085560
private String w(Sentence sent, int pos, int i){
		String cp = "w:" + Integer.toString(i) + ":"; 
		//if (pos + i == -1)
		//	cp += "BS";
		//else if (pos + i == sent.size())
		//	cp += "ES";
		if (0 <= (pos + i) && (pos + i) < sent.size())
			cp += sent.getWordAt(pos + i);
		else cp="";
		
		return cp;
	}
28319
def textparse(ts)
    if ts.length <= 0
      raise Error, 'empty'
    end

    typ, _, val = ts[0]
    case typ
    when '{' then objparse(ts)
    when '[' then arrparse(ts)
    else
      raise Error, "unexpected #{val.inspect}"
    end
  end
724980
def parse(command)
      case command.class.name.downcase.to_sym #Array => :array
      when :array
        command.compact.join(' && ')
      when :string
        command.chomp
      else
        raise Trooper::MalformedCommandError, "Command Not a String or Array: #{command.inspect}"
      end
    end
720720
function parseMessage(line) { // {{{
  var message = {};
  var match;

  // Parse prefix
  if (match = line.match(/^:([^ ]+) +/)) {
    message.prefix = match[1];
    line = line.replace(/^:[^ ]+ +/, '');
    if (match = message.prefix.match(/^([_a-zA-Z0-9\[\]\\`^{}|-]*)(!([^@]+)@(.*))?$/)) {
      message.nick = match[1];
      message.user = match[3];
      message.host = match[4];
    }
    else
      message.server = message.prefix;
  }

  // Parse command
  match = line.match(/^([^ ]+) +/);
  message.command = match[1];
  message.rawCommand = match[1];
  message.commandType = 'normal';
  line = line.replace(/^[^ ]+ +/, '');

  if (replyFor[message.rawCommand]) {
    message.command     = replyFor[message.rawCommand].name;
    message.commandType = replyFor[message.rawCommand].type;
  }

  message.args = [];
  var middle, trailing;

  // Parse parameters
  if (line.indexOf(':') != -1) {
    var index = line.indexOf(':');
    middle = line.substr(0, index).replace(/ +$/, "");
    trailing = line.substr(index+1);
  } else
    middle = line;

  if (middle.length)
    message.args = middle.split(/ +/);

  if (typeof(trailing) != 'undefined' && trailing.length)
    message.args.push(trailing);

  return message;
}
251975
function parse(doc,context){
	var vs;
	var cmds=[];
	var pats;
	var exprs;
	var subpats;
	var mode=context.mode;

	var vs=splitLine_(doc);
	for(var i=0;i<vs.length;i++){
		if(pats=vs[i].match(macroRegex)){
			if(mode=='tcmd'){
				console.log(pats[1]+','+pats[2]);
			}
			exprs=null;
			switch(pats[1]){
			case 'define':
				if(subpats=pats[2].match(defineRegex)){
					exprs=[subpats[1],subpats[2]];
				}else{
					console.log("error: invalid format in define statement "+pats[1]+" in line "+(i+1));
				}
				break;
			case 'include':
			case 'include_once':
			case 'include_code':
			case 'include_code_once':
				exprs=toExpr(pats[2],i+1);
				break;
			case 'if':
			case 'elseif':
			case 'elif':
				exprs=toExpr(pats[2],i+1);
				break;
			case 'else':
			case 'endif':
				break;
			case 'namespace':
				if(subpats=pats[2].match(nsRegex)){
					setNamespace_(subpats[1]);
				}else{
					console.log("error: invalid format in namespace statement "+pats[1]+" in line "+(i+1));
				}
				break;
			default:
				if(pats[1].charAt(0)!='@'){
					console.log("error: unknown statement "+pats[1]+" in line "+(i+1));
				}
				break;
			}
			cmds.push({type:pats[1], exprs:exprs});
		}else{
			cmds.push({type:'text', value:vs[i]});
		}
	}
	if(mode=='cmd'){
		for(var i=0;i<cmds.length;i++){
			console.log(JSON.stringify(cmds[i]));
		}
	}
	return cmds;
}
1102847
private void pushPiece(String sentence, String normalized, int start, int end, byte preType, List<String> wordList)
    {
        if (preType == CharType.CT_CHINESE)
        {
            segmenter.segment(sentence.substring(start, end), normalized.substring(start, end), wordList);
        }
        else
        {
            wordList.add(sentence.substring(start, end));
        }
    }
732742
def _parse(self, bus, data):
        

        sen_time = time.time()

        try:
            # Split up multiple sentences
            if isinstance(data, bytes):
                data = data.decode('ascii')

            dirtysentences = data.split("\n")
            sentences = [(sen_time, x) for x in dirtysentences if x]

            def unique(it):
                s = set()
                for el in it:
                    if el not in s:
                        s.add(el)
                        yield el
                    else:
                        # TODO: Make sure, this is not identical but new data
                        self.log("Duplicate sentence received: ", el,
                                 lvl=debug)

            sentences = list(unique(sentences))
            return sentences
        except Exception as e:
            self.log("Error during data unpacking: ", e, type(e), lvl=error,
                     exc=True)
1154469
public final void mSUP() throws RecognitionException {
        try {
            int _type = SUP;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // org/javaruntype/type/parser/Type.g:38:5: ( 'SUP' )
            // org/javaruntype/type/parser/Type.g:38:7: 'SUP'
            {
            match("SUP"); 


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        }
    }
257034
public final ProtoParser.parse_return parse(Proto proto) throws RecognitionException {
        ProtoParser.parse_return retval = new ProtoParser.parse_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token EOF2=null;
        ProtoParser.statement_return statement1 = null;


        Object EOF2_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:53:5: ( ( statement[proto] )+ EOF )
            // com/dyuproject/protostuff/parser/ProtoParser.g:53:9: ( statement[proto] )+ EOF
            {
            root_0 = (Object)adaptor.nil();

            // com/dyuproject/protostuff/parser/ProtoParser.g:53:9: ( statement[proto] )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                switch ( input.LA(1) ) {
                case AT:
                case PKG:
                case SYNTAX:
                case IMPORT:
                case OPTION:
                case MESSAGE:
                case SERVICE:
                case ENUM:
                case EXTEND:
                    {
                    alt1=1;
                    }
                    break;

                }

                switch (alt1) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:53:10: statement[proto]
            	    {
            	    pushFollow(FOLLOW_statement_in_parse178);
            	    statement1=statement(proto);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, statement1.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
            	    if (state.backtracking>0) {state.failed=true; return retval;}
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);

            EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_parse183); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                          
                          proto.postParse();
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
141131
def parse (cls, line, lineno, log, cmddict=None):
    
    start  = line.find('{')
    stop   = line.find('}')
    pos    = SeqPos(line, lineno, start + 1, stop)
    result = cls(None, pos)

    if start >= 0 and stop >= start:
      attrs = { }
      pairs = line[start + 1:stop].split(',')

      for item in pairs:
        ncolons = item.count(':')
        if ncolons == 0:
          log.error('Missing colon in command attribute "%s".' % item, pos)
        elif ncolons > 1:
          log.error('Too many colons in command attribute "%s".' % item, pos)
        else:
          name, value = (s.strip() for s in item.split(':'))
          attrs[name] = value

      result = cls(attrs, pos)

    elif start != -1 or stop != -1:
      log.error('Incorrect command attribute curly brace placement.', pos)

    return result
98169
def p_simple_command_element(p):
    ''''''
    if isinstance(p[1], ast.node):
        p[0] = [p[1]]
        return

    parserobj = p.context
    p[0] = [_expandword(parserobj, p.slice[1])]

    # change the word node to an assignment if necessary
    if p.slice[1].ttype == tokenizer.tokentype.ASSIGNMENT_WORD:
        p[0][0].kind = 'assignment'
736126
public void parseLongestText(String text, AhoCorasickDoubleArrayTrie.IHit<V> processor)
    {
        int length = text.length();
        for (int i = 0; i < length; ++i)
        {
            BaseNode<V> state = transition(text.charAt(i));
            if (state != null)
            {
                int to = i + 1;
                int end = to;
                V value = state.getValue();
                for (; to < length; ++to)
                {
                    state = state.transition(text.charAt(to));
                    if (state == null) break;
                    if (state.getValue() != null)
                    {
                        value = state.getValue();
                        end = to + 1;
                    }
                }
                if (value != null)
                {
                    processor.hit(i, end, value);
                    i = end - 1;
                }
            }
        }
    }