Skip to content

Package: RegExpBeginSelectionState2

RegExpBeginSelectionState2

nameinstructionbranchcomplexitylinemethod
RegExpBeginSelectionState2(Scanner, Integer, Integer)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
action(Character, Buffer, String)
M: 0 C: 36
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
finish(Buffer, String)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package scanner;
2:
3: import symbols.AbstractSymbol;
4: import basic.Buffer;
5:
6: /**
7: * This class represents the 2. BeginSelectionState for the Regular Expressions.
8: *
9: * @author HFW410
10: *
11: */
12: public class RegExpBeginSelectionState2 extends AbstractState {
13:         /**
14:          * initialize the RegExpBeginSelectionState2.
15:          *
16:          * @param myScanner
17:          * is the used Scanner.
18:          * @param beginningColumn
19:          * is the Begin Column of the Symbol
20:          * @param beginningRow
21:          * is the beginning row of the symbol
22:          */
23:         public RegExpBeginSelectionState2(final Scanner myScanner, final Integer beginningColumn,
24:                         final Integer beginningRow) {
25:                 super(myScanner, beginningColumn, beginningRow);
26:         }
27:
28:         @Override
29:         public AbstractState action(final Character character,
30:                         final Buffer<AbstractSymbol> currentResult, final String dataPath)
31:                         throws InterruptedException {
32:•                if (character.equals(ScannerConstants.REGEXP.charAt(2))) {
33:                         this.getMyScanner().skip();
34:                         return new RegExpState(this.getMyScanner(), this.getBeginningColumn(), this
35:                                         .getMyScanner().getRowCounter());
36:                 } else {
37:                         return new IdentifierState(this.getMyScanner(), this.getBeginningColumn(), this
38:                                         .getMyScanner().getRowCounter(), ScannerConstants.REGEXP.substring(0, 2));
39:                 }
40:
41:         }
42:
43:         @Override
44:         protected void finish(final Buffer<AbstractSymbol> currentResult, final String dataPath)
45:                         throws InterruptedException {
46:                 new IdentifierState(this.getMyScanner(), this.getBeginningColumn(), getBeginningRow(),
47:                                 ScannerConstants.REGEXP.substring(0, 2)).finish(currentResult, dataPath);
48:         }
49: }