Skip to content

Commit

Permalink
gec: Semicolon Optionality rule (S7SC).
Browse files Browse the repository at this point in the history
gec: validity rule VSCI.
gec: validity rule VSRP.
gec: validity rule VSRT.
  • Loading branch information
ebezault committed Jan 16, 2025
2 parents 5cf754a + 92038e3 commit 4b4b277
Show file tree
Hide file tree
Showing 1,118 changed files with 30,382 additions and 8,571 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Test features of class SED_STORABLE_FACILITIES"

library: "FreeELKS Library"
copyright: "Copyright (c) 2024, Eric Bezault and others"
copyright: "Copyright (c) 2024-2025, Eric Bezault and others"
license: "MIT License"

class TEST_SED_STORABLE_FACILITIES
Expand All @@ -27,7 +27,6 @@ feature -- Test
local
l_sed: SED_STORABLE_FACILITIES
l_filename: STRING
l_expected_filename: STRING
l_file: RAW_FILE
l_object: STRING
l_retrieved: detachable ANY
Expand Down
15 changes: 14 additions & 1 deletion library/tools/src/build.eant
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<description>
description: "Eiffel Ant file for the Gobo Eiffel Tools Library"
library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 2001-2019, Eric Bezault and others"
copyright: "Copyright (c) 2001-2025, Eric Bezault and others"
license: "MIT License"
</description>

Expand All @@ -30,6 +30,8 @@
<geant target="eiffel_preparser"/>
<geant target="lace_scanner"/>
<geant target="lace_parser"/>
<geant target="type_scanner"/>
<geant target="type_parser"/>
</target>

<target name="clobber" depend="init">
Expand All @@ -45,6 +47,9 @@
<delete file="lace/parser/et_lace_scanner.e"/>
<delete file="lace/parser/et_lace_parser.e"/>
<delete file="lace/parser/et_lace_tokens.e"/>
<delete file="eiffel/parser/et_type_scanner.e"/>
<delete file="eiffel/parser/et_type_parser.e"/>
<delete file="eiffel/parser/et_type_tokens.e"/>
</target>

<!-- Implementation -->
Expand All @@ -69,4 +74,12 @@
<geyacc input="et_lace_parser.y" tokens="ET_LACE_TOKENS" output="et_lace_parser.e"/>
</target>

<target name="type_scanner" dir="eiffel/parser" export="NONE">
<gelex input="et_type_scanner.l"/>
</target>

<target name="type_parser" dir="eiffel/parser" export="NONE">
<geyacc input="et_type_parser.y" tokens="ET_TYPE_TOKENS" output="et_type_parser.e" separate_actions="true"/>
</target>

</project>
5 changes: 3 additions & 2 deletions library/tools/src/ecf/ast/et_ecf_root_all_classes.e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ECF all classes roots"

library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 2008-2009, Eric Bezault and others"
copyright: "Copyright (c) 2008-2025, Eric Bezault and others"
license: "MIT License"

class ET_ECF_ROOT_ALL_CLASSES
Expand All @@ -30,7 +30,8 @@ feature -- Element change
fill_root (a_system: ET_ECF_SYSTEM)
-- Fill `a_system' with root information.
do
a_system.unset_root_type
a_system.set_root_type_name (Void)
a_system.set_root_type (Void)
a_system.set_root_creation (Void)
end

Expand Down
5 changes: 3 additions & 2 deletions library/tools/src/ecf/ast/et_ecf_root_class.e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ECF root classes and creation procedures"

library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 2008-2017, Eric Bezault and others"
copyright: "Copyright (c) 2008-2025, Eric Bezault and others"
license: "MIT License"

class ET_ECF_ROOT_CLASS
Expand Down Expand Up @@ -64,7 +64,8 @@ feature -- Element change
fill_root (a_system: ET_ECF_SYSTEM)
-- Fill `a_system' with root information.
do
a_system.set_root_type (class_name)
a_system.set_root_type_name (class_name)
a_system.set_root_type (Void)
a_system.set_root_creation (creation_procedure_name)
end

Expand Down
28 changes: 0 additions & 28 deletions library/tools/src/ecf/ast/et_ecf_system.e
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,4 @@ feature -- Access
-- It might be different from the current system config itself when
-- using parent targets with an 'extension_location' attribute.

feature -- Setting

set_root_class_name (a_name: STRING)
-- Set root class name to `a_name'.
local
an_identifier: ET_IDENTIFIER
do
if a_name /= Void and then a_name.count > 0 then
create an_identifier.make (a_name)
set_root_type (an_identifier)
else
unset_root_type
end
end

set_creation_procedure_name (a_name: STRING)
-- Set `creation_procedure_name' to `a_name'.
local
an_identifier: ET_IDENTIFIER
do
if a_name /= Void and then a_name.count > 0 then
create an_identifier.make (a_name)
set_root_creation (an_identifier)
else
root_creation := Void
end
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Eiffel assertions followed by a semicolon"

library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 2002-2014, Eric Bezault and others"
copyright: "Copyright (c) 2002-2024, Eric Bezault and others"
license: "MIT License"

class ET_ASSERTION_SEMICOLON
Expand Down Expand Up @@ -38,7 +38,7 @@ feature -- Access
assertion: ET_ASSERTION
-- Assertion in list of assertions

semicolon: ET_SYMBOL
semicolon: ET_SEMICOLON_SYMBOL
-- Semicolon separator

position: ET_POSITION
Expand Down
13 changes: 13 additions & 0 deletions library/tools/src/eiffel/ast/assertion/et_assertions.e
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ feature -- Status report

feature -- Access

