MCPcopy Index your code
hub / github.com/apache/tomcat / parse

Method parse

java/org/apache/jasper/compiler/Parser.java:103–133  ·  view source on GitHub ↗

The main entry for Parser @param pc The ParseController, use for getting other objects in compiler and for parsing included pages @param reader To read the page @param parent The parent node to this page, null for top

(ParserController pc, JspReader reader, Node parent, boolean isTagFile,
            boolean directivesOnly, Jar jar, String pageEnc, String jspConfigPageEnc, boolean isDefaultPageEncoding,
            boolean isBomPresent)

Source from the content-addressed store, hash-verified

101 * @throws JasperException If an error occurs during parsing
102 */
103 public static Node.Nodes parse(ParserController pc, JspReader reader, Node parent, boolean isTagFile,
104 boolean directivesOnly, Jar jar, String pageEnc, String jspConfigPageEnc, boolean isDefaultPageEncoding,
105 boolean isBomPresent) throws JasperException {
106
107 Parser parser = new Parser(pc, reader, isTagFile, directivesOnly, jar);
108
109 Node.Root root = new Node.Root(reader.mark(), parent, false,
110 pc.getJspCompilationContext().getOptions().getTempVariableNamePrefix());
111 root.setPageEncoding(pageEnc);
112 root.setJspConfigPageEncoding(jspConfigPageEnc);
113 root.setIsDefaultPageEncoding(isDefaultPageEncoding);
114 root.setIsBomPresent(isBomPresent);
115
116 // For the Top level page, add include-prelude and include-coda
117 PageInfo pageInfo = pc.getCompiler().getPageInfo();
118 if (parent == null && !isTagFile) {
119 parser.addInclude(root, pageInfo.getIncludePrelude());
120 }
121 if (directivesOnly) {
122 parser.parseFileDirectives(root);
123 } else {
124 while (reader.hasMoreInput()) {
125 parser.parseElements(root);
126 }
127 }
128 if (parent == null && !isTagFile) {
129 parser.addInclude(root, pageInfo.getIncludeCoda());
130 }
131
132 return new Node.Nodes(root);
133 }
134
135 /**
136 * Attributes ::= (S Attribute)* S?

Callers 8

doParseMethod · 0.95
getTaglibXmlMethod · 0.45
scanJspConfigMethod · 0.45
parseTldMethod · 0.45
configureMethod · 0.45
streamFilesForDeleteMethod · 0.45
addLoggerMethod · 0.45

Calls 15

setPageEncodingMethod · 0.95
setIsBomPresentMethod · 0.95
addIncludeMethod · 0.95
getIncludePreludeMethod · 0.95
parseFileDirectivesMethod · 0.95
parseElementsMethod · 0.95
getIncludeCodaMethod · 0.95
getPageInfoMethod · 0.80
hasMoreInputMethod · 0.80

Tested by

no test coverage detected