public AbstractParser(AbstractLexer lexer) { this.lexer = lexer; this.environment = lexer.getEnvironment(); environment.setParser(this); }
/** * Define the input text by reading from a reader. * @param reader providing the source text * @throws IOException if reading fails * * @deprecated clients should invoke {@link #reset(Reader, String)} */ @Deprecated public void initialize(Reader reader) throws IOException { char[] buffer = getInputChars(reader); reset(buffer, null); }
/** * @param parser the {@link AbstractParser} instance * @deprecated clients should invoke {@link #lexer(DerivedPrsStream)} */ @Deprecated public void lexToTokens(AbstractParser parser) { lexToTokens(null, parser); }
/** * * @param lexer * @deprecated To set/reset the lex stream use {@link #reset(ILexStream)} */ @Deprecated public void setLexStream(AbstractLexer lexer) { this.lexer = lexer; getIPrsStream().resetLexStream(lexer.getILexStream()); }
/** * Define the input text by reading from a reader. * * @param reader * providing the source text * @param fileName * the associated finleName of the input, or <code>null</code> if none. * @throws IOException * if reading fails * @since 3.0 */ public void reset(Reader reader, String fileName) throws IOException { AbstractLexer lexer = getLexer(); lexer.reset(reader, fileName); AbstractParser parser = getAbstractParser(); if (parser.getIPrsStream() == null) { parser.reset(lexer.getILexStream()); } }
/** * @param parser the {@link AbstractParser} instance * @deprecated clients should invoke {@link #lexer(Monitor, DerivedPrsStream)} */ @Deprecated public void lexToTokens(Monitor monitor, AbstractParser parser) { lexer(monitor, parser.getIPrsStream()); }
/** * Define the input text as a given array of characters. * @param inputChars the characters * @deprecated clients should use {@link #reset(char[], String)} */ @Deprecated public void initialize(char[] inputChars) { reset(inputChars, null); }
/** * * @param lexer * @deprecated To set/reset the lex stream use {@link #reset(ILexStream)} */ @Deprecated public void setLexStream(AbstractLexer lexer) { this.lexer = lexer; getIPrsStream().resetLexStream(lexer.getILexStream()); }
/** * Define the input text by reading from a reader. * * @param reader * providing the source text * @param fileName * the associated finleName of the input, or <code>null</code> if none. * @throws IOException * if reading fails * @since 3.0 */ public void reset(Reader reader, String fileName) throws IOException { AbstractLexer lexer = getLexer(); lexer.reset(reader, fileName); AbstractParser parser = getAbstractParser(); if (parser.getIPrsStream() == null) { parser.reset(lexer.getILexStream()); } }
/** * @param parser the {@link AbstractParser} instance * @deprecated clients should invoke {@link #lexer(Monitor, DerivedPrsStream)} */ @Deprecated public void lexToTokens(Monitor monitor, AbstractParser parser) { lexer(monitor, parser.getIPrsStream()); }
/** * Define the input text as a given array of characters. * @param inputChars the characters * @deprecated clients should use {@link #reset(char[], String)} */ @Deprecated public void initialize(char[] inputChars) { reset(inputChars, null); }
/** * Define the input text by reading from a reader. * @param reader providing the source text * @throws IOException if reading fails * * @deprecated clients should invoke {@link #reset(Reader, String)} */ @Deprecated public void initialize(Reader reader) throws IOException { char[] buffer = getInputChars(reader); reset(buffer, null); }
public void setFileName(String filename) { getLexer().getILexStream().setFileName(filename); }
/** * Construct an OCL semantic analyzer with default syntactic and lexical * parsers all operating within a given environment. Then prime the analyzer * by performing keyword and lexical parsing of the given source text. * * @param environment * the symbolic and problem handling environment * @param text * the source text for analysis */ public OCLAnalyzer( Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> environment, String text) { this(new OCLParser(new OCLLexer(environment, text.toCharArray()))); getLexer().lexer(getAbstractParser().getIPrsStream()); }
/** * Define the input text as a given array of characters. * * @param buffer * the characters * @param fileName * the associated finleName of the input, or <code>null</code> if none. * @since 3.0 */ public void reset(char[] buffer, String fileName) { getLexer().reset(buffer, fileName); }
public AbstractParser(AbstractLexer lexer) { this.lexer = lexer; this.environment = lexer.getEnvironment(); environment.setParser(this); }
/** * @param parser the {@link AbstractParser} instance * @deprecated clients should invoke {@link #lexer(DerivedPrsStream)} */ @Deprecated public void lexToTokens(AbstractParser parser) { lexToTokens(null, parser); }
public void setFileName(String filename) { getLexer().getILexStream().setFileName(filename); }
/** * Construct an OCL semantic analyzer with default syntactic and lexical * parsers all operating within a given environment. Then prime the analyzer * by performing keyword and lexical parsing of the given source text. * * @param environment * the symbolic and problem handling environment * @param text * the source text for analysis */ public OCLAnalyzer( Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> environment, String text) { this(new OCLParser(new OCLLexer(environment, text.toCharArray()))); getLexer().lexer(getAbstractParser().getIPrsStream()); }
/** * Define the input text as a given array of characters. * * @param buffer * the characters * @param fileName * the associated finleName of the input, or <code>null</code> if none. * @since 3.0 */ public void reset(char[] buffer, String fileName) { getLexer().reset(buffer, fileName); }