Examples of PushbackReader


Examples of java.io.PushbackReader

        defineDecls = (String) defineDeclarations.get(filename);
      defineDecls = prependGlobalDefineDeclarations(defineDecls);

      try {
        CppFilterReader readIn = new CppFilterReader(in, defineDecls);
        Parser p = new Parser(new Lexer(new PushbackReader(readIn, 1024)));

        // Parse the file.
        Start tree = p.parse();

        // Apply the file loader.
View Full Code Here

Examples of java.io.PushbackReader

    public static PValue compileVal(String expression)
        throws CompilationException
    {
        try {
            // Create a Parser instance.
            Parser p = new Parser(new Lexer(new PushbackReader
                (new StringReader("[foo] = " + expression + ";"), 1024)));

            // Parse the input
            Start tree = p.parse();
View Full Code Here

Examples of java.io.PushbackReader

    private static Start compile(String expression) {
        Start result = (Start) COMPILED_EXPRESSIONS.get(expression);
        if (result == null) {
            try {
                Parser p = new Parser(new Lexer(new PushbackReader(
                        new StringReader(expression), 1024)));

                // Parse the input
                result = p.parse();
            } catch (Exception e) {
View Full Code Here

Examples of java.io.PushbackReader

    private boolean escaping = false;
    private Deque<String> activeTokens;
    private Map<String, String> resolvedTokens;
   
    public TokenReplacingReader(Reader source, Map<String, String> tokens) {
        this.pushbackReader = new PushbackReader(source, 2);
        this.tokens = tokens;
        this.activeTokens = new ArrayDeque<String>();
        this.resolvedTokens = new HashMap<String, String>();
    }
View Full Code Here

Examples of java.io.PushbackReader

        this.activeTokens = new ArrayDeque<String>();
        this.resolvedTokens = new HashMap<String, String>();
    }

    protected TokenReplacingReader(String source, Map<String, String> tokens, Deque<String> activeTokens, Map<String, String> resolvedTokens) {
        pushbackReader = new PushbackReader(new StringReader(source));
        this.tokens = tokens;
        this.activeTokens = activeTokens;
        this.resolvedTokens = resolvedTokens;
    }
View Full Code Here

Examples of java.io.PushbackReader

     * @param config_str Configuration string
     * @return Vector of strings
     */
    private static List<String> parseProtocols(String config_str) throws IOException {
        List<String> retval=new LinkedList<String>();
        PushbackReader reader=new PushbackReader(new StringReader(config_str));
        int ch;
        StringBuilder sb;
        boolean running=true;

        while(running) {
            String protocol_name=readWord(reader);
            sb=new StringBuilder();
            sb.append(protocol_name);

            ch=read(reader);
            if(ch == -1) {
                retval.add(sb.toString());
                break;
            }

            if(ch == ':') {  // no attrs defined
                retval.add(sb.toString());
                continue;
            }

            if(ch == '(') { // more attrs defined
                reader.unread(ch);
                String attrs=readUntil(reader, ')');
                sb.append(attrs);
                retval.add(sb.toString());
            }
            else {
                retval.add(sb.toString());
            }

            while(true) {
                ch=read(reader);
                if(ch == ':') {
                    break;
                }
                if(ch == -1) {
                    running=false;
                    break;
                }
            }
        }
        reader.close();

        return retval;
    }
View Full Code Here

Examples of java.io.PushbackReader

    }
    return result;
  }

  private static void parseFromClassName(StringReader StringReader, PermissionInfo result) throws IOException {
    PushbackReader reader = new PushbackReader(StringReader, 1);
    result.className = readSection(reader);
    result.name = readSection(reader);
    result.actions = readSection(reader);
    byte closingBracketsCount = 0;
    for (int ch = reader.read(); ch != -1; ch = reader.read()) {
      if (ch == ' ')  {
        continue;
      }
      if (ch == ')')  {
        closingBracketsCount++;
View Full Code Here

Examples of java.io.PushbackReader

   * Transforms the html text from the reader to formatted text.
   * @param presentation If not <code>null</code>, formattings will be applied to
   * the presentation.
  */
  public HTML2TextReader(Reader reader, TextPresentation presentation) {
    super(new PushbackReader(reader));
    fTextPresentation= presentation;
  }
View Full Code Here

Examples of java.io.PushbackReader

   * Transforms the html text from the reader to formatted text.
   * @param presentation If not <code>null</code>, formattings will be applied to
   * the presentation.
  */
  public HTML2TextReader(Reader reader, TextPresentation presentation) {
    super(new PushbackReader(reader));
    fTextPresentation= presentation;
  }
View Full Code Here

Examples of java.io.PushbackReader

      this.currentReader = new StackedReader();
      this.readers = new Stack();
      Reader reader = this.openStream(publicID, systemIDasURL.toString());
      this.currentReader.lineReader = new LineNumberReader(reader);
      this.currentReader.pbReader
         = new PushbackReader(this.currentReader.lineReader, 2);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.