9#ifndef FORTRAN_PARSER_PARSING_H_
10#define FORTRAN_PARSER_PARSING_H_
12#include "characters.h"
13#include "instrumented-parser.h"
15#include "parse-tree.h"
16#include "provenance.h"
17#include "flang/Common/Fortran-features.h"
18#include "flang/Parser/preprocessor.h"
19#include "llvm/Support/raw_ostream.h"
30 using Predefinition = std::pair<std::string, std::optional<std::string>>;
32 bool isFixedForm{
false};
33 int fixedFormColumns{72};
35 std::vector<std::string> searchDirectories;
36 std::vector<std::string> intrinsicModuleDirectories;
37 std::vector<Predefinition> predefinitions;
38 bool instrumentedParse{
false};
39 bool isModuleFile{
false};
40 bool needProvenanceRangeToCharBlockMappings{
false};
41 Fortran::parser::Encoding encoding{Fortran::parser::Encoding::UTF_8};
42 bool prescanAndReformat{
false};
43 bool expandIncludeLinesInPreprocessedOutput{
true};
44 bool showColors{
false};
52 bool consumedWholeFile()
const {
return consumedWholeFile_; }
53 const char *finalRestingPlace()
const {
return finalRestingPlace_; }
56 Messages &messages() {
return messages_; }
57 std::optional<Program> &parseTree() {
return parseTree_; }
59 const CookedSource &cooked()
const {
return DEREF(currentCooked_); }
62 void EmitPreprocessedSource(
63 llvm::raw_ostream &,
bool lineDirectives =
true)
const;
64 void EmitPreprocessorMacros(llvm::raw_ostream &)
const;
65 void DumpCookedChars(llvm::raw_ostream &)
const;
66 void DumpProvenance(llvm::raw_ostream &)
const;
67 void DumpParsingLog(llvm::raw_ostream &)
const;
68 void Parse(llvm::raw_ostream &debugOutput);
71 void EmitMessage(llvm::raw_ostream &o,
const char *at,
72 const std::string &message,
const std::string &prefix,
73 llvm::raw_ostream::Colors color = llvm::raw_ostream::SAVEDCOLOR,
74 bool echoSourceLine =
false)
const {
75 allCooked_.allSources().EmitMessage(o,
76 allCooked_.GetProvenanceRange(
CharBlock(at)), message, prefix, color,
85 bool consumedWholeFile_{
false};
86 const char *finalRestingPlace_{
nullptr};
87 std::optional<Program> parseTree_;
Definition: Fortran-features.h:84
Definition: provenance.h:281
Definition: char-block.h:28
Definition: provenance.h:233
Definition: message.h:319
Definition: instrumented-parser.h:25
Definition: preprocessor.h:73
Definition: check-expression.h:19