Testing compilers requires coming up with textual input that can be parsed. Depending on the input the compiler may indicate an error, e.g., a lexical or a syntactical error, or may proceed converting the input to the output format. In this paper, we focus on the parsing functionality of a compiler and discuss an approach that is based on combinatorial testing for generating textual inputs. In particular, we make use of ontology-based testing, where we come up with an ontology describing potential inputs. Originally, ontology-based testing has been developed for testing safety-critical systems where the underlying idea was to use ontologies to describe the concepts of an environment of the system under test, and to use combinatorial testing for extracting critical scenarios based on these concepts. Making use of ontology-based testing for compilers extends the applicability of this testing method to the domain of compiler testing. Besides discussing the foundations behind the approach, we make use of a case study to illustrate the applicability of the proposed method.