Parses the references clause.
974301
public void parseReferences(ArrayList<String> name)
  {
    String foreignTable = parseIdentifier();

    Token token = scanToken();

    ArrayList<String> foreignColumns = new ArrayList<String>();

    if (token == Token.LPAREN) {
      _token = token;

      foreignColumns = parseColumnNames();
    }
    else {
      _token = token;
    }
  }
412557
private function parseRefAsTag($reference): ?string
    {
        if (preg_match(self::REGEX_TAG, $reference, $matches) !== 1) {
            return null;
        }

        return $matches[1];
    }
497236
def _parse_from_ref(cls, pairs=None, flat=None,
                      reference=None, serialized=None, urlsafe=None,
                      app=None, namespace=None, parent=None):
    """"""
    if cls is not Key:
      raise TypeError('Cannot construct Key reference on non-Key class; '
                      'received %r' % cls)
    if (bool(pairs) + bool(flat) + bool(reference) + bool(serialized) +
        bool(urlsafe) + bool(parent)) != 1:
      raise TypeError('Cannot construct Key reference from incompatible '
                      'keyword arguments.')
    if urlsafe:
      serialized = _DecodeUrlSafe(urlsafe)
    if serialized:
      reference = _ReferenceFromSerialized(serialized)
    if reference:
      reference = _ReferenceFromReference(reference)
    pairs = []
    elem = None
    path = reference.path()
    for elem in path.element_list():
      kind = elem.type()
      if elem.has_id():
        id_or_name = elem.id()
      else:
        id_or_name = elem.name()
      if not id_or_name:
        id_or_name = None
      tup = (kind, id_or_name)
      pairs.append(tup)
    if elem is None:
      raise RuntimeError('Key reference has no path or elements (%r, %r, %r).'
                         % (urlsafe, serialized, str(reference)))
    # TODO: ensure that each element has a type and either an id or a name
    # You needn't specify app= or namespace= together with reference=,
    # serialized= or urlsafe=, but if you do, their values must match
    # what is already in the reference.
    ref_app = reference.app()
    if app is not None:
      if app != ref_app:
        raise RuntimeError('Key reference constructed uses a different app %r '
                           'than the one specified %r' %
                           (ref_app, app))
    ref_namespace = reference.name_space()
    if namespace is not None:
      if namespace != ref_namespace:
        raise RuntimeError('Key reference constructed uses a different '
                           'namespace %r than the one specified %r' %
                           (ref_namespace, namespace))
    return (reference, tuple(pairs), ref_app, ref_namespace)
1181591
@Override
  protected final Parse processSample(final Parse reference) {

    final String sentenceText = reference.getText();

    final Parse[] predictions = ShiftReduceParser.parseLine(sentenceText,
        this.parser, 1);

    Parse prediction = null;
    if (predictions.length > 0) {
      prediction = predictions[0];
      // System.err.println("-> Prediction: " + prediction.getType());
    }

    this.fmeasure.updateScores(getConstituencySpans(reference),
        getConstituencySpans(prediction));

    return prediction;
  }
981560
protected function parseSelectStmt(){
		$cols = $this->stmt->getColumns();
		list($source, $where, $group, $order) = $this->clauses;
		foreach($cols as $key => $col){
			$col = preg_match('~^[\w.]+$~', $col) ? ":$col" : $col;
			$cols[$key] = $this->tryDelimite($col);
		}
		$cols = implode(', ', $cols);

		return $this->applyLimit("SELECT $cols\nFROM " . $source . $where . $group . $order);
	}
