PARIS France's far-right National Front leader Marine Le Pen, who wants to become president in next spring's elections, celebrated Britain's vote to leave the European Union.
"Victory for freedom!" she said on her Twitter page in June after Britons voted for Brexit. "We now need to hold the same referendum in France and in (other) EU countries."
But unlike Britain, France has a written constitution, which states that "the Republic is part of the European Union". So a "Frexit" would require a constitutional change which experts say is difficult, but not impossible.
Pollsters say Le Pen is unlikely to become president, but if she does, she has promised to seek revised terms for France's EU membership, and then ask in a referendum if voters want to leave. She says EU membership has stripped France of autonomy, including on immigration, monetary and fiscal policy.
Given surging support for populists worldwide, the chance of an electoral upset in the euro zone's second largest economy is being taken seriously by financial market participants concerned about the future of the euro and the EU.
France's constitution says that proposed laws on the organisation of state powers, reforms relating to economic, social and environmental policy, or a request for authority to ratify a treaty can be decided by referendums.
But it stops short of providing the power to withdraw France from an existing international agreement.
"So if a government or a president wants France to get out of the European Union, the constitution would have to be modified," said Alain Lamassoure, a former French European Affairs Minister.
Article 89 of the constitution says that to make any such change must first be approved the National Assembly and the Senate.
Then, a president can either put it to a referendum, or seek approval from a three-fifths majority in Congress - a combined sitting of both houses of parliament.
That would be a big ask for the National Front.
France's two-round electoral system has so far ensured there are only two far-right members of parliament and two senators among France's roughly 900 federal lawmakers.
This is despite a popular vote for Le Pen's party of 13 percent in the 2012 legislative elections' first round, and despite backing for it among over a quarter of the population in the first round of local elections last year.
"If Marine Le Pen wants to use article 89 she would need a very strong parliamentary majority... and she would not get that on such a subject," said Philippe Cossalter, a professor of government law.
However, governments have not always followed these rules. In 1962, President Charles de Gaulle proposed an electoral reform that was backed by a majority of voters and became law. He did not get the required parliamentary approval for it.
"He went straight to the French people. It was a revision of the constitution but he did not use the revision procedure because he knew the two chambers would be against it," said Agnes Roblot-Troizier, a specialist in constitutional and European law at the Sorbonne's Paris 1 university.
"The legal community is agreed that this was illegal in constitutional terms. Marine Le Pen could be tempted to do the same thing."
The first barrier to a "Frexit", though, is presidential power itself for Le Pen.
Polls in past months have shown her reaching the second round run-off next May, but they have also consistently shown her losing that run-off vote by a big margin.
The latest ones show centre-right candidate Francois Fillon, who will likely face her, winning with a two-thirds majority.
Assuming she does get power, and can dodge the parliamentary vote as de Gaulle did, there is the referendum result itself to consider.
A poll published by Ifop in July found that 67 percent of French voters who expressed a view would vote to stay in the EU. Only 33 percent were against.
However, 21 percent did not offer a view. Taking these into account, the majority in favour of staying was slimmer, at 53 percent.
Whatever the constitutional technicalities, in the final analysis, a popular vote for or against "Frexit" would prove difficult for lawmakers and judges to ignore, according to Paris 1's Roblot-Troizier, "because it is the expression of national sovereignty expressed directly, and that has such political weight that in the end, strict legal logic must give way".
(Additional reporting by Michel Rose, Yves Clarisse and Jean-Michel Belot; Editing by Richard Balmforth and Anna Willard)