ast::Node *parseStatement(TokenIt &it, const TokenIt &end) { Token *current = currentToken(it, end); EXPECT_ANY_TOKEN(current, errorN, "Statement expected"); switch(current->type) { case Token::DIM: return parseDim(it, end); default: return parseExpr(it, end); } }
void ColorizationFilter::processOptions(const Options& options) { m_rasterFilename = options.getValueOrThrow<std::string>("raster"); if (options.hasOption("dimension") && !options.hasOption("dimensions")) throw pdal_error("Option 'dimension' no longer supported. Use " "'dimensions' instead."); StringList defaultDims; defaultDims.push_back("Red"); defaultDims.push_back("Green"); defaultDims.push_back("Blue"); StringList dims = options.getValueOrDefault<StringList>("dimensions", defaultDims); uint32_t defaultBand = 1; for (std::string& dim : dims) { BandInfo bi = parseDim(dim, defaultBand); defaultBand = bi.m_band + 1; m_bands.push_back(bi); } }