-
Notifications
You must be signed in to change notification settings - Fork 781
Feature/uctags2 #2983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feature/uctags2 #2983
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
148b7ad
No need for "UNDEFINED" handling re Ctags argv
idodeclare d6082ef
Retire CtagsInstalled check. ctags is fundamental to OpenGrok.
idodeclare cadf3d8
Remove redundant language mapping. Only do via registerAnalyzer()
idodeclare 260dc97
Check validateUniversalCtags() from web too
idodeclare 76dac0a
Clone CAnalyzer as AsmAnalyzer, and associate .S and .ASM
idodeclare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
74 changes: 74 additions & 0 deletions
74
opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzer.java
This file contains hidden or 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,74 @@ | ||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* | ||
* See LICENSE.txt included in this distribution for the specific | ||
* language governing permissions and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at LICENSE.txt. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2017-2019, Chris Fraire <[email protected]>. | ||
*/ | ||
|
||
package org.opengrok.indexer.analysis.asm; | ||
|
||
import org.opengrok.indexer.analysis.AbstractAnalyzer; | ||
import org.opengrok.indexer.analysis.AnalyzerFactory; | ||
import org.opengrok.indexer.analysis.JFlexTokenizer; | ||
import org.opengrok.indexer.analysis.JFlexXref; | ||
import org.opengrok.indexer.analysis.plain.AbstractSourceCodeAnalyzer; | ||
|
||
import java.io.Reader; | ||
|
||
/** | ||
* Represents an analyzer for assembly language. | ||
*/ | ||
public class AsmAnalyzer extends AbstractSourceCodeAnalyzer { | ||
|
||
/** | ||
* Creates a new instance of {@link AsmAnalyzer}. | ||
* @param factory instance | ||
*/ | ||
protected AsmAnalyzer(AnalyzerFactory factory) { | ||
super(factory, new JFlexTokenizer(new AsmSymbolTokenizer(AbstractAnalyzer.DUMMY_READER))); | ||
} | ||
|
||
/** | ||
* @return {@code "Asm"} | ||
*/ | ||
@Override | ||
public String getCtagsLang() { | ||
return "Asm"; | ||
} | ||
|
||
/** | ||
* Gets a version number to be used to tag processed documents so that | ||
* re-analysis can be re-done later if a stored version number is different | ||
* from the current implementation. | ||
* @return 20191120_00 | ||
*/ | ||
@Override | ||
protected int getSpecializedVersionNo() { | ||
return 20191120_00; // Edit comment above too! | ||
} | ||
|
||
/** | ||
* Creates a wrapped {@link AsmXref} instance. | ||
* @return a defined instance | ||
*/ | ||
@Override | ||
protected JFlexXref newXref(Reader reader) { | ||
return new JFlexXref(new AsmXref(reader)); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzerFactory.java
This file contains hidden or 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,54 @@ | ||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* | ||
* See LICENSE.txt included in this distribution for the specific | ||
* language governing permissions and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at LICENSE.txt. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2017, 2019, Chris Fraire <[email protected]>. | ||
*/ | ||
|
||
package org.opengrok.indexer.analysis.asm; | ||
|
||
import org.opengrok.indexer.analysis.AbstractAnalyzer; | ||
import org.opengrok.indexer.analysis.FileAnalyzerFactory; | ||
|
||
/** | ||
* Represents a factory to create {@link AsmAnalyzer} instances. | ||
*/ | ||
public class AsmAnalyzerFactory extends FileAnalyzerFactory { | ||
|
||
private static final String NAME = "Asm"; | ||
|
||
private static final String[] SUFFIXES = {"ASM", "S"}; | ||
|
||
/** | ||
* Initializes a factory instance to associate file extensions ".asm" and | ||
* ".s" with {@link AsmAnalyzer}. | ||
*/ | ||
public AsmAnalyzerFactory() { | ||
super(null, null, SUFFIXES, null, null, "text/plain", AbstractAnalyzer.Genre.PLAIN, NAME); | ||
} | ||
|
||
/** | ||
* Creates a new {@link AsmAnalyzer} instance. | ||
* @return a defined instance | ||
*/ | ||
@Override | ||
protected AbstractAnalyzer newAnalyzer() { | ||
return new AsmAnalyzer(this); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.