mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
stub out a parser hook.
Swift SVN r13
This commit is contained in:
@@ -25,6 +25,7 @@ namespace llvm {
|
||||
}
|
||||
|
||||
namespace swift {
|
||||
class Token;
|
||||
|
||||
class Lexer {
|
||||
llvm::SourceMgr &SourceMgr;
|
||||
|
||||
47
include/swift/Parse/Parser.h
Normal file
47
include/swift/Parse/Parser.h
Normal file
@@ -0,0 +1,47 @@
|
||||
//===--- Parser.h - Swift Language Parser -----------------------*- C++ -*-===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines the Parser interface.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef SWIFT_PARSER_H
|
||||
#define SWIFT_PARSER_H
|
||||
|
||||
namespace llvm {
|
||||
class SourceMgr;
|
||||
}
|
||||
|
||||
namespace swift {
|
||||
class Lexer;
|
||||
|
||||
class Parser {
|
||||
llvm::SourceMgr &SourceMgr;
|
||||
Lexer *L;
|
||||
|
||||
Parser(const Parser&); // DO NOT IMPLEMENT
|
||||
void operator=(const Parser&); // DO NOT IMPLEMENT
|
||||
public:
|
||||
Parser(unsigned BufferID, llvm::SourceMgr &SM);
|
||||
~Parser();
|
||||
|
||||
void ParseTranslationUnit();
|
||||
|
||||
|
||||
private:
|
||||
void Warning(const char *Loc, const char *Message);
|
||||
void Error(const char *Loc, const char *Message);
|
||||
};
|
||||
|
||||
} // end namespace swift
|
||||
|
||||
#endif
|
||||
@@ -1 +1,31 @@
|
||||
int x;
|
||||
//===--- Parser.cpp - Swift Language Parser -------------------------------===//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See http://swift.org/LICENSE.txt for license information
|
||||
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the Swift parser.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "swift/Parse/Parser.h"
|
||||
#include "swift/Parse/Lexer.h"
|
||||
using namespace swift;
|
||||
|
||||
Parser::Parser(unsigned BufferID, llvm::SourceMgr &SM) : SourceMgr(SM) {
|
||||
L = new Lexer(BufferID, SM);
|
||||
}
|
||||
|
||||
Parser::~Parser() {
|
||||
delete L;
|
||||
}
|
||||
|
||||
void Parser::ParseTranslationUnit() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user