654819
public final EObject ruleMultiTypeReference() throws RecognitionException {
        EObject current = null;

        Token otherlv_2=null;
        EObject this_JvmTypeReference_0 = null;

        EObject lv_references_3_0 = null;



        	enterRule();

        try {
            // InternalSARL.g:10427:2: ( (this_JvmTypeReference_0= ruleJvmTypeReference ( () (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+ )? ) )
            // InternalSARL.g:10428:2: (this_JvmTypeReference_0= ruleJvmTypeReference ( () (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+ )? )
            {
            // InternalSARL.g:10428:2: (this_JvmTypeReference_0= ruleJvmTypeReference ( () (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+ )? )
            // InternalSARL.g:10429:3: this_JvmTypeReference_0= ruleJvmTypeReference ( () (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+ )?
            {
            if ( state.backtracking==0 ) {

              			newCompositeNode(grammarAccess.getMultiTypeReferenceAccess().getJvmTypeReferenceParserRuleCall_0());
              		
            }
            pushFollow(FOLLOW_98);
            this_JvmTypeReference_0=ruleJvmTypeReference();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			current = this_JvmTypeReference_0;
              			afterParserOrEnumRuleCall();
              		
            }
            // InternalSARL.g:10437:3: ( () (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+ )?
            int alt267=2;
            int LA267_0 = input.LA(1);

            if ( (LA267_0==97) ) {
                alt267=1;
            }
            switch (alt267) {
                case 1 :
                    // InternalSARL.g:10438:4: () (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+
                    {
                    // InternalSARL.g:10438:4: ()
                    // InternalSARL.g:10439:5: 
                    {
                    if ( state.backtracking==0 ) {

                      					current = forceCreateModelElementAndAdd(
                      						grammarAccess.getMultiTypeReferenceAccess().getJvmSynonymTypeReferenceReferencesAction_1_0(),
                      						current);
                      				
                    }

                    }

                    // InternalSARL.g:10445:4: (otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) ) )+
                    int cnt266=0;
                    loop266:
                    do {
                        int alt266=2;
                        int LA266_0 = input.LA(1);

                        if ( (LA266_0==97) ) {
                            alt266=1;
                        }


                        switch (alt266) {
                    	case 1 :
                    	    // InternalSARL.g:10446:5: otherlv_2= '|' ( (lv_references_3_0= ruleJvmTypeReference ) )
                    	    {
                    	    otherlv_2=(Token)match(input,97,FOLLOW_41); if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      					newLeafNode(otherlv_2, grammarAccess.getMultiTypeReferenceAccess().getVerticalLineKeyword_1_1_0());
                    	      				
                    	    }
                    	    // InternalSARL.g:10450:5: ( (lv_references_3_0= ruleJvmTypeReference ) )
                    	    // InternalSARL.g:10451:6: (lv_references_3_0= ruleJvmTypeReference )
                    	    {
                    	    // InternalSARL.g:10451:6: (lv_references_3_0= ruleJvmTypeReference )
                    	    // InternalSARL.g:10452:7: lv_references_3_0= ruleJvmTypeReference
                    	    {
                    	    if ( state.backtracking==0 ) {

                    	      							newCompositeNode(grammarAccess.getMultiTypeReferenceAccess().getReferencesJvmTypeReferenceParserRuleCall_1_1_1_0());
                    	      						
                    	    }
                    	    pushFollow(FOLLOW_98);
                    	    lv_references_3_0=ruleJvmTypeReference();

                    	    state._fsp--;
                    	    if (state.failed) return current;
                    	    if ( state.backtracking==0 ) {

                    	      							if (current==null) {
                    	      								current = createModelElementForParent(grammarAccess.getMultiTypeReferenceRule());
                    	      							}
                    	      							add(
                    	      								current,
                    	      								"references",
                    	      								lv_references_3_0,
                    	      								"org.eclipse.xtext.xbase.Xtype.JvmTypeReference");
                    	      							afterParserOrEnumRuleCall();
                    	      						
                    	    }

                    	    }


                    	    }


                    	    }
                    	    break;

                    	default :
                    	    if ( cnt266 >= 1 ) break loop266;
                    	    if (state.backtracking>0) {state.failed=true; return current;}
                                EarlyExitException eee =
                                    new EarlyExitException(266, input);
                                throw eee;
                        }
                        cnt266++;
                    } while (true);


                    }
                    break;

            }


            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
691995
@SuppressWarnings("fallthrough")
    protected DCReference reference(boolean allowMember) throws ParseException {
        int pos = bp;
        int depth = 0;

        // scan to find the end of the signature, by looking for the first
        // whitespace not enclosed in () or <>, or the end of the tag
        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    // fallthrough

                case ' ': case '\t':
                    if (depth == 0)
                        break loop;
                    break;

                case '(':
                case '<':
                    newline = false;
                    depth++;
                    break;

                case ')':
                case '>':
                    newline = false;
                    --depth;
                    break;

                case '}':
                    if (bp == pos)
                        return null;
                    newline = false;
                    break loop;

                case '@':
                    if (newline)
                        break loop;
                    // fallthrough

                default:
                    newline = false;

            }
            nextChar();
        }

        if (depth != 0)
            throw new ParseException("dc.unterminated.signature");

        String sig = newString(pos, bp);

        // Break sig apart into qualifiedExpr member paramTypes.
        JCTree qualExpr;
        Name member;
        List<JCTree> paramTypes;

        Log.DeferredDiagnosticHandler deferredDiagnosticHandler
                = new Log.DeferredDiagnosticHandler(fac.log);

        try {
            int hash = sig.indexOf("#");
            int lparen = sig.indexOf("(", hash + 1);
            if (hash == -1) {
                if (lparen == -1) {
                    qualExpr = parseType(sig);
                    member = null;
                } else {
                    qualExpr = null;
                    member = parseMember(sig.substring(0, lparen));
                }
            } else {
                qualExpr = (hash == 0) ? null : parseType(sig.substring(0, hash));
                if (lparen == -1)
                    member = parseMember(sig.substring(hash + 1));
                else
                    member = parseMember(sig.substring(hash + 1, lparen));
            }

            if (lparen < 0) {
                paramTypes = null;
            } else {
                int rparen = sig.indexOf(")", lparen);
                if (rparen != sig.length() - 1)
                    throw new ParseException("dc.ref.bad.parens");
                paramTypes = parseParams(sig.substring(lparen + 1, rparen));
            }

            if (!deferredDiagnosticHandler.getDiagnostics().isEmpty())
                throw new ParseException("dc.ref.syntax.error");

        } finally {
            fac.log.popDiagnosticHandler(deferredDiagnosticHandler);
        }

        return m.at(pos).newReferenceTree(sig, qualExpr, member, paramTypes).setEndPos(bp);
    }
