/** * Applies a parser error action that will generate an exception with the location of the current parse term in * it. * * @throws SourceCodeException With an error location for the current parse term. */ public void apply() throws SourceCodeException { throw new SourceCodeException(errorMessage, null, null, null, nextTerm.getSourceCodePosition()); } }
/** * Applies a parser error action that will generate an exception with the location of the current parse term in * it. * * @throws SourceCodeException With an error location for the current parse term. */ public void apply() throws SourceCodeException { throw new SourceCodeException(errorMessage, null, null, null, nextTerm.getSourceCodePosition()); } }
/** * Parses a single sentence in first order logic. A sentence consists of a term followed by a full stop. * * @return A sentence in first order logic. * * @throws SourceCodeException If the token sequence does not parse into a valid sentence. */ public Clause clause() throws SourceCodeException { // Each new sentence provides a new scope in which to make variables unique. variableContext.clear(); Term term = term(); Clause clause = TermUtils.convertToClause(term, interner); if (clause == null) { throw new SourceCodeException("Only queries and clauses are valid sentences in Prolog, not " + term + ".", null, null, null, term.getSourceCodePosition()); } return clause; }
/** * Parses a single sentence in first order logic. A sentence consists of a term followed by a full stop. * * @return A sentence in first order logic. * * @throws SourceCodeException If the token sequence does not parse into a valid sentence. */ public Clause clause() throws SourceCodeException { // Each new sentence provides a new scope in which to make variables unique. variableContext.clear(); Term term = term(); Clause clause = TermUtils.convertToClause(term, interner); if (clause == null) { throw new SourceCodeException("Only queries and clauses are valid sentences in Prolog, not " + term + ".", null, null, null, term.getSourceCodePosition()); } return clause; }
" but does not.", null, null, null, termToExtract.getSourceCodePosition()); " but does not.", null, null, null, nextTerm.getSourceCodePosition());
" but does not.", null, null, null, termToExtract.getSourceCodePosition()); " but does not.", null, null, null, nextTerm.getSourceCodePosition());