This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
18,533 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
analysis-api/src/main/java/com/apkide/analysis/api/cle/CodeAnalyzer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.SyntaxTree; | ||
import com.apkide.analysis.api.clm.Type; | ||
import com.apkide.analysis.api.clm.excpetions.UnknownEntityException; | ||
import com.apkide.common.collections.SetOfInt; | ||
|
||
public interface CodeAnalyzer { | ||
Type analyzeTypeName(SyntaxTree ast, int var2, int var3, String name) throws UnknownEntityException; | ||
|
||
void analyzeImports(SyntaxTree ast); | ||
|
||
void analyzeEveryIdentifiers(SyntaxTree ast, SetOfInt identifiers); | ||
|
||
void analyzeEveryIdentifier(SyntaxTree ast, int identifier); | ||
|
||
void analyzeNode(SyntaxTree ast, int node); | ||
|
||
void analyzeNodeWithValues(SyntaxTree ast, int node); | ||
|
||
void analyzeNamesAndTypes(SyntaxTree ast); | ||
|
||
void analyzeErrors(SyntaxTree ast); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
analysis-api/src/main/java/com/apkide/analysis/api/cle/CodeRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,42 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.ClassType; | ||
import com.apkide.analysis.api.clm.Entity; | ||
import com.apkide.analysis.api.clm.Namespace; | ||
import com.apkide.analysis.api.clm.SyntaxTree; | ||
import com.apkide.analysis.api.clm.Type; | ||
import com.apkide.analysis.api.clm.Variable; | ||
import com.apkide.analysis.api.clm.collections.MapOf; | ||
import com.apkide.analysis.api.clm.collections.SetOf; | ||
|
||
public interface CodeRenderer { | ||
String renderParameter(String typeName, String identifier); | ||
|
||
String renderTypeName(SyntaxTree ast, int line, int column, Type type); | ||
|
||
String renderDefaultValueString(Type type); | ||
|
||
String renderStaticImports(SyntaxTree ast, MapOf<ClassType, Entity> imports); | ||
|
||
String renderFileNamespace(Namespace namespace); | ||
|
||
String renderClassNamespaceStart(Namespace namespace); | ||
|
||
String renderClassNamespaceEnd(Namespace namespace); | ||
|
||
String renderImports(SyntaxTree ast, MapOf<ClassType, Entity> imports); | ||
|
||
String renderImports(SyntaxTree ast, int line, int column, SetOf<? extends Type> imports); | ||
|
||
String renderImports(SyntaxTree ast, int line, int column, SetOf<? extends Type> imports, SetOf<Entity> set); | ||
|
||
String getModifierString(int modifier); | ||
|
||
String getHTMLString(Variable variable); | ||
|
||
String getNameString(Entity entity); | ||
|
||
String getFullyQualifiedNameString(Entity entity); | ||
|
||
String getHTMLString(Entity entity); | ||
} |
3 changes: 3 additions & 0 deletions
3
analysis-api/src/main/java/com/apkide/analysis/api/cle/Compiler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.SyntaxTree; | ||
|
||
public interface Compiler { | ||
void compile(SyntaxTree ast, boolean createDebugMetadata); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
analysis-api/src/main/java/com/apkide/analysis/api/cle/Preprocessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.FileEntry; | ||
import com.apkide.analysis.api.clm.SyntaxTree; | ||
|
||
import java.io.Reader; | ||
|
||
public interface Preprocessor { | ||
char POS_ESCAPE_CHAR = '\uFFEE'; | ||
|
||
void processVersion(FileEntry fileEntry); | ||
|
||
Reader process(FileEntry fileEntry, Reader reader, SyntaxTree ast); | ||
} |
28 changes: 28 additions & 0 deletions
28
analysis-api/src/main/java/com/apkide/analysis/api/cle/SignatureAnalyzer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.ClassType; | ||
import com.apkide.analysis.api.clm.FileEntry; | ||
import com.apkide.analysis.api.clm.Member; | ||
import com.apkide.analysis.api.clm.SyntaxTree; | ||
|
||
public interface SignatureAnalyzer { | ||
long getDeclarationDigest(SyntaxTree ast); | ||
|
||
long getPublicDeclarationDigest(SyntaxTree ast); | ||
|
||
long getClassDeclarationDigest(SyntaxTree ast); | ||
|
||
void doLoadNamespaces(FileEntry fileEntry); | ||
|
||
void doLoadPositions(FileEntry fileEntry); | ||
|
||
void doLoadTypes(FileEntry fileEntry); | ||
|
||
void doLoadSyntax(FileEntry fileEntry); | ||
|
||
void doLoadSuperClassTypes(FileEntry fileEntry, ClassType classtype); | ||
|
||
void doLoadDefaultSuperClassTypes(FileEntry fileEntry, ClassType classtype); | ||
|
||
void doLoadBoundTypes(FileEntry fileEntry, ClassType classtype); | ||
|
||
void doLoadSuperTypes(FileEntry fileEntry, ClassType classtype); | ||
|
||
void doLoadConstantValueOfField(FileEntry fileEntry, Member member); | ||
} |
99 changes: 99 additions & 0 deletions
99
analysis-api/src/main/java/com/apkide/analysis/api/cle/Syntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,103 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.SyntaxTree; | ||
import com.apkide.common.collections.ListOfInt; | ||
|
||
public interface Syntax { | ||
|
||
boolean isParameters(int syntaxTag); | ||
|
||
boolean isMethodDeclaration(int syntaxTag); | ||
|
||
boolean isFieldDeclaration(int syntaxTag); | ||
|
||
boolean isArguments(int syntaxTag); | ||
|
||
boolean isClassBody(int syntaxTag); | ||
|
||
boolean isBlock(int syntaxTag); | ||
|
||
boolean isIdentifier(int syntaxTag); | ||
|
||
boolean isExpression(int syntaxTag); | ||
|
||
boolean isStatement(int syntaxTag); | ||
|
||
boolean isMemberDeclaration(int syntaxTag); | ||
|
||
boolean isClassDeclaration(int syntaxTag); | ||
|
||
boolean isLiteral(int syntaxTag); | ||
|
||
boolean isToken(int syntaxTag); | ||
|
||
int getOperator(int syntaxTag); | ||
|
||
int getOperatorPriority(int syntaxTag); | ||
|
||
String getString(int syntaxTag); | ||
|
||
int getTokenLength(int syntaxTag); | ||
|
||
int getIdentifierForKeyword(int syntaxTag); | ||
|
||
boolean hasAttrVariableSlot(int syntaxTag); | ||
|
||
boolean hasAttrDAIndex(int syntaxTag); | ||
|
||
boolean hasAttrTarget(int syntaxTag); | ||
|
||
boolean hasAttrType(int syntaxTag); | ||
|
||
boolean hasAttrValue(int syntaxTag); | ||
|
||
boolean isDeclarationIdentifierNode(SyntaxTree ast, int node); | ||
|
||
boolean isPublicSignatureIdentifierNode(SyntaxTree ast, int node); | ||
|
||
boolean isNonQualifiedTypeIdentifierNode(SyntaxTree ast, int node); | ||
|
||
boolean isQualifiedTypeIdentifierNode(SyntaxTree ast, int node); | ||
|
||
int getQualifiedTypeIdentifierNode(SyntaxTree ast, int node); | ||
|
||
int getTypeIdentifierNodeArgumentCount(SyntaxTree ast, int node); | ||
|
||
boolean isFieldIdentifierNode(SyntaxTree ast, int node); | ||
|
||
boolean isAssignedExpressionNode(SyntaxTree ast, int node); | ||
|
||
boolean isChangedExpressionNode(SyntaxTree ast, int node); | ||
|
||
int getParameterNodeOfParametersNode(SyntaxTree ast, int node, int i); | ||
|
||
int getLeftParenNodeOfParametersNode(SyntaxTree ast, int node); | ||
|
||
int getRightParenNodeOfParametersNode(SyntaxTree ast, int node); | ||
|
||
int getArgumentNodeOfArgumentsNode(SyntaxTree ast, int node, int i); | ||
|
||
int getArgumentCountOfArgumentsNode(SyntaxTree ast, int node); | ||
|
||
int getLeftParenNodeOfArgumentsNode(SyntaxTree ast, int node); | ||
|
||
int getRightParenNodeOfArgumentsNode(SyntaxTree ast, int node); | ||
|
||
ListOfInt getNamespaceNodePairs(SyntaxTree ast); | ||
|
||
ListOfInt getImportNodePairs(SyntaxTree ast); | ||
|
||
int getImportStartLine(SyntaxTree ast); | ||
|
||
int getImportStartColumn(SyntaxTree ast); | ||
|
||
int getImportEndLine(SyntaxTree ast); | ||
|
||
int getImportEndColumn(SyntaxTree ast); | ||
|
||
String getHTMLDocCommentString(SyntaxTree ast, int node); | ||
|
||
boolean hasHTMLDocCommentString(SyntaxTree ast, int node); | ||
|
||
String getRawDocCommentString(SyntaxTree ast, int node); | ||
} |
45 changes: 45 additions & 0 deletions
45
analysis-api/src/main/java/com/apkide/analysis/api/cle/Tools.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,49 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.Entity; | ||
import com.apkide.analysis.api.clm.FileEntry; | ||
import com.apkide.analysis.api.clm.Member; | ||
import com.apkide.analysis.api.clm.Type; | ||
|
||
public interface Tools { | ||
boolean isHighlighted(); | ||
|
||
void requestParameterList(FileEntry fileEntry, int line, int column); | ||
|
||
void requestCompletionList(FileEntry fileEntry, int line, int column); | ||
|
||
void requestClassesCompletionList(FileEntry fileEntry); | ||
|
||
void requestSuperMethodsCompletionList(FileEntry fileEntry, int line, int column); | ||
|
||
void documentize(FileEntry fileEntry, int line, int column); | ||
|
||
void documentize(FileEntry fileEntry); | ||
|
||
void surroundWithTryCatch(FileEntry fileEntry, int startLine, int startColumn, int endLine, int endColumn); | ||
|
||
void addThrows(FileEntry fileEntry, int line, int column); | ||
|
||
void safeDelete(Entity entity); | ||
|
||
void createVariable(FileEntry fileEntry, int line, int column, int identifier, Type type); | ||
|
||
void createField(FileEntry fileEntry, int line, int column, int modifiers, int identifier, Type type); | ||
|
||
void createMethod(FileEntry fileEntry, int line, int column, int modifiers, int identifier, Type type, int[] argModifiers, Type[] argTypes, int[] argNames); | ||
|
||
void inlineVariable(FileEntry fileEntry,int line, int column); | ||
|
||
void createSettersAndGetters(FileEntry fileEntry, int startLine, int startColumn, int endLine, int endColumn); | ||
|
||
void createConstructor(FileEntry fileEntry, int startLine, int startColumn, int endLine, int endColumn); | ||
|
||
void extractMethod(FileEntry fileEntry, int startLine, int startColumn, int endLine, int endColumn); | ||
|
||
void implementMembers(FileEntry fileEntry, int line, int column); | ||
|
||
void overrideMember(FileEntry fileEntry, int line, int column, Member member); | ||
|
||
void introduceVariable(FileEntry fileEntry, int startLine, int startColumn, int endLine, int endColumn); | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
analysis-api/src/main/java/com/apkide/analysis/api/cle/TypeSystem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,33 @@ | ||
package com.apkide.analysis.api.cle; | ||
|
||
import com.apkide.analysis.api.clm.ClassType; | ||
import com.apkide.analysis.api.clm.FileEntry; | ||
import com.apkide.analysis.api.clm.Namespace; | ||
import com.apkide.analysis.api.clm.Type; | ||
import com.apkide.analysis.api.clm.excpetions.UnknownEntityException; | ||
|
||
public interface TypeSystem { | ||
boolean hasTypeparametersOfEnclosingClasstype(); | ||
|
||
boolean inheritsBoundTypes(); | ||
|
||
boolean supportsGenericTypeNameResolving(); | ||
|
||
boolean supportsMethodParametertypeVariables(); | ||
|
||
Type getConditionalOperationType(FileEntry fileEntry, Type type1, Type type2) throws UnknownEntityException; | ||
|
||
Type getBinaryNumericOperationType(FileEntry fileEntry, int operator, Type type1, Type type2) throws UnknownEntityException; | ||
|
||
boolean isImplicitConversion(FileEntry fileEntry, Type type1, Type type2); | ||
|
||
boolean isExplicitConversion(FileEntry fileEntry, Type type1, Type type2); | ||
|
||
int getTypeSemanticForClasstype(Namespace namespace, int identifier); | ||
|
||
int getTypeSemanticForPrimitivetype(int number); | ||
|
||
ClassType getRootClasstype(FileEntry fileEntry) throws UnknownEntityException; | ||
|
||
ClassType getArraySuperClasstype(FileEntry fileEntry) throws UnknownEntityException; | ||
} |
Oops, something went wrong.