1106599
def parse_component_reference(self, node):
        

        if 'name' in node.lattrib:
            name = node.lattrib['name']
        else:
            self.raise_error('<ComponentReference> must specify a name for the ' +
                             'reference.')

        if 'type' in node.lattrib:
            type_ = node.lattrib['type']
        else:
            self.raise_error('<ComponentReference> must specify a type for the ' +
                             'reference.')
                             
        if 'local' in node.lattrib:
            local = node.lattrib['local']
        else:
            local = None

        self.current_component_type.add_component_reference(ComponentReference(name, type_, local))
1004659
protected function resolveReferences()
    {
        $references = $this->config['references'] ?? [];

        if (! is_array($references) || empty($references)) {
            return;
        }

        foreach ($references as $config) {
            $this->resolveReference($config);
        }
    }
1098912
private function parseRefAsCommit($reference): ?string
    {
        if (preg_match(self::REGEX_COMMIT, $reference, $matches) !== 1) {
            return null;
        }

        return $matches[0];
    }
778079
def referencesFinder(text):
    
    references = referencesRegEx.finditer(text)
    count = 0
    refs = []
    spans = []
    for i in references:
        refs.append(i.group())
        spans.append(i.span())
        count += 1
    done = set()
    nameRegEx = re.compile(r"""(name=["']*.*?["']*)(\s|/|>)""")

    for index, obj in enumerate(refs):

        if obj.startswith('<ref name='):
                nameTag = re.escape(nameRegEx.search(obj).group(1))

                if nameTag not in done:
                    nameTag = re.escape(nameRegEx.search(obj).group(1))
                    indeces = [i for i, x in enumerate(refs) if re.search(nameTag, x)]
                    matches = [refs[i] for i in indeces]
                    full = max(matches, key=len)

                    for i in indeces:
                        refs[i] = full

                    done.add(nameTag)

    #eliminate <ref tag or other rudiments from the ref string

    for i in range(len(refs)):
        #print('SIIT', refs[i])
        lastindex = refs[i].rindex('<')
        firstindex = refs[i].index('>')+1
        refs[i]=refs[i][firstindex:lastindex]

    #Handle cite-references

    for i in range(len(refs)):
        if 'cite' in refs[i].lower():
            newText = ''
            values = refs[i].split('|')
            for j in values:
                if '=' in j:
                    first = j.index('=')
                    newText += j[first+1:].strip() + ';'
            refs[i] = newText
    #a ref string:position int dictionary
    refspos = {}
    c = 0
    for i in refs:
        if i not in refspos.keys():
            refspos[i] = c
            c +=1
        else:
            continue

    #print(refspos)

    #eliminate old, bad <ref> tags and insert clean  ones <ref 1..2..3/> to the same spot.
    newText = ''
    assert len(spans) == len(refs)
    #Could happen... havent yet.
    next = 0
    for i in range(len(spans)):
        start = spans[i][0]
        newText+=text[next:start]+'<ref '+str(refspos[refs[i]])+'/>'
        next = spans[i][1]

    newText+=text[next:]

    #switch keys:values in the dictionary for use in sectionsParser
    #positiontag:ref
    newDict  = {y:x for x,y in refspos.items()}

    return newText, newDict
