Skip to content

Commit

Permalink
Update our Usage of virtual/override/final in the Slice Compiler (
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere authored Jun 11, 2024
1 parent 674707b commit fcb106a
Show file tree
Hide file tree
Showing 21 changed files with 379 additions and 393 deletions.
6 changes: 3 additions & 3 deletions cpp/src/Slice/FileTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Slice
{
public:
FileException(const char*, int, const std::string&);
virtual std::string ice_id() const;
virtual void ice_print(std::ostream&) const;
std::string ice_id() const override;
void ice_print(std::ostream&) const override;

std::string reason() const;

Expand All @@ -25,7 +25,7 @@ namespace Slice

class FileTracker;
using FileTrackerPtr = std::shared_ptr<FileTracker>;
class FileTracker
class FileTracker final
{
public:
FileTracker();
Expand Down
28 changes: 14 additions & 14 deletions cpp/src/Slice/GrammarUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Slice
// StringTok
// ----------------------------------------------------------------------

class StringTok : public GrammarBase
class StringTok final : public GrammarBase
{
public:
StringTok() {}
Expand All @@ -58,7 +58,7 @@ namespace Slice
// StringListTok
// ----------------------------------------------------------------------

class StringListTok : public GrammarBase
class StringListTok final : public GrammarBase
{
public:
StringListTok() {}
Expand All @@ -69,7 +69,7 @@ namespace Slice
// TypeStringTok
// ----------------------------------------------------------------------

class TypeStringTok : public GrammarBase
class TypeStringTok final : public GrammarBase
{
public:
TypeStringTok() {}
Expand All @@ -80,7 +80,7 @@ namespace Slice
// TypeStringListTok
// ----------------------------------------------------------------------

class TypeStringListTok : public GrammarBase
class TypeStringListTok final : public GrammarBase
{
public:
TypeStringListTok() {}
Expand All @@ -91,7 +91,7 @@ namespace Slice
// IntegerTok
// ----------------------------------------------------------------------

class IntegerTok : public GrammarBase
class IntegerTok final : public GrammarBase
{
public:
IntegerTok() : v(0) {}
Expand All @@ -103,7 +103,7 @@ namespace Slice
// FloatingTok
// ----------------------------------------------------------------------

class FloatingTok : public GrammarBase
class FloatingTok final : public GrammarBase
{
public:
FloatingTok() : v(0) {}
Expand All @@ -115,7 +115,7 @@ namespace Slice
// BoolTok
// ----------------------------------------------------------------------

class BoolTok : public GrammarBase
class BoolTok final : public GrammarBase
{
public:
BoolTok() : v(false) {}
Expand All @@ -126,7 +126,7 @@ namespace Slice
// ExceptionListTok
// ----------------------------------------------------------------------

class ExceptionListTok : public GrammarBase
class ExceptionListTok final : public GrammarBase
{
public:
ExceptionListTok() {}
Expand All @@ -137,7 +137,7 @@ namespace Slice
// ClassListTok
// ----------------------------------------------------------------------

class ClassListTok : public GrammarBase
class ClassListTok final : public GrammarBase
{
public:
ClassListTok() {}
Expand All @@ -148,7 +148,7 @@ namespace Slice
// InterfaceListTok
// ----------------------------------------------------------------------

class InterfaceListTok : public GrammarBase
class InterfaceListTok final : public GrammarBase
{
public:
InterfaceListTok() {}
Expand All @@ -159,7 +159,7 @@ namespace Slice
// EnumeratorListTok
// ----------------------------------------------------------------------

class EnumeratorListTok : public GrammarBase
class EnumeratorListTok final : public GrammarBase
{
public:
EnumeratorListTok() {}
Expand All @@ -170,7 +170,7 @@ namespace Slice
// ConstDefTok
// ----------------------------------------------------------------------

class ConstDefTok : public GrammarBase
class ConstDefTok final : public GrammarBase
{
public:
ConstDefTok() {}
Expand All @@ -190,7 +190,7 @@ namespace Slice
// OptionalDefTok
// ----------------------------------------------------------------------

class OptionalDefTok : public GrammarBase
class OptionalDefTok final : public GrammarBase
{
public:
OptionalDefTok() : isOptional(false), tag(0) {}
Expand All @@ -207,7 +207,7 @@ namespace Slice
// ClassIdTok
// ----------------------------------------------------------------------

class ClassIdTok : public GrammarBase
class ClassIdTok final : public GrammarBase
{
public:
ClassIdTok() : t(0) {}
Expand Down
Loading

0 comments on commit fcb106a

Please sign in to comment.