~ubuntu-branches/debian/sid/latexdraw/sid

« back to all changes in this revision

Viewing changes to latexDraw/parsers/CodeParser.java

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2009-07-15 23:35:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090715233552-2bblktyf2lmrkyo3
Tags: 2.0.3+1-1
* New upstream release.
* Add additional Recommended packages for new export features.
* Fix typo in long description, with thanks to Kai Weber (Closes: #529195).
* Bump standards to 3.8.2 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package latexDraw.parsers;
2
2
 
 
3
import java.text.ParseException;
 
4
 
3
5
/**
4
6
 * Defines an abstract parser that parses code.<br>
5
7
 *<br>
91
93
        
92
94
        /**
93
95
         * Parses the code.
94
 
         * @throws UnclosedBracketsException If a bracket is not closed.
 
96
         * @throws ParseException If an error occurs.
95
97
         * @since 2.0.2
96
98
         */
97
 
        public abstract void parse() throws UnclosedBracketsException;
 
99
        public abstract void parse() throws ParseException;
98
100
        
99
101
        
100
102
        
140
142
    
141
143
    
142
144
    /**
 
145
     * The character at the given position.
 
146
     * @param pos The position of the wanted character.
 
147
     * @return The character or EOC.
 
148
     * @since 2.0.3
 
149
     */
 
150
    public int getCharAt(int pos)
 
151
    {
 
152
        if(pos>=codeCore.code.length() || pos<0)
 
153
                return EOC;
 
154
        
 
155
        return codeCore.code.charAt(pos);
 
156
    }
 
157
    
 
158
    
 
159
    /**
143
160
     * @return the current character or EOC if the end of the path is reached.
144
161
     * @since 2.0.2
145
162
     */
216
233
                        skipWSP();
217
234
                        skipComment();
218
235
                }
219
 
                while(pos!=codeCore.position);
 
236
                while(pos!=codeCore.position && !isEOC());
220
237
        }
221
238
        
222
239
        
 
240
        
 
241
        /**
 
242
         * @return True if the current position points to a comment token.
 
243
         * @since 2.0.3
 
244
         */
 
245
        public abstract boolean isComment();
 
246
        
 
247
        
 
248
        
223
249
        /**
224
250
         * @return True if the current character is a whitespace/ignorable character.
225
251
         * @since 2.0.2