Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Miklos Magyari
titan.EclipsePlug-ins
Commits
d8b1c190
Commit
d8b1c190
authored
Oct 28, 2021
by
Miklos Magyari
Browse files
OOP: parsing of chained function calls
Signed-off-by:
Miklos Magyari
<
miklos.magyari@sigmatechnology.se
>
parent
1974e043
Changes
4
Hide whitespace changes
Inline
Side-by-side
Semantic_Analizer_Tests/src/Basic_tests/preprocessor_test/ttcnpp_marker_test_with_syntax_errors.ttcnpp
View file @
d8b1c190
...
...
@@ -52,12 +52,12 @@ error_marker_not_expected //this is not inserted
error_marker_not_expected //this is not inserted
error_marker_not_expected //this is not inserted
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
//not too big:
#if 21474836488
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
//too big number:
...
...
@@ -66,14 +66,14 @@ error_marker_not_expected //this is not inserted
#endif
#if 1
{xxx
;
} //error expected, pass
{xxx
!
} //error expected, pass
#else
xxx; //commented out
#endif
//verdict:pass
#if 100
x1;
//error expected, pass
{error_marker_expected!}
//error expected, pass
#elif -2
x2
#else //commented out
...
...
@@ -84,7 +84,7 @@ xxx
#if 0
x1; //commented out, error not expected
#elif -2
x2;
//error expected
{error_marker_expected!}
//error expected
#else //commented out
xxx //commented out, error not expected
#endif
...
...
@@ -92,28 +92,28 @@ xxx //commented out, error not expected
#if 0
x1;
//error expected, fail
{error_marker_expected!}
//error expected, fail
#elif 0
x2;
#else //commented out
{xxx
;
} //error expected, pass
{xxx
!
} //error expected, pass
#endif
//verdict:pass
#if ((ONE+ONE)*THREE==6)
{xxxx
;
} //error expected, fail
{xxxx
!
} //error expected, fail
#else
xxx; //commented out
#endif
//verdict:fail
#if(THREE-TWO==ONE)
{xxxy
;
} //error expected
{xxxy
!
} //error expected
#endif
//verict: fail
#if(THREE>TWO)
{xxxz
;
} //error expected
{xxxz
!
} //error expected
#endif
}//tc_macro1
...
...
@@ -146,7 +146,7 @@ function f_include_test() runs on My_CT {
if(vl_i==124){setverdict(pass);} else {setverdict(fail)}
#if defined VL_I
{error_expected
;
}
{error_
marker_
expected
!
}
#else
error_notexpected;
#endif
...
...
@@ -170,13 +170,13 @@ testcase tc_if_and_macro_expr() runs on My_CT {
#if 0
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#if 0
error_marker_not_expected
#elif -3
{error_marker_expected
;
}
{error_marker_expected
!
}
#else //commented out
error_marker_not_expected
#endif
...
...
@@ -189,37 +189,37 @@ testcase tc_if_and_macro_expr() runs on My_CT {
#elif ZERO
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
//verdict:pass
//#if true constructs
#if 1
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#if 2147483647
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#if -2147483647
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#if -1
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
//verdict:pass
#if 1
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
//verdict:pass
#if 100
{error_marker_expected
;
}
{error_marker_expected
!
}
#elif -2
error_marker_not_expected
#else //commented out
...
...
@@ -228,7 +228,7 @@ testcase tc_if_and_macro_expr() runs on My_CT {
//verdict:pass
#if 100
{error_marker_expected
;
}
{error_marker_expected
!
}
#elif 0
error_marker_not_expected
#else //commented out
...
...
@@ -237,55 +237,55 @@ testcase tc_if_and_macro_expr() runs on My_CT {
//verdict:pass
#if ((ONE+ONE)*THREE==6)
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
//verdict:pass
#if ((ONE+ONE)*THREE==6)
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
//verdict:pass
#if (ONE+TWO*THREE==7)
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
//verdict:pass
#if(THREE-TWO==ONE)
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
//verict: fail
#if(THREE>TWO)
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
}//tc_if
testcase tc_define_ifdef() runs on My_CT {
//************** define and ifdef************************************/
{error_marker_expected
;
} //wrong highlighting, if */ removed from the prev line
{error_marker_expected
!
} //wrong highlighting, if */ removed from the prev line
#define MYMACRO1
#ifdef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#ifdef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
#ifdef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#elif 12
error_marker_not_expected
#else
...
...
@@ -293,20 +293,20 @@ testcase tc_define_ifdef() runs on My_CT {
#endif
#ifdef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#define MYMACRO2
#ifdef MYMACRO2
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
setverdict(false);
#endif
#ifdef MYMACRO
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#undef MYMACRO1
...
...
@@ -317,13 +317,13 @@ testcase tc_define_ifdef() runs on My_CT {
#ifdef MYMACRO1
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#ifdef MYMACRO1
error_marker_not_expected
#elif 12
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -343,13 +343,13 @@ testcase tc_define_ifndef() runs on My_CT {
#ifndef MYMACRO1
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#ifndef MYMACRO1
error_marker_not_expected
#elif 12
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -362,14 +362,14 @@ testcase tc_define_ifndef() runs on My_CT {
#else
error_marker_not_expected
#endif
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#define MYMACRO2
#ifndef MYMACRO2
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#endif
}
...
...
@@ -380,17 +380,17 @@ testcase tc_undef_ifndef() runs on My_CT {
#undef MYMACRO1
#ifndef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#ifndef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
#ifndef MYMACRO1
{error_marker_expected
;
}
{error_marker_expected
!
}
#elif 12
error_marker_not_expected
#else
...
...
@@ -409,13 +409,13 @@ testcase tc_undef_ifdef() runs on My_CT {
#ifdef MYMACRO1
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#ifdef MYMACRO1
error_marker_not_expected
#elif 12
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -424,11 +424,11 @@ testcase tc_undef_ifdef() runs on My_CT {
testcase tc_embedded_ifs() runs on My_CT {
#if 1 && -1
{error_marker_expected
;
}
{error_marker_expected
!
}
#if 0
setvedict(fail)
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#else
error_marker_not_expected
...
...
@@ -447,11 +447,11 @@ testcase tc_embedded_ifs() runs on My_CT {
error_marker_not_expected
#endif
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#if 0
setvedict(fail)
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#endif
}
...
...
@@ -464,13 +464,13 @@ testcase tc_cascade() runs on My_CT {
#define TWENTY5 TWENTY4
#if TWENTY2 == 20
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
#if TWENTY5 == 20
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -478,7 +478,7 @@ testcase tc_cascade() runs on My_CT {
#if TWENTY5 != 20
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
}
...
...
@@ -488,12 +488,12 @@ testcase tc_three_operands() runs on My_CT {
#if AAA ? 0 : 1
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#define AAA 1
#if AAA ? 1 : 0
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -502,12 +502,12 @@ testcase tc_three_operands() runs on My_CT {
#if AAA ? 1 : 0
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#define AAA 0
#if AAA ? 0 : 1
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -519,7 +519,7 @@ testcase tc_A() runs on My_CT {
#if defined A_IMPORTED
var integer vl_i:=cg_A_i;
log(vl_i);
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -529,7 +529,7 @@ testcase tc_B() runs on My_CT {
#if defined B_IMPORTED
var integer vl_i:=cg_B_i;
log(vl_i);
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -544,7 +544,7 @@ testcase tc_B() runs on My_CT {
testcase tc_AandB() runs on My_CT {
#if defined A_AND_B_DEFINED
var integer vl_i:=cg_A_i+cg_B_i;
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -558,7 +558,7 @@ testcase tc_if_defined() runs on My_CT {
log(vl_i);
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
}
...
...
@@ -569,7 +569,7 @@ testcase tc_include_ttcnin() runs on My_CT {
#if defined A_IMPORTED
var integer vl_i:=cg_A_i;
log(vl_i);
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -580,7 +580,7 @@ testcase tc_bitoperands() runs on My_CT{
#define B 0x00
#if (A & B == B)
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -588,17 +588,17 @@ testcase tc_bitoperands() runs on My_CT{
#if ((A & B) == A)
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#if (A|B == B)
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
#if (A|B == A)
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -610,13 +610,13 @@ testcase tc_bitoperands() runs on My_CT{
#if ((A & B) == B)
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
#if ((A | B) == A)
error_marker_not_expected
#else
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
}
...
...
@@ -627,7 +627,7 @@ testcase tc_wrap() runs on My_CT{
O 10\
20
#if FOO == 1020
{error_marker_expected
;
}
{error_marker_expected
!
}
#else
error_marker_not_expected
#endif
...
...
@@ -662,7 +662,7 @@ error_marker_not_expected
error_marker_not_expected
#else
setverdict(pass);
{error_marker_expected
;
}
{error_marker_expected
!
}
#endif
}
...
...
org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ClassTypeReferenceList.java
View file @
d8b1c190
...
...
@@ -184,7 +184,7 @@ public final class ClassTypeReferenceList extends ASTNode implements ILocateable
final
Def_Function
funcDef
=
(
Def_Function
)
def
;
if
(
funcDef
.
isAbstract
())
{
if
(!
parentClass
.
getClassBody
().
hasAssignmentWithId
(
timestamp
,
funcDef
.
getIdentifier
()))
{
parentClass
.
getLocation
().
reportSemanticError
(
parentClass
.
getClassBody
().
getIdentifier
().
getLocation
().
reportSemanticError
(
MessageFormat
.
format
(
ABSTRACTMETHODUNIMPLEMENTED
,
funcDef
.
getIdentifier
().
getName
(),
extClass
.
getFullName
()));
}
...
...
org.eclipse.titan.designer/src/org/eclipse/titan/designer/parsers/ttcn3parser/Ttcn3Parser.g4
View file @
d8b1c190
...
...
@@ -6631,16 +6631,20 @@ pr_USI returns[List<String> uid_elements]
pr_RParen
);
pr_ReferencedValue returns[Value value]
pr_ReferencedValue returns[Value value
, Reference ref
]
@init {
$value = null;
$ref = null;
Reference temporalReference = null;
List<ISubReference> subReferences = null;
}:
(
( t = pr_ValueReference { temporalReference = $t.reference; }
| pr_Identifier DOT i = pr_PredefOrIdentifier pr_ExtendedFieldReference? { temporalReference = new Reference($i.identifier); }
| pr_Identifier DOT pr_Identifier LPAREN pr_FunctionActualParList? RPAREN pr_ExtendedFieldReference?
(
pr_Identifier DOT fi = pr_Identifier LPAREN pr_FunctionActualParList? RPAREN pr_ExtendedFieldReference? {
$ref = new Reference($fi.identifier);
}
| t = pr_ValueReference { temporalReference = $t.reference; }
| pr_Identifier DOT i = pr_PredefOrIdentifier pr_ExtendedFieldReference? // { temporalReference = new Reference($i.identifier); }
| pr_Identifier DOT pr_ObjectIdentifierValue DOT pr_Identifier pr_ExtendedFieldReference?
)
( e = pr_ExtendedFieldReference { subReferences = $e.subReferences; } )?
...
...
@@ -7064,6 +7068,7 @@ pr_BehaviourStatements returns[Statement statement]
| pr_LParen // this is a syntactically erroneous state only used to report better error messages
)
)
| pr_ReferencedValue
| BREAK
{ $statement = new Break_Statement();
$statement.setLocation(getLocation( $BREAK));
...
...
org.eclipse.titan.regressiontests/src/org/eclipse/titan/regressiontests/designer/statictests/Basic_tests/AST_tests.java
View file @
d8b1c190
...
...
@@ -11621,145 +11621,145 @@ public class AST_tests {
markersToCheck.add(new MarkerToCheck("Preprocessor directive #line is ignored", lineNum, IMarker.SEVERITY_WARNING));
markersToCheck.add(new MarkerToCheck("Preprocessor directive #pragma is ignored", ++lineNum, IMarker.SEVERITY_WARNING));
lineNum += 23;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_marker_expected;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 5;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_marker_expected;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 4;
//semantic: markersToCheck.add(new MarkerToCheck("Invalid integer value: For input string: \"214748364888888888888\"", lineNum, IMarker.SEVERITY_ERROR));//64
lineNum += 5;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'xxx;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 7;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'x1;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 11;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'x2;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 12;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'xxx;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 5;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'xxxx;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 7;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'xxxy;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 5;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'xxxz;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 5;
markersToCheck.add(new MarkerToCheck("Preprocessor directive #line is ignored", lineNum, IMarker.SEVERITY_WARNING));
lineNum += 5;
markersToCheck.add(new MarkerToCheck("Preprocessor directive #line is ignored", lineNum, IMarker.SEVERITY_WARNING));
lineNum += 23;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_expected;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 24;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_marker_expected;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 6;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_marker_expected;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 13;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_marker_expected;
'", lineNum, IMarker.SEVERITY_ERROR));
markersToCheck.add(new MarkerToCheck("
extraneous input '!' expecting '}
'", lineNum, IMarker.SEVERITY_ERROR));
lineNum += 6;
markersToCheck.add(new MarkerToCheck("
no viable alternative at input 'error_marker_expected;
'", lineNum, IMarker.SEVERITY_ERROR));