first_semicolon: detachable ET_SEMICOLON_SYMBOL
-- Semicolon before the first assertion, if any

assertion (i: INTEGER): ET_ASSERTION
-- Assertion at index `i' in list
require
Expand All @@ -198,6 +201,16 @@ feature -- Access
assertion_not_void: Result /= Void
end

feature -- Setting

set_first_semicolon (a_first_semicolon: like first_semicolon)
-- Set `first_semicolon' to `a_first_semicolon'.
do
first_semicolon := a_first_semicolon
ensure
first_semicolon_set: first_semicolon = a_first_semicolon
end

feature -- Element change

add_old_expressions (a_list: DS_ARRAYED_LIST [ET_OLD_EXPRESSION])
Expand Down
10 changes: 8 additions & 2 deletions library/tools/src/eiffel/ast/assertion/et_invariants.e
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ feature -- Access
-- current node in source code
do
Result := invariant_keyword.position
if Result.is_null and not is_empty then
Result := first.position
if Result.is_null then
if not is_empty then
Result := first.position
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.position
end
end
end

Expand All @@ -142,6 +146,8 @@ feature -- Access
do
if not is_empty then
Result := last.last_leaf
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.last_leaf
else
Result := invariant_keyword
end
Expand Down
10 changes: 8 additions & 2 deletions library/tools/src/eiffel/ast/assertion/et_loop_invariants.e
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ feature -- Access
-- current node in source code
do
Result := invariant_keyword.position
if Result.is_null and not is_empty then
Result := item (1).position
if Result.is_null then
if not is_empty then
Result := item (1).position
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.last_leaf
end
end
end

Expand All @@ -63,6 +67,8 @@ feature -- Access
do
if not is_empty then
Result := last.last_leaf
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.last_leaf
else
Result := invariant_keyword
end
Expand Down
14 changes: 11 additions & 3 deletions library/tools/src/eiffel/ast/assertion/et_postconditions.e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Eiffel postcondition lists"

library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 1999-2014, Eric Bezault and others"
copyright: "Copyright (c) 1999-2024, Eric Bezault and others"
license: "MIT License"

class ET_POSTCONDITIONS
Expand Down Expand Up @@ -63,8 +63,14 @@ feature -- Access
-- current node in source code
do
Result := ensure_keyword.position
if Result.is_null and not is_empty then
Result := first.position
if Result.is_null then
if not is_empty then
Result := first.position
elseif attached then_keyword as l_then_keyword then
Result := l_then_keyword.position
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.position
end
end
end

Expand All @@ -79,6 +85,8 @@ feature -- Access
do
if not is_empty then
Result := last.last_leaf
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.last_leaf
elseif attached then_keyword as l_then_keyword then
Result := l_then_keyword
else
Expand Down
14 changes: 11 additions & 3 deletions library/tools/src/eiffel/ast/assertion/et_preconditions.e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Eiffel precondition lists"

library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 1999-2014, Eric Bezault and others"
copyright: "Copyright (c) 1999-2024, Eric Bezault and others"
license: "MIT License"

class ET_PRECONDITIONS
Expand Down Expand Up @@ -63,8 +63,14 @@ feature -- Access
-- current node in source code
do
Result := require_keyword.position
if Result.is_null and not is_empty then
Result := first.position
if Result.is_null then
if not is_empty then
Result := first.position
elseif attached else_keyword as l_else_keyword then
Result := l_else_keyword.position
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.position
end
end
end

Expand All @@ -79,6 +85,8 @@ feature -- Access
do
if not is_empty then
Result := last.last_leaf
elseif attached first_semicolon as l_first_semicolon then
Result := l_first_semicolon.last_leaf
elseif attached else_keyword as l_else_keyword then
Result := l_else_keyword
else
Expand Down
23 changes: 20 additions & 3 deletions library/tools/src/eiffel/ast/class/et_class.e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Eiffel classes"

library: "Gobo Eiffel Tools Library"
copyright: "Copyright (c) 1999-2024, Eric Bezault and others"
copyright: "Copyright (c) 1999-2025, Eric Bezault and others"
license: "MIT License"

class ET_CLASS
Expand Down Expand Up @@ -66,7 +66,7 @@ inherit

create

make, make_unknown
make, make_unknown, make_root

feature {NONE} -- Initialization

Expand Down Expand Up @@ -102,6 +102,15 @@ feature {NONE} -- Initialization
make (tokens.unknown_class_name)
end

make_root (a_system: ET_SYSTEM)
-- Create a new "*ROOT*" class for system `a_system'.
require
a_system_not_void: a_system /= Void
do
make (tokens.root_class_name)
create {ET_ROOT_GROUP} group.make (a_system)
end

feature -- Initialization

reset
Expand Down Expand Up @@ -578,6 +587,14 @@ feature -- Status report
definition: Result = group.is_unknown
end

is_root: BOOLEAN
-- Is current class an "*ROOT*" class?
do
Result := name.same_class_name (tokens.root_class_name)
ensure
definition: Result = name.same_class_name (tokens.root_class_name)
end

is_ignored: BOOLEAN
-- Should this class not be taken into account when
-- analyzing the system?
Expand Down Expand Up @@ -1266,7 +1283,7 @@ feature -- Class header
is_deferred: BOOLEAN
-- Is current class deferred?
-- A class is deferred if it has been marked as
-- deferred or if is has deferred features. If
-- deferred or if it has deferred features. If
-- it has deferred features but has not been marked
-- as deferred then VCCH-1 is violated; if it is
-- marked as deferred but has no deferred features
Expand Down
Loading

0 comments on commit 4b4b277

Please sign in to comment.