442895
def references(self):
        
        return self.connection.query("""
        SELECT concat('`', table_schema, '`.`', table_name, '`') as referencing_table, column_name
        FROM information_schema.key_column_usage
        WHERE referenced_table_name="{tab}" and referenced_table_schema="{db}"
        """.format(tab=self.table_name, db=self.database), as_dict=True)
56939
protected function parseIncludes()
    {
        if ($this->query->has('includes')) {
            $this->query->setIncludes(
                explode(',', $this->query->getRaw('includes'))
            );
        }
    }
46921
private function getReferencesDeclaration()
    {

        // we got a max instances allowed in normality tags
        $references = json_encode( $this->entity->pgClass->getReferences() );
        $references = Php::varExport( $references, true );

        $this->class->classComponents[] = new VariableDeclaration(
            'references',
            new SFormatf( <<<'PHP'
                /**
                 * Reference information for this relation
                 * @var array
                 */
                protected $references = %s;
PHP
                , $references
            )
        );

    }
367422
public static function parse(string $value, array $references = [])
    {
        $value = \trim($value);

        if ('' === $value) {
            return '';
        }

        $i = 0;
        switch ($value[$i]) {
            case '[':
                $result = self::parseSequence($value, $i, $references);
                ++$i;
                break;
            case '{':
                $result = self::parseMapping($value, $i, $references);
                ++$i;
                break;
            default:
                $result = self::parseScalar($value, null, $i, true, $references);
        }

        // some comments are allowed at the end
        if (\preg_replace('/\s+#.*$/A', '', \substr($value, $i))) {
            throw new ParseException(\sprintf('Unexpected characters near "%s".', \substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
        }

        return $result;
    }
103765
protected void parseFunctionReference(I_CmsXmlContentLocation node) {

        String name = node.getSubValue(N_NAME).asString(m_cms);
        CmsUUID functionId = node.getSubValue(N_FUNCTION).asId(m_cms);
        CmsUUID functionDefaultPageId = null;
        I_CmsXmlContentValueLocation defaultPageValue = node.getSubValue(N_FUNCTION_DEFAULT_PAGE);
        if (defaultPageValue != null) {
            functionDefaultPageId = defaultPageValue.asId(m_cms);
        }
        I_CmsXmlContentValueLocation orderNode = node.getSubValue(N_ORDER);
        int order = I_CmsConfigurationObject.DEFAULT_ORDER;
        if (orderNode != null) {
            String orderStr = orderNode.asString(m_cms);
            try {
                order = Integer.parseInt(orderStr);
            } catch (NumberFormatException e) {
                // noop
            }
        }
        m_functionReferences.add(new CmsFunctionReference(name, functionId, functionDefaultPageId, order));
    }
1174464
private function parseFacts(): void
    {
        // Split the record into facts
        if ($this->gedcom) {
            $gedcom_facts = preg_split('/\n(?=1)/s', $this->gedcom);
            array_shift($gedcom_facts);
        } else {
            $gedcom_facts = [];
        }
        if ($this->pending) {
            $pending_facts = preg_split('/\n(?=1)/s', $this->pending);
            array_shift($pending_facts);
        } else {
            $pending_facts = [];
        }

        $this->facts = [];

        foreach ($gedcom_facts as $gedcom_fact) {
            $fact = new Fact($gedcom_fact, $this, md5($gedcom_fact));
            if ($this->pending !== null && !in_array($gedcom_fact, $pending_facts, true)) {
                $fact->setPendingDeletion();
            }
            $this->facts[] = $fact;
        }
        foreach ($pending_facts as $pending_fact) {
            if (!in_array($pending_fact, $gedcom_facts, true)) {
                $fact = new Fact($pending_fact, $this, md5($pending_fact));
                $fact->setPendingAddition();
                $this->facts[] = $fact;
            }
        }
    }