-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:antlr4/antlr4.dart'; | ||
import 'dart:io'; | ||
import 'dart:convert'; | ||
import 'CPP14Parser.dart'; | ||
|
||
abstract class CPP14ParserBase extends Parser | ||
{ | ||
CPP14ParserBase(TokenStream input) : super(input) | ||
{ | ||
} | ||
|
||
bool IsPureSpecifierAllowed() | ||
{ | ||
try | ||
{ | ||
var x = this.context; // memberDeclarator | ||
var c = x?.getChild(0)?.getChild(0); | ||
var c2 = c?.getChild(0); | ||
var p = c2?.getChild(1); | ||
if (p == null) return false; | ||
return p.runtimeType == ParametersAndQualifiersContext; | ||
} | ||
catch (e) | ||
{ | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import antlr4 from 'antlr4'; | ||
import CPP14Parser from './CPP14Parser.js'; | ||
|
||
export default class CPP14ParserBase extends antlr4.Parser { | ||
constructor(input) { | ||
super(input); | ||
} | ||
|
||
IsPureSpecifierAllowed() { | ||
try { | ||
var x = this._ctx; // memberDeclarator | ||
var c = x.getChild(0).getChild(0); | ||
var c2 = c.getChild(0); | ||
var p = c2.getChild(1); | ||
return p.constructor === CPP14Parser.ParametersAndQualifiersContext; | ||
} catch (e) { | ||
} | ||
return false; | ||
} | ||
} |