Search in sources :

Example 6 with PartialParsingPointers

use of org.eclipse.xtext.parser.impl.PartialParsingPointers in project xtext-core by eclipse.

the class PartialParsingPointerLookaheadTest method testLookahead_0_2.

@Test
public void testLookahead_0_2() throws Exception {
    String model = "bar a foo bar c b d foo bar b c";
    for (int i = 0; i < 3; ++i) {
        PartialParsingPointers parsingPointers = calculatePartialParsingPointers(model, i, 1);
        checkParseRegionPointers(parsingPointers, model, "ParserRule", "Entry");
    }
}
Also used : PartialParsingPointers(org.eclipse.xtext.parser.impl.PartialParsingPointers) Test(org.junit.Test)

Example 7 with PartialParsingPointers

use of org.eclipse.xtext.parser.impl.PartialParsingPointers in project xtext-core by eclipse.

the class PartialParsingPointerLookaheadTest method testLookahead_9_14.

@Test
public void testLookahead_9_14() throws Exception {
    String model = "bar a foo bar c b d foo bar b c";
    for (int i = 9; i < 15; ++i) {
        PartialParsingPointers parsingPointers = calculatePartialParsingPointers(model, i, 1);
        // actual expecation would lead to yet more complexity in partial parser
        // checkParseRegionPointers(parsingPointers, " foo bar c b d", "RuleCall", "Alts");
        checkParseRegionPointers(parsingPointers, model, "ParserRule", "Entry");
    }
}
Also used : PartialParsingPointers(org.eclipse.xtext.parser.impl.PartialParsingPointers) Test(org.junit.Test)

Example 8 with PartialParsingPointers

use of org.eclipse.xtext.parser.impl.PartialParsingPointers in project xtext-core by eclipse.

the class PartialParsingPointerLookaheadTest method testLookahead_19_22.

@Test
public void testLookahead_19_22() throws Exception {
    String model = "bar a foo bar c b d foo bar b c";
    for (int i = 19; i < 22; ++i) {
        PartialParsingPointers parsingPointers = calculatePartialParsingPointers(model, i, 1);
        checkParseRegionPointers(parsingPointers, model, "ParserRule", "Entry");
    }
}
Also used : PartialParsingPointers(org.eclipse.xtext.parser.impl.PartialParsingPointers) Test(org.junit.Test)

Example 9 with PartialParsingPointers

use of org.eclipse.xtext.parser.impl.PartialParsingPointers in project xtext-core by eclipse.

the class PartialParsingPointerReferenceTest method testReference.

@Test
public void testReference() throws Exception {
    String model = "spielplatz 17 { kind ( Dennis 6 ) kind ( Sven 7 ) }";
    PartialParsingPointers parsingPointers = calculatePartialParsingPointers(model, model.indexOf("Sven"), 4);
    checkParseRegionPointers(parsingPointers, " kind ( Sven 7 )", "RuleCall", "Kind");
}
Also used : PartialParsingPointers(org.eclipse.xtext.parser.impl.PartialParsingPointers) Test(org.junit.Test)

Example 10 with PartialParsingPointers

use of org.eclipse.xtext.parser.impl.PartialParsingPointers in project xtext-core by eclipse.

the class PartialParsingPointerExpressionTest method testExpression_1_1.

@Test
public void testExpression_1_1() throws Exception {
    String model = "(a+b+c)*(c/d)";
    PartialParsingPointers parsingPointers = calculatePartialParsingPointers(model, 1, 1);
    checkParseRegionPointers(parsingPointers, "(a+b+c)", "RuleCall", "Parens");
}
Also used : PartialParsingPointers(org.eclipse.xtext.parser.impl.PartialParsingPointers) Test(org.junit.Test)

Aggregations

PartialParsingPointers (org.eclipse.xtext.parser.impl.PartialParsingPointers)19 Test (org.junit.Test)16 EObject (org.eclipse.emf.ecore.EObject)2 IReferableElementsUnloader (org.eclipse.xtext.parser.antlr.IReferableElementsUnloader)2 ReplaceRegion (org.eclipse.xtext.util.ReplaceRegion)2 IParseResult (org.eclipse.xtext.parser.IParseResult)1