blob: 2a5b29e3c979a90fa521bd75f975db0229e72b05 [file] [log] [blame]
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
parserClass="com.android.tools.idea.lang.proguard.parser.ProguardParser"
extends="com.intellij.extapi.psi.ASTWrapperPsiElement"
psiClassPrefix="Proguard"
psiImplClassSuffix="Impl"
psiPackage="com.android.tools.idea.lang.proguard.psi"
psiImplPackage="com.android.tools.idea.lang.proguard.psi.impl"
elementTypeHolderClass="com.android.tools.idea.lang.proguard.psi.ProguardTypes"
elementTypeClass="com.android.tools.idea.lang.proguard.psi.ProguardElementType"
tokenTypeClass="com.android.tools.idea.lang.proguard.psi.ProguardTokenType"
}
// The tokens used in this grammar are defined in Proguard.flex.
// The structure of a ProGuard file consist of flags and comments
// delimited by newlines. A trailing newline at the end of the file
// is optional.
proguardFile ::= (comment CRLF | flag CRLF | WS? CRLF)*
(comment | flag | WS? )?
comment ::= LINE_CMT
// A flag can be either single line or multiline (in case it includes a Java spec).
flag ::= (multiLineFlag | singleLineFlag comment?)
multiLineFlag ::= FLAG_NAME FLAG_ARG* javaSection
singleLineFlag ::= FLAG_NAME FLAG_ARG*
// A Java spec is of the form "{ <java declarations }" with optional
// newlines after the braces and each java declaration.
javaSection ::= OPEN_BRACE CRLF? (JAVA_DECL CRLF?)* CLOSE_BRACE