JavaParser Source Viewer

Home|JavaParser/com/github/javaparser/ParseStart.java
1/*
2 * Copyright (C) 2007-2010 JĂșlio Vilmar Gesser.
3 * Copyright (C) 2011, 2013-2020 The JavaParser Team.
4 *
5 * This file is part of JavaParser.
6 *
7 * JavaParser can be used either under the terms of
8 * a) the GNU Lesser General Public License as published by
9 *     the Free Software Foundation, either version 3 of the License, or
10 *     (at your option) any later version.
11 * b) the terms of the Apache License
12 *
13 * You should have received a copy of both licenses in LICENCE.LGPL and
14 * LICENCE.APACHE. Please refer to those files for details.
15 *
16 * JavaParser is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU Lesser General Public License for more details.
20 */
21
22package com.github.javaparser;
23
24import com.github.javaparser.ast.CompilationUnit;
25import com.github.javaparser.ast.ImportDeclaration;
26import com.github.javaparser.ast.PackageDeclaration;
27import com.github.javaparser.ast.body.BodyDeclaration;
28import com.github.javaparser.ast.body.MethodDeclaration;
29import com.github.javaparser.ast.body.Parameter;
30import com.github.javaparser.ast.body.TypeDeclaration;
31import com.github.javaparser.ast.expr.*;
32import com.github.javaparser.ast.modules.ModuleDeclaration;
33import com.github.javaparser.ast.modules.ModuleDirective;
34import com.github.javaparser.ast.stmt.BlockStmt;
35import com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt;
36import com.github.javaparser.ast.stmt.Statement;
37import com.github.javaparser.ast.type.ClassOrInterfaceType;
38import com.github.javaparser.ast.type.Type;
39import com.github.javaparser.ast.type.TypeParameter;
40
41/**
42 * The start production for JavaParser.
43 * Tells JavaParser what piece of Java code it can expect.
44 * For example,
45 * COMPILATION_UNIT indicates a complete Java file,
46 * and CLASS_BODY would indicate the part of a class that is within { and }.
47 *
48 * @see JavaParser#parse(ParseStart, Provider)
49 */
50@FunctionalInterface
51public interface ParseStart<R> {
52    ParseStart<CompilationUnitCOMPILATION_UNIT = GeneratedJavaParser::CompilationUnit;
53    ParseStart<BlockStmtBLOCK = GeneratedJavaParser::BlockParseStart;
54    ParseStart<StatementSTATEMENT = GeneratedJavaParser::BlockStatementParseStart;
55    ParseStart<ImportDeclarationIMPORT_DECLARATION = GeneratedJavaParser::ImportDeclarationParseStart;
56    ParseStart<ExpressionEXPRESSION = GeneratedJavaParser::ExpressionParseStart;
57    ParseStart<AnnotationExprANNOTATION = GeneratedJavaParser::AnnotationParseStart;
58    ParseStart<BodyDeclaration<?>> ANNOTATION_BODY = GeneratedJavaParser::AnnotationBodyDeclarationParseStart;
59    ParseStart<BodyDeclaration<?>> CLASS_BODY = GeneratedJavaParser::ClassOrInterfaceBodyDeclarationParseStart;
60    ParseStart<ClassOrInterfaceTypeCLASS_OR_INTERFACE_TYPE = GeneratedJavaParser::ClassOrInterfaceTypeParseStart;
61    ParseStart<TypeTYPE = GeneratedJavaParser::ResultTypeParseStart;
62    ParseStart<TypeParameterTYPE_PARAMETER = GeneratedJavaParser::TypeParameterParseStart;
63    ParseStart<VariableDeclarationExprVARIABLE_DECLARATION_EXPR = GeneratedJavaParser::VariableDeclarationExpressionParseStart;
64    ParseStart<ExplicitConstructorInvocationStmtEXPLICIT_CONSTRUCTOR_INVOCATION_STMT = GeneratedJavaParser::ExplicitConstructorInvocationParseStart;
65    ParseStart<NameNAME = GeneratedJavaParser::NameParseStart;
66    ParseStart<SimpleNameSIMPLE_NAME = GeneratedJavaParser::SimpleNameParseStart;
67    ParseStart<ParameterPARAMETER = GeneratedJavaParser::ParameterParseStart;
68    ParseStart<PackageDeclarationPACKAGE_DECLARATION = GeneratedJavaParser::PackageDeclarationParseStart;
69    ParseStart<TypeDeclaration<?>> TYPE_DECLARATION = GeneratedJavaParser::TypeDeclarationParseStart;
70    ParseStart<ModuleDeclarationMODULE_DECLARATION = GeneratedJavaParser::ModuleDeclarationParseStart;
71    ParseStart<ModuleDirectiveMODULE_DIRECTIVE = GeneratedJavaParser::ModuleDirectiveParseStart;
72    ParseStart<MethodDeclarationMETHOD_DECLARATION = GeneratedJavaParser::MethodDeclarationParseStart;
73
74    R parse(GeneratedJavaParser parser) throws ParseException;
75}
76
MembersX
ParseStart:CLASS_BODY
ParseStart:TYPE_DECLARATION
ParseStart:TYPE
ParseStart:EXPRESSION
ParseStart:COMPILATION_UNIT
ParseStart:CLASS_OR_INTERFACE_TYPE
ParseStart:MODULE_DECLARATION
ParseStart:parse
ParseStart:TYPE_PARAMETER
ParseStart:EXPLICIT_CONSTRUCTOR_INVOCATION_STMT
ParseStart:ANNOTATION_BODY
ParseStart:METHOD_DECLARATION
ParseStart:NAME
ParseStart:SIMPLE_NAME
ParseStart:MODULE_DIRECTIVE
ParseStart:IMPORT_DECLARATION
ParseStart:BLOCK
ParseStart:VARIABLE_DECLARATION_EXPR
ParseStart:PARAMETER
ParseStart:STATEMENT
ParseStart:ANNOTATION
ParseStart:PACKAGE_DECLARATION
Members
X